PDA

View Full Version : MCMC simulation with s+



Doron
09-01-2008, 06:58 AM
Hello,
I need help with S+ code for:
1. Generating random numbers from function called "Frank cupola".
2. Run MCMC simulation in order to estimate the copula parameters.

I have already written the code but sometime the simulation stuck and i don't understand why.

Doron

mp83
09-01-2008, 08:36 AM
Can't help you coz I never studied copulas. But there is an R function to help you in the QRMlib package

> http://rss.acs.unt.edu/Rdoc/library/QRMlib/html/rcopula.frank.html

Doron
09-01-2008, 03:38 PM
Thanks for the link.
But I find this software too difficult for me to handle.
Do you know maybe someone who is familiar with this subject so I can hire to help me finish this project?

mp83
09-01-2008, 04:38 PM
But the code woulld be essentially the same (along the lines, of course)!

If there is something in the MCMC I might be of help, but as far as copulas I think a quant forum would be more appropriate

Doron
09-02-2008, 06:00 AM
If it is not too much trouble, I have attached 3 codes that I wrote, maybe you can take a look at them and see if you can find the probelem with my code.


1. I define a function and generate data from Frank copula with parameters: th1=0.3 , th2=0.8 , alp=2
2. I calculate the hyper parameters.
I assumed that the parameters distribution is Gamma, therefore the hyper parameters distribution is Pareto.
I am using the Moment technique to estimate them.
3. I run MCMC simulation in order to estimate the parameters of the copula.

I have noticed that when ever the value of one of the hyper parameter in negetive, i don't have starting point.
When all the hyper parameters are positive, sometime i get the following note: Problem in .C("S_Var1_NA",: There are 249 missing value(s) in x and/or y passed to cor or var with na.method="fail"

What does this note means?