fitted.nlVar: fitted method for objects of class nlVar, i.e. VAR and VECM models.

Description

Returns the fitted values of the model, either as computed in the model, or back to the original series level.

Usage

1
2
## S3 method for class 'nlVar'
fitted(object, level = c("model", "original"), ...)

Arguments

object

An object of class ‘nlVar’; generated by VECM or lineVar.

level

How to return the fitted values. See below.

...

Currently not used.

Details

In case of a VAR in differences, in ADF specification, or a VECM, the fitted values are actually in differences. With the option level="original", the function returns the series in the original level.

For VAR in levels, the two arguments are evidently the same and hence it is not taken into account, returning a warning.

Value

A matrix.

Author(s)

Matthieu Stigler

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## estimate models
data(barry)

ve <- VECM(barry, lag=2)
va <- lineVar(barry, lag=1)
va_diff <- lineVar(barry, lag=1, I="diff")
va_ADF <- lineVar(barry, lag=1, I="ADF")


## get fitted values:
tail(fitted(ve))
tail(fitted(ve, level="original"))

tail(fitted(va))
tail(fitted(object=va, level="original"))

tail(fitted(va_diff))
tail(fitted(object=va_diff, level="original"))

tail(fitted(va_ADF))
tail(fitted(object=va_ADF, level="original"))

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.