On Sun, Mar 04, 2012 at 17:21 -0500, David P. Huenemoerder wrote: > > Daniel> Off hand it seem to me that "fitting an integer-valued parameter" > Daniel> is kind of an oxymoron ;-) > > Well, it's an analytical functional approximation for a line profile, > with enough dials to please nearly anyone. I don't a priori know > whether the exponent is to be frozen, or to be fit. (The model is > definitely degenerate if everything is left free). > > The easy use is simulation, where I can pick whatever valid parameters > I want. The inverse---fitting---is where some constraints must be > defined. It just doesn't seem right to have a model parameter which > shouldn't be able to be left free, but if left free, can become > invalid and produce NaNs. > > Daniel> It would seem instead that you'd do the fit with your n fixed > Daniel> in turn at, say, 2, 3, 4, 5, 6 and compare the restults for > Daniel> these 'different' models. > > Sure, but if I could do it manually, why can't I do it automatically? > If chisqr is better for n=3, then fitting should find it (within > limitations of searching multi-dimensional bumpy chi-squared spaces). Algorithms for integer optimization do exist, but isis doesn't currently provide any. The optimization methods in isis were not designed to provide special treatment for integer-valued parameters. You could set step=1, but different optimizers use 'step' in different ways. Some interpret it as an initial suggestion, some ignore it altogether. In principle, you can use a generic optimization method as you have described, and simply map a continuous fit parameter onto an integer, e.g. n = 2*nint(x)+1. In practice, this may cause convergence problems because the fit statistic will presumably make discontinous jumps whenever the integer-valued fit parameter changes. In that situation, optimizers that don't rely directly on numerical derivative information might perform better -- e.g. simplex, diffevol might work better than mpfit. 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: unsubscribeReceived on Sun Mar 04 2012 - 17:57:15 EST
This archive was generated by hypermail 2.2.0 : Thu Aug 23 2012 - 08:51:52 EDT