compare_plus: compare_plus

Description Usage Arguments Value Examples

View source: R/compare_plus.R

Description

compare_plus

Usage

1
2
compare_plus(models, discount, model_prior = NULL, state_prior = NULL, obs,
  action, alphas = NULL, model_names = NULL, ...)

Arguments

models

a list of lists, each of which gives the transition matrix, observation matrix and reward matrix for the model considered

discount

discount rate

model_prior

Prior belief assigned to each model. uniform by default.

state_prior

Prior belief that system is in state x_i and model m_i

obs

vector of historical observations. Must use index value of (discrete) observation

action

corresponding vector of historical actions. Must use index value of (discrete) action

alphas

the alpha vectors for each model, as provided from sarsop_plus, which will otherwise be run each time if not provided.

model_names

vector of identifying names for each model. If none are provided, model posterior columns will be named V1, V2, etc.

...

additional options to sarsop::sarsop, if alphas are not provided

Value

a list with elements (1) df a data.frame with the time, state, observation, action, and value at each timestep, (2) model_posterior, a data.frame of Tmax rows by n_models columns giving the evolution of the belief over models, and (3) state_posterior, a data.frame of Tmax rows by n_states columns giving the evolution of the belief over states

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
source(system.file("examples/K_models.R", package="pomdpplus"))
alphas <- sarsop_plus(models, discount, precision = 1)
out <- compare_plus(models = models, discount = discount,
                obs = rnorm(21, 15, 0.1),
                action = rep(1, 21),
                alphas = alphas)

## End(Not run)

boettiger-lab/pomdpplus documentation built on May 24, 2019, 3:05 a.m.