CopulaGauss: Gauss Copula

Description Usage Arguments Value See Also Examples

Description

Functions for evaluating the Gauss copula, generating random variates and fitting.

Usage

1
2
3
dcopula.gauss(Udata, Sigma, log = FALSE)
rcopula.gauss(n, Sigma)
fit.gausscopula(Udata, ...)

Arguments

log

logical, whether log density values should be returned.

n

integer, count of random variates

Sigma

matrix, correlation matrix.

Udata

matrix, pseudo-uniform data where rows are vector observations with all values in unit interval.

...

ellipsis argument, passed down to nlminb() used in optimization.

Value

For dcopula.gauss() a vector of density values of length n. For rcopula.gauss() a n \times d matrix of random variates and for fit.gausscopula() a list with the optimization results.

See Also

nlminb

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
ll <- c(0.01,0.99)
BiDensPlot(func = dcopula.gauss, xpts = ll, ypts = ll,
           Sigma = equicorr(2, 0.5))
data <- rcopula.gauss(2000, Sigma = equicorr(d = 6, rho = 0.7)) 
pairs(data)
## Fitting Gauss Copula
data(smi)
data(ftse100)
s1 <- window(ftse100, "1990-11-09", "2004-03-25")
s1a <- alignDailySeries(s1)
s2a <- alignDailySeries(smi)
idx <- merge(s1a, s2a)
r <-returns(idx)
rp <- series(window(r, "1994-01-01", "2003-12-31"))
rp <- rp[(rp[, 1] != 0) & (rp[, 2] !=0), ]
Udata <- apply(rp, 2, edf, adjust = 1)
copgauss <- fit.gausscopula(Udata) 

Example output

Loading required package: gsl
Loading required package: Matrix
Loading required package: mvtnorm
Loading required package: numDeriv
Loading required package: timeSeries
Loading required package: timeDate

Attaching package: 'QRM'

The following object is masked from 'package:base':

    lbeta

QRM documentation built on April 14, 2020, 6:49 p.m.