Sign-truncated normal sampling
ID: sign-truncated-normal-sampling
To draw restricted to a positive value, let and return for uniform . For restriction to a negative value use . These are inverse transform sampling constructions. Repeatedly drawing an untruncated normal until its sign agrees is also exact, but inefficient for rare signs.
New to topics? Read the docs here!