예제 #1
0
        public XABRInterpolationImpl(List <double> xBegin, int size, List <double> yBegin, double t,
                                     double forward, List <double?> _params,
                                     List <bool> paramIsFixed, bool vegaWeighted,
                                     EndCriteria endCriteria,
                                     OptimizationMethod optMethod,
                                     double errorAccept, bool useMaxError, int maxGuesses, List <double?> addParams = null)
            : base(xBegin, size, yBegin)
        {
            // XABRCoeffHolder<Model>(t, forward, params, paramIsFixed),
            endCriteria_  = endCriteria;
            optMethod_    = optMethod;
            errorAccept_  = errorAccept;
            useMaxError_  = useMaxError;
            maxGuesses_   = maxGuesses;
            forward_      = forward;
            vegaWeighted_ = vegaWeighted;

            // if no optimization method or endCriteria is provided, we provide one
            if (optMethod_ == null)
            {
                optMethod_ = new LevenbergMarquardt(1e-8, 1e-8, 1e-8);
            }
            if (endCriteria_ == null)
            {
                endCriteria_ = new EndCriteria(60000, 100, 1e-8, 1e-8, 1e-8);
            }
            coeff_ = new XABRCoeffHolder <Model>(t, forward, _params, paramIsFixed, addParams);
            this.coeff_.weights_ = new InitializedList <double>(size, 1.0 / size);
        }
예제 #2
0
        public XABRInterpolationImpl(List <double> xBegin, int size, List <double> yBegin, double t,
                                     double forward, List <double?> _params,
                                     List <bool> paramIsFixed, bool vegaWeighted,
                                     EndCriteria endCriteria,
                                     OptimizationMethod optMethod,
                                     double errorAccept, bool useMaxError, int maxGuesses, List <double?> addParams = null,
                                     XABRConstraint constraint = null)
            : base(xBegin, size, yBegin)
        {
            endCriteria_  = endCriteria ?? new EndCriteria(60000, 100, 1e-8, 1e-8, 1e-8);
            optMethod_    = optMethod ?? new LevenbergMarquardt(1e-8, 1e-8, 1e-8);
            errorAccept_  = errorAccept;
            useMaxError_  = useMaxError;
            maxGuesses_   = maxGuesses;
            forward_      = forward;
            vegaWeighted_ = vegaWeighted;
            constraint_   = constraint ?? new NoXABRConstraint();

            coeff_          = new XABRCoeffHolder <Model>(t, forward, _params, paramIsFixed, addParams);
            coeff_.weights_ = new InitializedList <double>(size, 1.0 / size);
        }
예제 #3
0
 public virtual void config <Model>(ProjectedCostFunction costFunction, XABRCoeffHolder <Model> coeff,
                                    double forward)
     where Model : IModel, new ()
 {
 }