# \#language

**URL:** https://discourse.mc-stan.org/tag/language/34.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)

---

## [Differences between jacobian += and target+=?](https://discourse.mc-stan.org/t/differences-between-jacobian-and-target/39685)

<div class="topic-metadata">

**Author:** [@bnicenboim](https://discourse.mc-stan.org/u/bnicenboim)\
**Replies:** 12\
**Last updated:** [June 5, 2026, 7:15pm UTC](https://discourse.mc-stan.org/t/differences-between-jacobian-and-target/39685 "2026-06-05T19:15:57Z")

</div>

Hi! Thanks for another release :) I’m a bit confused by jacobian +=, and I don’t find much about it. When should I use it? How is it different from target +=?

---

## [Brainstorming named tuples/structs](https://discourse.mc-stan.org/t/brainstorming-named-tuples-structs/41041)

<div class="topic-metadata">

**Author:** [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Replies:** 12\
**Last updated:** [April 17, 2026, 4:27am UTC](https://discourse.mc-stan.org/t/brainstorming-named-tuples-structs/41041 "2026-04-17T04:27:14Z")

</div>

@avehtari and I were discussing today that there are many cases where tuples can be used but are sub-optimal because you need to track that t.1 is one thing and t.2 is another, without naming those. The natural extensio…

---

## [Missing signatures for \_jacobian and \_constrain functions?](https://discourse.mc-stan.org/t/missing-signatures-for-jacobian-and-constrain-functions/40934)

<div class="topic-metadata">

**Author:** [@huffyhenry](https://discourse.mc-stan.org/u/huffyhenry)\
**Replies:** 3\
**Last updated:** [February 20, 2026, 9:38pm UTC](https://discourse.mc-stan.org/t/missing-signatures-for-jacobian-and-constrain-functions/40934 "2026-02-20T21:38:46Z")

</div>

I was surprised to find that it is not possible to use the \_jacobian and \_constrain functions to get bounded vectors that share bounds. This code \<- " data {} parameters {vector\[2\] x\_raw;} transformed parameters {…

---

## [Stan language meetings---second Thursday of Month, 10 am NYC time](https://discourse.mc-stan.org/t/stan-language-meetings-second-thursday-of-month-10-am-nyc-time/39257)

<div class="topic-metadata">

**Author:** [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Replies:** 1\
**Last updated:** [September 9, 2025, 3:58pm UTC](https://discourse.mc-stan.org/t/stan-language-meetings-second-thursday-of-month-10-am-nyc-time/39257 "2025-09-09T15:58:39Z")

</div>

We have monthly meetings to discuss the Stan language, particularly new feature designs. Schedule Second Thursday of every month at 10 am NYC time. Google Calendar invite If you’d like to be put on the Google Calendar …

---

## [Use of ~ for overloaded distribution statements?](https://discourse.mc-stan.org/t/use-of-for-overloaded-distribution-statements/37238)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 8\
**Last updated:** [November 13, 2024, 5:35pm UTC](https://discourse.mc-stan.org/t/use-of-for-overloaded-distribution-statements/37238 "2024-11-13T17:35:38Z")

</div>

While I can successfully overload distribution statements, if I use the ~ syntax instead of target, the compiler throws a syntax error: functions { real distribution\_lpdf(vector y, real mu, real sigma) { return…

---

## [Compound Assignment Reference Semantics and Gradient Calculations](https://discourse.mc-stan.org/t/compound-assignment-reference-semantics-and-gradient-calculations/33817)

<div class="topic-metadata">

**Author:** [@jesse-smith](https://discourse.mc-stan.org/u/jesse-smith)\
**Replies:** 3\
**Last updated:** [February 7, 2024, 3:28pm UTC](https://discourse.mc-stan.org/t/compound-assignment-reference-semantics-and-gradient-calculations/33817 "2024-02-07T15:28:51Z")

</div>

This is a two-parter: What are the reference semantics for a compound assignment in Stan? E.g., in C++, x += y modifies x in-place. Does Stan retain this behavior this behavior, or is the expression expanded to x = x …

---

## [Intended behavior of vector\[array\_idx\] += vector?](https://discourse.mc-stan.org/t/intended-behavior-of-vector-array-idx-vector/33990)

<div class="topic-metadata">

**Author:** [@ssp3nc3r](https://discourse.mc-stan.org/u/ssp3nc3r)\
**Replies:** 1\
**Last updated:** [January 31, 2024, 8:51pm UTC](https://discourse.mc-stan.org/t/intended-behavior-of-vector-array-idx-vector/33990 "2024-01-31T20:51:38Z")

</div>

Stan allows us to index each element of a vector multiple times, and allows us to assign that indexed element some values. Using this toy syntax below, I intend to increment an element five times, but it occurs only on…

---

## [Syntax for an array of range-constrained vectors?](https://discourse.mc-stan.org/t/syntax-for-an-array-of-range-constrained-vectors/28415)

<div class="topic-metadata">

**Author:** [@stan-n00b](https://discourse.mc-stan.org/u/stan-n00b)\
**Replies:** 2\
**Last updated:** [August 3, 2022, 9:27pm UTC](https://discourse.mc-stan.org/t/syntax-for-an-array-of-range-constrained-vectors/28415 "2022-08-03T21:27:30Z")

</div>

What’s the correct syntax for an array of vectors, with range constraints? // Works: A vector of length K vector\[K\] alpha; // Works: A vector of length K, with range constraint vector\<lower…

---

## [Subsetting from an array of matrices](https://discourse.mc-stan.org/t/subsetting-from-an-array-of-matrices/26526)

<div class="topic-metadata">

**Author:** [@schmert](https://discourse.mc-stan.org/u/schmert)\
**Replies:** 1\
**Last updated:** [February 23, 2022, 10:05pm UTC](https://discourse.mc-stan.org/t/subsetting-from-an-array-of-matrices/26526 "2022-02-23T22:05:32Z")

</div>

I have a parameter declaration for K distinct parameters for each of R regions in each of Y years like this: matrix\[K,R\] alpha\[Y\]; It’s valuable to have this particular form because there are Y matrix products (B \* alp…

---

## [Short blog on conditional parameters in Stan](https://discourse.mc-stan.org/t/short-blog-on-conditional-parameters-in-stan/3961)

<div class="topic-metadata">

**Author:** [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Replies:** 3\
**Last updated:** [January 12, 2022, 9:40am UTC](https://discourse.mc-stan.org/t/short-blog-on-conditional-parameters-in-stan/3961 "2022-01-12T09:40:40Z")

</div>

I just wrote a short post on how to use ternary operator to get optional/conditional parameters and/or data in Stan if anyone’s interested. http://www.martinmodrak.cz/2018/04/24/optional-parameters-data-in-stan/

---

## [What is the \`ints\` type mentioned in the Stan Functions Reference](https://discourse.mc-stan.org/t/what-is-the-ints-type-mentioned-in-the-stan-functions-reference/25574)

<div class="topic-metadata">

**Author:** [@andypea](https://discourse.mc-stan.org/u/andypea)\
**Replies:** 1\
**Last updated:** [December 6, 2021, 9:13am UTC](https://discourse.mc-stan.org/t/what-is-the-ints-type-mentioned-in-the-stan-functions-reference/25574 "2021-12-06T09:13:25Z")

</div>

What is the ints type used the example code in the Stan Functions Reference document. One place it appears is: https://mc-stan.org/docs/2\_28/functions-reference/poisson.html I’ve tried using it myself when specifying a…

---

## [The var keyword: should Stan support local variable type inference](https://discourse.mc-stan.org/t/the-var-keyword-should-stan-support-local-variable-type-inference/23928)

<div class="topic-metadata">

**Author:** [@WardBrian](https://discourse.mc-stan.org/u/WardBrian)\
**Replies:** 1\
**Last updated:** [August 12, 2021, 9:38pm UTC](https://discourse.mc-stan.org/t/the-var-keyword-should-stan-support-local-variable-type-inference/23928 "2021-08-12T21:38:43Z")

</div>

This was discussed in today’s Stan meeting, and we decided it would be good to discuss on the forums. The proposal is to include something similar to the Java var keyword to allow local variables to have their type infe…

---

## [Allow users to declare terms as Jacobian](https://discourse.mc-stan.org/t/allow-users-to-declare-terms-as-jacobian/22479)

<div class="topic-metadata">

**Author:** [@martinmodrak](https://discourse.mc-stan.org/u/martinmodrak)\
**Replies:** 0\
**Last updated:** [May 13, 2021, 6:05pm UTC](https://discourse.mc-stan.org/t/allow-users-to-declare-terms-as-jacobian/22479 "2021-05-13T18:05:16Z")

</div>

Background: Currently, when you run optimize, by default Stan does not include the Jacobian term for the constrained parameters (so that with uniform priors, you get the maximum-likelihood estimate). However, when peopl…

---

## [Writing Stan code with greek symbols](https://discourse.mc-stan.org/t/writing-stan-code-with-greek-symbols/19152)

<div class="topic-metadata">

**Author:** [@adkinsty](https://discourse.mc-stan.org/u/adkinsty)\
**Replies:** 1\
**Last updated:** [November 9, 2020, 12:51am UTC](https://discourse.mc-stan.org/t/writing-stan-code-with-greek-symbols/19152 "2020-11-09T00:51:15Z")

</div>

Is it possible to use greek symbols in my Stan code? For example β ~ std\_normal(); Or will it always fail to compile?

---

## ['Pedantic Mode' is ready for your testing and feedback](https://discourse.mc-stan.org/t/pedantic-mode-is-ready-for-your-testing-and-feedback/13893)

<div class="topic-metadata">

**Author:** [@rybern](https://discourse.mc-stan.org/u/rybern)\
**Replies:** 29\
**Last updated:** [May 22, 2020, 7:13pm UTC](https://discourse.mc-stan.org/t/pedantic-mode-is-ready-for-your-testing-and-feedback/13893 "2020-05-22T19:13:37Z")

</div>

I’ve built a prototype of ‘Pedantic Mode’, a tool for finding issues with Stan programs. It’s based some of the ideas from a previous discussion here. It’s an early version, but it’s ready for your testing and feedback (…

---

## [Can we have unnormalised densities in user functions?](https://discourse.mc-stan.org/t/can-we-have-unnormalised-densities-in-user-functions/14333)

<div class="topic-metadata">

**Author:** [@wds15](https://discourse.mc-stan.org/u/wds15)\
**Replies:** 20\
**Last updated:** [April 16, 2020, 1:24pm UTC](https://discourse.mc-stan.org/t/can-we-have-unnormalised-densities-in-user-functions/14333 "2020-04-16T13:24:21Z")

</div>

Hi! With reduce\_sum (and map\_rect) we can now parallelise Stan programs nicely. However, this comes at the price of being forced to use the standardised densities. So while one can write this in the model block: count…

---

## [Bug in indexed assignment](https://discourse.mc-stan.org/t/bug-in-indexed-assignment/10148)

<div class="topic-metadata">

**Author:** [@seantalts](https://discourse.mc-stan.org/u/seantalts)\
**Replies:** 0\
**Last updated:** [August 12, 2019, 5:09pm UTC](https://discourse.mc-stan.org/t/bug-in-indexed-assignment/10148 "2019-08-12T17:09:55Z")

</div>

Hey all, Over in the new compiler, we’ve discovered a bug - basically a\[:\]\[2\] and a\[:, 2\] are equivalent if they appear as the destination for an assignment, but on the right hand size the a\[:\]\[2\] is equivalent to a\[2…

---

## [Probabilistic programming language paper (includes comparison with Stan): "From High-Level Inference Algorithms to Efficient Code"](https://discourse.mc-stan.org/t/probabilistic-programming-language-paper-includes-comparison-with-stan-from-high-level-inference-algorithms-to-efficient-code/9632)

<div class="topic-metadata">

**Author:** [@ariddell](https://discourse.mc-stan.org/u/ariddell)\
**Replies:** 2\
**Last updated:** [July 9, 2019, 9:47pm UTC](https://discourse.mc-stan.org/t/probabilistic-programming-language-paper-includes-comparison-with-stan-from-high-level-inference-algorithms-to-efficient-code/9632 "2019-07-09T21:47:25Z")

</div>

FYI “From High-Level Inference Algorithms to Efficient Code” Abstract: Probabilistic programming languages are valuable because they allow domain experts to express probabilistic models and inference algorithms witho…

---

## [Chronikis: a language for Bayesian time-series models that compiles to Stan](https://discourse.mc-stan.org/t/chronikis-a-language-for-bayesian-time-series-models-that-compiles-to-stan/8410)

<div class="topic-metadata">

**Author:** [@Kevin\_Van\_Horn](https://discourse.mc-stan.org/u/Kevin_Van_Horn)\
**Replies:** 2\
**Last updated:** [April 29, 2019, 7:20pm UTC](https://discourse.mc-stan.org/t/chronikis-a-language-for-bayesian-time-series-models-that-compiles-to-stan/8410 "2019-04-29T19:20:24Z")

</div>

I’d like to announce the open-source release of Chronikis (kroh-NEE-kees), a special-purpose language for creating Bayesian time-series models, available here: \[http://opensource.adobe.com/Chronikis/\](http://opensource.…

---

## [Deprecated function '\_log'](https://discourse.mc-stan.org/t/deprecated-function-log/2806)

<div class="topic-metadata">

**Author:** [@cindyhfls](https://discourse.mc-stan.org/u/cindyhfls)\
**Replies:** 5\
**Last updated:** [December 21, 2017, 6:23am UTC](https://discourse.mc-stan.org/t/deprecated-function-log/2806 "2017-12-21T06:23:56Z")

</div>

Hi, I have an error message in R saying that the function ‘multi\_student\_t\_log’ is deprecated. DIAGNOSTIC(S) FROM PARSER: Warning: Deprecated function ‘multi\_student\_t\_log’; please replace suffix ‘\_log’ with ‘\_lpdf’ f…

---

## [Stan FAQ](https://discourse.mc-stan.org/t/stan-faq/1921)

<div class="topic-metadata">

**Author:** [@Bob\_Carpenter](https://discourse.mc-stan.org/u/Bob_Carpenter)\
**Replies:** 2\
**Last updated:** [September 19, 2017, 8:43pm UTC](https://discourse.mc-stan.org/t/stan-faq/1921 "2017-09-19T20:43:09Z")

</div>

This is really about the Stan language and algorithms. I created a Stan FAQ. I realized when I was done I hadn’t really followed the standard frequently asked questions form—it’s more frequent answers with some hints a…
