MathGroup Archive 1998

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

Search the Archive

NonLinearRegress question

  • To: mathgroup at
  • Subject: [mg12860] NonLinearRegress question
  • From: Easan Siviniah <easan at>
  • Date: Wed, 17 Jun 1998 00:28:03 -0400
  • Organization: University of California, Santa Barbara
  • Sender: owner-wri-mathgroup at

Hi folks,

I'm writing some data fitting code on Mathematica that uses the add-on
'NonLinearRegress'. However I'm currently stumped because the model I
for fitting involves the use of conditional 'Ifs'. It seems that
Mathematica does not recoginise such a function as numerical.
Does Anyone have an idea of how to get round this. I've included a
but simplified example below.

In[1]      Clear[fun,t,x,y]
              fun[t_,x_,y_]:=If[t<10,t^2 x + Log[t] y, t^3 x + Log[t] y]

              data=Table[{t,N[fun[t,2,3]]},{t,1,21,2}] Out[1]


In[2]       << Statistics`NonlinearFit`
                N[func[t,a,b]] ,z, {{a,{-100,-101}},{b,{2,3}}},
                RegressionReport -> BestFitParameters,
                ShowProgress -> True]

Out[2]  NonlinearRegress::"nonnum": "The model is not numerical at
             Check that all model parameters are included in the
parameter list.

  • Prev by Date: greek symbols in eps files
  • Next by Date: symbols in eps files?
  • Previous by thread: Re: Fw: greek symbols in eps files
  • Next by thread: Re: NonLinearRegress question