FittedModel[…]
represents the symbolic fitted model obtained from functions like LinearModelFit.
FittedModel
FittedModel[…]
represents the symbolic fitted model obtained from functions like LinearModelFit.
Details
- Properties of a fitted model are obtained from FittedModel[…]["property"].
- FittedModel[…][{prop1,prop2,…}] gives several properties.
- FittedModel[…][x1,…] gives the value of the best-fit function at a particular point x1, ….
- Normal gives the expression for the best-fit function in a FittedModel.
- FittedModel objects are returned by fitting functions such as LinearModelFit, NonlinearModelFit, and GeneralizedLinearModelFit.
- FittedModel[…][prop,ann] gives the annotation ann associated with the property prop.
- Possible properties available for a given type of fitted model are listed on the pages for functions such as LinearModelFit that generate the model.
Examples
open all close allBasic Examples (2)
Obtain a FittedModel from a nonlinear fitting:
data = {{0, 1}, {1, 0}, {3, 2}, {5, 4}};nlm = NonlinearModelFit[data, Log[a + b x ^ 2], {a, b}, x]Obtain the functional form from the FittedModel object:
Normal[nlm]Evaluate the model at a point:
nlm[2.3]Visualize the fitted function with the data:
Show[ListPlot[data], Plot[nlm[x], {x, 0, 5}], Frame -> True]Extract information about the fitting:
nlm["FitResiduals"]Generate noisy data for the same model:
data = Table[{x, Log[2 + 3 x ^ 2] + RandomReal[{0, 0.5}]}, {x, RandomReal[{-10, 10}, 200]}];ListLinePlot[Sort@data]m = NonlinearModelFit[data, Log[a + b x ^ 2], {a, b}, x]Show[ListPlot[data], Plot[m[x], {x, -10, 10}]]Visually examine the residuals:
ListPlot[m["FitResiduals"]]Scope (4)
Extract the short description for a property:
lm = LinearModelFit[Range[10], x ^ 2, x]lm["ParameterErrors", "Description"]lm["ParameterErrors", "LongDescription"]Obtain multiple properties at once:
lm = LinearModelFit[Range[10], {x ^ 2, Sin[x]}, x]lm[{"Response", "PredictedResponse"}]Plot the actual and predicted response values:
ListPlot[%]Obtain a FittedModel object for a linear fit:
LinearModelFit[Table[{i, RandomReal[{i - 1, i}]}, {i, 10}], x ^ 2, x]NonlinearModelFit[Table[{i, RandomReal[{i - 1, i}]}, {i, 10}], Exp[a x], a, x]GeneralizedLinearModelFit[Table[{i, 1 / RandomReal[{i - 1, i}]}, {i, 10}], x, x, ExponentialFamily -> "Gamma"]LogitModelFit[Table[{i, RandomReal[{i - 1, i}] / 10}, {i, 10}], x, x]ProbitModelFit[Table[{i, RandomReal[{i - 1, i}] / 10}, {i, 10}], x, x]Obtain a list of available properties for a linear model:
lm = LinearModelFit[Range[10], x ^ 2, x]lm["Properties"]Properties vary for different types of models:
nlm = NonlinearModelFit[Range[10], Exp[a x], a, x]nlm["Properties"]//Lengthglm = GeneralizedLinearModelFit[Range[10], x ^ 2, x]glm["Properties"]//LengthGeneralizations & Extensions (1)
Perform other mathematical operations on the functional form of a fitted model:
nlm = NonlinearModelFit[Exp[Range[10]] + RandomReal[1, 10], Exp[a + b x], {a, b}, x]Integrate symbolically and numerically:
Integrate[nlm[x], x]NIntegrate[nlm[x], {x, 1, 5}]Find a predictor value that gives a particular value for the model:
FindRoot[nlm[x] == 10, {x, 1}]See Also
LinearModelFit NonlinearModelFit GeneralizedLinearModelFit ProbitModelFit LogitModelFit InterpolatingFunction
Function Repository: FittedModelPlot
Tech Notes
Related Guides
History
Text
Wolfram Research (2008), FittedModel, Wolfram Language function, https://reference.wolfram.com/language/ref/FittedModel.html.
CMS
Wolfram Language. 2008. "FittedModel." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/FittedModel.html.
APA
Wolfram Language. (2008). FittedModel. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FittedModel.html
BibTeX
@misc{reference.wolfram_2026_fittedmodel, author="Wolfram Research", title="{FittedModel}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/FittedModel.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_fittedmodel, organization={Wolfram Research}, title={FittedModel}, year={2008}, url={https://reference.wolfram.com/language/ref/FittedModel.html}, note=[Accessed: 13-June-2026]}