regpred {rego}R Documentation

Automatic Time Series forecasting and Missing Value Imputation.

Description

Automatic time series prediction and missing value imputation.

Usage

  regpred(Data, from_lag=1, max_lag="auto", alpha=0.05, nsim=1000, flg_print=1, 
          direction="->", flg_const=TRUE, flg_diff=FALSE, model=NULL)

Arguments

Data

data.frame containing target variable at first column and regressors if present from second to last column.

from_lag

minimum time lag to be considered in the autoregressive moving average part of the algorithm.

max_lag

maximum time lag to be considered in the autoregressive moving average part of the algorithm. If "auto" then the algorithm will set a suitable value. Set to 0 or NULL if you want to remove the autoregressive moving average part as in case of non time series data.

alpha

significance level for the confidence interval produced around predictions. If 0.05 then the algorithm will calculate a 95% confidence interval around predictions.

nsim

number of bootstrap replications used for producing confidence interval around predictions.

flg_print

if 1 some information during the evaluation will be printed.

direction

if "->" then only a forward prediction will be executed, if "<-" then only a backward prediction will be executed, if "<->" then both a forward than a backward prediction will be executed if possible. For imputing missing values is convenient to leave default "<->".

flg_const

if 1 then a constant is included into the model.

flg_diff

if 1 and no regressor is present then if the target variable exhibits a trend, it is one-step differentiated up to two times.

model

estimated models from a previous train to be used in new data prediction without retraining.

Value

An object of class list with predictions and models.

Author(s)

Davide Altomare (info@channelattribution.io).

References

rego Documentation

Examples


## Not run: 

#example 1: seasonal time series

library(rego)

data(Data)

res=regpred(Data)

#print final prediction 
print(res$prediction)

#example 2: high dimensional problem

Data=read.csv(url("https://channelattribution.io/csv/Data_sim_1000.csv"),header=FALSE)

res=regpred(Data, max_lag=NULL)

#print final prediction 
print(res$prediction)



## End(Not run)


[Package rego version 1.6.1 Index]