stan-dev / stan-dev/rstanarm

Invalid stanfit object produced from stan_betareg... stan_glm worked fine?

Open
#576 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Summary:

I cannot run stan_betareg. Checked that all y variables are in hte proper support and updated the package. Still doesnt work

Description:

Running :
model<-stan_betareg(
linformula,
link=c('logit'),
data=train ,
model = TRUE,
x = TRUE,
y = TRUE,
contrasts = NULL,
weights = Insured.Acres,
QR=TRUE,
refresh=0,
prior= normal(0,2),
prior_intercept = normal(0,2)
)

[linformula is defined using as.formula to be:
PercentLoss ~ LossRatio.11 + ZeroIndemnities.11 + LossRatio.15 +
ZeroIndemnities.15 + LossRatio.16 + ZeroIndemnities.16 +
LossRatio.41 + ZeroIndemnities.41 + LossRatio.51 + ZeroIndemnities.51 +
LossRatio.78 + ZeroIndemnities.78 + LossRatio.81 + ZeroIndemnities.81 +
LossRatio.91 + ZeroIndemnities.91 + prec + dday0C + dday10C +
dday30C + prec2 + weightCovLevel.84 + totalpolicies | totalpolicies +
weightCovLevel.84 ]

gets the error:

[1] "Error in sampler$call_sampler(args_list[[i]]) : Initialization failed."
[1] "error occurred during calling the sampler; sampling not done"
Error in check_stanfit(stanfit) :
Invalid stanfit object produced please report bug

RStanARM Version:

2.21.3

R Version:

4.2.1

Operating System:

Your operating system (e.g., OS X 10.11.3)
Bugdata.csv

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

Reproduce the stan_betareg call with Bugdata.csv and the supplied formula, then inspect the sampler initialization failure before check_stanfit reports an invalid stanfit object. Confirm the missing operating-system details and compare the behavior with the working stan_glm case; done when the failure is reproducible with a clear cause or the call returns a valid stanfit object.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.