...
lognormal_log(y- psi,mu,sigma)
...
P_dist[1] ~ beta(0.1,0.9);
for (i in 1:N_obs){ real distrib[2]; distrib[1] <- log(P_dist[1])+ uniform_log(rt[i],range_rt[1],range_rt[2]); distrib[2] <- log(P_dist[2])+ shifted_lognormal_log(rt[i],mu[i], sigma,psi[i]); increment_log_prob(log_sum_exp(distrib)); }> compare(loo_sl,loo_sl_mixt)
elpd_diff se weight1 weight2
-6.6 8.2 1.0 0.0
> compare(waic_sl,waic_sl_mixt)
elpd_diff se weight1 weight2
2.5 7.0 0.1 0.9 From Vehtari et al 2015, I understand that "for influential observations WAIC underestimates the effect of leaving out one observation". And that LOO "relies on inference from a smaller subset of the data being close to inference from the full dataset". So my objective is to figure out if this uniform distribution is good enough to capture the outliers, or if I must try something else. How can I check which of the compare results is telling me what I want to know?
You can also plot the khats using the plot.loo method.
Jonah
> loo_slComputed from 3000 by 3782 log-likelihood matrix
Estimate SEelpd_loo -24016.6 83.9p_loo 213.5 9.6looic 48033.3 167.9Warning messages:1: 42 (1.1%) Pareto k estimates between 0.5 and 1 2: 2 (0.1%) Pareto k estimates greater than 1 3: See PSIS-LOO description (?'loo-package') for more information
> loo_slwo0Computed from 3000 by 3782 log-likelihood matrix
Estimate SEelpd_loo -24023.2 84.7p_loo 232.6 12.6looic 48046.5 169.4Warning messages:1: 31 (0.8%) Pareto k estimates between 0.5 and 1 2: 15 (0.4%) Pareto k estimates greater than 1 3: See PSIS-LOO description (?'loo-package') for more information
> compare(loo_sim_sl,loo_sim_slwo0)elpd_diff se weight1 weight2 37.0 14.6 0.0 1.0 > compare(waic_sim_sl,waic_sim_slwo0)elpd_diff se weight1 weight2 37.8 14.6 0.0 1.0
> loo_sim_slComputed from 3000 by 800 log-likelihood matrix
Estimate SEelpd_loo -5305.1 53.0p_loo 59.8 3.6looic 10610.3 106.0Warning messages:1: 26 (3.2%) Pareto k estimates between 0.5 and 1 2: See PSIS-LOO description (?'loo-package') for more information > loo_sim_slwo0Computed from 3000 by 800 log-likelihood matrix
Estimate SEelpd_loo -5268.1 48.9p_loo 67.2 3.4looic 10536.3 97.7Warning messages:1: 25 (3.1%) Pareto k estimates between 0.5 and 1 2: See PSIS-LOO description (?'loo-package') for more information
--
You received this message because you are subscribed to a topic in the Google Groups "Stan users mailing list" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/stan-users/g5GDNDCamj8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
This many khats>1 means trouble and means that you can't trust IS-LOO nor WAIC, and you need to use k-fold-CV
or change your model to be more robust. I know you had log-uniform part for the contamination, but I don't think that uniform with some interval is necessarily a good choice as you get discontinuity in the density. How about making the second component to be a wider log-normal distribution?
The fact that you don't have khats>1 with the simulated data shows that your real data is more surprising. You could check the observed values with khat>1
More complex model may have larger khats as then these influential observations can change the posterior more (making importance sampling leave one out approximation more difficult). The log-uniform is likely to be problematic, too..
Thanks! A couple of comments and questions inline:On Tue, Nov 24, 2015 at 12:57 PM, Aki Vehtari <aki.v...@aalto.fi> wrote:This many khats>1 means trouble and means that you can't trust IS-LOO nor WAIC, and you need to use k-fold-CVK-fold-CV involves fitting each model at least 10 times in Stan, right? I think I understood it good enough to implement it, but I would like to avoid doing it. (There's no package in R that does it in the same way as loo, right?)or change your model to be more robust. I know you had log-uniform part for the contamination, but I don't think that uniform with some interval is necessarily a good choice as you get discontinuity in the density. How about making the second component to be a wider log-normal distribution?I'm right now trying to do that, but all the papers about reaction times (I'm fitting reading times) that try to deal with outliers like this, use an uniform for the contaminated distribution.
You are (likely) seeing what Aki mentions where the log-normal + uniform mixture has a kink in it so the uniform takes care of high outliers but it does not necessarily take care of medium-high outliers.
On Tuesday, November 24, 2015 at 6:03:30 PM UTC+2, Krzysztof Sakrejda wrote:You are (likely) seeing what Aki mentions where the log-normal + uniform mixture has a kink in it so the uniform takes care of high outliers but it does not necessarily take care of medium-high outliers.Excellent comment! The observations close to region between "non-outlier" and "outlier" is problematic, as if they are not outliers they are influence strongly the parameters of log-normal, but if they are outliers they don't, and thus observations in these region may have large difference in the posterior and leave-one-out posterior. Since the effect is so strong, it seems that log-normal is not good choice here either.Aki
I understand. So it's either that the uniform is not be the ideal distribution to capture the outliers or that the shifted-lognormal is not the ideal distribution for the "good observations" (or both).But if I think that the distribution of "good observations" should still be a shifted-lognormal (because of theoretical reasons), sorry to be repetitive, but then I just can't know using WAIC or LOO if the uniform mixture gives any better fit than not using anything. Is it right?
On Tuesday, November 24, 2015 at 6:03:30 PM UTC+2, Krzysztof Sakrejda wrote:You are (likely) seeing what Aki mentions where the log-normal + uniform mixture has a kink in it so the uniform takes care of high outliers but it does not necessarily take care of medium-high outliers.Excellent comment! The observations close to region between "non-outlier" and "outlier" is problematic, as if they are not outliers they are influence strongly the parameters of log-normal, but if they are outliers they don't, and thus observations in these region may have large difference in the posterior and leave-one-out posterior. Since the effect is so strong, it seems that log-normal is not good choice here either.
That said, I don't think I have a complete understanding of how the pareto k estimates should be used since in my own model (png posted by me in a comment above, don't have it with me right now) the smattering of very-high-k points was mixed in among other less problematic points so (for models with many k>1 values) I think of it as a general indicator of the problem area in covariate space, rather than a distinct indicator that specific points are surprising. I'll ask a separate question on the list (once I sort out what it is).