series_to_tpm: Time Series to TPM

Description Usage Arguments Value Examples

View source: R/seriestotpm.R

Description

Estimate the one-time-step transition probability matrix 'A' from a time series. The element 'A_ji' is the probability of transitioning to state 'j' in the next time step given the system is in state 'i' (note the column-major convention).

Usage

1
series_to_tpm(series)

Arguments

series

Vector or matrix specifying one or more time series.

Value

Matrix giving the corresponding transition probability matrix.

Examples

1
2
3
4
5
6
7
8
9
# TPM from 2 base-2 time series
xs      <- matrix(0, nrow = 5, ncol = 2)
xs[, 1] <- c(0, 0, 1, 1, 0)
xs[, 2] <- c(1, 0, 1, 1, 1)
series_to_tpm(xs)

# TPM from one base-3 time series
xs <- c(0, 1, 2, 2, 1, 1, 0, 0, 1, 2)
series_to_tpm(xs)

rinform documentation built on April 1, 2018, 12:12 p.m.