jlperla / continuous_time_methods

MIT License
23 stars 15 forks source link

Fix tests and examples to use the new discretize_univariate_diffusion #22

Closed jlperla closed 7 years ago

jlperla commented 7 years ago

After your modification and tests in discretize_univariate_diffusion_test.m some of the other files are broken because of the change to multiplying $A$ by $\Delta$.

Can you fix this by modifying the following functions:

The modifications will be pretty simple. In particular, mostly multiplying by $\Delta$ where currently there is an $A$ to follow the notation and equation numbers in operator_discretization_finite_differences.pdf and optimal_stopping.pdf

You will know you are successful when you can run all of the tests in the matlab folder (i.e. run_tests.m) with no errors. Also, the /matlab/examples/optimal_stopping/LCP_example.m will require running manually.

stevenzhangdx commented 7 years ago

I have fixed most errors. But there is still one that comes from HJBE_discretized_univariate_test/bigger_value_function_test. I saved the new csv file generated by this test and compared it with the old one. I noticed that some entries between two files have a difference about 1e^-10, and the aggregate difference over 10000 entries is 4.8654e^-6. I guess the error is caused by different ways we used to do the division. Do you think this difference is acceptable?

jlperla commented 7 years ago

Totally acceptable. Feel free to update the test csv files if that is the only problem, and close the ticket if the test suite runs

stevenzhangdx commented 7 years ago

Now all tests can be successfully completed.