Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong name for sigma value from NNETAR #302

Closed
wkdavis opened this issue Aug 18, 2020 · 2 comments
Closed

Wrong name for sigma value from NNETAR #302

wkdavis opened this issue Aug 18, 2020 · 2 comments

Comments

@wkdavis
Copy link

wkdavis commented Aug 18, 2020

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.

@mitchelloharawild
Copy link
Member

I believe you're right. Fixed, thanks!

@wkdavis
Copy link
Author

wkdavis commented Aug 18, 2020

@mitchelloharawild Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants