Variance in Ornstein Uhlenbeck process
조회 수: 4 (최근 30일)
이전 댓글 표시
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!
댓글 수: 0
답변 (1개)
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).
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!