Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Modifying Fit[] using SingularValues

  • To: mathgroup at
  • Subject: [mg23424] Re: Modifying Fit[] using SingularValues
  • From: Jens-Peer Kuska <kuska at>
  • Date: Wed, 10 May 2000 02:32:11 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <8f55db$>
  • Sender: owner-wri-mathgroup at


MakeFunctions[fname_, x_Symbol, flst_] :=
  Module[{arg, lst, patt},
    lst = flst /. x -> arg;
    patt = Pattern  @@ {arg, Blank[]};
    MapIndexed[(fname[First[#2]][patt] := #1) &, lst]]


will take a name like qq for your functions, a symbol x for 
the argument and a function list like {1,x,x^2}
It will generate qq[1], qq[2],qq[3] functions

MakeFunctions[qq, x, {1, x, x^2}]


?? qq



Hope that helps

> What I want to do and can't figure out, is how to take a list of
> expressions like {1,x,x^2} and use them like I used the explicitly
> defined functions f1, f2, and f3 above.  So then I could define a
> function myFit which would be invoked like Fit, i.e.
> myFit[Transpose[{testx,testy}],{1,x,x^2,Sin[x]},x]
> and yield a1 + a2 x + a3 x^2 + a4 Sin[x], along with chisquared and
> the variance for each parameter.
> Bill Campbell

  • Prev by Date: Starting Mathematica kernal from external programs
  • Next by Date: How to Play Sound from FrontEndTokenExecute
  • Previous by thread: Modifying Fit[] using SingularValues
  • Next by thread: Can FindMinimum solve boundary value problems?