[R] Standard Deviation Distribution

Duncan Murdoch murdoch at stats.uwo.ca
Sun Jun 18 10:14:44 CEST 2006


davidr at rhotrading.com wrote:
> I'm having trouble with the standard deviation distribution
> as shown on http://mathworld.wolfram.com/StandardDeviationDistribution.html .
> (Eric Weisstein references Kenney and Keeping 1951, which I can't check.)
>
> I believe the graphs they show, but when I code the function in R, according to the listed formula,
> I get very different graphs.
>
> Would someone please point out my error or tell me where it's already implemented in R?
>
> Here is my version:
>   
>> sddist
>>     
> function(s,n) {
> sig2 <- n*s*s/(n-1)
> 2*(n/(2*sig2))^((n-1)/2) / gamma((n-1)/2) * exp(-n*s*s/(2*sig2)) * s^(n-2)
> }
>
>   
Your initial factor looks a lot different from theirs.  I think you 
believed your variable name (i.e. sig2 is sigma^2), but didn't
define it that way.

Duncan Murdoch
> Version 2.3.1 (2006-06-01) on Windows XP SP2
>
> Thanks for any help.
>
> David L. Reiner
> Rho Trading Securities, LLC
> Chicago  IL  60605
> 312-362-4963
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



More information about the R-help mailing list