Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. begin{algorithm}[H]
  2. caption{LSM Algorithm}label{euclid}
  3. begin{algorithmic}
  4. State Generate $M$ paths of stock prices $S_i(t)$, $i = 1,ldots,M$
  5. State which evolves in discreet time index $j = 1,ldots, N$ (time interval $Delta t = frac{T}{N}$)
  6. For{$i$}
  7. For{$j$}
  8. State Generate $S_{i} = S_{i-1}e^{(r-q-frac{sigma^2}{2})Delta t + sigmasqrt{Delta t}Z_{i,j}}, Z_{i,j}sim N(0,1)$
  9. EndFor
  10. EndFor
  11. textbf{end for}\
  12. textbf{end for}
  13. State Put $P_i gets f(S_{i}(t_N))$ for all $i$
  14. For{$t$ from $t_{N-1}$ to $t_1$}\
  15. Find in the money paths ${i_1,i_2,ldots, i_n}$ such that $f(S_i(t)) > 0$\
  16. Set $ipaths gets {i_1,i_2,ldots, i_n}$\
  17. Set $x_igets S_i(t)$ and $y_igets e^{-rDelta t}P_i$ for $iin ipaths$\
  18. Apply regression on $x,y$ to obtain regression coefficients $hat{beta}_0,ldots, hat{beta}_k$\
  19. Estimate continuation values $hat{C}(S_i(t))$ then calculate the value of immediate exercise $f(S_i(t))$\ for $iin ipaths$
  20. For{$i$}
  21. If{$iin ipaths$ textbf{and} $f(S_i(t)) > hat{C}(S_i(t))$ }
  22. State $P_igets f(S_i(t))$\
  23. textbf{else}\
  24. State $P_igets e^{-rDelta t}P_i$\
  25. EndIf
  26. EndFor
  27. textbf{end if}\
  28. textbf{end for}\
  29. textbf{end for}\
  30. $pricegets frac{1}{M}sum_{i=1}^{M}e^{-rDelta t}P_i$
  31. end{algorithmic}
  32. end{algorithm}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement