Contents
How does Bayesian linear regression work?
In the Bayesian viewpoint, we formulate linear regression using probability distributions rather than point estimates. The response, y, is not estimated as a single value, but is assumed to be drawn from a probability distribution.
What is the statistical model behind linear regression?
Linear regression is a linear model, e.g. a model that assumes a linear relationship between the input variables (x) and the single output variable (y). When there are multiple input variables, literature from statistics often refers to the method as multiple linear regression.
How to calculate prior densities of Bayesian regression?
Create a normal-inverse-gamma conjugate prior model for the linear regression parameters. Specify the number of predictors p and the variable names. PriorMdl is a conjugateblm Bayesian linear regression model object representing the prior distribution of the regression coefficients and disturbance variance.
How to visualize the prior and posterior distributions?
Plot the posterior distributions. Plot the prior and posterior distributions of the parameters on the same subplots. Consider the regression model in Plot Prior and Posterior Distributions. Load the Nelson-Plosser data set, create a default conjugate prior model, and then estimate the posterior using the first 75% of the data.
Can a plot confirm that the posterior densities are the same?
Confirm that the posterior densities are the same, but that the prior densities are not. When plotting only the prior distribution, plot evaluates the prior densities at points that produce a clear plot of the prior distribution.
Which is a conjugateblm Bayesian linear regression model?
PriorMdl is a conjugateblm Bayesian linear regression model object representing the prior distribution of the regression coefficients and disturbance variance. Plot the prior distributions.