Search code examples
rsimulation

The result of Monte Carlo standard error in my code could be wrong in R


I try to compute the Monte Carlo standard error of my estimators. I first got my estimators based on the following repetition of Monte Carlo simulation:

So my code is as follows but the results are weird...

#[1] 0.01081287
#[1] 0.007556727

Solution

  • You should follow the definition of MCSE of bias (theta in the formula refers to the estimated parameter, i.e., MLE)

    > MCSE_bias_mle <- sqrt(1 / rowSums((MLE - rowMeans(MLE))^2) / (2*choose(N, 2)))
    
    > MCSE_bias_mle
    [1] 0.010812870 0.007556727
    

    where the 1st and 2nd values are for mu and sigma, respectively