# map.mmoment: Moments for Markovian arrival pcess (MAP) In mapfit: A Tool for PH/MAP Parameter Estimation

Moments for MAP.

## Usage

 ```1 2 3``` ```map.mmoment(k, map) map.jmoment(lag, map) map.acf(map) ```

## Arguments

 `map` an object of S4 class of MAP (`map`, `gmmpp`). `k` an integer of dgrees of moments. `lag` an integer of time lag for corrleation.

## Details

MAP parameters are α, D_0 and D_1;

P = (-D_0)^{-1} D_1

and

s P = s.

Then the moments for MAP are marginal moment;

m_k = k! s (-D_0)^{-k} 1,

joint moment;

s_{ij}(lag) = i! j! s (-D_0)^{-i} P^{lag} (-D_0)^{-j} 1,

k-lag correlation (autocorrelation);

rho(lag) = (s_{11}(lag) - m_1^2)/(m_2 - m_1^2)

## Value

`map.mmoment` gives a vector of up to k moments. `map.jmoment` gives a matrix of s_{ij}(lag), i=1,..,n, j=1,..,n where n is the size of phases. `map.acf` gives a vector of up to n-lag correlation, where n is the size of phases.

`map`, `gmmpp`, `erhmm`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21``` ```## create an MAP with specific parameters (param1 <- map(alpha=c(1,0,0), D0=rbind(c(-4,2,0),c(2,-5,1),c(1,0,-4)), D1=rbind(c(1,1,0),c(1,0,1),c(2,0,1)))) ## create an ER-HMM with specific parameters (param2 <- erhmm(shape=c(2,3), alpha=c(0.3,0.7), rate=c(1.0,10.0), P=rbind(c(0.3, 0.7), c(0.1, 0.9)))) ## marginal moments of MAP map.mmoment(k=3, map=param1) map.mmoment(k=3, map=as(param2, "map")) ## joint moments of MAP map.jmoment(lag=1, map=param1) map.jmoment(lag=1, map=as(param2, "map")) ## k-lag correlation map.acf(map=param1) map.acf(map=as(param2, "map")) ```