roger chan
2008-Jan-26 18:11 UTC
[R] Any numeric differentiation routine in R for boundary points?
Hi, I have a scalar valued function with several variables. One of the variables is restricted to be non-negative. For example, f(x,y)=sqrt(x)*exp(y), then x should be non-negative. I need the gradient and hessian for some vector (0,y), i.e., I need the gradient and hessian at the boudary of parameter space. The "numderiv" package does not work, even for f(x)=sqrt(x), if you do "genD(f,x=0)", warning message comes out. I need the one sided derivatives. Thanks if you could provide some help. -- View this message in context: http://www.nabble.com/Any-numeric-differentiation-routine-in-R-for-boundary-points--tp15110811p15110811.html Sent from the R help mailing list archive at Nabble.com.
Gabor Grothendieck
2008-Jan-26 18:18 UTC
[R] Any numeric differentiation routine in R for boundary points?
Reparameterize to f(x, y) = sqrt(x*x) * exp(y*y) On Jan 26, 2008 1:11 PM, roger chan <rogerchan2006 at gmail.com> wrote:> > Hi, I have a scalar valued function with several variables. One of the > variables is restricted to be non-negative. For example, > f(x,y)=sqrt(x)*exp(y), then x should be non-negative. I need the > gradient and hessian for some vector (0,y), i.e., I need the gradient and > hessian at the boudary of parameter space. > > The "numderiv" package does not work, even for f(x)=sqrt(x), if you > do "genD(f,x=0)", warning message comes out. > > I need the one sided derivatives. > > Thanks if you could provide some help. > -- > View this message in context: http://www.nabble.com/Any-numeric-differentiation-routine-in-R-for-boundary-points--tp15110811p15110811.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >