\(Models\ comparison\ trough\ Widely\ applicable\ information\ criterion\ (WAIC),\ using\ the dataset\\ with\ the\ visit\ length\ at\ the\ feeder\ when\ the\ next\ visit\ was\ less\ than\ or\ equal\ to\ 60sc,\ and\ greater\ than\ or\ equal\ to\ 600sc, from\ 7\ trials,\\ in\ pig\ production\)
\(The\ matrix\ to\ each\ model\ contain:\\ elpd_{waic}:\ expected\ log\ predictive\ pointwise\ density\\p_{waic}:\ effective\ number\ of\ parameters\\ waic:\ information\ ciretion\ converted\ to\ deviance\ scale=\ -2*elpd_{waic}\)
print(m1.60s.waic)
##
## Computed from 30000 by 58255 log-likelihood matrix
##
## Estimate SE
## elpd_waic -192339.2 236.7
## p_waic 181.7 2.0
## waic 384678.4 473.4
## Warning: 2 (0.0%) p_waic estimates greater than 0.4. We recommend trying loo
## instead.
print(m2.60s.waic)
##
## Computed from 30000 by 58255 log-likelihood matrix
##
## Estimate SE
## elpd_waic -191608.1 240.3
## p_waic 301.0 3.2
## waic 383216.3 480.6
## Warning: 2 (0.0%) p_waic estimates greater than 0.4. We recommend trying loo
## instead.
print(m3.60s.waic)
##
## Computed from 30000 by 58255 log-likelihood matrix
##
## Estimate SE
## elpd_waic -191608.3 240.3
## p_waic 301.3 3.2
## waic 383216.6 480.6
## Warning: 2 (0.0%) p_waic estimates greater than 0.4. We recommend trying loo
## instead.
\(compare\ fitted\ models\ based\ on\ expected\ log\ pointwise\ predictive\ density\ (elpd_{waic}),\\ the\ matrix\ contain:\\ elpd_{diff}: is\ the\ diference\ in\ elpd\ for\ two\ models,\ if\ more\ than\ two\ models\ asre\ comared,\ the\ difference\ is\ computed\ relative\ to\ the model\ with\ highest\ elpd\\ se_{diff}:\ standard\ error\ of\ deifference\\ se-elpd_{waic}:\ standard \ error \ expected\ log\ predictive\ pointwise\ density\\ se-p_{waic}:\ standard \ error\ effective\ number\ of\ parameters\)
print(loo_compare(m1.60s.waic,m2.60s.waic, m3.60s.waic), simplify = F)
## elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic
## model2 0.0 0.0 -191608.1 240.3 301.0 3.2 383216.3
## model3 -0.1 0.5 -191608.3 240.3 301.3 3.2 383216.6
## model1 -731.1 41.0 -192339.2 236.7 181.7 2.0 384678.4
## se_waic
## model2 480.6
## model3 480.6
## model1 473.4
print(compare(m1.60s.waic,m2.60s.waic, m3.60s.waic), simplify = F)
## elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic
## m2.60s.waic 0.0 0.0 -191608.1 240.3 301.0 3.2
## m3.60s.waic -0.1 0.5 -191608.3 240.3 301.3 3.2
## m1.60s.waic -731.1 41.0 -192339.2 236.7 181.7 2.0
## waic se_waic
## m2.60s.waic 383216.3 480.6
## m3.60s.waic 383216.6 480.6
## m1.60s.waic 384678.4 473.4
print(m1.600s.waic)
##
## Computed from 30000 by 6258 log-likelihood matrix
##
## Estimate SE
## elpd_waic -21071.1 211.5
## p_waic 179.3 20.2
## waic 42142.1 423.1
## Warning: 33 (0.5%) p_waic estimates greater than 0.4. We recommend trying loo
## instead.
print(m2.600s.waic)
##
## Computed from 30000 by 6258 log-likelihood matrix
##
## Estimate SE
## elpd_waic -21069.4 210.6
## p_waic 184.0 20.5
## waic 42138.9 421.2
## Warning: 37 (0.6%) p_waic estimates greater than 0.4. We recommend trying loo
## instead.
print(m3.600s.waic)
##
## Computed from 30000 by 6258 log-likelihood matrix
##
## Estimate SE
## elpd_waic -21072.1 211.1
## p_waic 186.1 20.8
## waic 42144.2 422.2
## Warning: 37 (0.6%) p_waic estimates greater than 0.4. We recommend trying loo
## instead.
print(loo_compare(m1.600s.waic,m2.600s.waic, m3.600s.waic),simplify=F)
## elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic waic
## model2 0.0 0.0 -21069.4 210.6 184.0 20.5 42138.9
## model1 -1.6 1.4 -21071.1 211.5 179.3 20.2 42142.1
## model3 -2.7 1.4 -21072.1 211.1 186.1 20.8 42144.2
## se_waic
## model2 421.2
## model1 423.1
## model3 422.2
print(compare(m1.600s.waic,m2.600s.waic, m3.600s.waic),simplify=F)
## elpd_diff se_diff elpd_waic se_elpd_waic p_waic se_p_waic
## m2.600s.waic 0.0 0.0 -21069.4 210.6 184.0 20.5
## m1.600s.waic -1.6 1.4 -21071.1 211.5 179.3 20.2
## m3.600s.waic -2.7 1.4 -21072.1 211.1 186.1 20.8
## waic se_waic
## m2.600s.waic 42138.9 421.2
## m1.600s.waic 42142.1 423.1
## m3.600s.waic 42144.2 422.2