Get "infinite gradient" error for code with finite gradient
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.1k
- Forks
- 266
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 1
Description
Summary:
I have a small example program that dies with "Rejecting initial value: Gradient evaluated at the initial value is not finite" even though the log probability has a finite gradient everywhere.
Description:
This is illustrated in the same example program as given in issue #274. Referencing the model code given there, I get the error if I keep the assignment to z_lo, but not if I remove the assignment to z_lo. But z_lo never enters into the log probability in any way!
The example may seem contrived, but it is boiled down from a more reasonable example in which z_lo is always computed, but never used in the cases for which lo is infinite.
Reproducible Steps:
See issue #274.
RStan Version:
2.9.0
R Version:
3.2.1
Operating System:
Mac OS X El Capitan
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 with the example program and model code referenced in issue #274, then reproduce the difference between keeping and removing the z_lo assignment. Trace why the finite-gradient check rejects the initial value despite z_lo not entering the log probability; done means the cause and affected behavior are understood and the error no longer occurs for this case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100