LAPACKException for missing/NaN values
Closed this issue · 3 comments
I was experimenting with missing values when I ran into LAPACKExceptions for some models (namely LocalLinearTrend
and DAR
, which are the ones I tested).
They seem to arise from the hessian being all NaN in the pinv
call caused by the initial_hyperparameters!
method missing the [findall(!isnan, model.system.y)]
part. This is at least my guess for LocalLinearTrend
.
MWE to reproduce:
using StateSpaceModels
input = LinRange(1, 100, 100) + rand(100)
input[10] = NaN
model = LocalLinearTrend(input)
# model = DAR(input, 10)
# model = LocalLevel(input) # works fine
fit!(model; optimizer = Optimizer(StateSpaceModels.Optim.NelderMead()))
Indeed! I am preparing a quick patch to solve the issue across models. Thank you for pointing it out
The case for DAR is a little different, since we need to lag the observations vector in the system matrices there are NaNs inside the system matrices. For now I am putting an error message stating that DAR does not accept missing values
Solved in #300