Variance in Ornstein Uhlenbeck process

1 回表示 (過去 30 日間)
Adam Calhoun
Adam Calhoun 2012 年 9 月 27 日
I don't know if anyone here will be able to help me, but I'm trying to simulate an Ornstein Uhlenbeck process using the code found here: http://planetmath.org/OrnsteinUhlenbeckProcess.html
X_free = cumsum(sqrt(2*D*dt)*randn(size(t)));
X_filt = filter([0 g*dt], [1 -1+g*dt] , X_free);
X_OU = X_free-X_filt;
Here, D is the diffusion constant and g is the rate of mean reversion. I know that the variance in the process should be:
(2*D / (2*g)) * (1 - exp(-2*g*t)
(See, for example http://planetmath.org/OrnsteinUhlenbeckProcess.html) But this seems to not work; for example, when D=.1, g=.01, and t = 1:10000, the variance in the process is roughly ~7.5 (on average), when the equation says that it should be 10. Anyone have any idea why I'm getting a different variance than expected?
Thanks!

回答 (1 件)

Ben Petschel
Ben Petschel 2012 年 9 月 29 日
That's an interesting method, though it's not obvious to me how it works and I couldn't see any reference to it in the planet math article. I would first check that X_OU returns exactly the same value when calculated by a simple FOR loop using the same randn values.
Failing that, I would check that dt is small enough for accurate results, and that you are calculating the variance of the values X_OU(end) returned from multiple runs (not the variance of X_OU).

カテゴリ

Help Center および File ExchangeFinancial Toolbox についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by