Download Non-linear Regression and Correlation Correlation coefficient for

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Factorization wikipedia , lookup

Fundamental theorem of algebra wikipedia , lookup

Corecursion wikipedia , lookup

Transcript
Regression and Data Fitting – Part 2
Non-linear Regression and
Correlation
Correlation coefficient for nonlinear least-square fittings - 1
●
A lecture
by
Gilberto E. Urroz
●
y = vector of values of the dependent
variable (observed)
yf = fitted values
●
Error vector, e = y – yf
●
Sum of squared errors (SSE):
Reference: RegressionAndDataFitting.mw
(Maple worksheet)
Correlation coefficient for nonlinear least-square fittings - 2
●
Ex.1 – Fitting a quadratic equation (1)
Sum of squared totals:
where ⎯y is the mean value of y.
●
The correlation coefficient is
Ex.1 – Fitting a quadratic equation (2)
Ex.1 – Fitting a quadratic equation (3)
A function to calculate correlation
coefficients for non-linear fittings
Example of exponential fitting - 1
Example of exponential fitting - 2
Fitting data with the Statistics package
Functions provided for data fitting:
Fit
LinearFit
NonlinearFit
ExponentialFit
LogarithmicFit
PolynomialFit
PowerFit
Function Fit - 1
●
●
Similar to CurveFitting[LeastSquares]
Example – third-order polynomial fitting:
Function Fit - 2
●
●
Calculating a vector of fitted data:
Use user-defined function NLCorrelation to
calculate the correlation coefficient:
Function Fit - 4
Function Fit - 3
●
Exponential fitting:
●
●
Fit works fine for this exponential fitting:
●
LeastSquares fails to produce a fitting:
Function LinearFit
●
Fitting data to a linear combination of
elementary functions
●
Function LinearFit:
●
Equivalent LeastSquares application:
Function NonlinearFit
●
●
Function PowerFit
●
Fitting function: y = axb
Fit fits more complex expressions than
LeastSquares.
Use it for fitting data to non-linear
combinations of elementary functions
Alternatively, use function Fit
Function PolynomialFit - 1
●
●
Given the data:
PolynomialFit(degree,xdata,ydata) produces
a vector of polynomial coefficients:
Function PolynomialFit - 2
●
PolynomialFit(degree,xdata,ydata,x)
produces the polynomial on x:
Function LogarithmicFit
●
Fitting function: y = a + b ln(x)
Function ExponentialFit
●
Fitting function: y = aebx