The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

rlcv

The goal of rlcv is to provide a robust likelihood cross validation bandwidth selector for kernel density estimation. It allows for both uni-variate and multi-variate densities. It is resistant against fat-tailed distributions and outliers.

Installation

You can install the development version of rlcv like so:

install.packages('rlcv')

Example

This is a basic example which shows you how to use rlcv to fit a fat-tailed bivariate distribution:

library(rlcv)
## basic example code
# fat-tailed marginals + fat-tailed copula
library(copula)
ncop=tCopula(.5,df=5)
n=500
u=rCopula(n,ncop)
x1=qt(u[,1],5)
x2=qt(u[,2],5)
x=cbind(x1,x2)
fit=rlcv_d(x.obs=x)
# evaluation data
x1=x2=seq(-5,5,length=50)
x11=rep(x1,each=50)
x22=rep(x2,50)
fhat=kde_d(x.new=cbind(x11,x22),x.obs=x,,h=fit$h)
f0=dCopula(cbind(pt(x11,5),pt(x22,5)),ncop)*dt(x11,5)*dt(x22,5)
# Mean squared errors
mean((f0-fhat)^2)
#> [1] 2.131485e-05

persp(x1,x2,matrix(fhat,50,50))

contour(x1,x2,matrix(fhat,50,50))
contour(x1,x2,matrix(f0,50,50),add=TRUE,col='red')

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.