On Wed, 1 Jul 2015, Sven Schreiber wrote:
I noticed that corr() and mcorr() produce the same results, but sd()
and sdc() seem to use different divisors.
True: both corr() and mcorr() use sample standard deviations in
computing the correlation coefficient, but sd() and sdc() differ in
that sd computes the sample standard deviation while sdc computes the
MLE by default (with the option of supplying a df value).
This "diff-in-diff" seems to me a bit arbitrary, or is
there some
background story? Otherwise I'd say the functions should all use the
same convention. (which one I don't care)
Well, there's some sort of background here. (1) AFAIK, correlation
coefficients are almost always computed using the sample sd. (2) The
sd() function is intended for series and I'd guess that in that
context most people want the sample sd most of the time. (3) In the
matrix context of sdc() users are somewhat more likely to be doing
something asymptotic.
This may not provide a very compelling rationale for what we do now,
but the difference between sd() and sdc() is documented in the help
for those functions.
Allin