predict.btsr {BTSR}R Documentation

Predict method for BTSR

Description

Predicted values based on btsr object.

Usage

## S3 method for class 'btsr'
predict(object, newdata, nnew = 0, debug = FALSE, ...)

Arguments

object

Object of class inheriting from "btsr"

newdata

A matrix with new values for the regressors. If omitted and "xreg" is present in the model, the fitted values are returned. If the model does not include regressors, the functions will use the value of nnew.

nnew

number of out-of-sample forecasts required. If newdata is provided, nnew is ignored.

debug

logical, if TRUE the output from Fortran is return (for debugging purposes). Default is debug = FALSE.

...

further arguments passed to or from other methods.

Details

predict.btsr produces predicted values, obtained by evaluating the regression function in the frame newdata.

If newdata is omitted the predictions are based on the data used for the fit.

For now, prediction intervals are not provided.

Value

If nnew = 0, returns a list with in-sample predictions (fitted.values, etat and error), otherwise, returns a list with the following arguments

Examples

#------------------------------------------------------------
# Generating a Beta model were mut does not vary with time
# yt ~ Beta(a,b), a = mu*nu, b = (1-mu)*nu
#------------------------------------------------------------

y <- btsr.sim(
  model = "BARFIMA", linkg = "linear",
  n = 100, coefs = list(alpha = 0.2, nu = 20)
)

# fitting the model
f <- btsr.fit(
  model = "BARFIMA", yt = y, report = TRUE,
  start = list(alpha = 0.5, nu = 10),
  linkg = "linear", d = FALSE
)

pred <- predict(f, nnew = 5)
pred$forecast


[Package BTSR version 1.0.0 Index]