prjm: Calculate projection matrix.

Description Usage Arguments Details Value Author(s) References Examples

View source: R/prjm.R

Description

Left multiply a transition matrix to create its projection matrix.

Usage

1
prjm(r_c, n)

Arguments

r_c

A transition matrix of numeric values representing conditional probabilities in the form of a two-way table:

Fr
0.62 0.16 0.02 ...
To 0.29 0.46 0.13 ...
0.06 0.30 0.31 ...
... ... ... ...

r_c can be constructed as follows in the example below.

n

The exponent, or number of times to pre-multiply r_c.

Details

Left-multiply a matrix a specified number of times and returns the projection matrix of r_c, which has the same dimensions and grand sum.

Value

Returns a projection matrix with the same dimensions and grand sum as r_c.

Author(s)

Bjorn J. Brooks, Lars Y. Pomara, Danny C. Lee

References

PAPER TITLE.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(transitions)                # Load example data
b <- brkpts(transitions$phenofr, # Find 10 probabilistically
            10)                  #  equivalent breakpoints
m <- xt(transitions,             # Make transition matrix
        fr.col=2, to.col=3,
        cnt.col=4, brk=b)
pxy <- jpmf(m)                   # Joint distribution
cmd <- colSums(pxy)              # Column marginal distribution
r_c <- cpf(pxy,                  # Transition matrix
           margin='p(row|col)')  #  (row | col)
colSums(r_c)                     # Check that each column sums to 1
r_c.prj <- prjm(r_c,10^3)        # Project matrix 1,000 steps

bjornbrooks/landat documentation built on May 17, 2019, 7:32 p.m.