Description Usage Arguments Details Value References See Also Examples
View source: R/cochraneorcuttjva.R
Interactive method using to solve first order autocorrelation problems. This procedure estimates both autocorrelation and beta coefficients recursively until we reach the convergence (8th decimal). The residuals are computed after estimating Beta using EGLS approach and Rho is estimated using the previous residuals.
1 | cochrane.orcutt.jva(reg, convergence = 8, max.iter = 100)
|
reg |
a linear model built with lm function |
convergence |
decimal value to reach for convergence, 8 as default |
max.iter |
the maximum number of iterations to try before giving up on convergence, 100 as default |
This is a duplicate of the cochrane.orcutt()
function from package orcutt version 2.2, with the addition of an
upper limit on the number of iterations to avoid an infinite
while()
loop.
An object of class "orcutt". See cochrane.orcutt
Verbeek M. (2004) A guide to modern econometrics, John Wiley & Sons Ltd, ISBN:978-88-08-17054-5
1 2 3 4 5 6 7 8 | # example from orcutt package that converges
data(icecream, package="orcutt")
lm <- lm(cons ~ price + income + temp, data=icecream)
cochrane.orcutt.jva(lm)
# another example that doesn't converge
mydat <- data.frame(year=2013:2017, meas=c(14.8, 10.7, 6.2, 4, 3.9))
lmfit <- lm(meas ~ year, data=mydat)
cochrane.orcutt.jva(lmfit)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.