The standard deviation is NAN

Hi all,

I was trying to model an example in the aircraft tracking and assumed the signals are noisy with normal distribution but for an error in my code, when I generated the noise with rnorm I got NAN in the SD.
sigma.eps1<- sqrt(1000)
sd(rnorm(0,1,sigma.eps1))
NA
So any idea why I got this error, sorry if my code is not clear. Thankyou.

Best regards,
Lamia

From help(normal)

For sd = 0 this gives the limit as sd decreases to 0, a point mass at mu. sd < 0 is an error and returns NaN.

1 Like

The first argument to rnorm() is the number of points. You generated a sample of length 0, hence the NA.

2 Likes

Thank you so much for your reply appreciated!