tidyverts / tidyverts/fable

Excessive division by df in `generate.TSLM()` to obtain the variance of innovations?

Open
#381 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
588
Forks
71
Avg merge
1h 58m
Merged PRs (30d)
1

Description

In generate.TSLM(), the variance of generated (non-bootstrapped) innovations is obtained as x$sigma2 / x$df.residual:

https://github.com/tidyverts/fable/blob/a9404d8bdbd2990a49fffcc43257f8a6e9f9a5d3/R/lm.R#L331

Correct me if I'm wrong, but I believe that plain x$sigma2 is in fact the variance we would like to use (sigma2 is obtained as rss/df, I don't see the point of further division by df).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in R/lm.R at generate.TSLM() around line 331, and inspect how x$sigma2 and x$df.residual are defined and used for non-bootstrapped innovations. Confirm which variance is intended, then update the behavior if needed and verify that generated innovation variance matches the issue's expectation.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.