From this, the next question is this: what if we wanted to do a long-dated bond forward for instance, what repo would we use ? Simply flat extrapolation from short-dated observable repo rates ?

Thanks for reading.

Statistics: Posted by woodsdevil — Today, 12:31 am

]]>

]]>

Comparison to Standard Prompting

With

+ toy examples..

Statistics: Posted by Cuchulainn — Yesterday, 6:48 pm

]]>

Requirements engineering for dummies?

just a 1st impression. Nothing new under the sun. Ecclesiastes 1:9,

Statistics: Posted by Cuchulainn — Yesterday, 6:29 pm

]]>

what's the issue? Can you post your code?

BTW what's prompt engineering?

Seems Julia and PDE go well together.

https://www.deeplearning.ai/short-cours ... evelopers/

Statistics: Posted by bearish — Yesterday, 1:40 pm

]]>

what's the issue? Can you post your code?

BTW what's prompt engineering?

Seems Julia and PDE go well together.

Statistics: Posted by Cuchulainn — Yesterday, 9:57 am

]]>

I have not presented the proof of those formulas but I will give friends an idea how to solve those iterated stochastic integrals. It is very embarrassing to admit but when I started out to solve for those integrals, I very naively thought that in iterated stochastic integrals with repeated dz(t) and dt, these integrals commute. Only later when I simulated the lognormal and other SDEs to higher order that I realized that these integrals do not commute.

Here in this post 689, I told friends that I had made an error and my earlier thoughts that stochastic integrals commute and resulting calculations were wrong.

https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=675#p826905

Then I went to blackboard again and found out that my method to evaluate dz integrals with Ito-isometry like formula with variances was very right but stochastic integrals that ended with dt were wrong.

I wrote this post four days later and gave the correct formulas. Post 690 here: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=675#p827224

For reference, here is the original post # 32 where I claimed that stochastic integrals should commute. The method suggested in that post only works for dz-integrals and not on dt-integrals. Here is the original post: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=30#p782089

Sometime after writing that post, I started working on ODEs and stopped the work on SDEs which I restarted later. I was forcefully detained several times in that duration.

Those dt integrals that could not be directly evaluated had to be first converted to dz integrals as below and then we could use ito isometry like formulas to solve for them and get exact results.

Then just like we approach the formulas [$]\int_0^{t} z(s) \, ds \, =\,\int_0^{t} \, d[\, s \, z]\, - \int_0^{t} \, s \, dz(s) \, [$]

I applied that to hermite polynomials as

[$]\, \int_0^{t} H_n(z(s)) \, ds \, =\,\int_0^{t} \, d[\, s \, H_n(z(s))]\, - \int_0^{t} \, s \, dH_n(z(s)) \, [$]

where second integral on RHS can be solved with ito-isometry like formula. So I had to replace dt integrals with [$]dz(t)][$] or [$]dH_n(z(t))[$] integrals which could be solved easily.

Using above recursions given in post 693, you can solve for a very large class of stochastic integrals by representing arbitrary polynomial expressions of z(t) in terms of hermite polynomials and then use above recursions.

Here in post 697, I have given a toy example how you could solve for integral [$]\, \int_0^t \, z(s)^4 \, ds[$]. Following the logic in that example you can easily solve for a very large number of stochastic integrals. : https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=690#p827488

I recall reading a scholarly paper in which author had calculated above integral [$]\, \int_0^t \, z(s)^4 \, ds[$] with great difficulty but you can very quickly solve it by representing it in a hermite polynomial form and then applying the stochastic integral solution recursions of post 697.

Another thing I want to mention that iterate integral formula with repeated Ito is completely general and can be applied to any univariate or multivariate SDEs or systems of SDEs. But you have to generalize it according to the problem. For example in stochastic volatility SDEs setting when we have two different variables in a term as can happen that in volatility term of asset there could be a power of asset and also a power of volatility. In such cases, you apply Ito product rule instead of Ito change of variable formula and successive application of Ito product rule would convert the original SDE into large number of terms with constant integrand evaluated at initial time and then all we need is to solve for the appropriate stochastic integrals. It is a bit tedious but straightforward.

I was not going to write a full-fledged stochastic volatility program and thought most people would do it on their own after looking at my research on strictly one dimensional SDEs. I wrote stochastic volatility program only because I needed a correct reference program which can be used to find the true distribution of the SV SDEs and I wanted to compare results from my experiments with other analytic methods that did not use any pseudo-random numbers.

Again here is the link to general Stochastic volatility SDEs program: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=1200#p867829

Statistics: Posted by Amin — Yesterday, 9:49 am

]]>

Statistics: Posted by bearish — Yesterday, 3:19 am

]]>

]]>

]]>

]]>

Statistics: Posted by Cuchulainn — May 30th, 2023, 10:44 pm

]]>

Statistics: Posted by tagoma — May 30th, 2023, 9:55 pm

]]>

1. Monte Carlo simulation of Stochastic Differential Equations.

In order to simulate an SDE with variable drift terms and variable volatility term, we apply Ito formula on variable drift and variable volatility terms and find an equivalent expression for each of the variable terms comprising a stochastic integral with constant integrand first term evaluated at initial value and several variable integrand terms under iterated stochastic integrals. We again apply Ito formula on variable integrand terms under the stochastic integral sign to convert them into constant integrand terms evaluated at initial values and further variable integrand terms under higher order iterated integrals. After N repeated application of the above procedure, we obtain an Nth order discretization of the SDE comprising a large number of constant integrand terms evaluated at initial values and we also get some N+1 order terms with variable integrands under the iterated integrals. We can easily evaluate the all the constant integrand terms up to order N under iterated stochastic integral signs and neglect the rest N+1 order variable integrand terms. All the constant integrand stochastic integrals can be analytically solved using hermite polynomials. This process can be repeatedly carried out to achieve high degree of accuracy in monte carlo simulations of the SDEs. Since number of terms involved in higher order expansions increases very fast and cannot be easily done with hand, I distributed an algorithm coded in matlab that calculated all the stochastic integrals and their coefficients from constant integrand terms involved and these coefficients are later used in higher order simulations of Stochastic differential equations.

In post 37 below, I described how to apply Ito change of variable formula on drift and volatility terms of the SDE and then substitute them in the original integral representation of the SDE. I also explained how to repeatedly apply the Ito Change of variable formula on variable integrand terms for higher order simulation of the SDEs. This post 37 was written on Monday, May 02, 2016 1:43 pm. I think due to forum adjustments, proper formatting of this post is lost but you can still properly read the equations in which Ito change of variable formula is repeatedly applied.

https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=30#p782234

I later stopped working on SDEs and applied the same idea on solution of ODEs. I started working on SDEs again after quite some time and then wrote another post describing how to expand the integral solution of an SDE to higher order by repeatedly applying Ito Change of variable formula. This post 564 is similar to post 37. Post 564 was written on Thu Nov 23, 2017 10:48 am.

https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=555#p816432

When I wrote the above post, I had only successfully expanded the SDE into constant integrand iterated stochastic integrals but I still had not given the proper analytic formulas for the solution of iterated stochastic integrals.

I was only able to solve for various iterated stochastic integrals whose integrands were constant values evaluated at initial starting time. I wrote this post 690 written on Thu May 10, 2018 10:38 pm where I gave analytic expressions for solution of stochastic integrals

https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=675#p827224

One day later I, latexed the formulas given in post 690 and wrote them again. This was done in post 693 written on Fri May 11, 2018 6:08 pm

https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=690#p827246

Here in post 736, I presented a program based on above research that would evolve density of an SDE without pseudo random numbers using a non-branching tree for underlying normal driving density. This program would automatically do repeated Taylor expansions of SDEs with two drift terms and one volatility term and would also automatically solve for all stochastic integrals involved. This program had exact behaviour for one evolution/simulation step of the non-branching tree but its multi-step behaviour with deterministic non-branching tree was flawed . As it turns out when we simulate with pseudo-random numbers, if the SDE does not have explicit dependence on time, we always simulate the SDE at the start of interval as if we are starting from time zero. So while multi-step simulation algorithm was not good for analytic non-branching density tree, its one-step version was perfect, precise and ideal for Monte Carlo simulations with pseudo-random numbers. However, it was only a few weeks later, when I started using the one step simulation scheme in monte carlo simulations. Again the algorithm and its explanation were given in post 736 written on Mon Jul 02, 2018 10:56 am here.

https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=735#p830547

It was the algorithm in above post that a lot of friends copied from my thread and distributed around. It would discretize for any arbitrary SDE with two drift terms and one volatility term without explicit time dependence in the SDE.

I later used the algorithm given in post # 736 for monte carlo simulations for the first time in a matlab program distributed in post # 773, written on Sun Nov 04, 2018 6:34 pm given here: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=765#p837313

In the above post, I simulated both bessel process version of the SDE and original coordinates version of the SDE with monte carlo simulations employing pseudo random numbers.

Here in post 891, I presented the same monte carlo simulation algorithm but all the binomial loops have been removed and all the various integrand terms are directly written as a summation. It is the same monte carlo algorithm as old but all the terms in expansion are written directly without any looping. Here is the link to post 891 written on Sat Mar 14, 2020 5:54 pm : https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=885#p855539

Here is posts 892 and 893, I have earlier collected all my posts written about monte carlo simulations and associated matlab programs.

Post 892: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=885#p855649

Post 893: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=885#p855653

Here in post 1172 and 1173, I presented ideas about expansion of high dimensional monte carlo simulations like we have for interest rate derivatives and equity baskets.

Post 1172: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=1170#p866762

Post 1173: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=1170#p866774

Here in post 1213, I have presented a higher order monte carlo program for very general system of correlated system of asset and SV SDEs.

Asset SDE is of the form

[$]\, dX(t)=(a X(t)^{\alpha_1} + b X(t)^{\alpha_2}) dt + \sqrt{(1-\rho^2)} \sigma_1 \, V(t)^{\gamma_V} \, X(t)^{\gamma_X} dZ1(t) + \rho \sigma_1 V(t)^{\gamma_V} X(t)^{\gamma_X} dZ2(t)[$]

while volatility SDE is of the form

[$]dV(t)=(\mu_1 V(t)^{\beta_1} + \mu_2 \, V(t)^{\beta_2}) \, dt + \, \sigma_0 \, V(t)^{\gamma} dZ2(t)[$]

Here is the higher order monte carlo simulation program for above general correlated system of SDEs written on Fri Aug 13, 2021 1:04 pm. Here is the address of post 1213: https://forum.wilmott.com/viewtopic.php?f=4&t=99702&start=1200#p867829

2. Initial Value problems of first and higher order ODEs and systems of ODEs.

You can read all about my work here: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2872598

Interestingly, I used the same basic ideas for solution of ODEs and SDEs. The common original idea involves taking iterated integrals of higher derivatives and then solve for stochastic integrals (in case of SDEs) and deterministic integrals (in case of ODEs). These integrals can easily be solved since their integrand is a constant value evaluated at initial time.

I will be making a separate post about my research work during last two years.

Statistics: Posted by Amin — May 30th, 2023, 9:34 pm

]]>

Always travel with laxatives would be my advice.

Statistics: Posted by tagoma — May 30th, 2023, 8:58 pm

]]>