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$
9
  • $\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$ Commented Feb 28, 2017 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$ Commented Feb 28, 2017 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$ Commented Mar 1, 2017 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$ Commented Mar 1, 2017 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$ Commented Jun 29, 2017 at 15:51

1 Answer 1

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$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.