[R-SIG-Finance] fit.gausscopula function

Xiaochen Sun Xiaochen.Sun at brunel.ac.uk
Tue Aug 21 11:14:44 CEST 2007


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



More information about the R-SIG-Finance mailing list