mise {bde}R Documentation

Mean Integrated Squared Error

Description

Computes the mean integrated squared error (MISE) for two given Bounded density objects.

Usage

mise(model1,model2,discreteApproximation = TRUE)

Arguments

model1

a bounded density object. See getSubclasses("BoundedDensity") to see all the allowed class objects

model2

a bounded density object. See getSubclasses("BoundedDensity") to see all the allowed class objects

discreteApproximation

If TRUE, the mise is calculated using the data stored in the cache. Otherwise the integral is computed.

Examples


# a general approximation to a Beta(1,10) distribution using BoundedDensity objects
cache <- seq(0,1,0.01)
dens  <- dbeta(cache,1,10)
bd    <- boundedDensity(x=cache,densities=dens)

# a BrVitale approximation to the Beta(1,10) distribution using a random data sample to 
# learn the model
dataSample <- rbeta(100,1,10)
kernel     <- hirukawaTSKernel(dataPoints=dataSample, b=0.1, c=0.3, 
                                dataPointsCache=cache, modified=FALSE)

# compute the mise
mise(bd,kernel,discreteApproximation=TRUE)
mise(bd,kernel,discreteApproximation=FALSE)

[Package bde version 1.0.1.1 Index]