I have the following worksheet:
The point of the spreadsheet is to use the LINEST function to determine what percentage of each of 3 mutual funds (FXAIX, FSMDX, FSSNX) best approximates a 4th fund (FSKAX). In other words, I am trying to find the least squares solution to the following overdetermined system of equations:
I have used LINEST successfully when the data is arranged in adjacent cells, but is it possible to use it in the example above where the matrix numbers are not in adjacent cells?
FXAIX | ||
16 | 29 | 38 |
5 | 8 | 3 |
0 | 0 | 0 |
FSMDX | ||
2 | 7 | 7 |
20 | 35 | 18 |
4 | 5 | 2 |
FSSNX | ||
0 | 0 | 0 |
1 | 2 | 3 |
30 | 41 | 23 |
FSKAX (target) | ||
14 | 25 | 33 |
5 | 9 | 5 |
3 | 4 | 2 |
fund | pct | |
FXAIX | ||
FSMDX | ||
FSSNX | ||
The point of the spreadsheet is to use the LINEST function to determine what percentage of each of 3 mutual funds (FXAIX, FSMDX, FSSNX) best approximates a 4th fund (FSKAX). In other words, I am trying to find the least squares solution to the following overdetermined system of equations:
VBA Code:
16*a + 2*b + 0*c = 14
29*a + 7*b + 0*c = 25
38*a + 7*b + 0*c = 33
5*a + 20*b + 1*c = 5
8*a + 35*b + 2*c = 9
0*a + 5*b + 41*c = 4
0*a + 4*b + 30*c = 3
0*a + 5*b + 41*c = 4
0*a + 2*b + 23*c = 2
I have used LINEST successfully when the data is arranged in adjacent cells, but is it possible to use it in the example above where the matrix numbers are not in adjacent cells?