txtn.eta: Calculate BMDL for a Given Changepoint Model, in Tmax / Tmin...

Description Usage Arguments Value

Description

For mean shifts detection in a bivariate time series. These functions can handle metadata.

Usage

1
txtn.eta(X, month, eta, meta, p, nu, alpha1, alpha2, period)

Arguments

X

A N by 2 matrix, observed time series data. Columns are Tmax and Tmin, respectively.

month

A vector of length N, month indicators. Takes value in 1, 2, ..., 12 for monthly data, or 1 for annual data.

eta

A N by 3 matrix, changepoint model. The first two columns are 0-1 indicators of changepoints for tmax and tmin, respectively, and the third column is the category 1-4 each time is in. The first p times are not allowed to be changepoints.

meta

A 0-1 indicator vector of length N, metadata indicator. The first p elemenet are always 0.

p

The order of the VAR process.

nu

Prior variance scale of mu; only used if fit == 'marlik'.

alpha1

The parameter in the Multinomial-Dirichlet prior of eta, for un-documented times (i.e., times not in metadata). Default value is c(3/7, 2/7, 2/7, 239) for monthly data, and c(3/7, 2/7, 2/7, 19) for annual data.

alpha2

The parameter in the Multinomial-Dirichlet prior of eta, for documented times (i.e., times in metadata). Default value is c(3/7, 2/7, 2/7, 47) for monthly data, and c(3/7, 2/7, 2/7, 3) for annual data.

period

Period of the seasonal cycle, 12 for monthly data and 1 for annual data.

Value

mdl

The Bayesian MDL score for the changepoint model eta.

Phi

A 2p by 2 matrix, the Yule-Walker estimator of the autocorrelation parameters Phi_1, ..., Phi_p, in a block matrix representation.

Sigma

A 2 by 2 matrix, the Yule-Walker estimator of the white noise covariance Sigma.

mu

A vector of length sum(eta[ , 1]) + sum(eta[ , 2]); the conditional posterior mean of regime-wise means (mu_1, mu_2).

s

A vector of length period, the EB estimator of the monthly means s.


yingboli/BayesMDL documentation built on May 29, 2019, 12:18 p.m.