The SD of a random variable itself being a random variable

Imagine a hierarchical model with 2 random variables of sd0 and sd1 standard deviation. What is the global SD ?

It is simply: SD=sqrt(sd0^2+sd1^2)

sd0 <- 1
sd1 <- 2
x0 <- rnorm(100000, mean=100, sd=sd0)
sd(x0)
var(x0)
x1 <- rnorm(100000, mean=x0, sd=sd1)
sd(x1)
var(x1)
sd0^2+sd1^2
sqrt(sd0^2+sd1^2)

Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04