

function [prob] = mulvtpdf(x, mu, Scale, df)


% OUTPUT
% prob      : probability, scalar
% INPUT
% x         : Value at which the probability is calculated, column vector
% mu        : location parameter, colum vector
% scale     : scale matrix, must be positive definite
% df        : degrees of freedom

k       = size(x,1);

% Check function
if k~= size(mu,1)
    error('Size of x and mu should be same, both should be column vectors')
end

numpdf      = gamma( (k+df)/2 );
denpdf      = ( (det(Scale))^(0.5) )*( gamma(df/2) )*( (df*pi)^(k/2) );
kernelpdf   = ( 1 + (1/df)*( (x-mu)'*(inv(Scale))*(x-mu) )  )^( -(k+df)/2);

prob        = ( numpdf/denpdf )*kernelpdf;

% z           = (x-mu)'*(inv(Scale))*(x-mu);
% prob        = ( gamma((k+df)/2)/(gamma(df/2)) )*( ( (det(Scale))^-0.5 )*( (pi*df)^(-k/2) ) )*...
%               (1 + z/df)^(-(k+df)/2);
