NonlinearRegression`
NonlinearRegression`

NonlinearRegress

As of Version 7.0, NonlinearRegress has been superseded by NonlinearModelFit and is part of the built-in Wolfram Language kernel.

NonlinearRegress[data,expr,pars,vars]

finds numerical values of the parameters pars that make the model expr give a best fit to data as a function of vars and provides diagnostics for the fitting.

NonlinearRegress[data,{expr,cons},pars,vars]

finds a best fit and provides diagnostics subject to the constraints cons.

Details

• To use NonlinearRegress, you first need to load the Nonlinear Regression Package using Needs["NonlinearRegression`"].
• The data can have the form {{x1,y1,,f1},{x2,y2,,f2},}, where the number of coordinates x,y, is equal to the number of variables in the list vars.
• The data can also be of the form {f1,f2,}, with a single coordinate assumed to take values 1, 2, .
• The model expr must yield a numerical value when pars and vars are all numerical.
• The estimates of the model parameters give a leastsquares fit, minimizing the sum of squared residuals.
• NonlinearRegress returns a list of rules for results and diagnostics specified by the option RegressionReport.
• The model expr must yield a numerical value when pars and vars are all numerical.
• For constrained models, the constraints cons can contain equations, inequalities, or logical combinations of equations and inequalities.
• Parameters are specified using the same syntax as in FindFit.
• The results found by NonlinearRegress may correspond only to a local optimum.
• The following options can be given:
•  AccuracyGoal Automatic the accuracy sought Compiled Automatic whether to compile the model ConfidenceLevel 0.95 confidence level for confidence intervals Gradient Automatic list of gradient functions MaxIterations 100 maximum number of iterations to use Method Automatic method to use PrecisionGoal Automatic the precision sought RegressionReport SummaryReport fit diagnostics to include Tolerance Automatic numerical tolerance for matrix operations Weights Automatic list of weights for each point or pure function WorkingPrecision MachinePrecision the precision used in internal computations
• The options AccuracyGoal, Compiled, Gradient, MaxIterations, Method, PrecisionGoal, and WorkingPrecision are the same as for FindFit.
• Possible settings for Weights are Automatic, a list of numbers with the same length as data, or a pure function.
• With the default setting , each data point is given a weight of 1.
• With the setting Weights->g, the weight associated with each point is g[fi,xi,yi,].
• The default setting includes the elements BestFitParameters, ParameterCITable, EstimatedVariance, ANOVATable, AsymptoticCorrelationMatrix and FitCurvatureTable.
• For constrained models, RegressionReport values based on approximate normality assumptions may not be valid. When such values are included, the values will be generated along with a warning message.

Examples

open all close all

Basic Examples(1)

 In:= Nonlinear regression with parameters a and b:

 In:= Out= 