Tries,
from simulated weights of batches of possibly
unequal sizes of bags (or other collective items),
to determine the mean and standard deviation,
μ and σ, of the Gaussian distribution
assumed for the weight of the individual bags.
The sizes of the m batches (indeed, commercial lots)
are ni, i = 1..m,
given in the vector n.
The determination of σ
is done by a weighting criterion applied to the various lot sizes,
a conjecture. The weights are, for i = 1..m,
wi = nic ⁄ Σnic.
(A criterion of c = 0 leads, of course, to the arithmetic mean,
which will also be the case for any c if all the
ni are equal.)
Detail...
The best criterion appears to be c = 1.
This is an attempt to estimate σ
(estimating μ is trivial) from a set of experimental data
that are here simulated but which routinely exist in many industries.
(The base data are inspired in real bags of fertilizers.)
As this computation is rather lengthy,
if the number of trials is excessive (for the total lot sizes),
it is reduced (trials × lot total ≤ 108).
Draws a plot of f, the 'pdf', and F,
the 'cdf', of the averages of bags,
a (certainly, around μ), only to verify
the sufficiency of the Monte Carlo simulation. |