rec.reg {fDMA} | R Documentation |
Computes Recursive Regression.
Description
This function computes Recursive Regression.
Usage
rec.reg(y,x=NULL,c=NULL)
Arguments
y |
|
x |
|
c |
optional, |
Details
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.
Value
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 |
|
See Also
print.reg
, summary.reg
, plot.reg
.
Examples
wti <- crudeoil[-1,1]
drivers <- (lag(crudeoil[,-1],k=1))[-1,]
ld.wti <- (diff(log(wti)))[-1,]
ld.drivers <- (diff(log(drivers)))[-1,]
rec1 <- rec.reg(y=ld.wti,x=ld.drivers)
rec2 <- rec.reg(y=ld.wti)