Fit a Gaussian Copula model.

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

# 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")