View source: R/wrappedCauchyFunctions.R
| wc | R Documentation |
Fundamental periodic hazard function, mixed hazard function, and their (analytical) integrals.
wc(t, mu, rho, tau)
iwc(t, mu, rho, tau)
mwc(t, mus, rhos, gammas, tau)
imwc(t, mus, rhos, gammas, tau)
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 \mu, concentration parameter \rho, and period \tau and are "unweighted", i.e.
\int_0^\tau f(t) dt = \tau
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^\tau f(t) dt = k\gamma\tau
numeric value (or vector of values of same length as t) of the respective function
# 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.