# stationary: Stationary Distribution of a Transition Matrix In hhh4contacts: Age-Structured Spatio-Temporal Models for Infectious Disease Counts

## Description

This auxiliary function determines the stationary distribution from a transition matrix.

## Usage

 `1` ```stationary(P) ```

## Arguments

 `P` a transition matrix, i.e., a square matrix where all rows sum to 1.

## Value

the stationary probability vector.

Leonhard Held

## Examples

 ```1 2 3 4 5``` ```Cgrouped_norm <- contactmatrix(normalize = TRUE) Cgrouped_norm (p <- stationary(Cgrouped_norm)) (Cpowered <- make_powerC(Cgrouped_norm)(1e6)) stopifnot(all.equal(Cpowered[1,], p)) ```

### Example output

```Loading required package: surveillance
This is surveillance 1.18.0. For overview type ‘help(surveillance)’.
contact
participant       00-04      05-14      15-24     25-44     45-64        65+
00-04 0.209937888 0.12670807 0.10807453 0.3515528 0.1453416 0.05838509
05-14 0.025072886 0.40524781 0.11137026 0.2804665 0.1323615 0.04548105
15-24 0.006560450 0.05763824 0.50187441 0.2436739 0.1597938 0.03045923
25-44 0.031518625 0.08309456 0.14654114 0.4494474 0.2300450 0.05935325
45-64 0.015728477 0.04304636 0.12086093 0.3249172 0.4139073 0.08153974
65+   0.009943182 0.04829545 0.04829545 0.2613636 0.3153409 0.31676136
attr(,"agedistri")
00-04      05-14      15-24      25-44      45-64        65+
0.06872587 0.15598456 0.18378378 0.22239382 0.26563707 0.10347490
00-04      05-14      15-24      25-44      45-64        65+
0.02455060 0.09742126 0.19832517 0.34286189 0.25875186 0.07808922
contact
participant     00-04      05-14     15-24     25-44     45-64        65+
00-04 0.0245506 0.09742126 0.1983252 0.3428619 0.2587519 0.07808922
05-14 0.0245506 0.09742126 0.1983252 0.3428619 0.2587519 0.07808922
15-24 0.0245506 0.09742126 0.1983252 0.3428619 0.2587519 0.07808922
25-44 0.0245506 0.09742126 0.1983252 0.3428619 0.2587519 0.07808922
45-64 0.0245506 0.09742126 0.1983252 0.3428619 0.2587519 0.07808922
65+   0.0245506 0.09742126 0.1983252 0.3428619 0.2587519 0.07808922
attr(,"agedistri")
00-04      05-14      15-24      25-44      45-64        65+
0.06872587 0.15598456 0.18378378 0.22239382 0.26563707 0.10347490
```

hhh4contacts documentation built on March 20, 2020, 5:07 p.m.