Mean Integrated Squared Error

Share:

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.