Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/bcpmeta.parameters.R
Given a changepoint configuration, use Gibbs sampler (or Metropolis-Hastings algorithm within Gibbs) to find posterior mean estimates of model parameters.
1 2 3 4 5 |
X |
a numerical vector. Observed time series. |
meta |
metadata. Either a vector of 0-1 indicators of the same length as |
eta |
the changepoint configuration. Either a vector of 0-1 indicators of the same length as |
iter |
total number of iterations of MCMC. |
thin |
thinning; save one iteration in every |
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 |
nu0 |
constant factor in prior variance of regim-wise means mu_j. |
phi.lower |
lower bound of the range of phi |
phi.upper |
upper bound of the range of phi |
sd.xi |
standard deviation of the jump proposal of log(phi) in Metropolis-Hastings updating when the fully Bayes method is used. |
start.phi |
initial value phi for the MCMC when the fully Bayes method is used. If |
burnin |
the ratio of burnin length compared with the total length of MCMC. All posterior mean estimates are calculated without burnin periods. |
track.time |
logical indicating whether to show process time. |
show.summary |
logical indicating whether to show the estimates of parameters. |
start.year |
year index of the first time point in the series. |
meta.year |
logical indicating whether |
eta.year |
logical indicating whether |
Conditional on the given changepoint configuration eta,
the posterior mean estimates of regime-wise mean mu and trend alphla (if trend == TRUE
) is obtained via Gibbs sampler.
If EB == TRUE
, empirical Bayes estimates of sigma2 and phi are given; otherwise, fully Bayes estimates of them
are obtained via Gibbs sampler and Metropolis-Hastings algorithm, under Jeffreys prior and uniform prior respectively.
Phi |
the empirical Bayes estimate of phi if |
Sigmasq |
the empirical Bayes estimate of sigma2 if |
Alpha |
a vector of length |
Mu |
a |
phi.est |
the empirical Bayes estimate of phi if |
sigmasq.est |
the empirical Bayes estimate of sigma2 if |
alpha.est |
posterior mean estimate of alpha |
mu.est |
a vector of length |
X |
observed time series, same as the input value. |
meta |
metadata, same as the input value. |
input.parameters |
input parameters. Use command |
change.phi |
ratio of accepting a new phi in the MCMC chain, if |
Yingbo Li
Maintainer: Yingbo Li <ybli@clemson.edu>
Li, Y. and Lund, R. (2014) Bayesian Mulitple Changepoint Detection Using Metadata. (submitted)
Function cp.plot
uses the output of this function as input.
1 2 3 4 5 6 7 | ## Create a time series of length 200 with three mean shifts at 50, 100, 150.
data = simgen(2, 1);
X = data$X[1, ]; ## time series
meta = data$meta; ## locations of metadata times
## Parameter estimation in the configuration where changepoints are time 50 and 99.
results = bcpmeta.parameters(X, meta = meta, eta = c(50, 99), trend = FALSE);
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.