constructs a nonlinear model with structure form that fits the yi for successive x values 1, 2, using the parameters β1, .


constructs a nonlinear model where form depends on the variables xk.


constructs a nonlinear model subject to the parameter constraints cons.

Details and Options

  • NonlinearModelFit returns a symbolic FittedModel object to represent the nonlinear model it constructs. The properties and diagnostics of the model can be obtained from model["property"].
  • The value of the best-fit function from NonlinearModelFit at a particular point x1, can be found from model[x1,].
  • The best-fit function from NonlinearModelFit[data,form,pars,vars] is the same as the result from FindFit[data,form,pars,vars].
  • NonlinearModelFit[data,form,{{par1,p1},},vars] starts the search for a fit with {par1->p1,}.
  • With data in the form {{x11,x12,,y1},{x21,x22,,y2},}, the number of coordinates xi1, xi2, should equal the number of variables xi.
  • Data in the form {y1,y2,} is equivalent to data in the form {{1,y1},{2,y2},}.
  • NonlinearModelFit produces a nonlinear model of the form under the assumption that the original are independent normally distributed with mean and common standard deviation.
  • NonlinearModelFit takes the following options:
  • AccuracyGoalAutomaticthe number of digits of accuracy sought
    ConfidenceLevel95/100confidence level for parameters and predictions
    EvaluationMonitorNoneexpression to evaluate whenever form is evaluated
    GradientAutomaticthe list of gradient components for form
    MaxIterationsAutomaticmaximum number of iterations to use
    MethodAutomaticmethod to use
    PrecisionGoalAutomaticthe precision sought
    StepMonitorNonethe expression to evaluate whenever a step is taken
    VarianceEstimatorFunctionAutomaticfunction for estimating the error variance
    WeightsAutomaticweights for data elements
    WorkingPrecisionAutomaticthe precision used in internal computations
  • With ConfidenceLevel->p, probability-p confidence intervals are computed for parameter and prediction intervals.
  • With the setting Weights->{w1,w2,}, the error variance for yi is assumed to be . By default, unit weights are used.
  • With the setting VarianceEstimatorFunction->f, the common variance is estimated by f[res,w], where res={y1-,y2-,} is the list of residuals and w is the list of weights.
  • Using VarianceEstimatorFunction->(1&) and Weights->{1/Δy12,1/Δy22,}, Δyi is treated as the known uncertainty of measurement yi, and parameter standard errors are effectively computed only from the weights.
  • Possible settings for Method include "ConjugateGradient", "Gradient", "LevenbergMarquardt", "Newton", "NMinimize", and "QuasiNewton", with the default being Automatic.
  • For constrained models, properties based on approximate normality assumptions may not be valid. When such values are computed, the values are generated along with a warning message.
  • Properties related to data and the fitted function using model["property"] include:
  • "BestFit"fitted function
    "BestFitParameters"parameter estimates
    "Data"the input data or design matrix and response vector
    "Function"best-fit pure function
    "Response"response values in the input data
  • Types of residuals include:
  • "FitResiduals"difference between actual and predicted responses
    "StandardizedResiduals"fit residuals divided by the standard error for each residual
    "StudentizedResiduals"fit residuals divided by single deletion error estimates
  • Properties related to the sum of squared errors include:
  • "ANOVATable"analysis of variance table
    "ANOVATableDegreesOfFreedom"degrees of freedom from the ANOVA table
    "ANOVATableEntries"unformatted array of values from the table
    "ANOVATableMeanSquares"mean square errors from the table
    "ANOVATableSumsOfSquares"sums of squares from the table
    "EstimatedVariance"estimate of the error variance
  • Properties and diagnostics for parameter estimates include:
  • "CorrelationMatrix"asymptotic parameter correlation matrix
    "CovarianceMatrix"asymptotic parameter covariance matrix
    "ParameterBias"estimated bias in the parameter estimates
    "ParameterConfidenceIntervals"parameter confidence intervals
    "ParameterConfidenceIntervalTable"table of confidence interval information for the fitted parameters
    "ParameterConfidenceIntervalTableEntries"unformatted array of values from the table
    "ParameterConfidenceRegion"ellipsoidal parameter confidence region
    "ParameterErrors"standard errors for parameter estimates
    "ParameterPValues"values for parameter statistics
    "ParameterTable"table of fitted parameter information
    "ParameterTableEntries"unformatted array of values from the table
    "ParameterTStatistics"-statistics for parameter estimates
  • Properties for curvature diagnostics include:
  • "CurvatureConfidenceRegion"confidence region for curvature diagnostics
    "FitCurvatureTable"table of curvature diagnostics
    "FitCurvatureTableEntries"unformatted array of values from the table
    "MaxIntrinsicCurvature"measure of maximum intrinsic curvature
    "MaxParameterEffectsCurvature"measure of maximum parameter effects curvature
  • Properties related to influence measures include:
  • "HatDiagonal"diagonal elements of the hat matrix
    "SingleDeletionVariances"list of variance estimates with the ^(th) data point omitted
  • Properties of predicted values include:
  • "MeanPredictionBands"confidence bands for mean predictions
    "MeanPredictionConfidenceIntervals"confidence intervals for the mean predictions
    "MeanPredictionConfidenceIntervalTable"table of confidence intervals for the mean predictions
    "MeanPredictionConfidenceIntervalTableEntries"unformatted array of values from the table
    "MeanPredictionErrors"standard errors for mean predictions
    "PredictedResponse"fitted values for the data
    "SinglePredictionBands"confidence bands based on single observations
    "SinglePredictionConfidenceIntervals"confidence intervals for the predicted response of single observations
    "SinglePredictionConfidenceIntervalTable"table of confidence intervals for the predicted response of single observations
    "SinglePredictionConfidenceIntervalTableEntries"unformatted array of values from the table
    "SinglePredictionErrors"standard errors for the predicted response of single observations
  • Properties that measure goodness of fit include:
  • "AdjustedRSquared" adjusted for the number of model parameters
    "AIC"Akaike Information Criterion
    "AICc"finite sample corrected AIC
    "BIC"Bayesian Information Criterion
    "RSquared"coefficient of determination


open all close all

Basic Examples  (1)

Fit a nonlinear model to some data:

Click for copyable input
Click for copyable input

Obtain the functional form:

Click for copyable input

Evaluate the model at a point:

Click for copyable input

Visualize the fitted function with the data:

Click for copyable input

Extract and plot the residuals:

Click for copyable input
Click for copyable input

Scope  (11)

Generalizations & Extensions  (2)

Options  (4)

Applications  (1)

Properties & Relations  (5)

Possible Issues  (2)

Introduced in 2008