Skip to content

Commit

Permalink
add conditional model to example
Browse files Browse the repository at this point in the history
  • Loading branch information
William Wilkinson committed Jan 5, 2023
1 parent a71c04f commit 232a156
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/linear_regression.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Distributions
using Distributions: PDMat
using Distributions: PDMat, Hermitian
using LinearAlgebra
using MaximumLikelihoodUtils
using MaximumLikelihoodUtils: ColVecs
Expand Down Expand Up @@ -48,3 +48,6 @@ d_em = fit_mle(MvTDist, D)
A_em = d_em.Σ[fdim+1:end, 1:fdim] / d_em.Σ[1:fdim, 1:fdim]
b_em = d_em.μ[fdim+1:end] - A_em * d_em.μ[1:fdim]
C_em = d_em.Σ[fdim+1:end, fdim+1:end] - A_em * d_em.Σ[1:fdim, fdim+1:end]

# conditional model for prediction
d_cond(x) = MvTDist(d_em.df, A_em * x + b_em, PDMat(Hermitian(C_em)))

0 comments on commit 232a156

Please sign in to comment.