using Distributions
using LinearAlgebra
= 3
p
= MvNormal(zeros(p), 5.0 * I) d
IsoNormal(
dim: 3
μ: [0.0, 0.0, 0.0]
Σ: [5.0 0.0 0.0; 0.0 5.0 0.0; 0.0 0.0 5.0]
)
This chapter describes some common distributions used in Bayesian models
Used when Y is a count outcome (e.g. the number of wins in a set of matches)
\(Y|\pi \sim Bin(n, \pi)\)
where \(\pi\) is the probability of success in a given trial
A multivariate normal distribution is an abstraction of the univariate normal distribution. It’s parameterized by two components:
The diagonal of the covariance matrix describes each variable’s (e.g. \(x_i\)) variance, whereas all off-diagonal elements describe the covariance between, \(x_i\) and \(x_j\) or whatever you want to refer to the variables as.
If the off-diagonal elements are all 0, then all of the variables are independent. The code below shows an example of a multivariate normal distribution with 3 independent variables, all with a mean of 0 and a variance of 5.
using Distributions
using LinearAlgebra
= 3
p
= MvNormal(zeros(p), 5.0 * I) d
IsoNormal(
dim: 3
μ: [0.0, 0.0, 0.0]
Σ: [5.0 0.0 0.0; 0.0 5.0 0.0; 0.0 0.0 5.0]
)
And the code below will do create a multivariate normal distribution where the variables are correlated
= [[1.0, 0.8, 0.7] [0.8, 1.0, 0.9] [0.7, 0.9, 1.0]]
Σ
= MvNormal(zeros(p), Σ) d2
FullNormal(
dim: 3
μ: [0.0, 0.0, 0.0]
Σ: [1.0 0.8 0.7; 0.8 1.0 0.9; 0.7 0.9 1.0]
)