class_docstr: Base class for estimation of a non-linear model with least squares
  
  This class is supposed to be subclassed, and the subclass has to provide a method
  `_predict` that defines the non-linear function `f(params) that is predicting the endogenous
  variable. The model is assumed to be
  
  :math: y = f(params) + error
  
  and the estimator minimizes the sum of squares of the estimated error.
  
  :math: min_parmas \sum (y - f(params))**2
  
  f has to return the prediction for each observation. Exogenous or explanatory variables
  should be accessed as attributes of the class instance, and can be given as arguments
  when the instance is created.
  
  Warning:
  Weights are not correctly handled yet in the results statistics,
  but included when estimating the parameters.
  
  similar to scipy.optimize.curve_fit
  API difference: params are array_like not split up, need n_params information
  
  includes now weights similar to curve_fit
  no general sigma yet (OLS and WLS, but no GLS)
  
  This is currently holding on to intermediate results that are not necessary
  but useful for testing.
  
  Fit returns and instance of RegressionResult, in contrast to the linear
  model, results in this case are based on a local approximation, essentially
  y = f(X, params) is replaced by y = grad * params where grad is the Gradient
  or Jacobian with the shape (nobs, nparams). See for example Greene
  
  Examples
  --------
  
  class Myfunc(NonlinearLS):
  
      def _predict(self, params):
          x = self.exog
          a, b, c = params
          return a*np.exp(-b*x) + c
  
  Ff we have data (y, x), we can create an instance and fit it with
  
  mymod = Myfunc(y, x)
  myres = mymod.fit(nparams=3)
  
  and use the non-linear regression results, for example
  
  myres.params
  myres.bse
  myres.tvalues
class_docstr_tok: ["Base","class","for","estimation","of","a","non-linear","model","with","least","squares","This","class","is","supposed","to","be","subclassed",",","and","the","subclass","has","to","provide","a","method","`","_predict","`","that","defines","the","non-linear","function","`","f","(","params",")","that","is","predicting","the","endogenous","variable",".","The","model","is","assumed","to","be",":","math",":","y","=","f","(","params",")","+","error","and","the","estimator","minimizes","the","sum","of","squares","of","the","estimated","error",".",":","math",":","min_parmas","\\sum","(","y","-","f","(","params",")",")","*","*","2","f","has","to","return","the","prediction","for","each","observation",".","Exogenous","or","explanatory","variables","should","be","accessed","as","attributes","of","the","class","instance",",","and","can","be","given","as","arguments","when","the","instance","is","created",".","Warning",":","Weights","are","not","correctly","handled","yet","in","the","results","statistics",",","but","included","when","estimating","the","parameters",".","similar","to","scipy.optimize.curve_fit","API","difference",":","params","are","array_like","not","split","up",",","need","n_params","information","includes","now","weights","similar","to","curve_fit","no","general","sigma","yet","(","OLS","and","WLS",",","but","no","GLS",")","This","is","currently","holding","on","to","intermediate","results","that","are","not","necessary","but","useful","for","testing",".","Fit","returns","and","instance","of","RegressionResult",",","in","contrast","to","the","linear","model",",","results","in","this","case","are","based","on","a","local","approximation",",","essentially","y","=","f","(","X",",","params",")","is","replaced","by","y","=","grad","*","params","where","grad","is","the","Gradient","or","Jacobian","with","the","shape","(","nobs",",","nparams",")",".","See","for","example","Greene","Examples","--","--","--","--","class","Myfunc","(","NonlinearLS",")",":","def","_predict","(","self",",","params",")",":","x","=","self.exog","a",",","b",",","c","=","params","return","a","*","np.exp","(","-b","*","x",")","+","c","Ff","we","have","data","(","y",",","x",")",",","we","can","create","an","instance","and","fit","it","with","mymod","=","Myfunc","(","y",",","x",")","myres","=","mymod.fit","(","nparams=3",")","and","use","the","non-linear","regression","results",",","for","example","myres.params","myres.bse","myres.tvalues"]
code: def start_value(self):
      return None
  
file_path: statsmodels/statsmodels/miscmodels/nonlinls.py
imports: import numpy
  from scipy import optimize
  from statsmodels.base.model import Model
label_desc: Use image node_id 4 for calling the NonlinearLS obj's underlying member method code with example usage: obj.start_value() and returns: None