Re: Approximation of a Function
- To: mathgroup at smc.vnet.net
- Subject: [mg33474] Re: Approximation of a Function
- From: Thomas Burton <tburton at brahea.com>
- Date: Fri, 22 Mar 2002 04:07:09 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, You can choose the interval, model, and fitting criterion, but you will be stuck the goodness of fit determined by these choices. Here I choose your suggested model, the interval [0.1, 1], and default measure of fit, unweighted sum of squares of deviations, over equally spaced points on the interval. In[349]:= <<Statistics`NonlinearFit` In[378]:= Clear[a,b,c,f,g,c1,c2,x] In[379]:= f[x_]:=a*x+b*x^2+c*x^3 In[384]:= g[x_]:=c1 x^c2 In[391]:= Block[{a=1,b=2,c=3}, NonlinearFit[Table[{x,f[x]},{x,0.1,1,.1}],g[x],{x},{c1,c2}] ] Out[391]= 5.92041141648034*x^2.124715956132496 Tom Burton On 3/21/02 6:36 AM, in article a7cr53$hsn$1 at smc.vnet.net, "Zsolt Regaly" <rezso at Amalthea.elte.hu> wrote: > Hi MathGroup! > > Can somebody to help me to find a solution of approximation of a function? > I have a function f[x_]:=a*x+b*x^2+c*x^3, where a,b,c are known numbers. I > would like to find a simplier function for f, for example g[x]=c1 x^c2 at an > given interval with specified precision. How can I find the numbers c1 and c2? > > Thanks for Help, Zsolt Regaly. >