using IStation.Numerics.LinearAlgebra; using System.Collections.Generic; namespace IStation.Numerics.Optimization { public interface IObjectiveModelEvaluation { IObjectiveModel CreateNew(); /// /// Get the y-values of the observations. /// Vector ObservedY { get; } /// /// Get the values of the weights for the observations. /// Matrix Weights { get; } /// /// Get the y-values of the fitted model that correspond to the independent values. /// Vector ModelValues { get; } /// /// Get the values of the parameters. /// Vector Point { get; } /// /// Get the residual sum of squares. /// double Value { get; } /// /// Get the Gradient vector. G = J'(y - f(x; p)) /// Vector Gradient { get; } /// /// Get the approximated Hessian matrix. H = J'J /// Matrix Hessian { get; } /// /// Get the number of calls to function. /// int FunctionEvaluations { get; set; } /// /// Get the number of calls to jacobian. /// int JacobianEvaluations { get; set; } /// /// Get the degree of freedom. /// int DegreeOfFreedom { get; } bool IsGradientSupported { get; } bool IsHessianSupported { get; } } public interface IObjectiveModel : IObjectiveModelEvaluation { void SetParameters(Vector initialGuess, List isFixed = null); void EvaluateAt(Vector parameters); IObjectiveModel Fork(); IObjectiveFunction ToObjectiveFunction(); } }