get_history_names {polle}R Documentation

Get history variable names

Description

get_history_names() returns the state covariate names of the history data table for a given stage. The function is useful when specifying the design matrix for g_model and q_model objects.

Usage

get_history_names(object, stage)

Arguments

object

Policy data object created by policy_data().

stage

Stage number. If NULL, the state/Markov-type history variable names are returned.

Value

Character vector.

Examples

library("polle")
### Multiple stages:
d3 <- sim_multi_stage(5e2, seed = 1)
pd3 <- policy_data(data = d3$stage_data,
                   baseline_data = d3$baseline_data,
                   type = "long",
                   id = "id",
                   stage = "stage",
                   event = "event",
                   action = "A",
                   utility = "U")
pd3
# state/Markov type history variable names (H):
get_history_names(pd3)
# full history variable names (H_k) at stage 2:
get_history_names(pd3, stage = 2)

[Package polle version 1.4 Index]