Displaying 1 result from an estimated 1 matches for "oufit".
Did you mean:
mufit
2012 Jul 20
1
fitting Ornstein-Uhlenbeck process by MAXIMUM LIKELYHOOD
...Uhlenbeck process by MAXIMUM LIKELYHOOD
method.
i found these formulas on
http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/
this is the mean-reverting process
http://r.789695.n4.nabble.com/file/n4637271/process.txt process.txt
and this is the script that i am using.......
ouFit.ML=function(spread) {
n=length(spread)
delta=n/n
Sx=sum(spread[1:n-1])
Sy=sum(spread[2:n])
Sxx=(Sx)^2
Syy=(Sy)^2
Sxy=Sx*Sy
mu = (Sy*Sxx - Sx*Sxy) / ( n*(Sxx - Sxy) - (Sx^2 - Sx*Sy) )
lambda = -log( (Sxy - mu*Sx - mu*Sy + n*mu^2) / (Sxx -2*mu*Sx + n*mu^2)
)/delta
a = exp(-lamb...