Re: [R] first and second derivative calculation

2012-10-07 Thread jeemba2012
I have a similar problem . Here are functions I know that work properly ## PAnnuity function definition PAnnuity <- function(A,y,m,n) { f<-(A/(y/m))*(1-1/((1+y/m)^n)) } ##BondPrice function BondPrice <- function(c,y,m,n) { B <-100 f<-PAnnuity((c/m)*B,y,m,n) + B /((1+y/m)^n) } My function o

Re: [R] first and second derivative calculation

2010-01-23 Thread Adaikalavan Ramasamy
*t + 30), 't') 3 * t^2 - 6 * (2 * t) + 5 D(D(expression(t^3-6*t^2+5*t + 30), 't'), 't') 3 * (2 * t) - 6 * 2 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org ] On Behalf Of Marlin Keith Cox Sent: Friday, January 22,

Re: [R] first and second derivative calculation

2010-01-22 Thread David Winsemius
t'), 't') 3 * (2 * t) - 6 * 2 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org ] On Behalf Of Marlin Keith Cox Sent: Friday, January 22, 2010 4:37 PM To: r-help@r-project.org Subject: [R] first and second derivative calculation I

Re: [R] first and second derivative calculation

2010-01-22 Thread Marlin Keith Cox
2 > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Marlin Keith Cox > Sent: Friday, January 22, 2010 4:37 PM > To: r-help@r-project.org > Subject: [R] first and second derivative calculation > > I wo

Re: [R] first and second derivative calculation

2010-01-22 Thread Doran, Harold
n Keith Cox Sent: Friday, January 22, 2010 4:37 PM To: r-help@r-project.org Subject: [R] first and second derivative calculation I would like to calculate a first and second derivative and am having problems finding a simple solution. My syntax may be off as I am not a mathematician, so pardon ahead o

[R] first and second derivative calculation

2010-01-22 Thread Marlin Keith Cox
I would like to calculate a first and second derivative and am having problems finding a simple solution. My syntax may be off as I am not a mathematician, so pardon ahead of time. data: t<-seq(0,4, by=.1) The function is: H(t) = t^3-6*t^2+5*t + 30 from here I plot the curve: plot(x,y ,xlab="x-va