Suppose I want to conduct an experiment 10,000 times in which a random sample of size $n=20$ from a beta distribution is collected and then the values of four different estimators are collected. At the end of the 10,000 experiments, I should have a different list with 10,000 instances of each estimator (so essentially I'm trying to get 10,000 random samples for all four estimators). So I started with something like this:
n = 20
mypdf = PDF[BetaDistribution[5, 1], x]
randsamplesize20 = List[]
For[i = 0, i < n, i++,
AppendTo[randsamplesize20,
RandomVariate[ProbabilityDistribution[mypdf, {x, 0, 1}]]]]
Xbar = Mean[randsamplesize20]
MOM = Xbar/(1-Xbar)
LogSum = Total[Log[randsamplesize20]]
MLE = (-n/LogSum)
Bayes = (n*(n+1))/(1-n*LogSum)
Estimator4 = ((n-1)MLE)/n
But you notice that this code only conducts one experiment. I need to see the average of MOM
, MLE
, Bayes
, and Estimator4
over 10,000 independent experiments. I'm really not very familiar with Mathematica yet, so I tried to wrap all of this in a for loop and ended up with several errors. So my question is, how can I conduct this experiment 10,000 times while still preserving the values of the estimators in each experiment so that I can perform statistical analysis on the random sample of my estimators?