Skip to content

Fix implementations of multivariate Student distribution

Gregor Boehl requested to merge gboehl/dynare:multivariate_t into master

The implementation in matlab/distributions/multivariate_student_pdf.m contains an error. In https://git.dynare.org/Dynare/dynare/-/blob/master/matlab/distributions/multivariate_student_pdf.m?ref_type=heads#L34 it is

t1 = gamma( .5*(nn+df) ) / ( gamma( .5*nn ) * (df*pi)^(.5*nn) ) ;

where it should be

t1 = gamma( .5*(nn+df) ) / ( gamma( .5*df ) * (df*pi)^(.5*nn) ) ;

The PDF was thus wrong.

On this occasion I changed the calculation such that it is no longer necessary to use mldivide twice.

I also added support for vectorized input and output, both for multivariate_student_pdf.m and for rand_multivariate_student.m.

Merge request reports