<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245240</link>
    <title>MATLAB Central Newsreader - multivariate student t distribution pdf in matlab?</title>
    <description>Feed for thread: multivariate student t distribution pdf in matlab?</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 24 Feb 2009 14:38:43 -0500</pubDate>
      <title>multivariate student t distribution pdf in matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245240#630473</link>
      <author>per</author>
      <description>hi all,&lt;br&gt;
&lt;br&gt;
i am trying to evaluate the pdf for various points that are&lt;br&gt;
distributed according to a multivariate Student t distribution. all&lt;br&gt;
the stat texts tell me that the multivariate t distribution pdf takes&lt;br&gt;
three parameters: a mean mu and a correlation matrix C, and a degrees-&lt;br&gt;
of-freedom parameter (and the point to evaluate the pdf on obviously.)&lt;br&gt;
&lt;br&gt;
the 'mvtpdf' function in matlab takes only two arguments: a degrees-of-&lt;br&gt;
freedom parameter and a correlation matrix C. what happened to the mu&lt;br&gt;
(mean) parameter? is there a way to evaluate this pdf in matlab&lt;br&gt;
according to the parametrization i have above?&lt;br&gt;
&lt;br&gt;
thank you.</description>
    </item>
    <item>
      <pubDate>Tue, 24 Feb 2009 15:56:54 -0500</pubDate>
      <title>Re: multivariate student t distribution pdf in matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245240#630502</link>
      <author>Peter Perkins</author>
      <description>per wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; i am trying to evaluate the pdf for various points that are&lt;br&gt;
&amp;gt; distributed according to a multivariate Student t distribution. all&lt;br&gt;
&amp;gt; the stat texts tell me that the multivariate t distribution pdf takes&lt;br&gt;
&amp;gt; three parameters: a mean mu and a correlation matrix C, and a degrees-&lt;br&gt;
&amp;gt; of-freedom parameter (and the point to evaluate the pdf on obviously.)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; the 'mvtpdf' function in matlab takes only two arguments: a degrees-of-&lt;br&gt;
&amp;gt; freedom parameter and a correlation matrix C. what happened to the mu&lt;br&gt;
&amp;gt; (mean) parameter? is there a way to evaluate this pdf in matlab&lt;br&gt;
&amp;gt; according to the parametrization i have above?&lt;br&gt;
&lt;br&gt;
Strictly speaking, the multivariate t has two parameters, but it's often the case that people add scale and location to that, and a simple transformation does the trick.  It's easy to compute the PDF for such a thing by unscaling and unshifting your data, then using MVTPDF and the usual rules for the PDF of a transformed variable.&lt;br&gt;
&lt;br&gt;
Hope this helps.</description>
    </item>
    <item>
      <pubDate>Fri, 27 Feb 2009 13:49:43 -0500</pubDate>
      <title>Re: multivariate student t distribution pdf in matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245240#631321</link>
      <author>per</author>
      <description>On Feb 24, 10:56=A0am, Peter Perkins&lt;br&gt;
&amp;lt;Peter.PerkinsRemoveT...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; per wrote:&lt;br&gt;
&amp;gt; &amp;gt; i am trying to evaluate the pdf for various points that are&lt;br&gt;
&amp;gt; &amp;gt; distributed according to a multivariate Student t distribution. all&lt;br&gt;
&amp;gt; &amp;gt; the stat texts tell me that the multivariate t distribution pdf takes&lt;br&gt;
&amp;gt; &amp;gt; three parameters: a mean mu and a correlation matrix C, and a degrees-&lt;br&gt;
&amp;gt; &amp;gt; of-freedom parameter (and the point to evaluate the pdf on obviously.)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; the 'mvtpdf' function in matlab takes only two arguments: a degrees-of-&lt;br&gt;
&amp;gt; &amp;gt; freedom parameter and a correlation matrix C. what happened to the mu&lt;br&gt;
&amp;gt; &amp;gt; (mean) parameter? is there a way to evaluate this pdf in matlab&lt;br&gt;
&amp;gt; &amp;gt; according to the parametrization i have above?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Strictly speaking, the multivariate t has two parameters, but it's often =&lt;br&gt;
the case that people add scale and location to that, and a simple transform=&lt;br&gt;
ation does the trick. =A0It's easy to compute the PDF for such a thing by u=&lt;br&gt;
nscaling and unshifting your data, then using MVTPDF and the usual rules fo=&lt;br&gt;
r the PDF of a transformed variable.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hope this helps.&lt;br&gt;
&lt;br&gt;
hi Peter,&lt;br&gt;
can you please say more about the transformation? i'm not sure i am&lt;br&gt;
following. what kind of transformation of the data would make it so i&lt;br&gt;
don't have to give the location (mu) parameter, but just the&lt;br&gt;
covariance matrix/correlation matrix (parameter C)?</description>
    </item>
    <item>
      <pubDate>Fri, 27 Feb 2009 14:38:24 -0500</pubDate>
      <title>Re: multivariate student t distribution pdf in matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245240#631335</link>
      <author>Peter Perkins</author>
      <description>per wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt; can you please say more about the transformation? i'm not sure i am&lt;br&gt;
&amp;gt; following. what kind of transformation of the data would make it so i&lt;br&gt;
&amp;gt; don't have to give the location (mu) parameter, but just the&lt;br&gt;
&amp;gt; covariance matrix/correlation matrix (parameter C)?&lt;br&gt;
&lt;br&gt;
No transformation will do that; you will always have to specify the degrees of freedom parameter as well.&lt;br&gt;
&lt;br&gt;
All you need to do to use MVT as a location/scale family is, separately for each column of your data, subtract the corresponding mean and divide by the corresponding scale factor.  It sounds like you have the Statistics Toolbox.  Take a look in stats/private/addtls.m; that code the handles the univariate t-location-scale distribution for the Distribution Fitting Tool is in there.  Look at tlspdf and tlscdf.  You need to do the same thing coordinate-wise.&lt;br&gt;
&lt;br&gt;
Hope this helps.</description>
    </item>
    <item>
      <pubDate>Wed, 04 Nov 2009 19:21:04 -0500</pubDate>
      <title>Re: multivariate student t distribution pdf in matlab?</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/245240#692164</link>
      <author>Kevin Murphy</author>
      <description>&lt;br&gt;
You can just write your own function to compute it - see below.&lt;br&gt;
Note that the mvtpdf function in the stats toolbox&lt;br&gt;
first converts Sigma to a correlation matrix, &lt;br&gt;
which is nonstandard (as far as I know).&lt;br&gt;
Thus these two methods only&lt;br&gt;
give the same results if Sigma has 1 on all the diagonals.&lt;br&gt;
&lt;br&gt;
HTH&lt;br&gt;
Kevin&lt;br&gt;
&lt;br&gt;
function logp = mvtLogpdf(X, mu, Sigma, nu)&lt;br&gt;
% Multivariate student T distribution, log pdf&lt;br&gt;
% X(i,:) is i'th case&lt;br&gt;
[N d] = size(X);&lt;br&gt;
M = repmat(mu(:)', N, 1); % replicate the mean across rows&lt;br&gt;
X = X-M;&lt;br&gt;
mahal = sum((X*inv(Sigma)).*X,2); %#ok&lt;br&gt;
logc = gammaln(nu/2 + d/2) - gammaln(nu/2) - 0.5*logdet(Sigma) ...&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;- (d/2)*log(nu) - (d/2)*log(pi);&lt;br&gt;
logp = logc  -(nu+d)/2*log1p(mahal/nu);&lt;br&gt;
&lt;br&gt;
if 0&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;% this check only works if Sigma is a correlation matrix&lt;br&gt;
&amp;nbsp;&amp;nbsp;logp2 = log(mvtpdf(X, Sigma, nu));&lt;br&gt;
&amp;nbsp;&amp;nbsp;assert(approxeq(logp, logp2))&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Peter Perkins &amp;lt;Peter.PerkinsRemoveThis@mathworks.com&amp;gt; wrote in message &amp;lt;go8tt0$rma$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; per wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; can you please say more about the transformation? i'm not sure i am&lt;br&gt;
&amp;gt; &amp;gt; following. what kind of transformation of the data would make it so i&lt;br&gt;
&amp;gt; &amp;gt; don't have to give the location (mu) parameter, but just the&lt;br&gt;
&amp;gt; &amp;gt; covariance matrix/correlation matrix (parameter C)?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; No transformation will do that; you will always have to specify the degrees of freedom parameter as well.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; All you need to do to use MVT as a location/scale family is, separately for each column of your data, subtract the corresponding mean and divide by the corresponding scale factor.  It sounds like you have the Statistics Toolbox.  Take a look in stats/private/addtls.m; that code the handles the univariate t-location-scale distribution for the Distribution Fitting Tool is in there.  Look at tlspdf and tlscdf.  You need to do the same thing coordinate-wise.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hope this helps.</description>
    </item>
  </channel>
</rss>

