필터 지우기
필터 지우기

Variance in Ornstein Uhlenbeck process

조회 수: 4 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by