gcopFit: Fit a Gaussian Copula model.

Description Usage Arguments Value Examples

View source: R/gcopFit.R

Description

Fit a Gaussian Copula model.

Usage

1
gcopFit(X, Rho, fitXD = c("kernel", "gc4"), ...)

Arguments

X

Either an N x p data matrix or a p-length list of XDens objects.

Rho

p x p correlation matrix (i.e., 1's on the diagonal). Optional if X is a matrix.

fitXD

String specifying method to fit marginals (see xDensity).

...

Additional arguments to pass to the methods of fitXD (see xDensity).

Value

An object of class gaussCop, i.e., a list with elements:

XDens

A list of xDensity objects specifying each marginal distribution (see xDensity).

Rho

The correlation matrix between the normalized quantiles.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# simulate data and plot it
n = 5e4
dat = cbind(rnorm(n, mean = 1, sd = 3),
            rnorm(n, mean=4, sd = 0.5))
plot(dat, cex=0.5)
# fit Gaussian Copula using Kernel method
temp.cop = gcopFit(X = dat, fitXD = "kernel")
# simulate data from Copula model and add it to plot, should blend in
new.data = rgcop(100, temp.cop)
points(new.data, cex = 0.5, col="red")

mlysy/GaussCop documentation built on Nov. 6, 2019, 6:19 p.m.