[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Re: simulation of standard normal values

**From**: |
CdeMills |

**Subject**: |
Re: simulation of standard normal values |

**Date**: |
Wed, 20 Jul 2011 00:35:33 -0700 (PDT) |

george brida wrote:
>* *
>* Dear Octavers,*
>* How can I simulate a sample of 50 observations from standard normal*
>* distribution so that the absolute value of each observation is less than*
>* 1?*
>* Many thanks in advance,*
>* *
The degree of freedom is the standard deviation. You want the probability of
|x| > 1 < 1/50, i.e.
prob(x < 1) < 0.01 (due to symmetry). The value of sigma is then determined
as
sig = norminv(0.99)
i.e. which is the threshold containing 99 % of the values ?
then
x = randn(1, 50)/sig
should fit your needs. Don't forget that you're using random variables, so
most of the time the constraint will be satisfied, but not always.
The problem lies in the question:
"so that the absolute value of each observation is less than 1?"
i.e. 'for which value of sigma is x NEVER > 1 ?'
"normal probability" and "never" should never be mixed in the same sentence,
for the domain of the normal pdf range from minus infinity to plus infinity.
You should define the problem in terms of confidence interval: "compute
sigma such that |x| > 1 only occurs 1/1000 of the time" or something
like that.
Regards
Pascal
--
View this message in context:
http://octave.1599824.n4.nabble.com/simulation-of-standard-normal-values-tp3679772p3680157.html
Sent from the Octave - General mailing list archive at Nabble.com.