cpo.RdImprove the estimates of the CPO/PIT-values be recomputing the model-fit by removing data-points.
inla.cpo(
result,
force = FALSE,
mc.cores = NULL,
verbose = TRUE,
recompute.mode = TRUE
)An object of class inla, ie a result of a call to
inla()
If TRUE, then recompute all CPO/PIT values and not just those
with result$cpo$failure > 0.
The number of cores to use in parallel::mclapply. If
is.null(mc.cores), then check getOption("mc.cores") and
inla.getOption("num.threads") in that order.
Run in verbose mode?
Should be mode (and the integration points) be recomputed when a data-point is removed or not?
The object returned is the same as result but the new
improved estimates of the CPO/PIT values replaced.
n = 10
y = rnorm(n)
r = inla(
y ~ 1,
data = data.frame(y),
control.compute = list(cpo=TRUE),
num.threads = "1:1" # Protect package testing from parallel execution
)
# \donttest{
rr = inla.cpo(
r,
force=TRUE,
mc.cores = 1 # Protect package testing from parallel execution
)
#> Compute new CPO/PIT values manually, for 10 cases...
#> index cpo.old cpo.new pit.old pit.new
#> [1,] 1 0.2293658 0.2293658 0.648756 0.648756
#> [2,] 2 0.1977867 0.1977867 0.256690 0.256690
#> [3,] 3 0.1300788 0.1300788 0.133419 0.133419
#> [4,] 4 0.1463859 0.1463859 0.158112 0.158112
#> [5,] 5 0.0498728 0.0498728 0.961189 0.961189
#> [6,] 6 0.1691352 0.1691352 0.197014 0.197014
#> [7,] 7 0.0118922 0.0118922 0.992734 0.992734
#> [8,] 8 0.1858985 0.1858985 0.230086 0.230086
#> [9,] 9 0.2473849 0.2473849 0.522305 0.522305
#> [10,] 10 0.2463437 0.2463437 0.541909 0.541909
#>
#> The retured result contain the new values.
# }