Learn R Programming

markovchain

R package providing classes, methods and function for easily handling Discrete Time Markov Chains (DTMC), performing probabilistic analysis and fitting.

Install the current release from CRAN:

install.packages('markovchain')

Install the development version from GitHub:

devtools::install_github('spedygiorgio/markovchain')

Copy Link

Version

Install

install.packages('markovchain')

Monthly Downloads

8,017

Version

0.9.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

September 24th, 2023

Functions in markovchain (0.9.5)

inferHyperparam

Function to infer the hyperparameters for Bayesian inference from an a priori matrix or a data set
is.CTMCirreducible

Check if CTMC is irreducible
markovchain-class

Markov Chain class
markovchainListFit

markovchainListFit
markovchainList-class

Non homogeneus discrete time Markov Chains class
hommc-class

An S4 class for representing High Order Multivariate Markovchain (HOMMC)
show,hommc-method

Function to display the details of hommc object
probabilityatT

Calculating probability from a ctmc object
is.irreducible

Function to check if a Markov chain is irreducible (i.e. ergodic)
ones

Returns an Identity matrix
is.regular

Check if a DTMC is regular
createSequenceMatrix

Function to fit a discrete Markov chain
multinomialConfidenceIntervals

A function to compute multinomial confidence intervals of DTMC
name

Method to retrieve name of markovchain object
meanRecurrenceTime

Mean recurrence time
kullback

Example from Kullback and Kupperman Tests for Contingency Tables
priorDistribution

priorDistribution
markovchain-package

Easy Handling Discrete Time Markov Chains
period

Various function to perform structural analysis of DTMC
markovchainSequence

Function to generate a sequence of states from homogeneous Markov chains.
ictmc-class

An S4 class for representing Imprecise Continuous Time Markovchains
impreciseProbabilityatT

Calculating full conditional probability using lower rate transition matrix
noofVisitsDist

return a joint pdf of the number of visits to the various states of the DTMC
names,markovchain-method

Returns the states for a Markov chain object
predictHommc

Simulate a higher order multivariate markovchain
meanAbsorptionTime

Mean absorption time
steadyStates

Stationary states of a markovchain object
verifyMarkovProperty

Various functions to perform statistical inference of DTMC
name<-

Method to set name of markovchain object
transitionProbability

Function to get the transition probabilities from initial to subsequent states.
transition2Generator

Return the generator matrix for a corresponding transition matrix
rmarkovchain

Function to generate a sequence of states from homogeneous or non-homogeneous Markov chains.
sales

Sales Demand Sequences
states

Defined states of a transition matrix
is.accessible

Verify if a state j is reachable from state i.
is.TimeReversible

checks if ctmc object is time reversible
meanNumVisits

Mean num of visits for markovchain, starting at each state
meanFirstPassageTime

Mean First Passage Time for irreducible Markov chains
predictiveDistribution

predictiveDistribution
rctmc

rctmc
rain

Alofi island daily rainfall
preproglucacon

Preprogluccacon DNA protein bases sequences
tm_abs

Single Year Corporate Credit Rating Transititions
zeros

Matrix to create zeros
expectedRewards

Expected Rewards for a markovchain
craigsendi

CD4 cells counts on HIV Infects between zero and six month
conditionalDistribution

conditionalDistribution of a Markov Chain
ExpectedTime

Returns expected hitting time from state i to state j
ctmcFit

Function to fit a CTMC
absorptionProbabilities

Absorption probabilities
committorAB

Calculates committor of a markovchain object with respect to set A, B
HigherOrderMarkovChain-class

Higher order Markov Chains class
hittingProbabilities

Hitting probabilities for markovchain
fitHigherOrder

Functions to fit a higher order Markov chain
freq2Generator

Returns a generator matrix corresponding to frequency matrix
expectedRewardsBeforeHittingA

Expected first passage Rewards for a set of states in a markovchain
firstPassageMultiple

function to calculate first passage probabilities
generatorToTransitionMatrix

Function to obtain the transition matrix from the generator
firstPassage

First passage across states
holson

Holson data set
ctmc-class

Continuous time Markov Chains class
blanden

Mobility between income quartiles
fitHighOrderMultivarMC

Function to fit Higher Order Multivariate Markov chain