stan-dev / rstanarm

rstanarm R package for Bayesian applied regression modeling
https://mc-stan.org/rstanarm
GNU General Public License v3.0
388 stars 133 forks source link

loo with non-default k_threshold parameter produces error #197

Closed awcm0n closed 6 years ago

awcm0n commented 7 years ago

Summary:

Error message when running loo with non-default k_threshold parameter may indicate a bug.

Description:

Running loo with the default k_threshold parameter caused no problems, but setting k_threshold to 0.7 produced an error.

model_loo <- loo(model, k_threshold = 0.7) 1 problematic observation(s) found. Model will be refit 1 times.

Fitting model 1 out of 1 (leaving out observation 33) Error: variable 'x' was fitted with type "nmatrix.1" but type "numeric" was supplied

RStanARM Version:

2.15.3

R Version:

3.3.3 (2017-03-06)

Operating System:

Windows 10 Version 10.0.15063 Build 15063

bgoodri commented 7 years ago

What was the original model?

On Jul 4, 2017 12:53 AM, "awcm0n" notifications@github.com wrote:

Summary:

Error message when running loo with non-default k_threshold parameter may indicate a bug. Description:

Running loo with the default k_threshold parameter caused no problems, but setting k_threshold to 0.7 produced an error.

model_loo <- loo(model, k_threshold = 0.7) 1 problematic observation(s) found. Model will be refit 1 times.

Fitting model 1 out of 1 (leaving out observation 33) Error: variable 'x' was fitted with type "nmatrix.1" but type "numeric" was supplied RStanARM Version:

2.15.3 R Version:

3.3.3 (2017-03-06) Operating System:

Windows 10 Version 10.0.15063 Build 15063

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstanarm/issues/197, or mute the thread https://github.com/notifications/unsubscribe-auth/ADOrqnzQW68Yfb6JxcDzZ9oVGBW82Ksfks5sKXDqgaJpZM4OMvWM .

jgabry commented 7 years ago

Yeah it's hard to debug this without more info on the original model and data, but I think it has to do with how the original data was constructed. Is it possible it's the same thing as reported here:

https://stackoverflow.com/questions/22337495/how-to-solve-predict-lm-error-variable-affinity-was-fitted-with-type-nmatr