John -
thanks for the suggestion. This will, of course, show the highest
correlation by the compounding method since that correlates well with
averaging. When I first heard the idea of comparing the two series by linear
interpolation of the sparser one, my instinctive reaction was that it would
bias the correlation lower though I'm not sure exactly why I thought that.
On reflection, it seems that linear interpolation could bias it either way,
perhaps depending on the overall trend of the series. This was really my
original motivation for running some simulations on different methods.
I parameterized the comparison function to allow comparison between series
of arbitrarily different frequencies. From this, I see that interpolation
severely limits the variance of the correlation coefficient, especially when
you compare monthly versus yearly numbers (see below).
Brian - thanks for your help as well. However, perhaps I didn't make it
clear that I'm looking for the correlations between two separate series: for
one fund we have monthly return data, for another, only quarterly.
Regards,
Devon
NB.* compareCorrBtwDiffFrqs: look at correlations between random series of
NB. different frequencies using three different methods: reduction,
NB. interpolation, and compounding.
compareCorrBtwDiffFrqs=: 3 : 0"1
'np fd'=. y NB. # points (sparser series), frequency difference
dense=. <:+:?0$~fd*np
sparse=.(+/%#)"1 ](-fd)]\dense NB. Sparser is average of denser
cc=. 3{.corrCoeff sparse,.dense#~1,2~:/\<.((#dense)%~#sparse)*i.#dense
cc=. (corrCoeff (,(fd-1) linterpolate"0 sparse),.dense) 1}cc
cc=. (corrCoeff sparse,.(-fd) aggrets\dense) 2}cc
NB.EG compareCorrBtwDiffFrqs 84 12 NB. look at 84 monthly versus yearly
values
)
$tt=. compareCorrBtwDiffFrqs &>100$<84 12 NB. Look at 100 samples:
monthly vs. yearly for 7 years
100 3
stddev tt
0.1000609 0.021911126 0.063240913
NB. Columns of "tt" are methods: Reduction, Interpolation, Compounding
plarg=. 'title Correlation Coefficients Between Monthly and (Derived)
Yearly Series by Different Methods;pensize 3;key Reduction Interpolation
Compounding'
plarg plot |:tt/:2{"1 tt NB. Plot sorted by Compounding method
On 7/28/07, Brian Schott <[EMAIL PROTECTED]> wrote:
>
> (some) corrections attempted
>
> On Sat, 28 Jul 2007, Brian Schott wrote:
>
> + Devon,
> +
> + By "returns" can I assume you mean something like
> + financial returns where for example if you had the following
> + value figures at the end of various months, then your
> + returns would be calculated as suggested?
> +
> + month value mnth return qtr return
> +
> + 0 100
> + 1 110 10%100 (unknown)
> + 2 121 11%100 (unknown)
>
> 2 121 11%110 (unknown)
>
> + 3 130 9%100 30%100
>
> 3 130 9%121=0.07438 30%100
>
> + 4 139 9%100 (unknown)
>
> 4 139 9%13=0.069230 (unknown)
> +
> + If my assumption above is correct, is the correct
> + correlation for that one set of figures the correlation
> + between the following pairs and the pairs would be expanded
> + by three pairs for each additional set of quarters of data
> + you have?
> +
> + 0.10 0.11 0.09%12
>
> 0.10 0.10 0.07438%12
>
> + 0.30 0.30 0.30% 4
> +
> + Or maybe the following pairs are better, but the
> + important point is that each quarterly aligns with 3 monthly
> + figures, and it is best that the three pieces be kept
> + pristine, imo.
> +
> + 0.11 0.09 0.09%12
>
> 0.10 0.07438 0.069230%12
>
> + 0.30 0.30 0.30% 4
> +
> + Otoh, if the quarterly figures are known and
> + calculated at the end of each month, then they each would be
> + used with a different month's figure.
> +
> + Maybe I have this all wrong. Please advise.
> +
> + (B=)
> +
> + Brian Schott
> +
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm