Unfit  3.1.1
Data fitting and optimization software
Public Member Functions | Private Attributes | List of all members
Unfit::Examples::Rosenbrock Class Reference

Implements the Rosenbrock function. More...

#include <Rosenbrock.hpp>

Inheritance diagram for Unfit::Examples::Rosenbrock:
Unfit::GenericCostFunction

Public Member Functions

 Rosenbrock (unsigned n)
 
std::vector< double > operator() (const std::vector< double > &param)
 
- Public Member Functions inherited from Unfit::GenericCostFunction
virtual ~GenericCostFunction ()
 

Private Attributes

const unsigned n_
 

Detailed Description

Implements the Rosenbrock function.

Here the goal is to find a parameter set that minimises the Rosenbrock function. This function is defined as:

f(x) = (1-A)*(1-A) + 105.0*(B-A*A)*(B-A*A)

The goal is to find the values of A & B that give a minimum cost. In terms of the model, A = param[0] and B = param[1].

Constructor & Destructor Documentation

◆ Rosenbrock()

Unfit::Examples::Rosenbrock::Rosenbrock ( unsigned  n)
inline

Create the cost function. Here the number of observations must be passed in.

Intended use : Rosenbrock cost_func(n);

Parameters
nThe number of observations

Member Function Documentation

◆ operator()()

std::vector<double> Unfit::Examples::Rosenbrock::operator() ( const std::vector< double > &  param)
inlinevirtual

Calculate the residuals for the Helical Valley function.

Intended use : residuals = cost_func(param)

Parameters
paramA vector containing the current estimates of the parameters
Returns
A vector containing the residuals

Implements Unfit::GenericCostFunction.

Member Data Documentation

◆ n_

const unsigned Unfit::Examples::Rosenbrock::n_
private

A variable to store number of observations


The documentation for this class was generated from the following file: