[R] mean reverting model: THANKS !

2009-03-10 Thread Josuah Rechtsteiner
dear useRs (especially andrew and gabor), you have helped me a lot, the ar(1)/ornstein-uhlenbeck type is exactly it (0 thank you, josuah __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] mean reverting model

2009-03-09 Thread andrew
Autoregression is more general than the (discretized) Ornstein Uhlenbeck process. For a start, a discretized version of the Ornstein- Uhlenbeck is just an AR(1) process X(n+1) = X(n) + a (X(n) - mu) + error(n+1), but with the coefficient a restricted to 0 < a < 1. This restriction is necessary as

Re: [R] mean reverting model

2009-03-09 Thread markleeds
i think there's confusion here between a time series that reverts to its long term mean and an "ornstein uhlenbeck" type of mean reversion. they're not the same thing and I don't want to go into the difference because I would probably just add to the confusion. you might be better off sending

Re: [R] mean reverting model

2009-03-09 Thread andrew
Autoregression is just X(n+1) = a X(n) + b + error. The mean reverting model is when |a| < 1. Estimation is carried out using x_ar <- ar(x) summary(x_ar) standard error is found in the square root of the diagonal of the x_ar $asy.var.coef matrix. please read the documentation found at ?ar to g

Re: [R] mean reverting model

2009-03-09 Thread Josuah Rechtsteiner
hi andrew, the problem is that I don't know what kind of model this exactly is... I only know that I have to do it this way and how the model is structured. Mean reverting model = autoregression? If so, then search for ?ar or ?arima to fit a time series. On Mar 10, 4:36 am, Josuah Rec

Re: [R] mean reverting model

2009-03-09 Thread andrew
Mean reverting model = autoregression? If so, then search for ?ar or ?arima to fit a time series. On Mar 10, 4:36 am, Josuah Rechtsteiner wrote: > dear useRs, > > i'm working with a mean reverting model of the following specification: > > y = mu + beta(x - mu) + errorterm, where mu is a cons

[R] mean reverting model

2009-03-09 Thread Josuah Rechtsteiner
dear useRs, i'm working with a mean reverting model of the following specification: y = mu + beta(x - mu) + errorterm, where mu is a constant currently I estimate just y = x (with lm()) to get beta and then calculate mu = estimated intercept / (1-beta). but I'd like to estimate mu and beta