<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259623</link>
    <title>MATLAB Central Newsreader - syntax for lognpdf(X,mu,sigma)</title>
    <description>Feed for thread: syntax for lognpdf(X,mu,sigma)</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>Fri, 28 Aug 2009 20:38:21 -0400</pubDate>
      <title>syntax for lognpdf(X,mu,sigma)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259623#676634</link>
      <author>Nancy Hammond</author>
      <description>When  x = log(X) ~ N(mu,sigma),  X ~ LN(mu, sigma)&lt;br&gt;
&lt;br&gt;
I don't find the  documentation clear about the data argument in lognpdf&lt;br&gt;
&lt;br&gt;
After fitting parameters for X~N(mu,sigma), I get &lt;br&gt;
probabilities &amp;gt; 1 for p =  lognpdf(X,mu, sigma)&lt;br&gt;
probabilities &amp;lt; 1 for p =  lognpdf((log(X)-mu)/sigma,0,1)&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;br&gt;
nh</description>
    </item>
    <item>
      <pubDate>Fri, 28 Aug 2009 21:44:03 -0400</pubDate>
      <title>Re: syntax for lognpdf(X,mu,sigma)</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/259623#676649</link>
      <author>Peter Perkins</author>
      <description>Nancy Hammond wrote:&lt;br&gt;
&amp;gt; When  x = log(X) ~ N(mu,sigma),  X ~ LN(mu, sigma)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I don't find the  documentation clear about the data argument in lognpdf&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; After fitting parameters for X~N(mu,sigma), I get &lt;br&gt;
&amp;gt; probabilities &amp;gt; 1 for p =  lognpdf(X,mu, sigma)&lt;br&gt;
&amp;gt; probabilities &amp;lt; 1 for p =  lognpdf((log(X)-mu)/sigma,0,1)&lt;br&gt;
&lt;br&gt;
Nancy, if x (as opposed to X) is a vector of data that you've fit a normal distribution to using, say, NORMFIT, and mu and sigma are the fitted parameters, then you'd want to pass X (equivalently exp(x)) into LOGNPDF.  So the first line seems like what you'd want.&lt;br&gt;
&lt;br&gt;
Are you concerned about &quot;probabilities &amp;gt; 1&quot;?  You should not be.  These are probability density values, not probabilities.  The LN is a continuous distribution.&lt;br&gt;
&lt;br&gt;
It might be less confusing if you use LOGNFIT to fit the lognormal directrly to X.  Then you need not worry about the parameterization or transformation.&lt;br&gt;
&lt;br&gt;
Hope this helps.</description>
    </item>
  </channel>
</rss>

