Aug 24

## PSOR for American option

Posted by abiao at 15:11 | Code » C++ | Comments(16) | Reads(24190)
We often have to price the American Option with Linear Complementarity Formulation when using finite difference method. One of methods for solving linear complementarity problem is Projected Successive Over Relaxation (PSOR), which is iterative and tries to solve the following formulation:
x'(Ax - b) = 0
x >= 0
Ax - b >= 0
using the projected SOR algorithm. Here is a sample Matlab code showing the basic algorithem of PSOR,
function [x] = psor(A,b,x0)
omega = 1.5;
tol = 1e-9;
jmax = 1e+3;

n = length(b); x = x0; j = 1;
for i = 1:n
x(i) = max(0,x(i)+omega*(b(i)-A(i,:)*x)/A(i,i));
end

while (norm(x-x0) > tol) && (j < jmax)
j = j + 1; x0 = x;
for i = 1:n
x(i) = max(0,x(i)+omega*(b(i)-A(i,:)*x)/A(i,i));
end
end
return

A problem with this sample code is slow computation speed, Should you are happy with C++, the following C++ code which can be called directly in Matlab.

wiki(Linear complementarity problem)

Tags: , ,
So stimulating to find out so much superior content. I like the design too. Very good job!
my singing monsters hack
meal preparation tips
Very helpful post, this is often my initial time visit here. It helps me very much to solve some problems. I really like and recognize your website post. Thanks for this post.
conduct workplace inspections
It really makes me happy and I am satisfied with the arrangement of your post.  I wanted concerning this subject and did not know who to ask. Thanks for such a great post and the review, I am totally impressed! Keep stuff like this coming.
ransomware decrypt
Nice blog post on this topic. It’s a great pleasure reading your post. I'd really like to help appreciate it with the efforts you get with writing this post.
what is cord blood banking
I always appreciate quality content. You actually understand how to bring a concern to light making it essential. I feel nice to be here reading your authentic work.what is cord blood banking
perth county landscaping
Thanks for sharing,
야마토게임
Thank you for helping people get the information. Your work is very good and I appreciate this issue. It’s a great pleasure reading your post. I'd really like to help appreciate it with the efforts you get with writing this post.
Custom tshirts las vegas
Thanks for sharing,
릴게임팡팡
You have done a great job on this article. Your work is very good and I appreciate this issue. Its a great pleasure reading your post. I'd really like to help appreciate it with the efforts you get with writing this post. You have some real writing talent. Thank you.
wedding video
The article is really the best point on this registry related issue. There is obviously a multiple to understand about this.  I really savored the experience of exploring your site.  Thanks for sharing this information.
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog post.  Its a great pleasure reading your post. I'd really like to help appreciate it with the efforts you get with writing this post. Thanks for sharing.
quickbooks support
You have done a great job on this article. You have even managed to make it understandable and easy to read. Thank you for posting such a great article.
Bespoke Excel
Very useful post. Its a great pleasure reading your post. I am wondering how I could be notified whenever a new post has been made. Thank you for posting such a great article.
sell car today for cash Austin
Excellent article. Very interesting to read. Your own posts are aiding me in uncovering some needed specifics. Make sure you continue your writing.
hoteles en cali
You have done a great job on this article. It helps me very much to solve some problems. I think you made some good points in Features also. Thank you for posting such a great article.
Pages: 1/2 1 2
 Add a comment Emots Enable HTML Enable UBB Enable Emots Hidden Remember Nickname   Password   Optional Site URI   Email   [Register]