# Variance gamma process, simulation and plot differ from ideal

I have simulated one possible path of a variance gamma process by the following code:

vektor<-c(1:23)

S0=20
theta=0.01

v=5
sigma=0.1

vektor[1]<-S0

for (i in 2:23){
randomgamma<-rgamma(1, shape=1/v, scale = v)
randomnormal<-rnorm(1,mean=0,sd=1)
vektor[i]<-vektor[i-1]+theta*randomgamma+sigma*sqrt(randomgamma)*randomnormal
}

plot(c(1:23),vektor)
lines(c(1:23),vektor)


The idea is to be found on page 26 in the following paper: http://www.rhsmith.umd.edu/faculty/mfu/fu_files/Fu07.pdf

Now my problem is, that the plot does not look like a variance gamma process, these should look like this:

So where is my mistake?

In general: Is what I am doing correct? I want to simulate a stock path. The initial value of the stock is 20. Now, I want to simulate different paths. What parameters should I use to get a realistic result?

-
first of all, there are 3 different methods on that page, which are you attempting? – jerad Nov 25 '12 at 22:15
also, what's your plot look like? – jerad Nov 25 '12 at 22:20
I noticed an edit to this post in reply to @jerad's comments (indicating the 1st method was considered). If you lost your account information, please flag your post for moderator attention and we will merge your accounts. – chl Nov 26 '12 at 8:31

I am using the variance gamma as well, and I just plotted it using the same algorithm implemented in R (which is what you use as well I guess). Simply change your 8th line of code as follows:

randomgamma<-rgamma(1, shape=1/v, scale = 1/v)


The issue with your code is the scale parameter. The scale parameter in the algorithm you refer to was meant to be a 'rate parameter' instead of a frequency parameter. However, R only interprets it as a frequency type of parameter. Good luck.

-
Forgot to add that if you make the suggested modification you should choose small values of v(.01 .001 ...) otherwise you wont have many jumps as in the wikipedia pictures. – PATCAT Jun 23 '14 at 6:30
However if you choose to keep your code as is, then take values of v that are much larger 20 or more to increase the jump frequency.Cheers! – PATCAT Jun 23 '14 at 6:32
You should consider embedding your comments directly into your answer. You can edit your answer by clicking "edit" at the bottom of it. Just an idea :) – Patrick Coulombe Jun 23 '14 at 6:41

Your procedure is correct. I just check in Monte Carlo Methods in Financial Engineering. In this book they use theta = 0; sigma = 0.4 and v = 1 and 0.5 (subordinator). With v = 1, you will get more peaked curve (fatter tails). As you reduce v, your pdf will looks like Normal.

To get the plot in Matlab.

S = price vector
plot(S,'.');


You will get disjoint points (not line). If you find a better way to plot, please let me know.

Once you get the price vector, plot the PDF: S is a vector

 >mu = mean(S);
> sigma = std(S);
> x=linspace(mu-4*sigma, mu+4*sigma);
> plot(x,normpdf(x,mu,sigma))

-