I am trying to compare two SequentialSamplingModels with loo using ParetoSmooth.jl, but I think I am doing something wrong:
using Turing
using SequentialSamplingModels
using Random
using Distributions
using DataFrames
using StatsPlots
using StatsModels
using StatsBase
using ParetoSmooth
# Generate data (1000 obs)
Random.seed!(6)
dist = LBA(Ξ½=[3.0, 2.0], A=0.8, k=0.2, Ο=0.3)
data = rand(dist, 1000)
# ---------------------
# Models
@model function model_lba(data; min_rt=minimum(data.rt))
Ξ½ ~ filldist(Normal(0, 1), 2)
A ~ truncated(Normal(0.8, 0.4), 0.0, Inf)
k ~ truncated(Normal(0.2, 0.2), 0.0, Inf)
Ο ~ Uniform(0.0, min_rt)
data ~ LBA(; Ξ½, A, k, Ο)
end
chain_lba = sample(model_lba(data), NUTS(), 1000)
@model function model_lnr(data; min_rt=minimum(data.rt))
Ξ½ ~ filldist(Normal(0, 1), 2)
Ο ~ truncated(Normal(0, 1), 0.0, Inf)
Ο ~ Uniform(0.0, min_rt)
data ~ LNR(; Ξ½, Ο, Ο)
end
chain_lnr = sample(model_lnr(data), NUTS(), 1000)
When I run the following:
rez1 = psis_loo(model_lba(data), chain_lba)
rez2 = psis_loo(model_lnr(data), chain_lnr)
loo_compare((lba=rez1, lnr=rez2))
While the comparison works, the psis_loo()
function returns
β Warning: Some Pareto k values are extremely high (>1). PSIS will not produce consistent estimates.
β @ ParetoSmooth C:\Users\domma\.julia\packages\ParetoSmooth\Ml7Gb\src\InternalHelpers.jl:47
Results of PSIS-LOO-CV with 1000 Monte Carlo samples and 1 data points. Total Monte Carlo SE of NaN.
βββββββββββββ¬βββββββββ¬βββββββββββ¬βββββββββ¬ββββββββββ
β β total β se_total β mean β se_mean β
βββββββββββββΌβββββββββΌβββββββββββΌβββββββββΌββββββββββ€
β cv_elpd β 452.85 β NaN β 452.85 β NaN β
β naive_lpd β 456.28 β NaN β 456.28 β NaN β
β p_eff β 3.43 β NaN β 3.43 β NaN β
I am not sure where it gets the β1 data pointsβ from, as there are 1000 observations
Moreover, in this post, Aki mentions that it is useful to compare the ELPD relative to their SEs to have an idea of the magnitude of the difference. Hence I am wondering if this info (or some standardized difference) is available or can be computed? Thanks for any tips for model comparison!