# Construct a Continuous-time Markov Chain Generator

### Description

This function enables easy construction of an absorbing continuous-time Markov chain generator matrix representation for a system when components are treated as having Exponential failure and repair times.

### Usage

1 | ```
systemGraphToGenerator(g, failRate, repairRate)
``` |

### Arguments

`g` |
an |

`failRate` |
the rate parameter of the Exponentially distributed lifetime distribution of the components. |

`repairRate` |
the rate parameter of the Exponentially distributed repair time distribution of the components. |

### Details

When the system or network is specified by means of an `igraph`

object, each end of the system must be denoted by nodes named "s" and "t" which are taken to be perfectly reliable. It is easy to construct the appropriate graph representation using the function `graph.formula`

.

This function then creates the generator matrix for an absorbing continuous-time Markov chain representation of such a system where components are repairable. All system states which in which the system is inoperative are collapsed into the absorbing state.

The returned values are in the format required by the `phtMCMC2`

.

Full details are in Aslett (2012).

### Value

A list is returned with both a numeric generator matrix (in `$G`

with the failure rate, `failRate`

, and repair rate, `repairRate`

) and a symbolic matrix (in `$structure$G`

), along with a matrix of the constant multiples of generator entries (in `$structure$C`

).

### Note

Please feel free to email aslett@stats.ox.ac.uk with any queries or if you encounter errors when running this function.

### Author(s)

Louis J.M. Aslett aslett@stats.ox.ac.uk (http://www.louisaslett.com/)

### References

Aslett, L. J. M. (2012), *MCMC for Inference on Phase-type and Masked System Lifetime Models*, PhD Thesis, Trinity College Dublin.

### Examples

1 2 3 4 | ```
# Get the generator representing a repairable 5 component 'bridge' system with
# failure rate 1 and repair rate 365.
data(sccsO5)
G <- systemGraphToGenerator(sccsO5[[18]]$graph, 1, 365)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.