rec.reg | R Documentation |
This function computes Recursive Regression.
rec.reg(y,x=NULL,c=NULL)
y |
|
x |
|
c |
optional, |
It might happen during computations that lm
(which is used inside rec.reg
) will produce NA
or NaN
. In such a case regression coefficients for a given period are taken as 0
and p-values for t-test for statistical significance of regression coefficients are taken as 1
.
It is not possible to set c=FALSE
if x=NULL
. In such a case the function will automatically reset c=TRUE
inside the code.
class reg
object, list
of
$y.hat |
fitted (forecasted) values |
$AIC |
Akaike Information Criterion (from the current set of observations) |
$AICc |
Akaike Information Criterion with a correction for finite sample sizes (from the current set of observations) |
$BIC |
Bayesian Information Criterion (from the current set of observations) |
$MSE |
Mean Squared Error (from the current set of observations) |
$coeff. |
regression coefficients |
$p.val |
p-values for t-test for statistical significance of regression coefficients |
$y |
|
print.reg
, summary.reg
, plot.reg
.
wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- drivers[-1,]
ld.drivers[,c(4,6)] <- (diff(drivers[,c(4,6)]))[-1,]
ld.drivers[,c(1:2,5,7)] <- (diff(log(drivers[,c(1:2,5,7)])))[-1,]
ld.drivers[,c(3,6)] <- ld.drivers[,c(3,6)]/100
rec1 <- rec.reg(y=ld.wti,x=ld.drivers)
rec2 <- rec.reg(y=ld.wti)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.