|
Nancy Hammond wrote:
> When x = log(X) ~ N(mu,sigma), X ~ LN(mu, sigma)
>
> I don't find the documentation clear about the data argument in lognpdf
>
> After fitting parameters for X~N(mu,sigma), I get
> probabilities > 1 for p = lognpdf(X,mu, sigma)
> probabilities < 1 for p = lognpdf((log(X)-mu)/sigma,0,1)
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.
Are you concerned about "probabilities > 1"? You should not be. These are probability density values, not probabilities. The LN is a continuous distribution.
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.
Hope this helps.
|