LinearRegression`
LinearRegression`

Regress

As of Version 7.0, Regress has been superseded by LinearModelFit.

Regress[data,funs,vars]

finds a leastsquares fit to a list of data as a linear combination of the functions funs of variables vars.

更多信息和选项

  • 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:
  • RegressionReportSummaryReportresults to be included in output
    IncludeConstantTruewhether to automatically include a constant as one of the functions
    BasisNamesAutomaticnames of basis elements for table headings
    WeightsAutomaticweights for each data point
    MethodAutomaticmethod used to compute singular values
    ToleranceAutomatictolerance to use in computing singular values
    ConfidenceLevel0.95confidence 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.

范例

打开所有单元关闭所有单元

基本范例  (2)

Linear regression for a straight line:

Linear regression for a constant plus a sinusoid:

Options  (6)

BasisNames  (1)

Linear regression for a straight line with basis functions labeled b1 and b2:

ConfidenceLevel  (1)

Linear regression with .99 confidence level for confidence intervals:

IncludeConstant  (1)

Linear regression with constant term assumed to be 0:

RegressionReport  (1)

Linear regression with a specific list of report values:

Weights  (2)

Weighted regression with explicit weights for each data element:

Weighted regression with weights equal to the squares of the measured responses:

Wolfram Research (2007),Regress,Wolfram 语言函数,https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.

文本

Wolfram Research (2007),Regress,Wolfram 语言函数,https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.

CMS

Wolfram 语言. 2007. "Regress." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/LinearRegression/ref/Regress.html.

APA

Wolfram 语言. (2007). Regress. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/LinearRegression/ref/Regress.html 年

BibTeX

@misc{reference.wolfram_2024_regress, author="Wolfram Research", title="{Regress}", year="2007", howpublished="\url{https://reference.wolfram.com/language/LinearRegression/ref/Regress.html}", note=[Accessed: 23-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_regress, organization={Wolfram Research}, title={Regress}, year={2007}, url={https://reference.wolfram.com/language/LinearRegression/ref/Regress.html}, note=[Accessed: 23-November-2024 ]}