Generate Samples from Truncated Normal Distribution
GoogleData Scientist · Technical ScreenLast updated
Evaluates truncated normal distribution fundamentals and sampling methods for lower-tail truncation. Strong answers name the lower-truncated normal, provide the PDF and CDF, and compare inverse-CDF, rejection, and tail-efficient samplers.
Scenario
You only keep samples from a normal distribution that are greater than 1.
Question
a) What is this resulting distribution called? b) Give its formal PDF/CDF definition. c) Describe at least two different ways to generate random samples directly from this truncated normal distribution.
Hints
CDF inversion and rejection/Monte-Carlo sampling are both acceptable.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.