writing normally distributed error code

Hello all,
I have an equation
Y = aX + E.....
E is error term that is N ~ ( 0 , [ 25 0 ; 0 25] ) , how I can write a code for E in this case know that it will be 2 x1 matrix size. that is normally distibuted with 0 mean and 25 standard deviation
Thank you in advance.

5 comentarios

Lina Alhelo
Lina Alhelo el 2 de Jun. de 2019
You mean it will be as random value, I will not have a certain constant value?
Bjorn Gustavsson
Bjorn Gustavsson el 2 de Jun. de 2019
Yes, that is what N(m,C) means, that you have a random numbers with expected values m and covariance C. Your case is what one typically do to model normal-distributed "random noise in measurements".
Lina Alhelo
Lina Alhelo el 2 de Jun. de 2019
Editada: Lina Alhelo el 3 de Jun. de 2019
Thank you very much.
I typically use something like this for scalar white noise with standard deviation proportional to the sqrt(intensity):
I = I_ideal + I_ideal.^.5*randn(size(I_ideal));
Maybe the documentation to normrnd gives you more information?
HTH
Lina Alhelo
Lina Alhelo el 3 de Jun. de 2019
Editada: Lina Alhelo el 3 de Jun. de 2019
Thank you very much, your help was valuable.

Iniciar sesión para comentar.

 Respuesta aceptada

Bjorn Gustavsson
Bjorn Gustavsson el 2 de Jun. de 2019

1 voto

Have a look at: randn, and normrnd.
HTH

Más respuestas (0)

Preguntada:

el 2 de Jun. de 2019

Editada:

el 3 de Jun. de 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by