0

For sample selection from a list, I wish to use a mathematical distribution where the total number of samples is fixed, St = 1000 and there are 5 buckets such that the initial distribution is uniform. samples = [200, 200, 200, 200, 200] I wish to add random Gaussian noise with mean 0 and 20% of uniform class weight as standard deviation, but the total number of samples should still be 1000.

This is my current code block

signal = np.array([200, 200, 200, 200, 200])
print('total samples: ', sum(signal))
noise = np.random.normal(0,0.2,5)
print('noise generated: ',noise)
val = (signal*noise)
val = np.round(val,0)
val = val+signal
print(val)
print('samples after weighted distribution: ',sum(val))

enter image description here

I want to apply weights but still maintain the total number of samples as 1000. How do I go about this?

0 Answers0