# Multivariate (multiple response) regression using matrixnormal in Turing

Hi all,
I am new to Turing and wanted to play on a toy example with a multiple response regression. Here is the code. Any help will be greatly appreciated.

#— Code started here

``````using Distributions, LinearAlgebra
using Random, PDMats
using Turing
using Turing: Variational

Random.seed!(42);

@model function MultVar2(X, Y) #, ::Type{T}=Vector{Float64}) where {T} = begin
n, q = size(Y)
_, p = size(X)
ν0 = q + 1.
#-- Lambda
#
Λ ~ MvNormal(zeros(p), 10.)
#end
# Variancce Components
Σ ~ InverseWishart(ν0, PDMat(Matrix{Float64}(I,q,q)))

# C matrix

C ~ MatrixNormal(zeros(p,q), PDMat(diagm(exp.(Λ))) , Σ)

#--- Likelihood
mu = X*C
Y ~ MatrixNormal(mu, Matrix{Float64}(I, n, n), Σ)
end;

#-- Simulate data

n= 30
p = 5
q = 3
C= zeros(p, q)
C[1:2,1:q] = 2.0 .+ randn(2,3)
X = randn(n, p)

Y = X*C + randn(n,q)

n, q = size(Y)
_, p = size(X)
ν0 = p+1.

#-- Sample
c6 = sample(MultVar2(X, Y), NUTS(0.65), 1000)
``````

# when I run this I get the following error

``````type InverseWishart has no field c0
getproperty(::InverseWishart{Float64,PDMat{Float64,Array{Float64,2}}}, ::Symbol) at Base.jl:33
getlogp(::InverseWishart{Float64,PDMat{Float64,Array{Float64,2}}}, ::Cholesky{Float64,Array{Float64,2}}, ::Array{Float64,2}) at Bijectors.jl:240
pd_logpdf_with_trans(::InverseWishart{Float64,PDMat{Float64,Array{Float64,2}}}, ::Array{Float64,2}, ::Bool) at Bijectors.jl:221
logpdf_with_trans(::InverseWishart{Float64,PDMat{Float64,Array{Float64,2}}}, ::Array{Float64,2}, ::Bool) at Bijectors.jl:122
_tilde at context_implementations.jl:59 [inlined]
tilde at context_implementations.jl:23 [inlined]
macro expansion at VB_Turing.jl:41 [inlined]