Estimate copula densities using tensor-product cubic splines.
sscopu(x, symmetry=FALSE, alpha=1.4, order=NULL, exclude=NULL,
weights=NULL, id.basis=NULL, nbasis=NULL, seed=NULL,
qdsz.depth=NULL, prec=1e-7, maxiter=30, skip.iter=dim(x)[2]!=2)sscopu2(x, censoring=NULL, truncation=NULL, symmetry=FALSE, alpha=1.4,
weights=NULL, id.basis=NULL, nbasis=NULL, seed=NULL, prec=1e-7,
maxiter=30)
sscopu
and sscopu2
return a list object of class
"sscopu"
. dsscopu
can be used to evaluate the
estimated copula density. A "copularization" process is applied to
the estimated density by default so the resulting marginal densities
are guaranteed to be uniform.
cdsscopu
, cpsscopu
, and
cqsscopu
can be used to evaluate 1-D conditional pdf,
cdf, and quantiles.
Matrix of observations on unit cubes.
Flag indicating whether to enforce symmetry, or invariance under coordinate permutation.
Highest order of interaction terms in log density.
When NULL
, it is set to dim(x)[2]
internally.
Pair(s) of marginals whose interactions to be excluded in log density.
Parameter defining cross-validation score for smoothing parameter selection.
Optional vector of bin-counts for histogram data.
Index of observations to be used as "knots."
Number of "knots" to be used. Ignored when
id.basis
is specified.
Seed to be used for the random generation of "knots."
Ignored when id.basis
is specified.
Depth to be used in smolyak.quad
for
the generation of quadrature.
Precision requirement for internal iterations.
Maximum number of iterations allowed for internal iterations.
Flag indicating whether to use initial values of
theta and skip theta iteration. See ssanova
for
notes on skipping theta iteration.
Optional censoring indicator.
Optional truncation points.
Chong Gu, chong@stat.purdue.edu
sscopu
is essentially ssden
applied to
observations on unit cubes. Instead of variables in data frames,
the data are entered as a numerical matrix, and model complexity is
globally controlled by the highest order of interactions allowed in log density.
sscopu2
further restricts the domain to the unit square, but
allows for possible censoring and truncation. With
censoring==0,1,2,3
, a data point \((x1,x2)\) represents
exact observation, \([0,x1]x{x2}\), \({x1}x[0,x2]\), or
\([0,x1]x[0,x2]\). With truncation
point \((t1,t2)\),
the sample is taken from \([0,t1]x[0,t2]\) instead of the unit
square.
With symmetriy=TRUE
, one may enforce the interchangeability
of coordinates so that \(f(x1,x2)=f(x2,x1)\), say.
When (1,2)
is a row in exclude
, interaction terms
involving coordinates 1
and 2
are excluded.
Gu, C. (2013), Smoothing Spline ANOVA Models (2nd Ed). New York: Springer-Verlag.
Gu, C. (2015), Hazard estimation with bivariate survival data and copula density estimation. Journal of Computational and Graphical Statistics, 24, 1053-1073.
## simulate 2-D data
x <- matrix(runif(200),100,2)
## fit copula density
fit <- sscopu(x)
## "same fit"
fit2 <- sscopu2(x,id=fit$id)
## symmetric fit
fit.s <- sscopu(x,sym=TRUE,id=fit$id)
if (FALSE) {
## Kendall's tau and Spearman's rho
summary(fit); summary(fit2); summary(fit.s)
## clean up
rm(x,fit,fit2,fit.s)
}
Run the code above in your browser using DataLab