Copula Fitting Using R

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Copula Fitting Using R

cahaya iman
Hi,

Is anybody using Copula package for fitting copulas to own data?
I have two marginals Log Normal with (parameters 1.17 and 0.76) and Gamma (
2.7 and 1.05)

Which package I should use to fit Gumbel and Clayton Copulas?

Thanks,
fayyad

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Copula Fitting Using R

djmuseR
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 <[hidden email]> wrote:

> Hi,
>
> Is anybody using Copula package for fitting copulas to own data?
> I have two marginals Log Normal with (parameters 1.17 and 0.76) and Gamma (
> 2.7 and 1.05)
>
> Which package I should use to fit Gumbel and Clayton Copulas?
>
> Thanks,
> fayyad
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Copula Fitting Using R

MK-3
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:

> 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<[hidden email]>  wrote:
>> Hi,
>>
>> Is anybody using Copula package for fitting copulas to own data?
>> I have two marginals Log Normal with (parameters 1.17 and 0.76) and Gamma (
>> 2.7 and 1.05)
>>
>> Which package I should use to fit Gumbel and Clayton Copulas?
>>
>> Thanks,
>> fayyad
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] 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.
>>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Copula Fitting Using R

Pfaff, Bernhard Dr.
In reply to this post by djmuseR
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: [hidden email] [mailto:[hidden email]] Im Auftrag von Dennis Murphy
Gesendet: Freitag, 25. November 2011 09:10
An: cahaya iman
Cc: [hidden email]
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 <[hidden email]> wrote:

> Hi,
>
> Is anybody using Copula package for fitting copulas to own data?
> I have two marginals Log Normal with (parameters 1.17 and 0.76) and Gamma (
> 2.7 and 1.05)
>
> Which package I should use to fit Gumbel and Clayton Copulas?
>
> Thanks,
> fayyad
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.
>

______________________________________________
[hidden email] 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}}

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Copula Fitting Using R

MK-3
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:

> 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: [hidden email] [mailto:[hidden email]] Im Auftrag von Dennis Murphy
> Gesendet: Freitag, 25. November 2011 09:10
> An: cahaya iman
> Cc: [hidden email]
> 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<[hidden email]>  wrote:
>> Hi,
>>
>> Is anybody using Copula package for fitting copulas to own data?
>> I have two marginals Log Normal with (parameters 1.17 and 0.76) and Gamma (
>> 2.7 and 1.05)
>>
>> Which package I should use to fit Gumbel and Clayton Copulas?
>>
>> Thanks,
>> fayyad
>>
>>         [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> [hidden email] 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.
>>
> ______________________________________________
> [hidden email] 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}}
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: Copula Fitting Using R

Spencer Graves-2
In reply to this post by Pfaff, Bernhard Dr.
Two comments on the ability of the 'sos' package to identify this kind
of thing:


       1.  The object returned by "findFn" can be passed to two other
useful functions (as documented in a vignette, previously published in
the R Journal):


             1.1.  "installPackages", which attempts to install CRAN [or
more precisely getOptions("repos")] packages not already available locally.


             1.2.  "writeFindFn2xls", which attempts to create a *.xls
file, whose first sheet is a summary by package of the results.  This
summary identifies number of matches in each referenced package, date
last updated, and other information to help users select among different
available packages.  If the package is not available locally and not on
CRAN, "installPackages" won't find it, and "writeFindFn2xls" will
provide blanks for the information it tries to obtain from installed
packages.


       2.  It would be nice if the 'findFn' results could also
immediately identify which functions are in packages available locally
and which repositories contain those not locally installed.  However,
this would require modification to the RSiteSearch database, used by
'findFn'.  Anyone willing to upgrade the RSiteSearch database is
encouraged to contact Prof. Jonathan Baron ([hidden email]), who
has repeatedly asked for volunteer(s) to maintain it;  he has many other
commitments, and would like to transfer this to someone else.


       Hope this helps.
       Spencer Graves


p.s.  Thanks to Dennis Murphy for demonstrating the utility of this
package for this purpose and to Prof. Ripley for suggesting a possible
enhancement to 'findFn'.

On 11/25/2011 1:04 AM, Pfaff, Bernhard Dr. 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:[hidden email]  [mailto:[hidden email]] Im Auftrag von Dennis Murphy
> Gesendet: Freitag, 25. November 2011 09:10
> An: cahaya iman
> Cc:[hidden email]
> 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<[hidden email]>  wrote:
>> Hi,
>>
>> Is anybody using Copula package for fitting copulas to own data?
>> I have two marginals Log Normal with (parameters 1.17 and 0.76) and Gamma (
>> 2.7 and 1.05)
>>
>> Which package I should use to fit Gumbel and Clayton Copulas?
>>
>> Thanks,
>> fayyad
>>
>>         [[alternative HTML version deleted]]
>>
>>
>> ______________________________________________
>> [hidden email]  mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>

--
Spencer Graves, PE, PhD
President and Chief Technology Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567
web:  www.structuremonitoring.com



        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.