Description Usage Arguments Details Value Note Author(s) Examples
This function enables easy simulation of iid masked lifetime observations from a system or network.
1 | simulateSystem(system, n, rdens, ...)
|
system |
may be: an |
n |
how many simulations to produce. |
rdens |
a user defined function which generates random realisations of the component lifetimes. |
... |
parameters passed to the user defined function |
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 generates iid realisations of masked lifetimes.
a numeric vector of length n
containing the masked lifetime data.
Please feel free to email aslett@stats.ox.ac.uk with any queries or if you encounter errors when running this function.
Louis J.M. Aslett aslett@stats.ox.ac.uk (http://www.louisaslett.com/)
1 2 3 4 5 6 7 | # Simulate 20 masked lifetimes of a two component series system with Exponential(2)
# component lifetimes
# Using igraph object ...
simulateSystem(graph.formula(s -- 1 -- 2 -- t), 20, rexp, rate=2)
# ... and using signature
simulateSystem(c(1,0), 20, rexp, rate=2)
|
Loading required package: igraph
Attaching package: 'igraph'
The following objects are masked from 'package:stats':
decompose, spectrum
The following object is masked from 'package:base':
union
[1] 0.27879905 0.10647598 0.10933396 0.29011122 0.90927132 0.41175219
[7] 0.01136972 0.12970720 0.12553881 0.03801741 0.28391300 0.02191104
[13] 0.06347991 0.17231989 0.52777538 0.07990025 0.08747876 0.37231373
[19] 0.01234228 0.35933249
[1] 0.02406391 0.24073067 0.12417842 0.06147446 0.02797287 0.03104583
[7] 0.11564146 0.01865271 0.19567428 0.12872126 0.64132876 0.28969154
[13] 0.08587121 0.32113442 0.25826596 0.35444135 0.01558576 0.24854268
[19] 0.22745567 0.05564812
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.