# \#link-function

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

---

## [Is \`brms::dirichlet()$linkinv()\` the same link function used by \`brms::fitted.brmsfit()\` when applied to a Dirichlet regression \`brmsfit\` object?](https://discourse.mc-stan.org/t/is-brms-dirichlet-linkinv-the-same-link-function-used-by-brms-fitted-brmsfit-when-applied-to-a-dirichlet-regression-brmsfit-object/40412)

<div class="topic-metadata">

**Author:** [@henningte](https://discourse.mc-stan.org/u/henningte)\
**Replies:** 0\
**Last updated:** [September 25, 2025, 10:00am UTC](https://discourse.mc-stan.org/t/is-brms-dirichlet-linkinv-the-same-link-function-used-by-brms-fitted-brmsfit-when-applied-to-a-dirichlet-regression-brmsfit-object/40412 "2025-09-25T10:00:57Z")

</div>

This code computes a brmsfit Dirichlet regression object and then extracts fitted values in three ways: (1) using brms::fitted.brmsfit(), or using brms::fitted.brmsfit(scale = "linear") and then applying either (2) brms:…

---

## [Force brms to run even with invalid response variables](https://discourse.mc-stan.org/t/force-brms-to-run-even-with-invalid-response-variables/40323)

<div class="topic-metadata">

**Author:** [@Ryan\_Giordano](https://discourse.mc-stan.org/u/Ryan_Giordano)\
**Replies:** 11\
**Last updated:** [September 4, 2025, 3:47pm UTC](https://discourse.mc-stan.org/t/force-brms-to-run-even-with-invalid-response-variables/40323 "2025-09-04T15:47:00Z")

</div>

Is there a way to force brm to ignore invalid response values when running logistic regression (or in general)? library(brms) data\_df \<- data.frame(y=c(0.1, 0.2, 0.3, 1.1), x=c(1, 2, 3, 0)) logit\_post \<- brm(y ~ x -…

---

## [Adding a logit link to brms mixture model](https://discourse.mc-stan.org/t/adding-a-logit-link-to-brms-mixture-model/38925)

<div class="topic-metadata">

**Author:** [@carlyls](https://discourse.mc-stan.org/u/carlyls)\
**Replies:** 1\
**Last updated:** [March 5, 2025, 11:39am UTC](https://discourse.mc-stan.org/t/adding-a-logit-link-to-brms-mixture-model/38925 "2025-03-05T11:39:32Z")

</div>

Hi! I am fitting a mixture model with brms and using a mixture of two normal distributions. How can I set my theta2 parameter (mixing parameter) to have a logit link? My current code is below: mix \<- mixture(gaussian(),…

---

## [Link function for nonnegative model of binary data](https://discourse.mc-stan.org/t/link-function-for-nonnegative-model-of-binary-data/36618)

<div class="topic-metadata">

**Author:** [@ScottAlder](https://discourse.mc-stan.org/u/ScottAlder)\
**Replies:** 2\
**Last updated:** [September 17, 2024, 2:54pm UTC](https://discourse.mc-stan.org/t/link-function-for-nonnegative-model-of-binary-data/36618 "2024-09-17T14:54:47Z")

</div>

Hello, I am trying to develop a factor model that generates a nonnegative parameter x in (0, inf) then map that parameter into a probability p in (0,1). When x is close to zero, I want p to also be close to zero. As x…

---

## [Question about a Log-Link function for a cognitive model](https://discourse.mc-stan.org/t/question-about-a-log-link-function-for-a-cognitive-model/35997)

<div class="topic-metadata">

**Author:** [@jangoe](https://discourse.mc-stan.org/u/jangoe)\
**Replies:** 1\
**Last updated:** [July 26, 2024, 1:17pm UTC](https://discourse.mc-stan.org/t/question-about-a-log-link-function-for-a-cognitive-model/35997 "2024-07-26T13:17:08Z")

</div>

Hey folks, I have a question regarding the implementation of certain link function outside of the brms framework, namely for cognitive models. I got a relatively simple hierachical cognitive model with 3 parameters: fu…

---

## [Brms custom link function for survival modelling](https://discourse.mc-stan.org/t/brms-custom-link-function-for-survival-modelling/19965)

<div class="topic-metadata">

**Author:** [@richard.turner](https://discourse.mc-stan.org/u/richard.turner)\
**Replies:** 5\
**Last updated:** [January 5, 2021, 7:35pm UTC](https://discourse.mc-stan.org/t/brms-custom-link-function-for-survival-modelling/19965 "2021-01-05T19:35:05Z")

</div>

Hi all, I am new to Bayesian modelling, so apologies in advance. My question is in relation to whether or not it is possible to create custom link functions in brms? In ecology (for this example, think of individual ne…

---

## [Dirichlet Generalized Additive Model](https://discourse.mc-stan.org/t/dirichlet-generalized-additive-model/26320)

<div class="topic-metadata">

**Author:** [@Andrew\_fg](https://discourse.mc-stan.org/u/Andrew_fg)\
**Replies:** 0\
**Last updated:** [February 13, 2022, 6:53pm UTC](https://discourse.mc-stan.org/t/dirichlet-generalized-additive-model/26320 "2022-02-13T18:53:06Z")

</div>

Dear users, I want to use Dirichlet regression in order to model proportions of deaths, using i.e. Age, Years, and Gender as predictors. I gave up this idea a few months ago, due to the impressive (for my modest backgro…

---

## [Modelling continuous positive data with strong right skew AND many zeros. Log-link AND Hurdle?](https://discourse.mc-stan.org/t/modelling-continuous-positive-data-with-strong-right-skew-and-many-zeros-log-link-and-hurdle/20713)

<div class="topic-metadata">

**Author:** [@OBidz](https://discourse.mc-stan.org/u/OBidz)\
**Replies:** 6\
**Last updated:** [February 10, 2021, 12:43am UTC](https://discourse.mc-stan.org/t/modelling-continuous-positive-data-with-strong-right-skew-and-many-zeros-log-link-and-hurdle/20713 "2021-02-10T00:43:47Z")

</div>

I am trying to build a model for a variable like Sales, which is continuous with a strong right skew i.e. many sales are small but a few are a couple of orders of magnitude larger. I had thought about using a gaussian li…

---

## [Binomial regression with a log link](https://discourse.mc-stan.org/t/binomial-regression-with-a-log-link/4102)

<div class="topic-metadata">

**Author:** [@David\_Westergaard](https://discourse.mc-stan.org/u/David_Westergaard)\
**Replies:** 38\
**Last updated:** [October 26, 2020, 6:35pm UTC](https://discourse.mc-stan.org/t/binomial-regression-with-a-log-link/4102 "2020-10-26T18:35:28Z")

</div>

Hi, I am trying to fit a binomial regression with a log link to some count data to estimate a relative risk (model posted last). The model seems to work OK, and retrieves the expected relative risk corrected for age (RR…
