jlperla / continuous_time_methods

MIT License
23 stars 15 forks source link

Complete annotated version of the option_simple_LCP #5

Closed jlperla closed 7 years ago

jlperla commented 7 years ago

Finish the annotation of: examples/continous_time_methods/optimal_stopping/option_simple_LCP.m

You will see a bunch of TODOs in the file. A few of them:

sig_bar = 0.01; sig = x.*sig_bar; sig2 = sig.^2;


Are we right to think that this says the drift is -0.01 and the variance squared is (0.01 *x)^2 ?  Why no x on the drift?
- [x]  Better explain the X, Y, and Z matrices for doing the upwind scheme in equations and math.  I would like to map this into the notation of http://www.princeton.edu/~moll/HACTproject/HACT_Numerical_Appendix.pdf pages 15 and 16.  In fact, those x, y, and z might be EXACTLY those with a map between s and mu  If so, put in comments to explain these (and the s_F and s_B, mappings) in comments.  Alternatively, perhaps the 2nd order terms are better done 
- [x] From these, explain the construction of the A matrix using spdiag better using comments, etc. Perhaps mapping to the http://www.princeton.edu/~moll/HACTproject/HACT_Numerical_Appendix.pdf setup...  All of these mappings should go in the [optimal stopping notes](../blob/master/continous_time_methods/optimal_stopping/optimal_stopping_notes.tex)
- [x] Better explain how the right hand boundary value is constructed with the `A(N_x,N_x)= Y(N_x) + sigma_2(N_x)/(2*dx_2); A(N_x,N_x-1) = X(N_x);` variation in the code.
- [x] For the left hand boundary value: verify in your mind that it really is v(0) = 0??? and see if this is enough, or if it should be adjusted for v(x_min) = B for some $B < S(x_min)$.  Alternatively, the stopping may simply never bind but the dependence on the $v(0) = 0$ would be unclear.
jlperla commented 7 years ago

Alternatively, look at http://www.princeton.edu/~moll/HACTproject/HACT_Additional_Codes.pdf equation (7) etc, but add in the 2nd order term.

stevenzhangdx commented 7 years ago

I re-considered the boundary value problem we discussed last Friday, and I notice that this scheme just requires the continuity at both end points (V(x_min - epsilon) = x_min and V(x_max + epsilon) =x_max). Then the second derivative can be simplified to the one they used.

jlperla commented 7 years ago

Sounds good. Lets discuss when you have this written up in equations (i.e. modifying optimal_stopping_notes.tex).

Also, the latest commits you pushed broke the simple_optimal_stopping_diffusion.m calculations. Can you commit whatever version you have that compile (so I can play with a few things)? In general, best to commit only working versions (i.e., ones that run the run_examples.m and run_matlab_tests.m without compilation errors.

stevenzhangdx commented 7 years ago

I think I have completed this issue. I just committed changes I have made to matlab code and latex notes. Please take a look at it. I will be available from 2 - 4pm if you want to discuss about it.

jlperla commented 7 years ago

Looks great. I am going to take a look and make a few changes and reorganizations, so leave the code alone for now. I will close this and post up other tasks or comments as required.