Permalink
Browse files

Changing initialization from a static property to function.

  • Loading branch information...
1 parent 0e48e6a commit a32d81f491e6730fb6ad6a6f97a8d4fa8092b2b5 @fierval committed Mar 3, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 Prototypes/MeanVariance/RiskMinimization.fs
  2. +1 −1 Prototypes/MeanVarianceDb/Program.cs
@@ -81,7 +81,7 @@ module RiskMinimizationFormulation =
let CreateRiskMinimization (expected : double []) (corelations : double [,]) (stdDeviations : double []) =
RiskMinimization (DenseVector(expected), DenseMatrix(corelations), DenseVector(stdDeviations))
- let CreateRiskMinimizationFromDb =
+ let CreateRiskMinimizationFromDb ()=
use dataLayer = new MeanVarianceData()
let expectation = dataLayer.GetExpected() |> Seq.toArray
let corelations = dataLayer.GetCorelations()
@@ -12,7 +12,7 @@ class Program
{
static void Main(string[] args)
{
- var rm = RiskMinimizationFormulation.CreateRiskMinimizationFromDb;
+ var rm = RiskMinimizationFormulation.CreateRiskMinimizationFromDb ();
var range = ListModule.OfSeq(Enumerable.Range(50, 120).Where(e => e % 5 == 0).Select(e => (double)e / 1000D));
rm.ChartOptimalWeights(range, new string[] { "Australia", "Austria", "Belgium", "Canada" });

0 comments on commit a32d81f

Please sign in to comment.