mtarmissing: Estimation of missing values of observed, covariate and...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/mtarmissing.R

Description

Estimation using Bayesian methodology of missing values in observed(output), covariate and threshold processes.

Usage

1
2
mtarmissing(ini_obj,niter = 1000, chain = FALSE, level = 0.95,
burn = NULL, cU = 0.5, b = NULL)

Arguments

ini_obj

class “regime_inipars” object, here specificate in pars: l, orders and r known. Not NULL

niter

numeric type, number of runs of MCMC. Default 1000

chain

logical type, if return chains of parameters. Default FALSE

level

numeric type, confident interval for estimations. Default 0.95

burn

numeric type, number of initial runs. Default NULL (10% of niter)

cU

numeric type, coefficient of the diagonal covariance matrix of process Ut = (Zt,Xt). Default 0.5

b

numeric type greater or equal 1, autoregressive order of Ut = (Zt,Xt). Default NULL meaning 1

Details

The MTAR model

Y_t= φ^{(j)}_{0}+ ∑_{i=1}^{p_j} φ_{i}^{(j)}Y_{t-i}+ ∑_{i=1}^{q_j}β_{i}^{(j)}X_{t-i} + ∑{i=1}^{d_j}δ_{i}^{(j)}Z_{t-i} +Σ_{(j)}^{1/2} ε_{t} if r_{j-1}< Z_t ≤ r_{j},

is written into a state space model with regime-switching where the matrices depend on the threshold variable. In order to estimate the missing data in the observed vector Y_t, it is necessary to obtain samples of the full conditional distribution of the state vector α_t, for all times t=1,\cdots,T using Kalman Filter. It is assumed that the process U_t=(X_t,Z_t) is a Markov chain, and in order to get samples of the full conditional distribution of U_t, t=1,\cdots,T, it is supposed that kernel and initial distribution are Gaussian for simplicity. However, in the next updates, we are going to get flexibility at this point.

Value

Return list type object of class “regime_missing

tsregime

ini_obj$tsregime_obj with estimated observations

estimates

credibility interval and mean of estimated missing values

Chain

if chain TRUE, chains of the estimated missing values

pos_na

list for where are the missing values in each process (Yt and Ut)

Author(s)

Valeria Bejarano vbejaranos@unal.edu.co, Sergio Calderon sacalderonv@unal.edu.co & Andrey Rincon adrincont@unal.edu.co

References

Calderon, S. and Nieto, F. (2017) Bayesian analysis of multivariate threshold autoregress models with missing data. Communications in Statistics - Theory and Methods 46 (1):296–318. doi:10.1080/03610926.2014.990758.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data("datasim")
yt = datasim$Sim
# some missing data
data_yt = yt$Yt
data_zt = yt$Zt
posNA = sample(c(1:500),8)
data_yt[c(posNA),] = c(NA,NA)
posNA = sample(c(1:500),8)
data_zt[c(posNA)] = NA
data_final = tsregime(data_yt,data_zt,r = yt$r)
autoplot.tsregime(data_final,1)
autoplot.tsregime(data_final,2)

initial = mtarinipars(tsregime_obj = data_final,
list_model = list(pars = list(l = 2,r = datasim$Sim$r,
orders = list(pj = c(1,1), qj = c(0,0),dj = c(0,0)))))

missingest = mtarmissing(ini_obj = initial,chain = TRUE,
niter = 500,burn = 500)
print(missingest)
autoplot.regime_missing(missingest,1)
datasim$Sim$Yt[is.na(data_yt[,1]),]
missingest$tsregime$Yt[is.na(data_yt[,1]),]

adrincont/BMTAR documentation built on Jan. 22, 2022, 2:09 p.m.