Regress
Regress[data,funs,vars]
finds a least–squares fit to a list of data as a linear combination of the functions funs of variables vars.
Details and Options
- To use Regress, you first need to load the Linear Regression Package using Needs["LinearRegression`"].
- 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 argument funs can be any list of functions that depend only on the variables vars.
- Regress returns a list of rules for results and diagnostics specified by the option RegressionReport.
- Regress always finds the linear combination of the functions in the list funs that minimize the sum of the squares of deviations from the values fi.
- Exact numbers given as input to Regress are converted to approximate numbers with machine precision.
- The following options can be given:
-
RegressionReport SummaryReport results to be included in output IncludeConstant True whether to automatically include a constant as one of the functions BasisNames Automatic names of basis elements for table headings Weights Automatic weights for each data point Method Automatic method used to compute singular values Tolerance Automatic tolerance to use in computing singular values ConfidenceLevel 0.95 confidence level used for confidence intervals - With the option IncludeConstant->False, Regress gives the same fit as Fit does.
- Possible settings for Weights are Automatic, a list of numbers with the same length as the data, or a pure function.
- With the default setting Weights->Automatic, each data point is given a weight of 1.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases

https://wolfram.com/xid/0mke9elspx529xv6-eobpg
Linear regression for a straight line:

https://wolfram.com/xid/0mke9elspx529xv6-jbnanf


https://wolfram.com/xid/0mke9elspx529xv6-ldk8w
Linear regression for a constant plus a sinusoid:

https://wolfram.com/xid/0mke9elspx529xv6-7p1

Options (6)Common values & functionality for each option
BasisNames (1)
ConfidenceLevel (1)
IncludeConstant (1)
RegressionReport (1)
Weights (2)

https://wolfram.com/xid/0mke9elspx529xv6-et00ls
Weighted regression with explicit weights for each data element:

https://wolfram.com/xid/0mke9elspx529xv6-c6zfy3


https://wolfram.com/xid/0mke9elspx529xv6-fycu3l
Weighted regression with weights equal to the squares of the measured responses:

https://wolfram.com/xid/0mke9elspx529xv6-bopk88

Wolfram Research (2007), Regress, Wolfram Language function, https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.
Text
Wolfram Research (2007), Regress, Wolfram Language function, https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.
Wolfram Research (2007), Regress, Wolfram Language function, https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.
CMS
Wolfram Language. 2007. "Regress." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.
Wolfram Language. 2007. "Regress." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.
APA
Wolfram Language. (2007). Regress. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/LinearRegression/ref/Regress.html
Wolfram Language. (2007). Regress. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/LinearRegression/ref/Regress.html
BibTeX
@misc{reference.wolfram_2025_regress, author="Wolfram Research", title="{Regress}", year="2007", howpublished="\url{https://reference.wolfram.com/language/LinearRegression/ref/Regress.html}", note=[Accessed: 11-July-2025
]}
BibLaTeX
@online{reference.wolfram_2025_regress, organization={Wolfram Research}, title={Regress}, year={2007}, url={https://reference.wolfram.com/language/LinearRegression/ref/Regress.html}, note=[Accessed: 11-July-2025
]}