Learn R Programming

NGSSEML (version 1.0)

LikeF2: Auxiliar Marginal Likelihood Function

Description

This function is an auxiliar function of the package that computes the marginal likelihood function of the transformed static parameters of the model. All transformed static parameters have values in the interval (-Inf, Inf). The marginal likelihood function is the 'LikeF' function.

Usage

LikeF2(formula, data,na.action="na.omit",pz=NULL,
nBreaks=NULL,model="Poisson",StaPar=NULL,a0=0.01,b0=0.01,amp=FALSE)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted.

data

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.

na.action

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.

pz

the number of the explanatory time series to be inserted in the mean of volatility model. Default: NULL. Optional argument.

nBreaks

the number of breaks used to build a vector with the interval limits, only for the PEM. Optional argument.

model

the chosen model for the observations. The options are: Poisson, Normal, Gamma, Weibull, Generalized Gamma, Laplace, GED and PEM models.

StaPar

a numeric vector of initial values for the static parameters. Optional argument.

a0

the shape parameter of the initial Gamma distribution. Optional argument. Default: a0=0.01.

b0

the scale parameter of the initial Gamma distribution. Optional argument. Default: b0=0.01.

amp

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.

Value

llik

This function returns the value of the marginal likelihood function in the logarithmic scale multiplied by -1.

Details

Typical usages are

LikeF2(Ytm~Trend+CosAnnual+SinAnnual+CosSemiAnnual+SinSemiAnnual,
data=data.frame(Ytm,Xtm),model="Poisson",
StaPar=c(log(-log(0.8)),-0.1,0.01,0.01,0.01,0.01),a0=0.01,b0=0.01)

References

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.

See Also

LikeF FilteringF SmoothingF

Examples

Run this code
# NOT RUN {
library(NGSSEML)
data(gte_data)
Ytm=gte_data$V1
Xtm=NULL
Ztm=NULL
Eventm=gte_data$V2
model="PEM"
LikeF2(Ytm~1,data=data.frame(Ytm,Eventm),model="PEM",StaPar=c(log(-log(0.8))))

# }

Run the code above in your browser using DataLab