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
[1] https://en.wikipedia.org/wiki/Rosenbrock_function -
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')
wheree
is a scalar value ande'
is a sequence of lengthn_parameters
.This is an optional method that is not always implemented.
-
-
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
[2] https://en.wikipedia.org/wiki/Rosenbrock_function -
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()
.
-
sample
(n_samples)¶ Generates independent samples from the underlying distribution.
-