Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

This is a cross-post from stats.SE.

The radii r is drawn from a cut-off log-normal distribution, which has a following probability density function:

pdf=((sqrt(2).*exp(-0.5*((log(r/rch)).^2)))./((sqrt(pi.*(sigma_nd.^2)).*r).*(erf((log(rmax/rch))./sqrt(2.*(sigma_nd.^2)))-erf((log(rmin/rch))./sqrt(2.*(sigma_nd.^2))))));

rch, sigma_nd, rmax, and rmin are all constants.

It is also shown in the following snapshot: enter image description here

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

In general, if you cutoff a pdf at $r_{min}$ and $r_{max}$ the pdf stays the same, except that you need to normalize it back to one. This means that you have to divide by the probability mass in that interval, which is the cdf at $r_{max}$ minus the cdf at $r_{min}$. I don't have Matlab here at the moment, but in octave the command is

lognormal_pdf(r)./(lognormal_cdf(rmax) - lognormal_cdf(rmin))

Since the denominator does not depend on $r$, the cdf is

lognormal_cdf(r)./(lognormal_cdf(rmax) - lognormal_cdf(rmin))
share|improve this answer
    
Would it be correct if I find truncated normal random variables by generating the untruncated values and replacing those that are outside the limits. Then, finally use the truncated normal random variable, say y, as follow: r = rch * exp(y).? –  Pupil Dec 18 '11 at 18:23
    
I am not sure what your goal is here. If you want to sample from the truncated distribution, then you can sample from the untruncated one and throw away everything that is not inside the truncation borders. However, that might take very long until you have enough samples. The other option is to use the inverse cdf of the lognormal distribution (actually works for every distribution). I am not sure whether it is available in matlab. Say $a=cdf(r_{min})$ and $b = cdf(r_{max})$, then sample $u\sim U[0,1]$ and use $icdf((u-a)/(b-a))$. That gives you samples from the truncated distribution. –  fabee Dec 18 '11 at 21:22
    
The question is what is the CDF of the given distribution? If I know CDF then I can follow the rest of the steps... –  Pupil Dec 18 '11 at 21:50
1  
Sorry, I don't get your question. The cdf of what? Of the truncated log-normal? The cdf of that is cdf(r)/(cdf(rmax)-cdf(rmin)). –  fabee Dec 19 '11 at 8:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.