The mean integrated square error of a density estimate $\hat p$ of a true density $p$ is $$\begin{equation} \begin{aligned} \text{MISE}(\hat{p}) &\equiv \mathbb{E} \Big[ \int (\hat{p}(x,\mathbf{X}) - p(x))^2 dx \Big] \\[6pt] &= \int \Big( \int (\hat{p}(x,\mathbf{x}) - p(x))^2 dx \Big) f(\mathbf{x}) d\mathbf{x} \\[6pt] &= \int \int (\hat{p}(x,\mathbf{x}) - p(x))^2 f(\mathbf{x}) dx d\mathbf{x}. \\[6pt] \end{aligned} \end{equation}$$

I wanted to compute this so I looked up some source code and found the following code in the deamer package for R:

#calculation of the MISE
mise = function(density, obj){
 supp <- obj$supp
 est <- obj$f
 } else { stop("argument 'obj' must be of class 'deamer'")} 

     dens <- density(supp)
     } else {
     stop("argument 'density' should be a function (see ?mise)")

mise <- ((max(supp)-min(supp))/length(supp))*sum((dens-est)^2)

This does not look correct to me. It seems they are just calculating the ISE $\int (\hat{p}(x,\mathbf{x}) - p(x))^2 dx$ and not the MISE since I don't see how they are computing the expectation?

So have I misinterpreted something, how can the above code produce the MISE when it doesn't perform an integration with respect to the sample?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.