Example #1
0
        public void SetEverything(Curve discCurve, CurveCalibrationProblem[] problems, CurveTenor[] tenors, CalibrationSpec settings, int[] OrderOfCalibration = null)
        {
            if (problems.Length != tenors.Length)
            {
                throw new InvalidOperationException("Number of problems and number of tenors have to match. ");
            }

            _problemMap         = new Dictionary <CurveTenor, CurveCalibrationProblem>();
            _hasBeenCalibrated  = new Dictionary <CurveTenor, bool>();
            _discCurve          = discCurve;
            _tenors             = tenors;
            _settings           = settings;
            _fwdCurveCollection = new FwdCurveContainer();


            List <int> curvePoints = new List <int>();

            for (int i = 0; i < problems.Length; i++)
            {
                _problemMap[tenors[i]] = problems[i];
                _fwdCurveCollection.AddCurve(problems[i].CurveToBeCalibrated, tenors[i]);
                curvePoints.Add(_fwdCurveCollection.GetCurve(tenors[i]).Dimension);
            }

            _curvePoints   = curvePoints.ToArray();
            _internalState = 0;
        }
Example #2
0
 public DiscCurveConstructor(CurveCalibrationProblem discProblem, CalibrationSpec settings)
 {
     _settings         = settings;
     _problem          = discProblem;
     _internalStateMax = settings.MaxIterations;
 }
Example #3
0
 // For constructing multiple curves at a time
 public FwdCurveConstructor(Curve discCurve, CurveCalibrationProblem[] problems, CurveTenor[] tenors, CalibrationSpec settings, int[] OrderOfCalibration = null)
 {
     SetEverything(discCurve, problems, tenors, settings, OrderOfCalibration);
 }