Displaying 1 result from an estimated 1 matches for "exret".
Did you mean:
exert
2013 May 20
1
How to fit a normal inverse gaussian distribution to my data using optim
...ll <- function(data,para) {
m0 <- para[1]
m1 <- para[2]
omega <- para[3]
tau <- para[4]
a <- para[5]
b <- para[6]
beta <- para[7]
theta <- para[8]
gamma <- para[9]
phi <- para[10]
T <- nrow(data)
ret <- data[,2];
rate <- data[,3]
exret=100*(ret+1-((rate/100)+1)^(1/365))
h = rep(0,T);
vx = rep(0,T);
h[1] = 10000*exret[1]^2
vx[1] = (exret[1]-m0-(m1+beta*((gamma^0.5)/(gamma^2+beta^2)^0.5))*h[1])/h[1]
for ( i in (2:T) ) {
h[i] = (omega+a*(abs(h[i-1]*vx[i-1])-tau*h[i-1]*vx[i-1])^theta+b*(h[i-1]^theta))^(1/theta)...