Re: FindFit constrains when parameters are in table
- To: mathgroup at smc.vnet.net
- Subject: [mg105804] Re: [mg105778] FindFit constrains when parameters are in table
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Sun, 20 Dec 2009 06:52:14 -0500 (EST)
- Reply-to: hanlonr at cox.net
The form would be ba = Array[b, 5]; cons = Join[ Thread[Abs[ba] < 1], Thread[Rest[ba] <= Most[ba]]] {Abs[b[1]] < 1, Abs[b[2]] < 1, Abs[b[3]] < 1, Abs[b[4]] < 1, Abs[b[5]] < 1, b[2] <= b[1], b[3] <= b[2], b[4] <= b[3], b[5] <= b[4]} params = Join[{a}, ba] {a, b[1], b[2], b[3], b[4], b[5]} Bob Hanlon ---- Vindhya Mishra <vindhya.mishra at gmail.com> wrote: ============= Hi I have a problem with specifying constrants and initial values for FindFit, when the parameters are defined as a table. This is my model and the parameters (params) model = a*(.5 + Sum[b[i]*Cos[2.00000*i*t*Pi/180], {i, 1, 500}]); params = Join[{a}, Table[b[i], {i, 1, 500}]] B[i_] = FindFit[data, model, params, t, MaxIterations -> 1000, AccuracyGoal -> 4] However I would like to constrain the b[i] parameters to be less than one. Also if possible , that b[n+1]<=b[n]. What should the syntax be for this? The number of parameters is too large to specify the constrains individually. Thanks, VM