I would like to be able to use the empirical (non-parametric) density of a set of forecast draws to compute a predictive score. The problem I am having is with getting NAs associated with outlier observations of the last few years. This is the result of the following block of code. I set the first grid point equal to the actual observation, to get the density evaluated at that value. It works fine for most observations, except for some outliers during the crisis. If anyone has suggestions on how to do this better and avoid getting missing values, I would really appreciate it.
Code: Select all
stats(noprint,fractiles) oneforecast 1 availdraws
comp span2 = %fract99 - %fract01
set grid2 2 npts2 = %fract01 + (t-2)*span2/(npts2-2.)
comp grid2(1) = actuals(i)(stpt+j-1)
density(grid=input) oneforecast 1 availdraws grid2 estdens2
comp predlike(i,j) = log(estdens2(1))