fit.Archcopula2d {QRMlib}R Documentation

Fit 2D Archimedean Copula

Description

Fits two-dimensional Archimedean copula by maximum likelihood. This function has been deprecated. Use fit.AC() instead.

Usage

fit.Archcopula2d(Udata, name)

Arguments

Udata Matrix of copula data with two columns taking values in unit interval (hence Udata).
name name of Archimedean copula: "clayton", "gumbel"

Details

see pages 234-236 of QRM

Value

list containing parameter estimate, standard error, value of log-likelihood at maximum and convergence flag

See Also

fit.gausscopula, fit.tcopula

Examples

data(ftse100);
data(smi);
TS1 <- window(ftse100, "1990-11-09", "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 <- window(INDEXES, "1994-01-01", "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=TRUE);
#Fit 2-dimensional Archimedian copula: choices are gumbel or clayton
#using pseudo data generated via edf() from observed data:
mod.gumbel <- fit.Archcopula2d(Udata,"gumbel");
mod.clayton <- fit.Archcopula2d(Udata,"clayton");

[Package QRMlib version 1.4.4 Index]