gcop: The Gaussian Copula distribution.

Description Usage Arguments Details Value See Also Examples

Description

The Gaussian Copula distribution.

Usage

1
2
3
dgcop(X, gCop, log = FALSE, decomp = FALSE)

rgcop(n, gCop)

Arguments

X

n x p values at which to evaluate the p-dimensional density.

gCop

An object of class gaussCop specifying the Gaussian Copula model.

log

Logical; whether or not to evaluate the density on the log scale.

decomp

Logical; if TRUE returns the normalized residuals Z, their log-density zlpdf, and the log-jacobian zljac, such that the total log-density is xldens = zldens + zljac. See Details.

n

Number of random samples to draw.

Details

The density of Gaussian Copula distribution is

g(x) = ψ(z | R) ∏_{i=1}^d f_i(x_i)/φ(z_i),

z_i = Φ^(-1)(F_i(x_i)),

where ψ(z | R) is the PDF of a multivariate normal with mean 0 and variance R, f_i(x_i) and F_i(x_i) are the marginal PDF and CDF of variable i, and φ(z) and Φ(z) are the PDF and CDF of a standard normal.

Value

dgcop provides the density of gCop, rgcop generates random values from gCop.

See Also

gcopFit for constructing gaussCop objects and fitting the Gaussian Copula model to observed data.

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
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.