Description Usage Arguments Value See Also Examples
Sensitivity analysis of parameters with SMC
1 | biips_smc_sensitivity(object, param_values, n_part, ...)
|
object |
|
param_values |
named list of numeric values. Each member is named after a parameter for which we want to study sensitivity. Each member value is a vector or array whose last dimension is equal to the number of values for which we want to study sensitivity. |
n_part |
integer. Number of particles. |
... |
Additional arguments to be passed to the SMC
algorithm such as |
biips_smc_sensitivity
returns a list with the following
members:
log_marg_like |
vector of log marginal likelihood estimates at the different values of the parameters. |
log_marg_like_pen |
vector of penalized log marginal likelihood estimates at the different values of the parameters. |
max_param |
parameters value with maximum |
max_log_marg_like |
maximum |
max_param_pen |
parameters value with maximum |
max_log_marg_like_pen |
maximum |
biips_model
, biips_smc_samples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | modelfile <- system.file('extdata', 'hmm.bug', package = 'rbiips')
stopifnot(nchar(modelfile) > 0)
cat(readLines(modelfile), sep = '\n')
data <- list(tmax = 10, p = c(.5, .5), logtau_true = log(1), logtau = log(1))
model <- biips_model(modelfile, data)
n_part <- 50
logtau_val <- -10:10
out_sens <- biips_smc_sensitivity(model, list(logtau = logtau_val), n_part)
par(mfrow = c(2, 1))
plot(logtau_val, out_sens$log_marg_like, type = 'l', col = 'blue',
xlab = 'logtau', ylab = 'log p(y|logtau) ', main = 'SMC sensitivity')
points(data$logtau, min(out_sens$log_marg_like), pch = 17, col = 'green')
plot(logtau_val, out_sens$log_marg_like_pen, type = 'l', col = 'blue',
xlab = 'logtau', ylab = 'log p(y|logtau) + log p(logtau)')
plml <- out_sens$log_marg_like_pen
ymin <- min(plml[is.finite(plml)])
points(data$logtau, ymin, pch = 17, col = 'green')
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.