Rosenbrock function

class pints.toy.RosenbrockError[source]

Error measure based on the rosenbrock function [1].

\[f(x,y) = (1 - x)^2 + 100(y - x^2)^2\]

Extends pints.ErrorMeasure.

References

evaluateS1(x)

Evaluates this error measure, and returns the result plus the partial derivatives of the result with respect to the parameters.

The returned data has the shape (e, e') where e is a scalar value and e' is a sequence of length n_parameters.

This is an optional method that is not always implemented.

n_parameters()[source]

See pints.ErrorMeasure.n_parameters().

optimum()[source]

Returns the global optimum for this function.

class pints.toy.RosenbrockLogPDF[source]

Unnormalised LogPDF based on the Rosenbrock function [2] with an addition of 1 on the denominator to avoid a discontinuity:

\[f(x,y) = -log[1 + (1 - x)^2 + 100(y - x^2)^2 ]\]

Extends pints.toy.ToyLogPDF.

References

distance(samples)[source]

Calculates a measure of normed distance of samples from exact mean and covariance matrix assuming uniform prior with bounds given by suggested_bounds().

See pints.toy.ToyLogPDF.distance().

evaluateS1(x)[source]

See LogPDF.evaluateS1().

n_parameters()[source]

See pints.LogPDF.n_parameters().

optimum()[source]

Returns the global optimum for this LogPDF.

sample(n_samples)

Generates independent samples from the underlying distribution.

suggested_bounds()[source]

See pints.toy.ToyLogPDF.suggested_bounds().