The function FilteringF gives the shape and scale parameters of the filtering and the one-step-ahead forecast distributions of the latent states.
FilteringF(formula,data,na.action="na.omit",pz=NULL,
nBreaks=NULL,model="Poisson",StaPar=NULL,a0=0.01,b0=0.01,amp=FALSE,
distl="PRED",splot=FALSE)
an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.
a data frame containing the variables in the model. The variables are: - the time series of interest Yt (first column of the data frame). the explanatory time series to be inserted in the model. - Xt must be always specified as a matrix of order n by p (after Yt). - the explanatory time series to be inserted in the mean of volatility model. Zt must be always specified as a matrix of order n by p (after Xt). - a censoring indicator of the event (a vector), only for the PEM. If the model is the PEM, put the variable Event in the secon column of tha data frame after Yt, and he explanatory time series after the variable Event.
a function which indicates what should happen when the data contain NAs. The default is set by the na.action setting of options, and is na.fail if that is unset. Optional argument.
the number of the explanatory time series to be inserted in the mean of volatility model. Default: NULL. Optional argument.
the number of breaks used to build a vector with the interval limits, only for the PEM. Optional argument.
the chosen model for the observations. The options are: Poisson, Normal, Gamma, Weibull, Generalized Gamma, Laplace, GED and PEM models.
a numeric vector of initial values for the static parameters. Optional argument.
the shape parameter of the initial Gamma distribution. Optional argument. Default: a0=0.01.
the scale parameter of the initial Gamma distribution. Optional argument. Default: b0=0.01.
the interval width is taken in account in the estimation of parameter w which controls the loss of information over time, only for the PEM. For more details see Santos et al. (2017). Default: FALSE. Optional argument.
the latent states distribution to be returned.
a plot with the point and interval estimates of the states is provided. Optional argument.
'att' is the shape parameter of the one-step-ahead forecast distribution of the states.
'btt' is the scale parameter of the one-step-ahead forecast distribution of the states.
'at' is the shape parameter of the filtering distribution of the states. It is necessary to specify this option in the argument 'distl'.
'bt' is the scale parameter of the filtering distribution of the states. It is necessary to specify this option in the argument 'distl'.
%% ...
Typical usages are
FilteringF(Yt~1,data=data.frame(Yt),StaPar=Par,model="Poisson", a0=0.01,b0=0.01,splot=TRUE)
Gamerman, D., Santos, T. R., and Franco, G. C. (2013). A Non-Gaussian Family of State-Space Models with Exact Marginal Likelihood. Journal of Time Series Analysis, 34(6), 625-645.
Santos T. R., Gamerman, D., Franco, G. C. (2017). Reliability Analysis via Non-Gaussian State-Space Models. IEEE Transactions on Reliability, 66, 309-318.
# NOT RUN {
library(NGSSEML)
Yt = c(1,2,1,4,3)
Par = c(0.9) #w
predpar = FilteringF(Yt~1, data = data.frame(Yt), StaPar = Par, model = "Poisson",
a0 = 0.01, b0 = 0.01, splot = FALSE)
filpar = FilteringF(Yt~1, data = data.frame(Yt), StaPar = Par, model = "Poisson",
a0 = 0.01, b0 = 0.01, distl = "FILTER", splot = FALSE)
# }
Run the code above in your browser using DataLab