Re: [R] Derivative of expm function

2014-04-24 Thread Martin Maechler
Wagner Bonat wbo...@gmail.com on Wed, 23 Apr 2014 12:12:17 +0200 writes: Hi all ! I am look for some efficient method to compute the derivative of exponential matrix function in R. For example, I have a simple matrix like log.Sigma - matrix(c(par1, rho, rho, par2),2,2)

[R] Derivative of expm function

2014-04-23 Thread Wagner Bonat
Hi all ! I am look for some efficient method to compute the derivative of exponential matrix function in R. For example, I have a simple matrix like log.Sigma - matrix(c(par1, rho, rho, par2),2,2) require(Matrix) Sigma - expm(log.Sigma) I want some method to compute the derivatives of Sigma

Re: [R] Derivative of a function

2011-06-29 Thread Lisa
This is not a homework. I just want to see if there are some R functions or some ideas I can borrow to solve my problem. -- View this message in context: http://r.789695.n4.nabble.com/Derivative-of-a-function-tp3631814p3633071.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Derivative of a function

2011-06-29 Thread David Winsemius
On Jun 29, 2011, at 10:48 AM, Lisa wrote: This is not a homework. I just want to see if there are some R functions or some ideas I can borrow to solve my problem. There is a deriv function that provides limited support for symbolic differentiation. The Rhelp list is advertised (

Re: [R] Derivative of a function

2011-06-29 Thread Gabor Grothendieck
On Tue, Jun 28, 2011 at 10:03 PM, Lisa lisa...@gmail.com wrote: Dear all, I just want to get the derivative of a function that looks like: y = exp(x1*b) / (exp(x1*b) + exp(x2*b)) where y is a scalar, x1, x2, and b are vectors. I am going to take the derivative of b with respect to y, but I

Re: [R] Derivative of a function

2011-06-29 Thread Rolf Turner
On 30/06/11 06:16, Gabor Grothendieck wrote: On Tue, Jun 28, 2011 at 10:03 PM, Lisalisa...@gmail.com wrote: Dear all, I just want to get the derivative of a function that looks like: y = exp(x1*b) / (exp(x1*b) + exp(x2*b)) where y is a scalar, x1, x2, and b are vectors. I am going to take

Re: [R] Derivative of a function

2011-06-29 Thread Lisa
Yes. I need to do implicit differentiation. After rearrangement, I got (x2 – x1) * b = log(1 / y - 1) Take derivative of both sides with respect to y, I have (x2 – x1) * b’[y] = - 1/y(1-y) Since both (x2 – x1) and b’[y] are vectors, I cannot move (x2 – x1) to RHS. This is why I posted my

Re: [R] Derivative of a function

2011-06-29 Thread Gabor Grothendieck
On Wed, Jun 29, 2011 at 4:35 PM, Lisa lisa...@gmail.com wrote: Yes. I need to do implicit differentiation. After rearrangement, I got (x2 – x1) * b = log(1 / y - 1) Take derivative of both sides with respect to y, I have (x2 – x1) * b’[y] = - 1/y(1-y) Since both (x2 – x1) and b’[y] are

Re: [R] Derivative of a function

2011-06-29 Thread S Ellison
...@gmail.com] Sent: 29 June 2011 21:35 To: r-help@r-project.org Subject: Re: [R] Derivative of a function Yes. I need to do implicit differentiation. After rearrangement, I got (x2 – x1) * b = log(1 / y - 1) Take derivative of both sides with respect to y, I have (x2 – x1) * b’[y] = - 1/y(1-y) Since both

[R] Derivative of a function

2011-06-28 Thread Lisa
Dear all, I just want to get the derivative of a function that looks like: y = exp(x1*b) / (exp(x1*b) + exp(x2*b)) where y is a scalar, x1, x2, and b are vectors. I am going to take the derivative of b with respect to y, but I cannot derive an expression in which b is function of y. I know

Re: [R] Derivative of a function

2011-06-28 Thread Rolf Turner
(1) You really ought to do your own homework. (2) What has this to do with R? cheers, Rolf Turner On 29/06/11 14:03, Lisa wrote: Dear all, I just want to get the derivative of a function that looks like: y = exp(x1*b) / (exp(x1*b) + exp(x2*b)) where y is a scalar, x1, x2, and

Re: [R] Derivative

2010-08-12 Thread TGS
This following works for me but I still favor the quick and dirty method suggested originally by David. options(scipen = 10) x - seq(0,2, by = .01) f - expression(5*cos(2*x)-2*x*sin(2*x)) D(f, 'x') f.prime - function(x){ -(5 * (sin(2 * x) * 2) + (2 * sin(2 * x) + 2 * x * (cos(2 * x) *

[R] Derivative

2010-08-11 Thread TGS
How would I numerically find the x value where the derivative of the function below is zero? x - seq(1,2, by = .01) y - 5*cos(2*x)-2*x*sin(2*x) plot(x,abs(y), type = l, ylab = |y|) __ R-help@r-project.org mailing list

Re: [R] Derivative

2010-08-11 Thread David Winsemius
On Aug 11, 2010, at 9:21 PM, TGS wrote: How would I numerically find the x value where the derivative of the function below is zero? x - seq(1,2, by = .01) y - 5*cos(2*x)-2*x*sin(2*x) plot(x,abs(y), type = l, ylab = |y|) Two ideas: ---minimize abs(diff(y)) abline(v=x[which.min(abs(

Re: [R] Derivative

2010-08-11 Thread Dennis Murphy
Hi: Try the following: f - function(x) 5*cos(2*x)-2*x*sin(2*x) curve(f, -5, 5) abline(0, 0, lty = 'dotted') This shows rather clearly that your function has multiple roots, which isn't surprising given that it's a linear combination of sines and cosines. To find a specific root numerically, use

Re: [R] Derivative

2010-08-11 Thread David Winsemius
On Aug 12, 2010, at 12:49 AM, Dennis Murphy wrote: Hi: Try the following: f - function(x) 5*cos(2*x)-2*x*sin(2*x) curve(f, -5, 5) abline(0, 0, lty = 'dotted') This shows rather clearly that your function has multiple roots, which isn't surprising given that it's a linear combination of

[R] Derivative of the probit

2010-05-06 Thread Andrew Redd
Is there a function to compute the derivative of the probit (qnorm) function in R, or in any of the packages? Thanks, -Andrew [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] Derivative of the probit

2010-05-06 Thread Thomas Stewart
f-function(x) 1/dnorm(qnorm(x)) for x in (0,1) -tgs On Thu, May 6, 2010 at 4:40 PM, Andrew Redd ar...@stat.tamu.edu wrote: Is there a function to compute the derivative of the probit (qnorm) function in R, or in any of the packages? Thanks, -Andrew [[alternative HTML version

Re: [R] Derivative of the probit

2010-05-06 Thread Ted Harding
On 06-May-10 20:40:30, Andrew Redd wrote: Is there a function to compute the derivative of the probit (qnorm) function in R, or in any of the packages? Thanks, -Andrew I don't think so (though stand to be corrected). However, it would be straightforward to write one. For simplicity of

Re: [R] Derivative of a smooth function

2010-04-04 Thread Julien Gagneur
Hi Fir, you can alternatively use local regression, implemented in the package locfit, which can also estimate derivatives: library(locfit) attach(cars) # main fit fit - locfit( dist ~ speed ) # fit 1st derivative fitd - locfit( dist ~ speed , deriv =1) # plots... plot(speed, dist ) lines(fit)

Re: [R] Derivative of a smooth function

2010-04-03 Thread Chidambaram Annamalai
While this doesn't answer your question, I want to let you know that there is a proposal for a related improvement within R that will let users compute (numerically) the derivatives, of any order, of a given function inside of R. In your case, this means that you will write the smooth spline

[R] Derivative of a smooth function

2010-04-02 Thread FMH
Dear All, I've been searching for appropriate codes to compute the rate of change and the curvature of  nonparametric regression model whish was denoted by a smooth function but unfortunately don't manage to do it. I presume that such characteristics from a smooth curve can be determined by

Re: [R] Derivative of a smooth function

2010-04-02 Thread Ravi Varadhan
, Division of Geriatric Medicine and Gerontology School of Medicine Johns Hopkins University Ph. (410) 502-2619 email: rvarad...@jhmi.edu - Original Message - From: FMH kagba2...@yahoo.com Date: Friday, April 2, 2010 4:39 am Subject: [R] Derivative of a smooth function To: r-help@r-project.org

Re: [R] Derivative of nonparametric curve

2009-09-14 Thread FMH
Thank you - Original Message From: spencerg spencer.gra...@prodsyse.com To: Liaw, Andy andy_l...@merck.com Cc: Rolf Turner r.tur...@auckland.ac.nz; FMH kagba2...@yahoo.com; r-help@r-project.org Sent: Wednesday, September 9, 2009 3:08:43 PM Subject: Re: [R] Derivative of nonparametric

Re: [R] Derivative of nonparametric curve

2009-09-09 Thread Liaw, Andy
From: Rolf Turner On 8/09/2009, at 9:07 PM, FMH wrote: Dear All, I'm looking for a way on computing the derivative of first and second order of a smoothing curve produced by a nonprametric regression. For instance, if we run the R script below, a smooth nonparametric

Re: [R] Derivative of nonparametric curve

2009-09-09 Thread spencerg
This may be overkill for your application, but you might be interested in the fda package, for which a new book appeared a couple of months ago: Functional Data Analysis with R and Matlab (Springer Use R! series, by Ramsay, Hooker and Graves; I'm the third author). The package includes

[R] Derivative of nonparametric curve

2009-09-08 Thread FMH
Dear All, I'm looking for a way on computing the derivative of first and second order of a smoothing curve produced by a nonprametric regression. For instance, if we run the R script below, a smooth nonparametric regression curve is produced. provide.data(trawl) Zone92   - (Year == 0 Zone ==

Re: [R] Derivative of nonparametric curve

2009-09-08 Thread Rolf Turner
On 8/09/2009, at 9:07 PM, FMH wrote: Dear All, I'm looking for a way on computing the derivative of first and second order of a smoothing curve produced by a nonprametric regression. For instance, if we run the R script below, a smooth nonparametric regression curve is produced.