Learn R Programming

subrank (version 0.9.9.3)

estimdep: Dependence estimation

Description

From a set of observations, builds a description of the multivariate distribution

Usage

estimdep(dataframe,varnames,subsampsize,nbsafe=5,mixties=FALSE,nthreads=2)

Value

the description of the dependence, it is an object with the following parts:

cop

the array representing the discretized copula

margins

the matrix representing the margins, estimated using kernel density estimation

varnames

the names of the variables

Arguments

dataframe

a data frame containing the observations

varnames

the name of the variables we want to estimate the multivariate distribution

subsampsize

the sub-sample size

nbsafe

the ratio between the discretized copula size and the number of sub-samples

mixties

if TRUE, put equal weight on tied values, using random permutations

nthreads

number of number of threads, assumed to be strictly positive. For "full throttle" computations, consider using parallel::detectCores()

Author

Jerome Collet

Examples

Run this code
lon=3000
plon=3000
subsampsize=20

##############
x=(runif(lon)-1/2)*3
y=x^2+rnorm(lon)
z=rnorm(lon)
donori=as.data.frame(cbind(x,y,z))
depori=estimdep(donori,c("x","y","z"),subsampsize)

knownvalues=data.frame(z=rnorm(plon))
prev <- predictdep(knownvalues,depori)
plot(prev$x,prev$y,xlim=c(-2,2),ylim=c(-2,5),pch=20,cex=0.5)
points(donori[,1:2],col='red',pch=20,cex=.5)

knownvalues=data.frame(x=(runif(lon)-1/2)*3)
prev <- predictdep(knownvalues,depori)
plot(prev$x,prev$y,xlim=c(-2,2),ylim=c(-2,5),pch=20,cex=0.5)
points(donori[,1:2],col='red',pch=20,cex=.5)

knownvalues=data.frame(y=runif(plon,min=-2,max=4))
prev <- predictdep(knownvalues,depori)
plot(prev$x,prev$y,xlim=c(-2,2),ylim=c(-2,5),pch=20,cex=0.5)
points(donori[,1:2],col='red',pch=20,cex=.5)

Run the code above in your browser using DataLab