Statistics
ExponentialFit
fit an exponential function to data
Calling Sequence
Parameters
Description
Options
Examples
Compatibility
ExponentialFit(X, Y, v, options)
ExponentialFit(XY, v, options)
X
-
Vector; values of independent variable
Y
Vector; values of dependent variable
XY
two-column Matrix; values of independent and dependent variables
v
name; (optional) independent variable name
options
(optional) equation(s) of the form option=value where option is one of output or weights; specify options for the ExponentialFit command
The ExponentialFit command fits an exponential function of the form y=a⁢ⅇb⁢x to data by performing a least-squares fit using the transformed model function ln⁡y=b⁢x+a0, where a0 is ln⁡a. The new function is linear in the model parameters, a0 and b. Given k data points, where each point is a pair of numerical values for (x, y), the ExponentialFit command finds a0 and b such that the sum of the k residuals squared is minimized. The ith residual is the value ln⁡y−a0−b⁢x at the ith data point.
In the first calling sequence, the first parameter X is a Vector containing the k values of the independent variable x, and the second parameter Y is a Vector containing the k values of the dependent variable y. The entries of Y must evaluate to positive numbers. In the second calling sequence, the first parameter XY is a Matrix with two columns, where the first column corresponds to X and the second column to Y. For X, Y, and XY, one can also use lists or Arrays; for details, see the Input Forms help page.
If the optional parameter v is provided, then the ExponentialFit command returns the exponential function in variable v with the computed values of a and b. Otherwise, a Vector containing values of a and b is returned.
The ExponentialFit command calls the Statistics[LinearFit] command to fit the given data to the linearized model. Additional options accepted by the LinearFit command, such as weights=W where W is a Vector of weights, may be provided to ExponentialFit. However, it is important to note that these options, including the output option for obtaining additional results, apply to the transformed model. More information about the underlying linear regression solver is available on the LinearFit help page.
The options argument can contain one or more of the options shown below. These options are described in more detail on the Statistics/Regression/Options help page.
output = name or string -- Specify the form of the solution. The output option can take as a value the name solutionmodule, or one of the following names (or a list of these names): AtkinsonTstatistic, confidenceintervals, CookDstatistic, degreesoffreedom, externallystandardizedresiduals, internallystandardizedresiduals, leastsquaresfunction, leverages, parametervalues, parametervector, residuals, residualmeansquare, residualstandarddeviation, residualsumofsquares, rsquared, rsquaredadjusted, standarderrors, tprobability, tvalue, variancecovariancematrix. For more information, see the Statistics/Regression/Solution help page.
summarize = identical( true, false, embed ) -- Display a summary of the regression model
svdtolerance = realcons(nonnegative) -- Set the tolerance that determines whether a singular-value decomposition is performed.
weights = Vector -- Provide weights for the data points.
with⁡Statistics:
Fit an exponential function to the provided data.
X≔Vector⁡1,2,3,4,5,6,datatype=float:
Y≔Vector⁡2,5.6,8.2,20.5,40.0,95.0,datatype=float:
ExponentialFit⁡X,Y,v
1.01888654495804⁢ⅇ0.746236510177018⁢v
Use the summarize option to return a summary for the regression model. Note that the summary is not a part of the output for the assigned variable ls:
ls≔ExponentialFit⁡X,Y,v,summarize=true:
Summary: ---------------- Model: 1.0188865*exp(.74623651*v) ---------------- Coefficients: Estimate Std. Error t-value P(>|t|) Parameter 1 0.0187 0.1323 0.1414 0.8944 Parameter 2 0.7462 0.0340 21.9702 0.0000 ---------------- R-squared: 0.9984, Adjusted R-squared: 0.9976
ls
Use the weights option to assign a weight to each data point. Because the v parameter is not provided, a Vector containing the computed model parameters is returned.
W≔Vector⁡1,1,1,2,5,5,datatype=float:
ExponentialFit⁡X,Y,weights=W
0.9894822974695120.752656239139387
The XY parameter was introduced in Maple 15.
For more information on Maple 15 changes, see Updates in Maple 15.
The Statistics[ExponentialFit] command was updated in Maple 2016.
The summarize option was introduced in Maple 2016.
For more information on Maple 2016 changes, see Updates in Maple 2016.
See Also
CurveFitting
Statistics/Regression
Statistics/Regression/InputForms
Statistics/Regression/Options
Statistics/Regression/Solution
Statistics[LinearFit]
Download Help Document