The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [rstan]

Relating to the R bindings for mc-stan

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

RStan v.s. simple lm for multivariate regression [closed]

I want to fit a multivariate linear regression, with Y1 ... Y4 as the response and X1 ... Xn as the explanatory variables. X1 and X2 are two components of a mixture, and X3 ... Xn environmental ...
1
vote
1answer
58 views

Parameter Updates in Stan

I am working on an example in which I have obtained parameter estimates using Stan. In a real life scenario, I would receive more data every week. The data are covariates of a product which are used ...
3
votes
1answer
78 views

Why is a Gelman-Rubin diagnostic of < 1.1 considered acceptable?

In multiple sources a Gelman-Rubin MCMC convergence diagnostic of less than 1.1 is considered evidence that chains have converged. For example in this thread: https://stackoverflow.com/questions/...
2
votes
1answer
62 views

Nonlinear sin model with brms

I try to fit sin function with brms using next code: ...
1
vote
1answer
45 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
151 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
1answer
80 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
59 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
55 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
35 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
56 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
40 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
45 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 ...
2
votes
1answer
58 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
1k 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
1answer
97 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
47 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
15 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
367 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
46 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
232 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
335 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
95 views

How to add random walk in rstanarm [closed]

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