Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [rstan]

Relating to the R bindings for mc-stan

1
vote
1answer
24 views

Forward algorithm for ZIP - Hidden Markov model

I'm trying to adjust a Zero Inflated Poisson Hidden Markov Model with Stan. For the Poisson-HMM in a past forum this setting was shown. see link. While to adjust the ZIP with the classical theory is ...
0
votes
0answers
29 views

Suggested noninformative hyperprior distributions?

I have a hierarchical model that includes a normal distribution and a beta distribution. For the normal distribution, it has two parameters: $\mu$ and $\tau^2$. However, I want to implement ...
0
votes
0answers
22 views

Should weights be applied in generated quantities block in stan?

I want to do predictions via generated quantities block in stan. I have two questions: Should the weights be applied again in the generated quantities block in addition to the likelihood in the ...
0
votes
1answer
58 views

Curved regression lines

I had already asked a similar question here, but I'm experiencing the same problem for a different data-set and for a different family of mixed models. My response variable is a binary outcome of ...
0
votes
0answers
46 views

Non-straight lines in random intercept random slope plots

I'm trying to see how boldness of individuals change over time. For this, I constructed a repeated measures random intercept random slope model with boldness scores (measured as latency to resume ...
0
votes
1answer
25 views

Intercepts of repeated measures

I'm examining how boldness of individuals change with time. My data consists of individuals repeatedly measured across trials for boldness scores. First, I plotted each individual to see its mean and ...
0
votes
0answers
35 views

using rstanarm for quantile regression

I understand that rstanarm can be used for GLMs, GAMs and hierarchical models. Does anyone know, if I can use it to estimate quantile regression models? If not, are there other Baysian R package, ...
0
votes
1answer
31 views

how can this missing observation model be extended to include cases where sigma is a function of other variables?

Richard McElreath's blog entry Algebra and the Missing Oxen describes a simple missing observation model in RStan. At the end of the blog, he says it can be extended easily to cases in which the ...
0
votes
1answer
19 views

performance issues with linear mixed model

I am fitting a linear mixed model $y_{t} = \beta_0 + \beta_1x_{1t} + \beta_2x_{2t}+ \beta_{0i[t]} + \beta_{1i[t]}x_{1t} + \beta_{2i[t]}x_{2t} + \beta_{0j[t]} + \epsilon_t$ with ...
0
votes
0answers
41 views

Advice on the Efficiency of Stan Specification

I am interested to model the probability that a consumer will buy each of the choices available given the price of these choices. To model the probability, I represented the data in a new format and ...
2
votes
1answer
52 views

Modelling Parameter $r = \max\limits_{i = 1, \dots , 10} p_i - \min\limits_{i = 1, \dots , 10} p_i$ of Binomial Random Variable in Stan/RStan/R

I'm trying to use Stan and R to fit a model that, uhh, models the observed realisations $y_i = 16, 9, 10, 13, 19, 20, 18, 17, 35, 55$, which are from a binomial distributed random variable, say, $Y_i$,...
0
votes
1answer
492 views

hurdle model with non-zero gaussian distribution in R

I have biomass data (continuous response variable). If sufficient data is collected, the log(Biomass) follows a normal distribution. However, I am separating the overall biomass by family (i.e., ...
1
vote
0answers
66 views

Obtaining effect size from “rstanarm” package's linear regression

In my study a control group (c) is pretested (pre.c) and post-tested (pos.c). Similarly a ...
2
votes
0answers
37 views

Is there a way to use the brms function bayes_factor without having to refit models to not have prior samples?

In the brms package the function bayes_factor allows you to compare two models. Personally, I prefer the WAIC or LOO methods of comparing, but it is helpful to have both these and bayes factors for ...
0
votes
0answers
13 views

Is this a sensible way to examine the effects of x on y for two different groups?

Let's say I have data from a number of brain regions in both teenagers and adults. I want to know if brain regions b1, b2, etc (selected based on theory) differ in their effect on a normally ...
2
votes
1answer
267 views

What exactly does it mean that a 90% Credible Interval is computationally stable?

I was reading the rstanarm documentation and came across this about its use of 90% intervals as the default. I was hoping someone might be able to provide some clarification. Default 90% intervals ...
1
vote
1answer
41 views

Stan - find dimensions of an object - lower and upper question [closed]

I have a bunch of objects (roughly rectangular) , for some of which I know what their dimesions - x, y, and ...
1
vote
0answers
181 views

stan - 2 approaches to missing value imputation; which is better and why?

So, me and a colleague have to impute some data, x, given a categorical variable. We arrived at two different approaches: a) as in the tutorial: split x into x_obs and x_mis, and treat x_mis as ...
1
vote
1answer
232 views

Why does MCMCpack use normal priors when running Poisson regression?

I thought that since the conjugate prior of Poisson distribution is gamma, we needed to use that when assigning prior distributions to the beta coefficient. MCMCpack and rstanarm both specify a ...
0
votes
1answer
75 views

How to add random walk in rstanarm [closed]

I have used rstanarm GLM model without the intercept like below in R ...