0
$\begingroup$

I'd like to generate some example data for this equation related to Bessel's correction. What is a way to generate data for first part of the equation (in the picture below). One way to approach is to come up with a vector, like x= {1,2,3} and do the Expected Value of Variance[x] - the biased variance. But, I had trouble understanding whether the Variance function uses n-1, so would it be the sigma^2 or Sbiased^2?

That is, in some way it would be ExpectedValue{x - sbiased}, where x is a matrix of something like x={{1,2,3}, {4,5,6}}.

I'm new to Mathematica (and stack overflow mathematica) and appreciate any help and advice if I posted a question in the wrong way. Thank you

enter image description here

$\endgroup$

closed as off-topic by wolfies, MarcoB, m_goldberg, LCarvalho, xzczd Jul 2 '17 at 9:30

  • The question does not concern the technical computing software Mathematica by Wolfram Research. Please see the help center to find out about the topics that can be asked here.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • $\begingroup$ you might want to consider it posting on the mathematics forum because it seems like you do not have any problem with the code but the mathematics (for which there is a dedicated forum). $\endgroup$ – Ali Hashmi Feb 28 '17 at 23:33
  • $\begingroup$ tom, if you agree with Ali Hashmi I can move your question to Mathematics; let me know in these comments, or flag your post for moderator attention. $\endgroup$ – Mr.Wizard Feb 28 '17 at 23:37
  • $\begingroup$ Thanks for suggestion. I want to make sure people in mathematics can tell me how to do it in mathematica. If that's the case, sure, please migrate it to any forum you think is best $\endgroup$ – tom Mar 1 '17 at 2:19
  • $\begingroup$ You would have to know the population mean $\mu$, and the distribution that the data comes from, in order to generate some sample data. If you would like to specify the distribution (e.g. $N(\mu, \sigma^2)$ ), then the question can be answered. You might also want to change your question from seeking the 'best' way, to different ways ... since 'best' is a restriction you probably don't intend, and hard to pin down. $\endgroup$ – wolfies Mar 1 '17 at 2:28
  • 2
    $\begingroup$ I'm voting to close this question as off-topic because the issue it raises is not a Mathematica issue but a mathematics issue. $\endgroup$ – m_goldberg Jun 29 '17 at 15:51
1
$\begingroup$

If the aim is illustrative, perhaps:

r[n_, k_] := RandomVariate[NormalDistribution[], {n, k}]
e[n_, k_] := Variance[Mean /@ rv[n, k]]
Manipulate[
 Show[DiscretePlot[e[n, s], {n, 100, 10000, 100}], 
  Plot[1/x, {x, 1, 10000}, PlotStyle -> Red]], {s, {10, 100, 1000}}]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.