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
*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,
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
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
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
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
6 matches
Mail list logo