|
On 6/2/2012 4:18 AM, Valeriu wrote:
> Hello,
>
> I have a set of ideal -error free- measurements and i want to add some error
>to them to simulate measurement error (noise etc). I want to know how to add an error with a known standard deviation.
>
> X is the ideall measurements.
> ? is the standard deviation of the error measurement - known
> e - error
>
> Xreal = X + e
>
> Xreal = X + ?^2*randn(1) ?
>
> this is not right becouse i will have only positive errors...
>
> please help needed!!
2*randn(1) you give one random number from distribution whose mean
is zero and with std of 2. So, you'll get negative numbers 50% of the time.
How about using randn with mean of 6?
6+2*randn(1) ?
This way since std=2, then -3*std will get you to zero and +3*std will
get you to 12.
So, 99.73% of the time, your errors will stay in the positive range.
Or you can go to mean of 8? this way, 99.994% of all the
numbers will come out positive?
(if you happen to get one negative, you can throw the dice again?)
Or you can go with mean=10, then 99.99999999999% (or something like this)
of the time the numbers will be positive? etc... you get the point
--Nasser
|