Re: Constrains

From: Arthur E. Snyder <snyder_at_slac.stanford.edu>
Date: Tue, 28 Oct 2008 18:06:59 -0700


Hi,

Since minuit does not provide lagrange multiplier interface [a] there are two other ways to apply your a contraint:

  1. re-write you paramterization to include it and remove the now uneeded parameter -- this looks to be easy in your case.
  2. Add a penalty function to your chisq or -log(like) such that it becomes very large if the constraint is violated. It's prob. a good idea to avoid making the penalty so large that you run into numerical difficulties. By making the penalty depend on a parameter you can set (but don't fit it!) you can turn the constraint on and off, or make it approximate -- e.g., if your constraint has some lack of precision you could account for that.

E.g., add

par[newPar]*(par[1]+par[2]-1)**2 to chisq (or whatever) ...

Setting |par[newPar]| big will enforce constraint to a very good approximation.

-Art S.

[a] It can't because it's a minimizer and the lagrange formulation is at saddle point in the lagrange multipliers.

A.E. Snyder, Group EC                        \!c*p?/
SLAC Mail Stop #95                          ((.   .))
Box 4349                                        |
Stanford, Ca, USA, 94309                      '\|/`
e-mail:snyder_at_slac.stanford.edu                 o
phone:650-926-2701                              _
http://www.slac.stanford.edu/~snyder          BaBar
FAX:650-926-2657                          Collaboration



On Wed, 29 Oct 2008, Patrick Dupre wrote:

> Hello,
>
> I am uisng minuit2 and FunctionMinimum.
> To define my function I use the operator ()
> but it is a virtual method:
> double operator () (const std::vector<double>&) const ;
> and I cannot modify the parameter inside this method, whilst I need
> to put a constrain to some of them.
> For example par [1] = 1 - par [2].
> I let par [1] be variable and fix par [2].
> How can I put a constrain on some parameters ?
>
> Thank.
>
> --
> ---
> ==========================================================================
> Patrick DUPRÉ | |
> Department of Chemistry | | Phone: (44)-(0)-1904-434384
> The University of York | | Fax: (44)-(0)-1904-432516
> Heslington | |
> York YO10 5DD United Kingdom | | email: pd520_at_york.ac.uk
> ==========================================================================
Received on Wed Oct 29 2008 - 02:07:18 CET

This archive was generated by hypermail 2.2.0 : Thu Oct 30 2008 - 17:50:02 CET