Re: Variance of a Plot



Can't think of a function that'll do what you want, but it sounds
like you need a quick measure for the "width" of a distribution,
which is doable. A quick-n-dirty way to do this (often, the accuracy
of the variance of a distribution isn't crucial) is to assume that
each value in your 20 "bins" correspond to the central value of that
bin.

So, take your mean value to be m=(X'*Y)/sum(Y), I'm guessing
something like 11.3, and then compute a rough variance this way:
v=(Y'*(X-m).^2)/sum(Y) - where you are weighting your bin's
"distances" from the mean by the quantity of points lying in each
bin.

So ... you'll probably see something like 17 -> a std dev of
around 4 or so for this 20-bin example. I hope this is more helpful
than anti-helpful. Alternatively, you could also estimate a stddev
straight from the unnormalized distribution (i.e. the two values
between which 68% of your distribution lies, the two values between
which 95% of your distribution lies, etc. etc.).

D. B. Yu

Soumyadip Rak*** wrote:
>
>
> Hi,
>
> Could you please tell me how to find the variance of a plot rather
> than that
> of data. Basically, I have the Y-data and would like to know how
> much it is
> spread about its peak at X
>
> For example if the Data is as follows
>
> Y = 0.2, 0.5, 1.2, ..., 4.6, 5.4, 5.1, ..., 1.9, 0.8, 0.5
> X = 1, 2, 3 ... 20
>
> with the peak (5.4) at 11
>
> I would like to find out how much the variance of the curve is
> about this
> peak at 11.
>
> Does Matlab have a function for this ?
>
> Thanks a ton for the help.
> Soumyadip.
>
>
>
.