dyn-package: Time Series Regression

Description Details Examples

Description

Time series regression. The dyn class interfaces ts, irts, its, zoo and zooreg time series classes to lm, glm, loess, quantreg::rq, MASS::rlm, quantreg::rq, randomForest::randomForest and other regression functions allowing those functions to be used with time series including specifications that may contain lags, diffs and missing values.

Details

"dyn" allows one to use time series with regression functions that were not originally written to support time series by simply prefacing the call to the regression function with "dyn$". The following are sources of information on "dyn":

Overview file.show(system.file("README", package = "dyn"))
News RShowDoc("NEWS", package = "dyn")
Acknowledgements RShowDoc("THANKS", package = "dyn")
Wish List RShowDoc("WISHLIST", package = "dyn")
License RShowDoc("COPYING", package = "dyn")
Citation citation(package = "dyn")
List of all demo files demo(package = "dyn"))
Invoking a demo file demo("dyn-rq")
Source of demo file file.show(system.file("dyn-rq.R", package = "dyn"))
This File package?dyn
Help file ?dyn

Examples

1
2
3
4
x <- ts(seq(10)^2)
dyn$lm(x ~ lag(x,-1))
dyn$glm(x ~ lag(x,-1))
dyn$loess(x ~ lag(x,-1))

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric


Call:
lm(formula = dyn(x ~ lag(x, -1)))

Coefficients:
(Intercept)   lag(x, -1)  
      4.976        1.190  


Call:  glm(formula = dyn(x ~ lag(x, -1)))

Coefficients:
(Intercept)   lag(x, -1)  
      4.976        1.190  

Degrees of Freedom: 8 Total (i.e. Null);  7 Residual
  (2 observations deleted due to missingness)
Null Deviance:	    8948 
Residual Deviance: 11.72 	AIC: 33.92
Call:
loess(formula = dyn(x ~ lag(x, -1)))

Number of Observations: 9 
Equivalent Number of Parameters: 5.3 
Residual Standard Error: 0.2286 

dyn documentation built on May 1, 2019, 9:12 p.m.