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!