selecRHLP implements a model selection procedure to select an optimal RHLP model with unknown structure.
selectRHLP(X, Y, Kmin = 1, Kmax = 10, pmin = 0, pmax = 4,
criterion = c("BIC", "AIC"), verbose = TRUE)
Numeric vector of length m representing the covariates/inputs
Numeric vector of length m representing the observed
response/output
The minimum number of regimes (RHLP components).
The maximum number of regimes (RHLP components).
The minimum order of the polynomial regression.
The maximum order of the polynomial regression.
The criterion used to select the RHLP model ("BIC", "AIC").
Optional. A logical value indicating whether or not a summary of the selected model should be displayed.
selectRHLP returns an object of class ModelRHLP
representing the selected RHLP model according to the chosen criterion
.
selectRHLP selects the optimal MRHLP model among a set of model
candidates by optimizing a model selection criteria, including the Bayesian
Information Criterion (BIC). This function first fits the different RHLP
model candidates by varying the number of regimes K
from Kmin
to Kmax
and the order of the polynomial regression p
from pmin
to pmax
. The
model having the highest value of the chosen selection criterion is then
selected.
# NOT RUN {
data(univtoydataset)
# Let's select a RHLP model on a time series with 3 regimes:
data <- univtoydataset[1:320,]
selectedrhlp <- selectRHLP(X = data$x, Y = data$y,
Kmin = 2, Kmax = 4, pmin = 0, pmax = 1)
selectedrhlp$summary()
# }
Run the code above in your browser using DataLab