# \#specification

**URL:** https://discourse.mc-stan.org/tag/specification/17.md

[Latest](https://discourse.mc-stan.org/latest.md) · [Categories](https://discourse.mc-stan.org/categories.md) · [Tags](https://discourse.mc-stan.org/tags.md)

---

## [A "squashed" normal distribution](https://discourse.mc-stan.org/t/a-squashed-normal-distribution/41655)

<div class="topic-metadata">

**Author:** [@maxgotts](https://discourse.mc-stan.org/u/maxgotts)\
**Replies:** 10\
**Last updated:** [November 2, 2026, 6:44am UTC](https://discourse.mc-stan.org/t/a-squashed-normal-distribution/41655 "2026-11-02T06:44:11Z")

</div>

I often find myself trying to fit a normal distribution that is skewed. Not a “skewed normal distribution,” but a normal distribution with one side cut to nearly zero. I’ve even gone as far as trying to make a custom log…

---

## [Bmm 1.4.1: signal detection and MPT models on CRAN](https://discourse.mc-stan.org/t/bmm-1-4-1-signal-detection-and-mpt-models-on-cran/41683)

<div class="topic-metadata">

**Author:** [@g.frischkorn](https://discourse.mc-stan.org/u/g.frischkorn)\
**Replies:** 2\
**Last updated:** [October 19, 2026, 6:32pm UTC](https://discourse.mc-stan.org/t/bmm-1-4-1-signal-detection-and-mpt-models-on-cran/41683 "2026-10-19T18:32:29Z")

</div>

bmm (Bayesian Measurement Modeling) fits hierarchical measurement models of cognition through brms and Stan. Version 1.4.1 adds signal detection theory models for yes/no, m-AFC, ranking, confidence-rating (with dual-proc…

---

## [How to choose a prior for the count parameter](https://discourse.mc-stan.org/t/how-to-choose-a-prior-for-the-count-parameter/41653)

<div class="topic-metadata">

**Author:** [@yanmin](https://discourse.mc-stan.org/u/yanmin)\
**Replies:** 3\
**Last updated:** [November 5, 2026, 9:08am UTC](https://discourse.mc-stan.org/t/how-to-choose-a-prior-for-the-count-parameter/41653 "2026-11-05T09:08:19Z")

</div>

In the case of the Beta, the obvious choice for reparameterization is in terms of a mean parameter \\phi = \\alpha /(\\alpha + \\beta) and total count parameter \\lambda = \\alpha + \\beta in the Stan user guide, the coun…

---

## [Can some individual-level predictors included in the regression model be excluded from the poststratification frame?](https://discourse.mc-stan.org/t/can-some-individual-level-predictors-included-in-the-regression-model-be-excluded-from-the-poststratification-frame/41592)

<div class="topic-metadata">

**Author:** [@yanmin](https://discourse.mc-stan.org/u/yanmin)\
**Replies:** 2\
**Last updated:** [September 17, 2026, 1:37am UTC](https://discourse.mc-stan.org/t/can-some-individual-level-predictors-included-in-the-regression-model-be-excluded-from-the-poststratification-frame/41592 "2026-09-17T01:37:05Z")

</div>

In multilevel regression and poststratification (MRP), do all individual-level predictors included in the regression model need to be available in the poststratification frame? For example, if the poststratification fram…

---

## [How to specify non centered parameterization for sigma in a distributional model in brms](https://discourse.mc-stan.org/t/how-to-specify-non-centered-parameterization-for-sigma-in-a-distributional-model-in-brms/41570)

<div class="topic-metadata">

**Author:** [@rstanuser](https://discourse.mc-stan.org/u/rstanuser)\
**Replies:** 8\
**Last updated:** [September 7, 2026, 11:13pm UTC](https://discourse.mc-stan.org/t/how-to-specify-non-centered-parameterization-for-sigma-in-a-distributional-model-in-brms/41570 "2026-09-07T23:13:28Z")

</div>

I want to fit a distributional model with brms along the following lines: df \<- data.frame() # some columns include: # value (continuous, zero-mean), # afactor (3 levels), bfactor (7 levels), # gfactor (240 level…

---

## [Difficulty adding loo criterion to longitudinal truncated normal model](https://discourse.mc-stan.org/t/difficulty-adding-loo-criterion-to-longitudinal-truncated-normal-model/41447)

<div class="topic-metadata">

**Author:** [@llewmills](https://discourse.mc-stan.org/u/llewmills)\
**Replies:** 14\
**Last updated:** [July 24, 2026, 8:44am UTC](https://discourse.mc-stan.org/t/difficulty-adding-loo-criterion-to-longitudinal-truncated-normal-model/41447 "2026-07-24T08:44:14Z")

</div>

I am analysing data from a clinical trial comparing placebo to active medication at multiple timepoint. One of my outcomes has a pronounced right-skew. The overwhelming majority of observations are between 0 and 0.03 but…

---

## [Using Laplace approximation for logistic normal multinomial model](https://discourse.mc-stan.org/t/using-laplace-approximation-for-logistic-normal-multinomial-model/41305)

<div class="topic-metadata">

**Author:** [@Yingnan\_Gao](https://discourse.mc-stan.org/u/Yingnan_Gao)\
**Replies:** 15\
**Last updated:** [July 14, 2026, 6:11pm UTC](https://discourse.mc-stan.org/t/using-laplace-approximation-for-logistic-normal-multinomial-model/41305 "2026-07-14T18:11:36Z")

</div>

Hello Stan community, I posted a thread regarding some difficult geometries I encountered for fitting logistic normal multinomial model with explicit latent residuals (so that the likelihood can be evaluated for observe…

---

## [Multilevel multiresponse phylogenetic mixed models with brms](https://discourse.mc-stan.org/t/multilevel-multiresponse-phylogenetic-mixed-models-with-brms/41411)

<div class="topic-metadata">

**Author:** [@Anoban](https://discourse.mc-stan.org/u/Anoban)\
**Replies:** 4\
**Last updated:** [July 10, 2026, 2:48am UTC](https://discourse.mc-stan.org/t/multilevel-multiresponse-phylogenetic-mixed-models-with-brms/41411 "2026-07-10T02:48:26Z")

</div>

Hi folks! I’m a 2nd year PhD student studying root ecological strategies and mycorrhizal outsourcing. I’m interested in understanding how the evolution of three response variables (three root traits) is influenced by a …

---

## [Prior/link selection for sigma in distributional Gaussian model](https://discourse.mc-stan.org/t/prior-link-selection-for-sigma-in-distributional-gaussian-model/41369)

<div class="topic-metadata">

**Author:** [@rstanuser](https://discourse.mc-stan.org/u/rstanuser)\
**Replies:** 3\
**Last updated:** [June 16, 2026, 3:12pm UTC](https://discourse.mc-stan.org/t/prior-link-selection-for-sigma-in-distributional-gaussian-model/41369 "2026-06-16T15:12:10Z")

</div>

I want to fit a distributional model with brms along the following lines: df \<- data.frame() # some columns include: value (continuous, zero-mean), afactor (3 levels), bfactor (7 levels), ... frml \<- bf( value ~ 0 + I…

---

## [A sufficient implementation of the multivariate normal lpdf](https://discourse.mc-stan.org/t/a-sufficient-implementation-of-the-multivariate-normal-lpdf/41346)

<div class="topic-metadata">

**Author:** [@markjrieke](https://discourse.mc-stan.org/u/markjrieke)\
**Replies:** 5\
**Last updated:** [June 9, 2026, 5:47pm UTC](https://discourse.mc-stan.org/t/a-sufficient-implementation-of-the-multivariate-normal-lpdf/41346 "2026-06-09T17:47:12Z")

</div>

I worked out a sufficient implementation of the multivariate normal. Compute the element-wise sums of \\sum \\mathbf{y} \\mathbf{y}^{\\text{T}} and \\sum \\mathbf{y}^\\text{T} (xxts and xts in the function below), then pass to …

---

## [Resolving difficult geometry in logistic normal multinomial model](https://discourse.mc-stan.org/t/resolving-difficult-geometry-in-logistic-normal-multinomial-model/41296)

<div class="topic-metadata">

**Author:** [@Yingnan\_Gao](https://discourse.mc-stan.org/u/Yingnan_Gao)\
**Replies:** 2\
**Last updated:** [June 7, 2026, 2:02am UTC](https://discourse.mc-stan.org/t/resolving-difficult-geometry-in-logistic-normal-multinomial-model/41296 "2026-06-07T02:02:45Z")

</div>

Hello all, I have been benchmarking a logistic normal multinomial model with an arbitrary correlation matrix as a parameter. I simulated some data following the logistic normal multinomial model and I fitted the simulate…

---

## [Gut check---correct model for bayesian meta-analysis of two proportions?](https://discourse.mc-stan.org/t/gut-check-correct-model-for-bayesian-meta-analysis-of-two-proportions/41330)

<div class="topic-metadata">

**Author:** [@arc\_circle\_square](https://discourse.mc-stan.org/u/arc_circle_square)\
**Replies:** 3\
**Last updated:** [June 5, 2026, 6:45pm UTC](https://discourse.mc-stan.org/t/gut-check-correct-model-for-bayesian-meta-analysis-of-two-proportions/41330 "2026-06-05T18:45:03Z")

</div>

I want to estimate (something like) the proportion of U.S. adults who use mobile banking. And suppose I try to do it like this: P(mobile banking) = P(smartphone owner) x P(mobile banking | smartphone owner) I have two …

---

## [A faster implementation of hierarchical models](https://discourse.mc-stan.org/t/a-faster-implementation-of-hierarchical-models/41120)

<div class="topic-metadata">

**Author:** [@Rick\_RS95](https://discourse.mc-stan.org/u/Rick_RS95)\
**Replies:** 22\
**Last updated:** [May 20, 2026, 11:34am UTC](https://discourse.mc-stan.org/t/a-faster-implementation-of-hierarchical-models/41120 "2026-05-20T11:34:22Z")

</div>

Hi all! I am sure many of you know useful tricks to make hierarchical models fit faster. I have been trying different things for a while, and I would like to share a specification that is very fast and that, as far as I…

---

## [Using projpred with a hierarchical Stan model with posterior-draw measurement error](https://discourse.mc-stan.org/t/using-projpred-with-a-hierarchical-stan-model-with-posterior-draw-measurement-error/41082)

<div class="topic-metadata">

**Author:** [@ViktorVdV](https://discourse.mc-stan.org/u/ViktorVdV)\
**Replies:** 3\
**Last updated:** [May 7, 2026, 9:30am UTC](https://discourse.mc-stan.org/t/using-projpred-with-a-hierarchical-stan-model-with-posterior-draw-measurement-error/41082 "2026-05-07T09:30:20Z")

</div>

Hi all, I’m working with a Stan model where I explicitly propagate uncertainty from a previous model by using posterior draws as inputs. I’m now trying to perform predictor selection among 9 covariates that exhibit some…

---

## [Better classification through mixture model regression](https://discourse.mc-stan.org/t/better-classification-through-mixture-model-regression/41087)

<div class="topic-metadata">

**Author:** [@caesoma](https://discourse.mc-stan.org/u/caesoma)\
**Replies:** 0\
**Last updated:** [April 30, 2026, 9:04am UTC](https://discourse.mc-stan.org/t/better-classification-through-mixture-model-regression/41087 "2026-04-30T09:04:22Z")

</div>

I was presented with “Machine Learning” problem where the “features” are used to “predict” a categorical outcome (possibly ordered, but that may be of lesser importance). Nevertheless, the observations are actually conti…

---

## [Copula regression example (gaussian & poisson)](https://discourse.mc-stan.org/t/copula-regression-example-gaussian-poisson/35071)

<div class="topic-metadata">

**Author:** [@Greg94](https://discourse.mc-stan.org/u/Greg94)\
**Replies:** 20\
**Last updated:** [April 13, 2026, 9:48am UTC](https://discourse.mc-stan.org/t/copula-regression-example-gaussian-poisson/35071 "2026-04-13T09:48:32Z")

</div>

Hi This is a question about copulas in Stan. I am trying to estimate a copula model which introduces some correlation between a Gaussian and a Poisson regression. This is my data generating process: library(MASS) s\_siz…

---

## [Blog article on Bayesian thinking in the use of historical control data](https://discourse.mc-stan.org/t/blog-article-on-bayesian-thinking-in-the-use-of-historical-control-data/33242)

<div class="topic-metadata">

**Author:** [@harrelfe](https://discourse.mc-stan.org/u/harrelfe)\
**Replies:** 9\
**Last updated:** [April 8, 2026, 8:30pm UTC](https://discourse.mc-stan.org/t/blog-article-on-bayesian-thinking-in-the-use-of-historical-control-data/33242 "2026-04-08T20:30:49Z")

</div>

I welcome comments and suggestions on a new blog article showing how Bayesian joint modeling can be used to directly model bias in observational data that are pooled with randomized trial data. I suggest that explicit …

---

## [Scenarios joint with estimation](https://discourse.mc-stan.org/t/scenarios-joint-with-estimation/41005)

<div class="topic-metadata">

**Author:** [@Gianni\_Lombardo](https://discourse.mc-stan.org/u/Gianni_Lombardo)\
**Replies:** 0\
**Last updated:** [March 25, 2026, 5:48pm UTC](https://discourse.mc-stan.org/t/scenarios-joint-with-estimation/41005 "2026-03-25T17:48:23Z")

</div>

Hi, I have a question that might sound philosophical. It concerns the treatment of scenario data in the estimation of a BVAR (Bayesian vector autoregressive model) and scenario analysis. In econometrics, the standard a…

---

## [Using Hierarchical mean estimates as predictors](https://discourse.mc-stan.org/t/using-hierarchical-mean-estimates-as-predictors/40969)

<div class="topic-metadata">

**Author:** [@E\_michels](https://discourse.mc-stan.org/u/E_michels)\
**Replies:** 8\
**Last updated:** [March 25, 2026, 4:19am UTC](https://discourse.mc-stan.org/t/using-hierarchical-mean-estimates-as-predictors/40969 "2026-03-25T04:19:37Z")

</div>

Hi everyone, I’m trying to build a model that propagates uncertainty across several linked components (possibly something like a Bayesian path model / SEM). Below is a simplified version of the full model, which is beha…

---

## [Shall we introduce the interaction between state and race in MRP?](https://discourse.mc-stan.org/t/shall-we-introduce-the-interaction-between-state-and-race-in-mrp/40967)

<div class="topic-metadata">

**Author:** [@yanmin](https://discourse.mc-stan.org/u/yanmin)\
**Replies:** 1\
**Last updated:** [March 15, 2026, 7:50pm UTC](https://discourse.mc-stan.org/t/shall-we-introduce-the-interaction-between-state-and-race-in-mrp/40967 "2026-03-15T19:50:25Z")

</div>

In multilevel regression and poststratification (MRP), state and race are typically included as key predictors in the model. However, given the substantial variation in racial composition across states, should an interac…

---

## [Hierarchical model, binning, no closed-form integral](https://discourse.mc-stan.org/t/hierarchical-model-binning-no-closed-form-integral/40959)

<div class="topic-metadata">

**Author:** [@tpapp](https://discourse.mc-stan.org/u/tpapp)\
**Replies:** 11\
**Last updated:** [March 11, 2026, 1:55pm UTC](https://discourse.mc-stan.org/t/hierarchical-model-binning-no-closed-form-integral/40959 "2026-03-11T13:55:45Z")

</div>

I have a difficult time conceptualizing a multilevel model where some observations are binned. The following is a simplification of my actual model for the purposes of asking this question. I have parameters \\theta, \\va…

---

## [Covariate impact on the ratio of dependent variables in BRMS multivariate model](https://discourse.mc-stan.org/t/covariate-impact-on-the-ratio-of-dependent-variables-in-brms-multivariate-model/40811)

<div class="topic-metadata">

**Author:** [@nswartwo](https://discourse.mc-stan.org/u/nswartwo)\
**Replies:** 3\
**Last updated:** [March 6, 2026, 11:10pm UTC](https://discourse.mc-stan.org/t/covariate-impact-on-the-ratio-of-dependent-variables-in-brms-multivariate-model/40811 "2026-03-06T23:10:47Z")

</div>

I am using a multivariate specification in brms to model two correlated outcomes, (y\_1, y\_2) jointly. However, the outcome of interest is actually y\_1/y\_2, which is calculated after model run. I am interested in estimati…

---

## [Question: Diagnostic status used in both interaction and derived predictor — better to use split models?](https://discourse.mc-stan.org/t/question-diagnostic-status-used-in-both-interaction-and-derived-predictor-better-to-use-split-models/39831)

<div class="topic-metadata">

**Author:** [@Felix\_Requena](https://discourse.mc-stan.org/u/Felix_Requena)\
**Replies:** 2\
**Last updated:** [February 22, 2026, 12:34am UTC](https://discourse.mc-stan.org/t/question-diagnostic-status-used-in-both-interaction-and-derived-predictor-better-to-use-split-models/39831 "2026-02-22T00:34:46Z")

</div>

Hi all, I’m working on a brms model analyzing social behavior (Gregariousness, binary outcome) in a population of reptiles. Two key predictors of interest are: Disease status of the focal individual (Diagnostic: Healt…

---

## [Two-part mixture model on left-censored biomarker data](https://discourse.mc-stan.org/t/two-part-mixture-model-on-left-censored-biomarker-data/40899)

<div class="topic-metadata">

**Author:** [@Biomarker\_Researcher](https://discourse.mc-stan.org/u/Biomarker_Researcher)\
**Replies:** 12\
**Last updated:** [February 19, 2026, 3:39pm UTC](https://discourse.mc-stan.org/t/two-part-mixture-model-on-left-censored-biomarker-data/40899 "2026-02-19T15:39:07Z")

</div>

I am trying to model blood biomarker data collected longitudinally in a sample of patients vs. controls. There are 4 sampling timepoints, with patient data collected either at timepoint 1 or 2 (I have considered combinin…

---

## [How to sample a (singular) covariance matrix under compositional constraint](https://discourse.mc-stan.org/t/how-to-sample-a-singular-covariance-matrix-under-compositional-constraint/40886)

<div class="topic-metadata">

**Author:** [@Yingnan\_Gao](https://discourse.mc-stan.org/u/Yingnan_Gao)\
**Replies:** 14\
**Last updated:** [February 19, 2026, 5:32am UTC](https://discourse.mc-stan.org/t/how-to-sample-a-singular-covariance-matrix-under-compositional-constraint/40886 "2026-02-19T05:32:43Z")

</div>

Hello Stan Community, I model the composition of n groups as a sum-to-zero vector X (after centered-log-ratio transformation) such that it follows the multivariate normal distribution with mean 0 and a singular variance…

---

## [Is there a way to accelerate this BetaBinomial and DirichletMultinomial model?](https://discourse.mc-stan.org/t/is-there-a-way-to-accelerate-this-betabinomial-and-dirichletmultinomial-model/40755)

<div class="topic-metadata">

**Author:** [@Amns](https://discourse.mc-stan.org/u/Amns)\
**Replies:** 3\
**Last updated:** [February 6, 2026, 8:59pm UTC](https://discourse.mc-stan.org/t/is-there-a-way-to-accelerate-this-betabinomial-and-dirichletmultinomial-model/40755 "2026-02-06T20:59:22Z")

</div>

I created the following .stan file called model\_tree. In essense it fits a BetaBinomial distribution when there are two categories, and a DirichletMultinomial when there are four categories. All the data that I provide a…

---

## [Modeling noisy indicator of a ratio](https://discourse.mc-stan.org/t/modeling-noisy-indicator-of-a-ratio/40881)

<div class="topic-metadata">

**Author:** [@tpapp](https://discourse.mc-stan.org/u/tpapp)\
**Replies:** 4\
**Last updated:** [February 5, 2026, 1:06am UTC](https://discourse.mc-stan.org/t/modeling-noisy-indicator-of-a-ratio/40881 "2026-02-05T01:06:52Z")

</div>

I have a survey dataset where individuals i have various sources of non-wage income (Y\_i), including unemployment benefits (U\_i). I do get to observe Y\_i, but not U\_i. But there is a question on the survey asking for pe…

---

## [Exact, approximate, and minimum count data](https://discourse.mc-stan.org/t/exact-approximate-and-minimum-count-data/40872)

<div class="topic-metadata">

**Author:** [@jacollings](https://discourse.mc-stan.org/u/jacollings)\
**Replies:** 4\
**Last updated:** [February 4, 2026, 10:06pm UTC](https://discourse.mc-stan.org/t/exact-approximate-and-minimum-count-data/40872 "2026-02-04T22:06:37Z")

</div>

Hi all, I’m working with some data on the abundance of a variety of plants. I’m hoping to work up to fitting some GLMs with these abundance data as the response. However, the abundance data is collected in an unstandard…

---

## [How to specify weakly informative priors for beta regression with 10 predictors?](https://discourse.mc-stan.org/t/how-to-specify-weakly-informative-priors-for-beta-regression-with-10-predictors/40786)

<div class="topic-metadata">

**Author:** [@spn](https://discourse.mc-stan.org/u/spn)\
**Replies:** 16\
**Last updated:** [January 29, 2026, 5:07pm UTC](https://discourse.mc-stan.org/t/how-to-specify-weakly-informative-priors-for-beta-regression-with-10-predictors/40786 "2026-01-29T17:07:30Z")

</div>

Hi all, I’m running a beta regression with 10 continuous predictors. I’m fairly new to Bayesian modeling (about a week in), and I’m trying to set weakly informative priors. I specified the following after standardizing …

---

## [One regression equation with multiple error terms](https://discourse.mc-stan.org/t/one-regression-equation-with-multiple-error-terms/40867)

<div class="topic-metadata">

**Author:** [@Arne\_Henningsen](https://discourse.mc-stan.org/u/Arne_Henningsen)\
**Replies:** 0\
**Last updated:** [January 23, 2026, 8:58pm UTC](https://discourse.mc-stan.org/t/one-regression-equation-with-multiple-error-terms/40867 "2026-01-23T20:58:25Z")

</div>

We would like to estimate a non-linear regression model, e.g.: \\log y = f( x\_1 , x\_2, \\beta ) + u, where y, x\_1, and x\_2 are (observed) variables, \\beta is a vector of unknown parameters (to be estimated), f( \\cdot ) i…

[Next page](https://discourse.mc-stan.org/tag/specification/17.md?match_all_tags=true&page=1&tags%5B%5D=specification)
