Message-ID: <006101c7e3df$8840aaa0$98c1ffe0$@com>
Date: 2007-08-21T10:39:19Z
From: Sylvain BARTHELEMY
Subject: fit.gausscopula function
In-Reply-To: <E386E504246A9249A9176B5BEEC13B6F0E499F@UXEXMBU116.academic.windsor>
Dear Xiaochen,
I think that there are conflicting versions of packages on your machine, as
the R code you provide works well on two of my machines, with R 2.5 and
QRMlib v2.5.1.
You should update all your R packages by using the "update packages" menu.
Regards.
---
Sylvain Barth?l?my
Research Director, TAC
www.tac-financial.com | www.sylbarth.com
-----Message d'origine-----
De?: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch] De la part de Xiaochen Sun
Envoy??: mardi 21 ao?t 2007 11:15
??: r-sig-finance at stat.math.ethz.ch
Objet?: [R-SIG-Finance] fit.gausscopula function
I do not know why, fit.gausscopula( ) function in QRMlib doesn't work.....
If you run the example code in help file, Here is the message I've got:
> data(ftse100);
> data(smi);
> TS1 <- cut(ftse100, "1990-11-08", "2004-03-25");
> TS1Augment <- alignDailySeries(TS1, method="before");
> TS2Augment <- alignDailySeries(smi, method="before");
> INDEXES.RAW <- merge(TS1Augment,TS2Augment);
> #Cleanup:
> rm(TS1, TS1Augment, TS2Augment);
> INDEXES <- mk.returns(INDEXES.RAW);
> PARTIALINDEXES <- cut(INDEXES, "1993-12-31", "2003-12-31");
> #Now create a data matrix from the just-created timeSeries
> data <- seriesData(PARTIALINDEXES);
> #Keep only the data items which are non-zero for both smi and ftse100
> data <- data[data[,1]!=0 & data[,2] !=0,];
> # Construct pseudo copula data. The 2nd parameter is MARGIN=2
> #when applying to columns and 1 applied to rows. Hence this says to
> #apply the 'edf()' empirical distribtion function() to the columns
> #of the data.
> Udata <- apply(data,2,edf,adjust=1);
> mod.gauss <- fit.gausscopula(Udata);
Error in dmnorm(Qdata, rep(0, d), P, logvalue = TRUE) :
unused argument(s) (logvalue = TRUE)
However it did work once:
X3X2 <- cbind(x3,x2)
U3U2 <- apply(X3X2,2,edf,adjust=1)
mod.gaussU3U2 <- fit.gausscopula(U3U2)
mod.gaussU3U2
> mod.gaussU3U2[1]
$P
[,1] [,2]
[1,] 1.0000000 0.2770152
[2,] 0.2770152 1.0000000
I can not figure out:((((
Could anyone tell me why?
Cheers
Mc
_______________________________________________
R-SIG-Finance at stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only.
-- If you want to post, subscribe first.