This module implements a Markov state object used by Decision::Markov.
It's not really intended to be used directly, but for completeness,
its public methods are documented here.
Creates a new Markov state object, given a name for the state and its
utility. The utility may be specified either as a number or as a
reference to a subroutine which will be called with the current model
cycle as its only argument.
Given a second Markov state, and a transition probability, adds a
transition from the first state to the second that will occur with
probability equal to the transition probability at the model
cycle. Probability can be specified as a number or a reference to a
subroutine which will be called with the current model cycle as its
only argument.
Returns undef if successful or an error message if unsuccessful
(e.g., there's already a transition between those states.)
Given a second Markov state, return the probability of transitioning
from the first state to the second. May return either a number or a
reference to a subroutine that can be called with the current model
cycle to get the numerical probability. If TransitionProb is given a
cycle number as its optional second argument, it will always return
the probability during that cycle. If a state doesn't have a
transition to the new state, this function returns 0.
Return the sum of all the transition probabilities from the state. If
any of the probabilities are subroutine references, they are evaluated
at the cycle given as an argument to SumProbs or at cycle 3 if
SumProbs is called without arguments. This function is used to check
that probabilities sum to 1.
Given the model cycle, randomly determine and return the next state
that a patient in this state will move to, based on the transition
probabilities. Used in Monte Carlo evaluations.
Given the model cycle, distribute all of the patients in the state to
other states in proportion to their transition probabilities. Note
that a state usually transitions to itself as well, so some of the
patients are distributed back to the same state. Distributed patients
are held in a temporary attribute of the object so that all states can
be distributed before calling UpdateCohort to actually set the new
number of patients for each state. Used in cohort simulations.
Copyright (c) 1998 Alan Schwartz <alansz@uic.edu>. All rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.