Compilation error fitting the Stan model
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 1.1k
- Forks
- 266
- Avg merge
- 2h 56m
- Merged PRs (30d)
- 1
Description
I encountered compilation errors when fitting a Stan model as below,
fit1 <- stan(file='mystancode.stan', data=ds, refresh=1000, warmup = 2000, iter = 4000, cores = 1, chains=4, seed=100)
Within mystancode.stan, I defined an improper prior distribution on param as below,
functions { // declare and define user-defined function before calling it
real gen_penalty_lpdf(vector param, real s1, real s2, real s3) {
return -s1 * fabs(param[1])-s2 * fabs(param[2])-s3 * fabs(param[1]*param[2]);
}
}
And the error messages are,
trying deprecated constructor; please alert package maintainer
Error in new_CppObject_xp(fields$.module, fields$.pointer, ...) :
no valid constructor available for the argument list
failed to create the sampler; sampling not done
Any help or advice would be greatly appreciated!!!
RStan Version:
The version of RStan you are running (e.g., from packageVersion("rstan"))
‘2.17.2’
R Version:
The version of R you are running (e.g., from R.version.string)
3.5.1
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 by reproducing the stan call from the issue with RStan 2.17.2, R 3.5.1, and the supplied mystancode.stan function. Inspect whether the compilation failure comes from the model definition or the deprecated-constructor error, then document a reproducible cause and confirmed resolution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100