is an option for linear and generalized linear model fitting functions that specifies a component for the model that is to be assumed known.
LinearOffsetFunction
is an option for linear and generalized linear model fitting functions that specifies a component for the model that is to be assumed known.
Details
- LinearOffsetFunction is an option for LinearModelFit, GeneralizedLinearModelFit, LogitModelFit, and ProbitModelFit.
- LinearOffsetFunction->func specifies that the model to be fitted should have a linear predictor of the form func[x1,x2,…]+β0+β1 f1+β2 f2+⋯.
- LinearOffsetFunction defines a known component of the linear predictor for each data point.
Examples
open all close allBasic Examples (1)
data = {{0, 1}, {1, 1.5}, {3, 2}, {5, 4}};LinearModelFit[data, x, x]//NormalFit data to a linear model with a known Exp[x] term:
LinearModelFit[data, x, x, LinearOffsetFunction -> (Exp[#]&)]//NormalScope (3)
Fit data to a generalized linear model:
data = {{0, 1}, {1, 1.5}, {3, 2}, {5, 4}};GeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Gamma"]//NormalFit to a model with a known Sqrt[x] term in the linear predictor:
GeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Gamma", LinearOffsetFunction -> (Sqrt[#]&)]//NormalFit to a model with a known constant term:
GeneralizedLinearModelFit[data, x, x, ExponentialFamily -> "Gamma", IncludeConstantBasis -> False, LinearOffsetFunction -> (2&)]//NormalInclude a linear offset in a logit model:
LogitModelFit[{.1, .3, .5, .6, .8}, x, x, LinearOffsetFunction -> (Sin[#]&)]//NormalProbitModelFit[{.1, .3, .5, .6, .8}, x, x, LinearOffsetFunction -> (Sin[#]&)]//NormalInclude an offset as a function of multiple variables:
GeneralizedLinearModelFit[{{4.3, 2, 1.2}, {3.8, 3.3, .6}, {4.5, 3, .7}, {3, 4.2, .5}, {2, 2.1, 1.4}}, {x, y}, {x, y}, ExponentialFamily -> "InverseGaussian", LinearOffsetFunction -> (#1 #2&)]//NormalThe model fitting a coefficient to the x y term:
GeneralizedLinearModelFit[{{4.3, 2, 1.2}, {3.8, 3.3, .6}, {4.5, 3, .7}, {3, 4.2, .5}, {2, 2.1, 1.4}}, {x, y, x y}, {x, y}, ExponentialFamily -> "InverseGaussian"]//NormalRelated Guides
History
Text
Wolfram Research (2008), LinearOffsetFunction, Wolfram Language function, https://reference.wolfram.com/language/ref/LinearOffsetFunction.html.
CMS
Wolfram Language. 2008. "LinearOffsetFunction." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/LinearOffsetFunction.html.
APA
Wolfram Language. (2008). LinearOffsetFunction. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/LinearOffsetFunction.html
BibTeX
@misc{reference.wolfram_2026_linearoffsetfunction, author="Wolfram Research", title="{LinearOffsetFunction}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/LinearOffsetFunction.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_linearoffsetfunction, organization={Wolfram Research}, title={LinearOffsetFunction}, year={2008}, url={https://reference.wolfram.com/language/ref/LinearOffsetFunction.html}, note=[Accessed: 12-June-2026]}