criterion | R Documentation |
Takes an mcpfit
as input and computes information criteria using loo or
WAIC. Compare models using loo_compare
and loo_model_weights
.
more in loo
.
criterion(fit, criterion = "loo", ...)
## S3 method for class 'mcpfit'
loo(x, ...)
## S3 method for class 'mcpfit'
waic(x, ...)
fit |
An |
criterion |
One of |
... |
Currently ignored |
x |
An |
a loo
or psis_loo
object.
loo(mcpfit)
: Computes loo on mcpfit objects
waic(mcpfit)
: Computes WAIC on mcpfit objects
Jonas Kristoffer Lindeløv jonas@lindeloev.dk
criterion
criterion
# Define two models and sample them
# options(mc.cores = 3) # Speed up sampling
ex = mcp_example("intercepts") # Get some simulated data.
model1 = list(y ~ 1 + x, ~ 1)
model2 = list(y ~ 1 + x) # Without a change point
fit1 = mcp(model1, ex$data)
fit2 = mcp(model2, ex$data)
# Compute LOO for each and compare (works for waic(fit) too)
fit1$loo = loo(fit1)
fit2$loo = loo(fit2)
loo::loo_compare(fit1$loo, fit2$loo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.