Beispiel #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;
        }
Beispiel #2
0
        private LinearRateModel ReturnModelWithReplacedFwdCurve(CurveTenor tenor, Curve newCurve)
        {
            FwdCurveContainer newCollection = FwdCurveCollection.Copy();

            newCollection.AddCurve(newCurve, tenor);
            return(new LinearRateModel(DiscCurve.Copy(), newCollection, Interpolation));
        }