Skip to content

Wrong name for sigma value from NNETAR #302

@wkdavis

Description

@wkdavis

I believe there is an incorrect reference to the sigma attribute of NNETAR in generate.NNETAR(). It is referred to as sigma

sigma <- x$fit$sigma

When it reality I believe it should be sigma2, per the output of a NNETAR model:

library(fable)
#> Warning: package 'fable' was built under R version 3.6.2
#> Loading required package: fabletools
#> Warning: package 'fabletools' was built under R version 3.6.2
library(fabletools)
library(tsibbledata)
#> Warning: package 'tsibbledata' was built under R version 3.6.2
library(tsibble)
#> Warning: package 'tsibble' was built under R version 3.6.2

fit <- as_tsibble(airmiles) %>%
  model(nn = NNETAR(box_cox(value, 0.15)))

fit$nn[[1]]$fit$fit
#> # A tibble: 1 x 1
#>   sigma2
#>    <dbl>
#> 1  0.211

Created on 2020-08-18 by the reprex package (v0.3.0)

There error I was getting in my "production" dataset that lead me to this was Unknown or uninitialised column: 'sigma'., but I haven't been able to fully reproduce it because it requires passing through a series of if statements in train_nnetar, forecast.NNETAR, and generate.NNETAR that I haven't been able to replicate with reprex and package data from tsibbledata.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions