Skip to main content

Questions tagged [rstan]

Relating to the R bindings for mc-stan

0 votes
1 answer
53 views

Title: How to fit a Frequentist Equivalent of Bayesian mixed-effects model with nlme or lme4 and obtain category-specific variances and intercepts?

I am interested in fitting a Bayesian mixed-effects model to my data using the brms package. My data includes three grouping variables (Category, BioRep, and TechRep), and I want to estimate category-...
Dermot Harnett's user avatar
2 votes
0 answers
182 views

Hurdle model for non-count continuous data with both positive and negative values

I am aiming to estimate a hurdle model (where being non-zero is the hurdle) in the vein of Cragg. My data is both positive and negative where the data reflects the difference between a value reported ...
peterr's user avatar
  • 21
1 vote
1 answer
36 views

Why am I getting negative means from a hierarchical clustering model fitted to binomial data using RStan

Apologies in advance - I'm new to Bayesian statistical methods and may not get all the terminology correct. I am trying to run some Bayesian analysis on survey data using the rstan package in R but I'...
Ellie's user avatar
  • 11
1 vote
0 answers
70 views

Quadratic regression with orthogonal polynomials vs. raw polynomials with QR decomposition

I'm using rstanarm to estimate random slopes for second-order polynomial coefficients. My model has the basic form: ...
sjs_999's user avatar
  • 11
0 votes
1 answer
164 views

CIs for random intercepts from gam and stan_gamm4 are similar, but those from gamm4 are not. why?

Question: how can one obtain a good confidence interval for the estimated random effects from gamm4? Motivation: The example below, using binomial data with a random intercept, shows that estimated ...
Greg Dropkin's user avatar
0 votes
0 answers
435 views

Can we define inverse gamma priors in stan_glmer()?

Although I tried to read the manual, I don't quite see how I can incorporate the following model in stan_glmer(). $Y_{ij}|\mu_j,\sigma_y \sim N(\mu_j,\sigma_y^2)$ $\...
Blain Waan's user avatar
  • 3,605
1 vote
1 answer
124 views

How to write proportionality in a Stan model?

I am having difficulties in writing the following equation into a Stan model. $$ y_i = \mu(x_i) + \epsilon_i \\ \epsilon_i \sim N(\theta,\sigma^2) \\ \mu(x_i) = a + b x_i \\ p(a) = p(b) \propto 1 \\ \...
John's user avatar
  • 11
1 vote
1 answer
156 views

Help with rstan models [closed]

I would need help in order to write a specific Stan model. The biological question The idea of the model is modeling the number of Bones (NbBones : discret ...
chippycentra's user avatar
0 votes
1 answer
299 views

How do I write the Jeffreys prior for error variances in stan? $p(\mu, \sigma_1^2, \dots, \sigma_C^2) \propto \Pi{ \sigma_i^{-2}}$ [closed]

I need to model the Jeffreys prior for error variances in a heteroscedastic ANOVA design in rstan. That is to say, $\pi(\mu,\sigma_1^2,\dotsb,\sigma_C^2)\varpropto\Pi_{i=1}^{C}\sigma_i^{-2}$. Is the ...
Dexter SherloConan's user avatar
0 votes
1 answer
326 views

Reporting guideline for bayesian using pd and ROPE

In the bayestestR articles, I came across the reporting guidelines that they recommend “the effect of X has a probability of pd of being negative (Median = median, ...
HNSKD's user avatar
  • 227
1 vote
0 answers
436 views

Is my Stan model correct? The Jeffreys prior for a heteroscedastic mixed-effects model

I am using rstan to obtain MCMC samples from a heteroscedastic mixed-effects model with different residual variances $\sigma_j^2$ for each experimental condition $j$. One assumption is the Jeffreys ...
Dexter SherloConan's user avatar
1 vote
0 answers
121 views

Find latent variable using rSTAN

I have the following simulated data: ...
zlon's user avatar
  • 718
0 votes
1 answer
712 views

How to extract predicted values from stan_lmer()

I fitted a stan_lmer model and tried to extract predicted (predict() function) but R suggested me to use posterior_predict() but cannot at this point plot the predicted vs observed plot, as I have a ...
atnplab's user avatar
  • 11
2 votes
0 answers
156 views

How to define informative priors from previous studies using stan_glm?

I am trying to develop a linear regression model for estimating stature from handprint measurements. I would like to employ the Bayesian approach and define informative priors from the previous ...
ivanJ's user avatar
  • 21
0 votes
1 answer
814 views

R Stan: Rejecting initial value error only with real data, not with simulated data

I am trying to fit a non-linear function to a dataset using Stan and R. I tested my model with a simulated dataset. It works nicely. However, as soon as I use real data that is formatted exactly the ...
Max J.'s user avatar
  • 113

15 30 50 per page