Posted by
animesh on
Jul 27, 2010; 1:04pm
URL: http://quantlib.414.s1.nabble.com/Variance-Gamma-implementation-in-Quantlib-tp7471p7473.html
It's simple to implement Gamma process, and VG Process can be easily
written as difference of two independent gamma processes.
http://en.wikipedia.org/wiki/Variance_gamma_process
I have used Gamma process with notation Mu or Nu, Theta , and Sigma.
The formulas are in CGM Notation (Carr Madan...)
If anyone is interested in Matlab....following code works.
rand(’state’,sum(100*clock));
randn(’state’,sum(100*clock));
Snul=100; T=1; r=0.04;
q=0.03; n=250; nu=0.10; sigma=0.2;
theta= -0.15 omega=log(1-sigma^2*nu/2-theta*nu)/nu;
C=1/nu;
G=(sqrt(theta^2*nu^2/4+sigma^2*nu/2)-theta*nu/2)^(-1);
M=(sqrt(theta^2*nu^2/4+sigma^2*nu/2)+theta*nu/2)^(-1);
dt=T/n;
tt=[0:dt:T];
S(1)=Snul;
vg(1)=0;
for s = 1:n
g1= gamrnd(dt*C,1/M);
g2= gamrnd(dt*C,1/G);
vg(s+1) = vg(s) + g1-g2;
S(s+1) = Snul*exp((r-q+omega)*tt(s+1)+vg(s+1));
end;
On 7/27/10 6:13 PM, james hirschorn wrote:
There is some implementation of Variance Gamma in
"ql/experimental/variancegamma". I haven't had a chance to try
it myself yet.
James
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
--
Regards,
Animesh Saxena
(http://quantanalysis.wordpress.com)
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users