hilu | R Documentation |
If autocorrelated errors can be modeled by an AR(1) process (rho as parameter) then this function finds the rho value that that minimizes SSR in a Prais-Winsten transformed linear model. This is known as Hildreth and Lu estimation. The object returned by this command can be plotted using the plot()
function.
hilu(mod, data = list(), range = seq(-1, 1, 0.01), details = FALSE)
mod |
estimated linear model object or formula. |
data |
data frame to be specified if |
range |
defines the range and step size of rho values. |
details |
logical value, indicating whether details should be printed. |
A list object including:
results | data frame of basic regression results. |
idx.opt | index of regression that minimizes SSR. |
nregs | number of regressions performed. |
rho.opt | rho-value of regression that minimizes SSR. |
y.trans | optimal transformed y-values. |
X.trans | optimal transformed x-values (incl. z). |
all.regs | data frame of regression results for all considered rho values. |
rho.vals | vector of used rho values. |
Hildreth, C. & Lu, J.Y. (1960): Demand Relations with Autocorrelated Disturbances. AES Technical Bulletin 276, Michigan State University.
sales.est <- ols(sales ~ price, data = data.filter)
## In this example regressions over 199 rho values between -1 and 1 are carried out
## The one with minimal SSR is printed out
hilu(sales.est)
## Direct usage of a model formula
X <- hilu(sick ~ jobless, data = data.sick[1:14,], details = TRUE)
## Print full details
X
## Suppress details
print(X, details = FALSE)
## Plot SSR over rho-values to see minimum
plot(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.