Closed JChonpca closed 1 year ago
Thank you for your immediate reply and bug fixing. Jumpdiff is a very nice python package and greatly helps with my research.
Thanks again @JChonpca, I have merged PR #6. I'll push a new version, v0.4.3
with this correction.
Thank you for your great effort in the
jumpdiff
, it is the first package in both simulation and estimation for the research in SDEwJ with Python language. But I find some mistakes in your simulation parts.In the code file jd_process.py, you directly treat the jump as the
dJ[i] * np.random.normal(loc = 0, scale = np.sqrt(xi))
for both Euler and Milstein schemes, which is a wrong simulation method. The correct method is treat the diffusion as the sum of d[j] iid samples that from normal distribution. The data generated with wrong data will leads to the estimation bias of your program. The example you used in the introduction in github and publication has very small lambda and thedJ[i]
is mostly equal to1
, so the data generated with wrong simulation method is almost the same with the right one. If you change the lambda to50
, the estimation will crash with big bias of about30
, which is showed the code file attached. After I change the simulation data using the correct simulation method, the estimation task is worked for both small and big lambda.I think your estimation method is good without any problem since I have tested other sample with the right simulation code, but you should correct the mistakes in jd_process.py.
Wrong Code in
jd_process.py
:Correct Code for jd_process.py:
Simulation and Estimation wth big
lambda
: