Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Standard deviation
Replies: 2   Last Post: Jan 28, 2013 9:50 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Torsten

Posts: 1,439
Registered: 11/8/10
Re: Standard deviation
Posted: Jan 28, 2013 9:50 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Paul " <paulrockt@gmx.de> wrote in message <ke61o4$4n8$1@newscl01ah.mathworks.com>...
> Hi together,
> i calculate the standard deviaton in MATLAB and to the check the results i reculculated manually in MATLAB and Excel and i got different results. I split the formula in MATLAB to calculate the individual terms and as result i have received the same as in Excel. Is there a known problem with the standard deviation in MATLAB?
>
> My example:
>
> test = -18.2264 -17.7185 -15.4258 -15.4092
>
> mean_test = -16.6950 <<< mean_test= mean(test)
>
> sqr = 278.7222 <<< sqr= mean_test^2
>
> test_sqr = 332.2018 313.9459 237.9556 237.4423 <<< test_sqr= test.^2
>
> diff = 53.4796 35.2237 -40.7666 -41.2799 <<< diff = bsxfun(@minus,test_sqr,sqr)
>
> sum = 6.6568 <<< summe = sum(diff(:))
>
> norm = 1.6642 <<< norm = 0.25*summe
>
> final = 1.2900 <<< final = norm^0.5
>
> my results
>
> in Excel: 1.2901
> in MATLAB (manually): 1.2900
> in MATLAB (with "stdev"): 1.0931
>
> Can someone explain this to me?
>
> Thanks,Paul


1. I only know of the command "std" in MATLAB.
2. Usually, the above variable "norm" is calculated according to norm=1/3*summe.

Instead of the stepwise calculation from above, provide your MATLAB code -
it's easier to follow.

Best wishes
Torsten.


Date Subject Author
1/28/13
Read Re: Standard deviation
Jos
1/28/13
Read Re: Standard deviation
Torsten

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.