Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
## ----setup--------------------------------------------------------------------
library(dist.structure)
library(algebraic.dist)
## -----------------------------------------------------------------------------
sys <- series_dist(list(
exponential(0.5),
exponential(0.3),
exponential(0.2)
))
class(sys)
algebraic.dist::is_dist(sys)
## -----------------------------------------------------------------------------
# General: any components, arbitrary topology
sys_general <- series_dist(replicate(3, exponential(1), simplify = FALSE))
# Specialization: exploits Exp(sum(rates)) closed form
sys_special <- exp_series(c(1, 1, 1))
## -----------------------------------------------------------------------------
for (ti in c(0.5, 1, 2)) {
stopifnot(isTRUE(all.equal(
algebraic.dist::surv(sys_general)(ti),
algebraic.dist::surv(sys_special)(ti),
tolerance = 1e-10
)))
}
## -----------------------------------------------------------------------------
d <- exponential(1)
# Plain min: just a dist, no topology
d_min <- min(d, d, d)
class(d_min)
## -----------------------------------------------------------------------------
# Structure-aware: a series_dist, topology preserved
sys_min <- min_iid(d, m = 3)
class(sys_min)
dist.structure::min_paths(sys_min)
## -----------------------------------------------------------------------------
# Parallel: max of iid
sys_max <- max_iid(d, m = 3)
class(sys_max)
# k-th order statistic
sys_k <- order_statistic(d, k = 2, m = 5)
class(sys_k)
## -----------------------------------------------------------------------------
# Density of exp_series: dexp at the aggregate rate.
f <- density(exp_series(c(0.5, 0.3, 0.2)))
f(1)
dexp(1, rate = 1.0)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.