Learn R Programming

fable (version 0.3.3)

residuals.VAR: Extract residuals from a fable model

Description

Extracts the residuals.

Usage

# S3 method for VAR
residuals(object, ...)

Value

A vector of fitted residuals.

Arguments

object

A model for which forecasts are required.

...

Other arguments passed to methods

Examples

Run this code
lung_deaths <- cbind(mdeaths, fdeaths) %>%
  as_tsibble(pivot_longer = FALSE)

lung_deaths %>%
  model(VAR(vars(mdeaths, fdeaths) ~ AR(3))) %>%
  residuals()

Run the code above in your browser using DataLab