jlperla / continuous_time_methods

MIT License
23 stars 15 forks source link

Create test suite for the univariate diffusion discretization #13

Closed jlperla closed 7 years ago

jlperla commented 7 years ago

You will see a starting point in continuous_time_methods\matlab\tests\discretize_univariate_diffusion_test.m The goal is to fully test the continuous_time_methods\matlab\lib\discretize_univariate_diffusion.m script.

To come up with the comprehensive test suite, you will want to go through all of the key permutations of parameters. The idea is that everytime we make changes to the discretize_univariate_diffusion.m file, we run the regression test to make sure nothing changed.

Beyond just ensuring that nothing changed, you should also make sure that the results match the theory in the continuous_time_methods\docs\optimal_stopping.pdf notes. This is sometimes best done with simple versions (e.g. 5 nodes) where you can verify by hand that things make sense.

Some of the parameter variations to check:

stevenzhangdx commented 7 years ago

Hi Jesse,

Please take a look at the unit test for discretize univariate diffusion. I added some new tests in terms of your requirements. Also, I made a small change to the $\mu$ in negative_drift_uniform_grid_test. Originally, you set $\mu = 0$, it should be a negative number based on my understanding. Please let me know if I am wrong.

jlperla commented 7 years ago

Looking great Do an update from the server: I noticed that the .m~ files (which I assume are OS/X temp files) were on the server. I added them to .gitignore and deleted them, but that shouldn't be a problem anymore.

I am assuming that you went through the results of the tests to ensure that they "make sense" in terms of the generated matrices for some small sized versions (even if you ended up saving the larger one).

Your tests on on the $\sigma^2 = 0$ setup got me thinking. A few small tings:

For the zero_sigma_somewhere_test, I notice that you have multiple absorbing states. I think what we need to do is modify the test to make sure that it is no longer absorbing. The easiest way to do that is to have a drift at the points where sigma = 0. At the corners, you will need to make sure the drift is in the right direction. Can you modify?

stevenzhangdx commented 7 years ago

Drifts terms for zero_sigma_somewhere_test has been modified. Now there should be no more absorbing states.