RegSL: Adjust a regression model using lasso and a simple regression...

Usage Arguments Value Author(s) Examples

View source: R/RegSL.R

Usage

1
RegSL(y,x,lagy=0,lagx=0,ini=0,out.of.sample=0)

Arguments

y

time series

x

covariables

lagy

how many lags of y should be tested if wanted.

lagx

how many lags of x should be tested if wanted.

ini

how many times of the beggining of series should be leave out of adjustment to keeping the model with lagy>0 or lagx>0 comparable with models with other lag options.

out.of.sample

how many times of the end of series should be leave out of testing sample for testing forecast.

Value

Returns the samples used to adjust and test model, predictions, prediction errors, simple and adjusted coefficients of determination, the estimated coefficients from regression with lasso and simple regression and p-values.

Author(s)

Coded by Luciene Gomes de Souza, last updated on 04-11-2016.

Examples

1
2
3
4
x <- cbind(rnorm(30),rnorm(30))
colnames(x)=c("x1","x2")
y <- x[,1] + x[,2] + rnorm(30)
tst=RegSL(y=y,x=x,lagy=0,lagx=0,nS=4,out.of.sample=5)

lucisouzarj/lasa documentation built on May 21, 2019, 8:54 a.m.