mBCV {KDEmcmc}R Documentation

Calculate Optimal Bandwidth in Kernel Density Estimation

Description

Calculate the optimal bandwidth for the kernel density estimator with a Markov chain Monte Carlo sample using modified biased cross-validation method.

Usage

mBCV(Y_in)

## S3 method for class 'mBCV_obj'
print(x, ...)

Arguments

Y_in

data from which the estimate is to be computed.

x

object of class mBCV_obj; result of a call to mBCV().

...

further arguments passed to or from other methods.

Value

mBCV returns a list of the following conmponents:

bw

optimal bandwidth.

IACT

intergrated autocorrelation time.

Y_in

input data.

Examples

res = mBCV(simMCMC)
den = density(res$Y_in, bw=res$bw)
hist(res$Y_in, xlim=range(den$x), freq=FALSE, 
      main="Histogram and Density Estimates", xlab="")
lines(den$x, den$y, col='blue', lwd=2)

[Package KDEmcmc version 0.0.1 Index]