Skip to content
Prev 293612 / 398502 Next

estimation problem

Dear Petr,

thank you for your input.
I tried to experiment with (probably somewhat biased) truncated means 
like in the following code.
How I got the 225 as a truncation limit is a good question. :)

REPS1 <- REPS2 <- 1000
N1 <- 100000
N2 <- 30000
N <- N1+N2
x1 <- rep(0,N1)
x2 <- rnorm(N2,300,100)
x <- c(x1,x2)

n <- 1000

for (i in 1:REPS1){
   x_sample <- sort(sample(x,n,replace=FALSE),TRUE)
   x_trunc <- x_sample[1:225]
   REPS1[i] <- mean(x_sample)*N
   REPS2[i] <- sum(x_trunc)/n*N
   }

sum(x2)
mean(REPS1)
mean(REPS2)
sd(REPS1)
sd(REPS2)
sd(REPS2)/sd(REPS1)


Best,
daniel

2012.05.03. 17:45 keltez?ssel, Petr Savicky ?rta: