On Fri, 2008-11-21 at 22:37 -0800, subbudas wrote:
> hello everyone ,
> i have written some code in R for jump diffusion model.
> the code generates answer as
> " NaN
> There were 50 or more warnings (use warnings() to see the first 50)"
> my code is
>
> mu<-0.2
> sig<-0.2
> S0<-100
> j<-0.2
>
i tried to run your code, this is how/why you got NaN:
> mu<-0.2
> sig<-0.2
> S0<-100
> j<-0.2
> dt<-1/252
> int<-0.1
> i<-0
> is.nan
function (x) .Primitive("is.nan")
> k<-rnorm(1,0,1)
> k
[1] 0.3214954
> theta<-ifelse((k<(int*dt)),1,0)
> theta
[1] 0
> m<-rnorm(1)
> m
[1] -0.4525731
> ga
hello everyone ,
i have written some code in R for jump diffusion model.
the code generates answer as
" NaN
There were 50 or more warnings (use warnings() to see the first 50)"
my code is
mu<-0.2
sig<-0.2
S0<-100
j<-0.2
dt<-1/252
int<-0.1
i<-0
while(i<=1)
{
is.nan
k<-rnorm(1,0,1)
theta<-
3 matches
Mail list logo