Re: integer model parameters

From: John E. Davis <davis_at_email.domain.hidden>
Date: Mon, 5 Mar 2012 12:30:36 -0500
David P. Huenemoerder <dph_at_email.domain.hidden> It might be best left frozen, but it would be nice if the fit function
> and optimizer could be given a reasonable clue.

Assuming that you fit function is well-defined for non-integer values
of the parameter, you could try something like the following:

     thaw (N);                   % N is the index of the integer parameter
     () = fit_counts ();
     p = get_par_info (N);
     ix = int(floor(p.value)) - 1;   % 2.5 --> 1, -2.5 --> -4
     stats = Double_Type[4];
     for (i = 0; i < 4; i++)
       {
          ix += i;
	  if (p.min < ix < p.max)
	    {
	       set_par (N, ix, 1);
	       stats[i] = fit_counts().statistic;
	    }
	  else stats[i] = _Inf;
       }
     if (stats[0] > stats[1] < stats[2])
       set_par (N, ix+1);
     else if (stats[1] > stats[2] < stats[3])
       set_par (N, ix+2);
     else
       throw IsisError, "Minimum not found for integer valued parameter"

The above is untested-- hopefully the idea is sound.

Thanks,
--John
----
You received this message because you are
subscribed to the isis-users list.
To unsubscribe, send a message to
isis-users-request_at_email.domain.hiddenwith the first line of the message as:
unsubscribe
Received on Mon Mar 05 2012 - 12:30:52 EST

This archive was generated by hypermail 2.2.0 : Mon Mar 05 2012 - 13:06:46 EST