Learn R Programming

rdecision (version 1.1.2)

MarkovState: A state in a Markov model

Description

An R6 class representing a state in a Markov model.

Arguments

Value

Updated MarkovState object

Author

Andrew J. Sims andrew.sims@newcastle.ac.uk

Super class

rdecision::Node -> MarkovState

Methods

Inherited methods


Method new()

Create an object of type MarkovState.

Usage

MarkovState$new(name, cost = 0, utility = 1)

Arguments

name

The name of the state (character string).

cost

The annual cost of state occupancy (numeric or ModVar). Default 0.

utility

The utility associated with being in the state (numeric or ModVar).

Details

Utility must be in the range [-Inf,1]. If it is of type numeric, the range is checked on object creation.

Returns

An object of type MarkovState.


Method name()

Accessor function to retrieve the state name.

Usage

MarkovState$name()

Returns

State name.


Method set_cost()

Set the annual occupancy cost

Usage

MarkovState$set_cost(cost)

Arguments

cost

The annual cost of state occupancy


Method cost()

Gets the annual cost of state occupancy.

Usage

MarkovState$cost()

Returns

Annual cost; numeric.


Method utility()

Gets the utility associated with the state.

Usage

MarkovState$utility()

Returns

Utility; numeric.


Method modvars()

Find all the model variables.

Usage

MarkovState$modvars()

Details

Find variables of type ModVar that have been specified as values associated with this MarkovState. Includes operands of these ModVars, if they are expressions.

Returns

A list of ModVars.


Method clone()

The objects of this class are cloneable with this method.

Usage

MarkovState$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Represents a single state in a Markov model. A Markov model is a digraph in which states are nodes and transitions are arrows. Inherits from class Node.