I am trying to create a random number based on the normal distribution characteristics that I have (mean and standard deviation). I do not have statistics and machine learning tools.
I know that one way to do this is to randomly generate a random number rfrom 0 to 1 and find the value that gives the probability of this random number. I can do this by introducing a standard normal function
f= @(y) (1/(1*2.50663))*exp(-((y).^2)/(2*1^2))
and solution for
r=integral(f,-Inf,z)
and then extrapolate from this z-value to the final answer Xusing the equation
z=(X-mew)/sigma
But as far as I know, there is no matlab command that allows you to solve for x, where x is the limit of the integral. Is there a way to do this, or is there a better way to randomly generate this number?
source
share