# \#linear\_model

**URL:** https://discourse.pymc.io/tag/linear-model/25.md

[Latest](https://discourse.pymc.io/latest.md) · [Categories](https://discourse.pymc.io/categories.md) · [Tags](https://discourse.pymc.io/tags.md)

---

## [Modeling of multiple regression model with array form](https://discourse.pymc.io/t/modeling-of-multiple-regression-model-with-array-form/12430)

<div class="topic-metadata">

**Author:** [@selmainger326](https://discourse.pymc.io/u/selmainger326)\
**Replies:** 12\
**Last updated:** [December 17, 2024, 10:25pm UTC](https://discourse.pymc.io/t/modeling-of-multiple-regression-model-with-array-form/12430 "2024-12-17T22:25:31Z")

</div>

Hello. I am a beginner in Bayesian Inference and PYMC (Also Python). I have studied multi-objective predictive control using machine learning and deep learning. I wonder whether users can develop the regression (or GP…

---

## [Linear regression with measurement errors, am I doing it right?](https://discourse.pymc.io/t/linear-regression-with-measurement-errors-am-i-doing-it-right/16235)

<div class="topic-metadata">

**Author:** [@Cricket4444](https://discourse.pymc.io/u/Cricket4444)\
**Replies:** 7\
**Last updated:** [December 16, 2024, 10:04pm UTC](https://discourse.pymc.io/t/linear-regression-with-measurement-errors-am-i-doing-it-right/16235 "2024-12-16T22:04:40Z")

</div>

Hi Everyone, I’m working on a difference-in-difference analysis problem where each observation has a reported standard error and I want to use this uncertainty in my model. The diff-in-diff model is pretty standard (alt…

---

## [Linear regression with log-normal model: posterior predictive is quite off](https://discourse.pymc.io/t/linear-regression-with-log-normal-model-posterior-predictive-is-quite-off/14929)

<div class="topic-metadata">

**Author:** [@han.xiao](https://discourse.pymc.io/u/han.xiao)\
**Replies:** 8\
**Last updated:** [August 22, 2024, 3:30pm UTC](https://discourse.pymc.io/t/linear-regression-with-log-normal-model-posterior-predictive-is-quite-off/14929 "2024-08-22T15:30:55Z")

</div>

I’d like to implement a linear regression model where the response variable is modeled via log-normal distribution. What I can achieve: build the model and obtain the correct posterior estimates on the regression coeff…

---

## [Bayesian Regression: Inconsistent Prior Predictive Checks](https://discourse.pymc.io/t/bayesian-regression-inconsistent-prior-predictive-checks/13035)

<div class="topic-metadata">

**Author:** [@J\_V](https://discourse.pymc.io/u/J_V)\
**Replies:** 12\
**Last updated:** [October 9, 2023, 9:20am UTC](https://discourse.pymc.io/t/bayesian-regression-inconsistent-prior-predictive-checks/13035 "2023-10-09T09:20:49Z")

</div>

I’m working on a Bayesian regression problem using PyMC and have encountered an issue with my prior predictive checks. I have some observed x, y data points and have constructed a Bayesian regression model with informati…

---

## [Calculating WAIC/LOO on different size datasets](https://discourse.pymc.io/t/calculating-waic-loo-on-different-size-datasets/12764)

<div class="topic-metadata">

**Author:** [@cocodimama](https://discourse.pymc.io/u/cocodimama)\
**Replies:** 1\
**Last updated:** [September 27, 2023, 7:49am UTC](https://discourse.pymc.io/t/calculating-waic-loo-on-different-size-datasets/12764 "2023-09-27T07:49:54Z")

</div>

Hi there, Suppose I have the following two datasets for a simple hierarchical linear regression with no intercept: Dataset 1: X1, Y1 Dataset 2: X2, Y2 X1, X2, Y1 and Y2 are all scalars. Dataset 2 is a transformed ve…

---

## [GLM with a truncated Gamma distribution](https://discourse.pymc.io/t/glm-with-a-truncated-gamma-distribution/12956)

<div class="topic-metadata">

**Author:** [@Boris](https://discourse.pymc.io/u/Boris)\
**Replies:** 9\
**Last updated:** [September 22, 2023, 4:21pm UTC](https://discourse.pymc.io/t/glm-with-a-truncated-gamma-distribution/12956 "2023-09-22T16:21:47Z")

</div>

Hi everyone! I’m trying to build a linear model where I have a random variable that has a Gamma likelihood function, but the distribution is truncated by a lower value. I found the code here which explains how to build…

---

## [Kernel crashes in Logistic Regression model specification](https://discourse.pymc.io/t/kernel-crashes-in-logistic-regression-model-specification/12966)

<div class="topic-metadata">

**Author:** [@Carlos\_Pumar-Frohber](https://discourse.pymc.io/u/Carlos_Pumar-Frohber)\
**Replies:** 0\
**Last updated:** [September 21, 2023, 11:01pm UTC](https://discourse.pymc.io/t/kernel-crashes-in-logistic-regression-model-specification/12966 "2023-09-21T23:01:19Z")

</div>

Hi, I am trying to sample from the posterior resulting of this (Logistic Regression) model specification: lower = 0.01 upper = 1 with pm.Model() as customer\_model: beta\_0 = pm.Uniform('beta\_0', lower=lower, upper…

---

## [How to add weights to data in bayesian linear regression](https://discourse.pymc.io/t/how-to-add-weights-to-data-in-bayesian-linear-regression/8362)

<div class="topic-metadata">

**Author:** [@sanket](https://discourse.pymc.io/u/sanket)\
**Replies:** 17\
**Last updated:** [May 22, 2023, 4:48am UTC](https://discourse.pymc.io/t/how-to-add-weights-to-data-in-bayesian-linear-regression/8362 "2023-05-22T04:48:54Z")

</div>

I have implemented a bayesian model like this: #Bayesian Linear Regression with pm.Model() as predictive\_model: x = pm.Data("x",xtrain.values) y = pm.Data("y",ytrain.values) a = pm.Normal('s…

---

## [Basic linear regression on fuel efficiency of cars/trucks. Trouble with dims](https://discourse.pymc.io/t/basic-linear-regression-on-fuel-efficiency-of-cars-trucks-trouble-with-dims/11954)

<div class="topic-metadata">

**Author:** [@mono](https://discourse.pymc.io/u/mono)\
**Replies:** 1\
**Last updated:** [April 22, 2023, 12:45pm UTC](https://discourse.pymc.io/t/basic-linear-regression-on-fuel-efficiency-of-cars-trucks-trouble-with-dims/11954 "2023-04-22T12:45:54Z")

</div>

Hi, I’m new here. While there are many examples online of different models one can make with pymc, I keep having trouble doing something on my own. I have tried pymc multiple times but I think I eventually always run int…

---

## [Odd results in model prediction using pymc.sample\_posterior\_predictive](https://discourse.pymc.io/t/odd-results-in-model-prediction-using-pymc-sample-posterior-predictive/10437)

<div class="topic-metadata">

**Author:** [@Ali\_Mehrabifard](https://discourse.pymc.io/u/Ali_Mehrabifard)\
**Replies:** 9\
**Last updated:** [September 24, 2022, 7:06pm UTC](https://discourse.pymc.io/t/odd-results-in-model-prediction-using-pymc-sample-posterior-predictive/10437 "2022-09-24T19:06:03Z")

</div>

Dear community, I have a linear regression problem in hand, where I wanted to consider the error propagation, considering the uncertainties in x variable, and fit a y value where there is a distribution of values with a…

---

## [Bambi vs pymc model specification](https://discourse.pymc.io/t/bambi-vs-pymc-model-specification/8913)

<div class="topic-metadata">

**Author:** [@Jake\_Wall](https://discourse.pymc.io/u/Jake_Wall)\
**Replies:** 5\
**Last updated:** [February 26, 2022, 6:48pm UTC](https://discourse.pymc.io/t/bambi-vs-pymc-model-specification/8913 "2022-02-26T18:48:19Z")

</div>

Hi, I’m struggling to fit an equivalent model in pymc to one specified using bambi. My code is below. The bambi model is producing different (and correct) results compared with the pymc model. I don’t understand how my m…

---

## [Create a hiearchical linear regression with 5 levels](https://discourse.pymc.io/t/create-a-hiearchical-linear-regression-with-5-levels/8562)

<div class="topic-metadata">

**Author:** [@luiswilbert](https://discourse.pymc.io/u/luiswilbert)\
**Replies:** 2\
**Last updated:** [January 19, 2022, 9:02am UTC](https://discourse.pymc.io/t/create-a-hiearchical-linear-regression-with-5-levels/8562 "2022-01-19T09:02:46Z")

</div>

Dear all I’m working in a forecast project for a fashion company. In this forecast, we have the following hierarchical structure: 1 - Level 1: Shoes 2 - Level 2: Sport\_Category\_1, Sport\_Category\_2, Sport\_Category\_3 … …

---

## [Mean of mu and mean of predictive posterior distribution](https://discourse.pymc.io/t/mean-of-mu-and-mean-of-predictive-posterior-distribution/8432)

<div class="topic-metadata">

**Author:** [@FHTE](https://discourse.pymc.io/u/FHTE)\
**Replies:** 2\
**Last updated:** [December 11, 2021, 12:27pm UTC](https://discourse.pymc.io/t/mean-of-mu-and-mean-of-predictive-posterior-distribution/8432 "2021-12-11T12:27:10Z")

</div>

Hi everyone, question updated: I am new to pymc3 and trying to understand the inner workings on an example of linear regression: with pm.Model() as m\_5\_1: marriage\_age\_s = pm.Data("marriage\_age\_s", df\['MedianAgeM…

---

## [How to run logistic regression with weighted samples](https://discourse.pymc.io/t/how-to-run-logistic-regression-with-weighted-samples/5689)

<div class="topic-metadata">

**Author:** [@timzen](https://discourse.pymc.io/u/timzen)\
**Replies:** 10\
**Last updated:** [August 30, 2021, 9:26am UTC](https://discourse.pymc.io/t/how-to-run-logistic-regression-with-weighted-samples/5689 "2021-08-30T09:26:48Z")

</div>

Hi there, I am fairly new to pymc3 and was using it for some basic regressions to get started. So far I liked it a lot. My Problem is now getting a logistisc regression with weighted samples to run. For my problem one o…
