Skip to content

Copula Fitting Using R

6 messages · cahaya iman, Dennis Murphy, Pfaff, Bernhard Dr. +2 more

#
Hi:

This is the type of question for which the sos package can come to the rescue:

library('sos')
findFn('Gumbel Clayton copula')

It appears that the QRMlib package would be a reasonable place to start.

Dennis
On Thu, Nov 24, 2011 at 7:29 PM, cahaya iman <qaisfayyad at gmail.com> wrote:
#
library(copula) could be helpful as well.

## Toy example for gumbel copula with log-normal distribution
## (Taken from the documentation of copula::fitMvdc)

## Specify the copula
gumbel.cop <- gumbelCopula(3, dim=2)
myMvd <- mvdc(gumbel.cop, c("lnorm","lnorm"), list(list(meanlog = 1.17),
                                                                                              list(meanlog = 0.76)))
## Generate some random sample to test
x <- rmvdc(myMvd, 1000)

## Fit the random sample
fit <- fitMvdc(x, myMvd, c(1,1,2))
fit

##  Jun Yan (2007). Enjoy the Joy of Copulas: With a Package copula.
## Journal of Statistical Software, 21(4), 1-21. URL
##  http://www.jstatsoft.org/v21/i04/.

##  Ivan Kojadinovic, Jun Yan (2010). Modeling Multivariate Distributions
##  with Continuous Margins Using the copula R Package. Journal of
##  Statistical Software, 34(9), 1-20. URL
##  http://www.jstatsoft.org/v34/i09/.

Cheers,
On 25/11/2011 9:09 a.m., Dennis Murphy wrote:
#
Hello Denis & Fayyad,

in principal the advice given is appropriate, but QRMlib has been removed from CRAN lately, due to a glitch with its dependencies and the current version of R. Hence, to get the package installed and does not want to wait until it shows up on CRAN, one should to the following in the intermediate time:

1) Grab an old release of QRMlib from the CRAN archive.
2) Obtain the packages fSeries and fCalendar from R-Forge
3) Install 2) and 1) in that order.

Best,
Bernhard

ps: The package maintainer of QRMlib is aware of the problem and hopefully, the package QRMlib is fixed quite soon.  

-----Urspr?ngliche Nachricht-----
Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von Dennis Murphy
Gesendet: Freitag, 25. November 2011 09:10
An: cahaya iman
Cc: r-help at r-project.org
Betreff: Re: [R] Copula Fitting Using R

Hi:

This is the type of question for which the sos package can come to the rescue:

library('sos')
findFn('Gumbel Clayton copula')

It appears that the QRMlib package would be a reasonable place to start.

Dennis
On Thu, Nov 24, 2011 at 7:29 PM, cahaya iman <qaisfayyad at gmail.com> wrote:
______________________________________________
R-help at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
*****************************************************************
Confidentiality Note: The information contained in this ...{{dropped:10}}
#
I don't know why my last email didn't go through properly, but library 
copula is still active.

Here is a toy example with reference.

## Toy example for gumbel copula with log-normal distribution
## (Taken from the documentation of copula::fitMvdc)

## Specify the copula
gumbel.cop <- gumbelCopula(3, dim=2)
myMvd <- mvdc(gumbel.cop, c("lnorm","lnorm"), list(list(meanlog = 1.17),
                                      
                                                   list(meanlog = 0.76)))
## Generate some random sample to test
x <- rmvdc(myMvd, 1000)

## Fit the random sample
fit <- fitMvdc(x, myMvd, c(1,1,2))
fit

##  Jun Yan (2007). Enjoy the Joy of Copulas: With a Package copula.
## Journal of Statistical Software, 21(4), 1-21. URL
##  http://www.jstatsoft.org/v21/i04/.

##  Ivan Kojadinovic, Jun Yan (2010). Modeling Multivariate Distributions
##  with Continuous Margins Using the copula R Package. Journal of
##  Statistical Software, 34(9), 1-20. URL
##  http://www.jstatsoft.org/v34/i09/.

Cheers,
On 25/11/2011 10:04 a.m., Pfaff, Bernhard Dr. wrote: