Truncated Distribution
Given a percentile_threshold
, sample size , and mean and standard deviation and of the normal distribution, write a function truncated_dist
to simulate a normal distribution truncated at percentile_threshold
.
Example:
Input:
m = 2
sd = 1
n = 6
percentile_threshold = 0.75
Output:
def truncated_dist(m,sd,n, percentile_threshold): ->
[2, 1.1, 2.2, 3, 1.5, 1.3]
All values in the output sample are in the lower 75% = percentile_threshold
of the distribution.
.....
Loading editor