stan_gamm4: bug with polynomial parameter
Open
Nobody has claimed this yet.
bug
- Dominant language
- R
- Stars
- 401
- Forks
- 136
- PR merge metrics
- No merged PRs in 30d
Description
rstanarm appears to fail when entering a polynomial parameter:
This works
rstanarm::stan_gamm4(Sepal.Width ~ Sepal.Length + s(Petal.Width), random=~(1|Species), data=iris)
This doesn't
rstanarm::stan_gamm4(Sepal.Width ~ poly(Sepal.Length, 2) + s(Petal.Width), random=~(1|Species), data=iris)
Error in poly(Sepal.Length, 2) : object 'Sepal.Length' not found
Note that the same using gamm4 works:
gamm4::gamm4(Sepal.Width ~ poly(Sepal.Length, 2) + s(Petal.Width), random=~(1|Species), data=iris)
Is there a way to fix it?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the stan_gamm4 entry point and reproduce the failing iris example with poly(Sepal.Length, 2), then compare it with the working gamm4 call. Trace how the formula is evaluated and identify why Sepal.Length is unavailable; done means the polynomial example works and a regression test covers it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100