fit_eta: Fit an individual changepoint model 'eta'

Description Usage Arguments Value

Description

Compute the objective function of the model, i.e., log of posterior proablity for BMDL, or log MDL, and estimate model parameters.

Usage

1
2
fit_eta(x, A, eta, xi, p = 2, fit = "marlik", penalty = "bmdl", nu = 5,
  kappa = 3, a = 1, b = 1, scale_trend_design = 0.05, weights = NULL)

Arguments

x

The time series data, a numeric vector of length n.

A

The design matrix for the nuisance coefficients in the linear model. It is usually the matrix of seasonal indicators, or the design matrix for harmonic regression with a column of all 1 for intercept.

eta

A multiple changepoint configuration, i.e., model. It is a 0/1 indicator vector of length n, with the first p elemenets always being 0.

xi

Outliers indicator, a 0/1 vector of length n.

p

The order of the AR process.

fit

For likelihood calculation, 'marlik' for marginal likelihood, or 'lik' for likelihood. Note that the 'lik' option already includes the two-part MDL of mu.

penalty

For penalty function calculation, 'bmdl' for Beta-Binomial prior, or 'mdl' for MDL.

nu

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

kappa

Prior variance scale of outliers.

a, b

The first and second parameters in the Beta-Binomial prior; only used if penalty == 'bmdl'.

scale_trend_design

The factor multiplied to the design matrix of trend. Default is 1/50.

weights

A numeric vector of observation weights, defined the same as the weights argument in the function lm.

Value

bmdl

BMDL or MDL.

s

Estimates of nuisance coefficients in the linear model. It usually contains the seasonal means or coefficients of harmonic regression (with intercept).

mu

Estimates of regime-wise coefficients in the linear model. It usually contains the regime means and regime trends.

sigmasq

Estimate of σ^2 in the AR(p) process.

phi

Yule-Walker estimates of the AR(p) coefficients.


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