0
$\begingroup$

The stochastic integral I want to simulate is $$\int_{0}^{1}J_c(s)dJ_c(s)$$ where $J_c(s) = \int_{0}^{s}e^{-c(s-r)}dB(r)$, is an OU process.

I simulate the data using Matlab and the sample codes are as follows. n is the sample size.

dB_x = mvnrnd(zeros(K, 1), Omega_xx/n, n); % n-by-m matrix
B_x = cumsum(dB_x,1); % n-by-m matrix
B_x = [zeros(1,K); B_x];
J_c = exp(-C*[1:n]/n)'.*cumsum(exp(C*[1:n]/n).*[zeros(K,1) dB_x(1:n-1,:)'])';
dJ_c=[J_c(1,:); diff(J_c)]; % m-by-n matrix
int_J =  1/n*J_c'*dJ_c;

I am not sure whether my calculation is correct or not, can anybody give me a correct way of simulating this integral?

$\endgroup$

1 Answer 1

0
$\begingroup$

Finally, I found it wrong. The correct way is

dB_x = mvnrnd(zeros(K, 1), Omega_xx/n, n); % n-by-m matrix
B_x = cumsum(dB_x,1); % n-by-m matrix
B_x = [zeros(1,K); B_x];
J_c = exp(C*[1:n]/n)'.*cumsum(exp(-C*[1:n]/n).*[zeros(K,1) dB_x(1:n-1,:)'])';
dJ_c=[J_c(1,:); diff(J_c)]; % m-by-n matrix
int_J = J_c'*dJ_c;
$\endgroup$
1
  • 1
    $\begingroup$ show your work, otherwise this is not actually an answer. $\endgroup$ Commented Jun 27, 2016 at 7:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.