- CroackingToad
**Posts:**33**Joined:**

Hi everyone,maybe this is a very trivial question but I would like to have some suggestions on this. I would like to jointly simulate a brownian motion [$]W(t)[$] and its integral [$]Y(t):=\int_0^t{W(s)ds}[$].More precisely, what I would like to have is an exact updating rule that allows me to simulate [$]W(t_2)[$] and [$]Y(t_2)[$] given [$]W(t_1)[$] and [$]Y(t_1)[$]. Many thanks in advance

just thinking out loud...the first step is developing the joint distribution of [$](W(t),Y(t))[$].is it a bivariate normal or something else? Left to you to nail down. let's say it *is* bivariate normal. Then, I would draw by(i) making a draw of [$]W(t)[$]; (ii) then drawing [$]Y(t) = A(t) [\rho(t) W(t) + \sqrt{1 -\rho(t)^2} Z(t)][$],choosing [$](A(t),\rho(t))[$] to make the variance, and covariance of [$]Y(t)[$] come out right. (We know the mean is correctly 0).Here [$]Z(t)[$] is an independent normal draw with mean 0 and variance t. Once that's nailed down, doing it from some t1 instead of t=0 should be clear.Anyway, something like that ...

Last edited by Alan on February 28th, 2016, 11:00 pm, edited 1 time in total.

- CroackingToad
**Posts:**33**Joined:**

Thanks Alan, that's precisely what I am trying to figure out. Surely [$]Y(t)[$] is normal, however what I miss is the correlation structure.I am trying to write [$]Y(t)[$] in a clever way but I am a bit stuck...

Well, the joint moment generating function will satisfy a 'bond-like' pde problem, which should be easy to solve. Then, from that, get the covariance by differentiating.

- CroackingToad
**Posts:**33**Joined:**

for the moment I just came out with this,maybe it could be helpful.We rewrite:[$]Y(t_2) =\int_{t_1}^{t_2}W(s)ds[$] by using Ito lemma on the process [$]W(t)t[$]. We get[$]W(t_2)t_2 -W(t_1)t_1 = \int_{t_1}^{t_2} W(s)ds + \int_{t_1}^{t_2}sdW(s) [$]from this follows [$]\int_{t_1}^{t_2} W(s)ds = W(t_2)t_2 -W(t_1)t_1 - \int_{t_1}^{t_2}sdW(s) [$]Now, writing the increment [$] W(t_2) -W(t_1) [$] as [$]\int_{t_1}^{t_2}dW(s) [$] I can compute the 2 out of 3 terms of the covariance:[$]E[\int_{t_1}^{t_2}dW(s) W(t_1)t_1 ]=0 [$][$]E[\int_{t_1}^{t_2}dW(s) \int_{t_1}^{t_2}sdW(s) ]= \int_{t_1}^{t_2}s ds [$]but I am again stuck with [$]E[\int_{t_1}^{t_2}dW(s) W(t_2)t_2 ] [$]....

If you can't get unstuck, try the pde thing.

Last edited by Alan on February 28th, 2016, 11:00 pm, edited 1 time in total.

This is well known... The easy way is simply to approximate by a discrete sum and then let the number of steps go infinity. Yes, it is bivariate normal. So all you need to compute are the variances and covariances.

- CroackingToad
**Posts:**33**Joined:**

QuoteOriginally posted by: CroackingToadfor the moment I just came out with this,maybe it could be helpful.We rewrite:[$]Y(t_2) =\int_{t_1}^{t_2}W(s)ds[$] by using Ito lemma on the process [$]W(t)t[$]. We get[$]W(t_2)t_2 -W(t_1)t_1 = \int_{t_1}^{t_2} W(s)ds + \int_{t_1}^{t_2}sdW(s) [$]from this follows [$]\int_{t_1}^{t_2} W(s)ds = W(t_2)t_2 -W(t_1)t_1 - \int_{t_1}^{t_2}sdW(s) [$]Now, writing the increment [$] W(t_2) -W(t_1) [$] as [$]\int_{t_1}^{t_2}dW(s) [$] I can compute the 2 out of 3 terms of the covariance:[$]E[\int_{t_1}^{t_2}dW(s) W(t_1)t_1 ]=0 [$][$]E[\int_{t_1}^{t_2}dW(s) \int_{t_1}^{t_2}sdW(s) ]= \int_{t_1}^{t_2}s ds [$]but I am again stuck with [$]E[\int_{t_1}^{t_2}dW(s) W(t_2)t_2 ] [$]....sorry also the last passage is easy to compute: just write [$]E[\int_{t_1}^{t_2}dW(s) W(t_2)t_2 ] = E[\int_{t_1}^{t_2}dW(s) \int_{0}^{t_2}dW(s) t_2 ] = t_2 (t_2-t_1)[$]So summing up the final covariance should read[$] t_2 (t_2-t_1) - \frac{1}{2}(t_2^2-t_1^2) = \frac{1}{2}(t_2-t_1)^2[$].Do you find this reasonable?

It's dimensionally correct, has the right sign, and vanishes with the interval. I guess that leaves [$]\alpha (t_2 - t_1)^2[$]. p.s. I just recalled I have a table in my stoch. vol. book Table 5A.1 (pg. 170), which has the nice formula, among others[$]<e^{x W_{\tau}} \int_0^{\tau} W_s \, ds> = \exp(\frac{1}{2} x^2 \tau) (\frac{1}{2} x \tau^2)[$], so differentiating confirms your answer.

Last edited by Alan on February 28th, 2016, 11:00 pm, edited 1 time in total.

- CroackingToad
**Posts:**33**Joined:**

many thanks for your help Alan.Regards

- MaxwellSheffield
**Posts:**70**Joined:**

Hello All,I have a similar question : Let 's take a system of random variables [$](X_{k})[$] with [$]X_{k}(t)=\int_{0}^{t}{\beta_{k}(u)^{T}dW(u)}[$] where W is a brownian vector of size n, beta is a deterministic vector, bounded, and k varies between 1 and N, where N>>n.Obviously, the system is big, and the distribution is entirely defined by the covariance matrix of size N*N. Let assume that we know [$]X_{k}(t)[$], and we would like to simulate [$]X_{k}(s)[$], where s>t. How do we "square root" the correlation matrix efficiently ? Application : Libor market model on which we already applied PCA , and wish to use a big step scheme .

I think it boils down to drawing from a multivariate normal, with the method explained at wikipediaIf you read my first response, that's essentially what I'm doing.

- MaxwellSheffield
**Posts:**70**Joined:**

Won't this imply generating N random variables ?

Sorry, I didn't notice the N vs. n business. In any event, the answer is yes. I'm not sure that is really an obstruction.If you haven't implemented it yet, I would try it in, say C/C++, and then see if the run times are acceptable.

GZIP: On