kaushikrch / rucm

Implementation of Unobserved Components Models (UCM) in R
3 stars 3 forks source link

Modifying Standard Error calculations in ucm function #4

Open RajarshiBhadra opened 8 years ago

RajarshiBhadra commented 8 years ago

The standard error calculations are getting affecting due to the presence of NA s in the ucm function.

The current code for standard error calculation is se <- sapply(find.indep.var, function(x) mean(sqrt(out$V[x, x, ])))

It has to be modified to se <- sapply(find.indep.var, function(x) mean(sqrt(out$V[x, x, ]), na.rm=T))

So that NAs are ignored. This takes care of the situations where estimates are available but standard errors are NA in the current code