Description Usage Arguments Details Value Examples
View source: R/wrappedCauchyFunctions.R
Fundamental periodic hazard function, mixed hazard function, and their (analytical) integrals.
1 2 3 4 5 6 7 |
t |
time (numeric, can be vectorized) |
mu |
mean peak |
rho |
concentration parameter (0 <= rho <= 1) |
tau |
period |
mus |
k-vector of mean peaks (assuming k seasons) |
rhos |
k-vector of concentration parameters |
gammas |
k-vector of average hazard values for each component |
These functions are mainly internal. wc
and iwc
are both parameterized in terms of
peak mean μ, concentration parameter ρ, and period τ and are "unweighted", i.e.
\int_0^τ f(t) dt = τ
The mixture model versions, mwc
and imwc
, are correspondingly parameterized in terms of
vectors mus
, rhos
, and also gammas
which correspond to the mean hazard contribution
of each peak, such that
\int_0^τ f(t) dt = kγτ
numeric value (or vector of values of same length as t
) of the respective function
1 2 3 4 5 6 7 8 9 10 11 12 13 | # wrapped Cauchy functions
curve(wc(x, mu = 100, rho = .7, tau = 365), xlim = c(0,365), n = 1e4,
ylab = "hazard", xlab = "time")
curve(wc(x, mu = 100, rho = .5, tau = 365), add = TRUE, col = 2)
curve(wc(x, mu = 100, rho = .3, tau = 365), add = TRUE, col = 3)
# mixed wrapped Cauchy functions
curve(mwc(x, mus = c(0.125, 0.5), rhos = c(0.7, 0.5),
gammas = c(2, 1), tau = 1), xlim = c(0,1), ylab = "hazard", xlab = "time")
curve(mwc(x, mus = c(0.25, 0.75), rhos = c(0.3, 0.8),
gammas = c(0.6, 0.4), tau = 1), add = TRUE, col = 2)
curve(mwc(x, mus = c(0.25, 0.5, 0.75), rhos = c(0.6, 0.5, 0.4),
gammas = c(0.5, 0.2, 0.3), tau = 1), add = TRUE, col = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.