Usage
bcpmeta.model(X, meta, iter = 10000, thin = 10, trend = TRUE, EB = TRUE, mu0 = NULL, nu0 = 5, a1 = 1, a2 = 1, b1 = 19, b2 = 3, phi.lower = -0.99, phi.upper = 0.99, start.eta = NULL, track.time = TRUE, show.summary = TRUE, start.year = 1, meta.year = FALSE)
Arguments
X
a numerical vector. Observed time series.
meta
metadata. Either a vector of 0-1 indicators of the same length as X
,
or a numerical vector of the time indice of the metadata times.
iter
total number of iterations of MCMC.
thin
thinning; save one iteration in every thin
number of iterations.
trend
logical indicating whether to allow the linear trend component.
EB
logical indicating whether to use the empirical Bayes method
for sigma^2 and phi.
mu0
prior mean of regime-wise means mu_j.
If NULL
, set to the default value mean(X)
.
nu0
constant factor in prior variance of regim-wise means mu_j.
a1
the first parameter in the Beta-Binomial prior of non-metadata times.
a2
the first parameter in the Beta-Binomial prior of metadata times.
b1
the second parameter in the Beta-Binomial prior of non-metadata times.
b2
the second parameter in the Beta-Binomial prior of metadata times.
phi.lower
lower bound of the range of phi
phi.upper
upper bound of the range of phi
start.eta
initial value of the changepoint configuration eta
for the MCMC. If NULL
, generated randomly.
track.time
logical indicating whether to show process time.
show.summary
logical indicating whether to show the top 5 configurations.
start.year
year index of the first time point in the series.
meta.year
logical indicating whether meta
is indexed in year,
if it consists of the locations of the metadata times (instead of 0-1 indicators).