These problems arise when you compute arithmetic return contributions: in a given month, you want the sum of the funds' contributions to equal the portfolio return. The sum of these single-month contributions over more than one month will never equal the total portfolio returns over more than one month.
One way to include the compounding effect is to 'pretend' that a segment's return contribution in one period is reinvested in the overall portfolio in succeeding periods.
Here is an example, with R code. There are just two periods: first F1 makes 10%, then F2 makes 10%. The weights of F1/F2 are kept constant at 50% each.
weights <- rbind(c( 0.5, 0.5),
c( 0.5, 0.5))
R <- rbind(c( 10, 0),
c( 0 , -10))/100
rc(R, weights, segment = c("F1", "F2"), timestamp = 1:2)
The output will be
timestamp F1 F2 total
1 1 0.05 0.00 0.05
2 2 0.00 0.05 0.05
F1 F2 total
0.0525 0.0500 0.1025
F1 makes a higher overall contribution because its single-period
contribution occured earlier and hence is compounded by the
overall portfolio return.
(The PMwR package, of which I am the author, is available from GitHub https://github.com/enricoschumann/PMwR .)