multivariate integration and partial differentiation
Hi, The "adapt" package might work, but note that it cannot handle infinite limits. So, integrate() is your best bet. Since you need to integrate out only one dimension, integrate() would work just fine. As for differentiation, you might try the grad() fucntion in the "numDeriv" package. Ravi. ____________________________________________________________________ Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvaradhan at jhmi.edu ----- Original Message ----- From: Wei-han Liu <weihanliu2002 at yahoo.com> Date: Saturday, March 7, 2009 9:38 am Subject: [R] multivariate integration and partial differentiation To: r-help at r-project.org
Hi R Users:
Could somebody share some tips on implementing multivariate
integration and partial differentiation in R?
For example, for a trivariate joint distribution (cumulative density
function) of F(x,y,z), how to differentiate with respect to x and get
the bivariate distribution (probability density function) of f(y,z).
Or integrate f(x,y,z) with respect to x to get bivariate distribution
of (y,z).
Your sharing is appreciated.
Wei-han Liu
[[alternative HTML version deleted]]
______________________________________________ R-help at r-project.org mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.