Functional programming; Outer; NonlinearFit
- To: mathgroup at smc.vnet.net
- Subject: [mg4147] Functional programming; Outer; NonlinearFit
- From: vvs124 at rsphy1.anu.edu.au (vvs124)
- Date: Fri, 7 Jun 1996 02:08:43 -0400
- Organization: Optical Sciences Centre, ANU
- Sender: owner-wri-mathgroup at wolfram.com
Dear MathGroup, Here is the kind of thing that is giving me trouble: ¥ First - I want to renormalize the list d d := {1, 2, 3, 4} according to the rule Renorm[{S_, P_, N0_}] = d/b where b := (1+S)^(P/2)/(Sqrt[N0]). Parameters S, P and N0 are defined in the ParamList := {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}} each set {S, P, N0} corresponding to the respective value of d in the list. I can do it for a d = const this way: Vectors := Table[f[i], {i, Length[ParamList]}] ToNumbers := Thread[Vectors -> ParamList] RenormArray := Outer[Renorm, Vectors] RenormNbrs := RenormArray /. ToNumbers But it obviously doesn't work if d has more than one element. In this case I end up with a whole matrix, but I only need the diagonal elements. I am REALLY tempted to do RenormD = Table[RenormNbrs[[i,i]], {i, Length[[ParamList]}], but there_should_be a more elegant way of doing this. Can someone help me out here? ¥ Second question - does anybody have a hint for getting closer to the global minimum of ChiSquared in NonlinearFit (Method -> FindMinimum)? With 3-parameter models it gets out of hand. THANKS! Vicki ________________________________________________________________________ Victoria Steblina Email: vvs124 at rsphy1.anu.edu.au Optical Sciences Centre Tel: 61 6 249 5129 Research School of Physical Fax: 61 6 249 5184 Sciences and Engineering Australian National University Canberra, ACT 0200, Australia ________________________________________________________________________ ==== [MESSAGE SEPARATOR] ====