Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LAPACKException for missing/NaN values #299

Closed
mapi1 opened this issue Dec 1, 2021 · 3 comments
Closed

LAPACKException for missing/NaN values #299

mapi1 opened this issue Dec 1, 2021 · 3 comments

Comments

@mapi1
Copy link

mapi1 commented Dec 1, 2021

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()))
@guilhermebodin
Copy link
Member

Indeed! I am preparing a quick patch to solve the issue across models. Thank you for pointing it out

@guilhermebodin
Copy link
Member

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

@guilhermebodin
Copy link
Member

Solved in #300

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants