Learn R Programming

MARX (version 0.2)

arx.ls: The ARX estimation by OLS function

Description

This function allows you to estimate ARX models by ordinary least squares (OLS).

Usage

arx.ls(y, x, p)

Arguments

y

Data vector of time series observations.

x

Matrix of data (every column represents one time series). Specify NULL or "not" if not wanted.

p

Number of autoregressive terms to be included.

Value

coefficients

Vector of estimated coefficients.

coef.auto

Vector of estimated autoregressive parameters.

coef.exo

Vector of estimated exogenous parameters.

mse

Mean squared error.

residuals

Residuals.

loglikelihood

Value of the loglikelihood.

fitted.values

Fitted values.

df

Degrees of freedom.

vcov

Variance-covariance matrix of residuals.

Examples

Run this code
# NOT RUN {
data <- sim.marx(c('t',3,1),c('t',1,1),100,0.5,0.4,0.3)
arx.ls(data$y,data$x,2)
# }

Run the code above in your browser using DataLab