[R] multivariate integration and partial differentiation

Ravi Varadhan rvaradhan at jhmi.edu
Sun Mar 8 01:09:37 CET 2009


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 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.

More information about the R-help mailing list