If all is well with your Function, this should work:
Function test() As Variant
test1 = *SQR*(Application.MMult(Application.MMult(RegionR
CovarMatrix), _
Application.Transpose(RegionR)))
End Function
But, I have serious reservations about the entire layered-structure of
the Function, among other things.
Firstly, RegionR = Sheets("Inputs").Range(Cells(12, 3), Cells(12, 2
num_regions)).Value defines a Variant Array, not a value, an
therefore its deployment in your Function Test should generate a
error. And then again, Function RegionR() should carry an argument a
in Function *RegionR(num_regions)*. Ditto Function CovarMatrix(
---Function CovarMatrix()num_regions.
My gravest concern is with Function CovarMatrix(). None of the batter
of Array holders RegionVar(), RegionStd(), RegionStd() and CorrMatri
is defined or dimensioned leaving it questionable as to how they ca
supply the inputs for the covariance matrix.
If you can clarify the situation, that should help the cause.
David
--
david
-----------------------------------------------------------------------
davidm's Profile:
http://www.excelforum.com/member.php...fo&userid=2064
View this thread:
http://www.excelforum.com/showthread.php?threadid=48395