Skip to content

Conjugate gradient minimizers do not work with some quadratic cost functions #8

@obromios

Description

@obromios

I am having difficulty getting the Minimization::PolakRibiere and Minimization::FletcherReeves minimizers work with a simple cost function of the form
proc{ |x| (x[0] - @p[0])**2 / s0**2 + (x[1] - @p[1])**2 / s1**2 + (x[2] - @p[2])**2 / s2**2 }
If s1=s2=s3 this works, but does not work for example if s0=1, s1=2, s2=1. I attach below an augmentation of the repository's minimization_conjugate_gradient_polak_ribiere_spec.rb file that demonstrate the problem (the tests at lines 60 and 66). The test uses the PolakRibiere, but the same problem occurs with FletcherReeves.
so_issue_spec.rb.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions