TREND
Syntax:
TREND ( known-ys [ , [ known-xs ] [ , [ new-xs ] [ , const-flag ] ] )
Description: Computes values along a linear trend. Fits a straight line (using the method of least squares) to the arrays known-ys and known-xs. The y-values along that line for the array of new-xs specified.
Arguments:
Name |
Type |
Description |
---|---|---|
known-ys |
array |
The set of y-values already known in the relationship y=mx+b. If that array is in a single column, each column of known-xs is interpreted as a separate variable. If that array is in a single row, each row of known-xs is interpreted as a separate variable. |
known-xs |
array |
An optional set of x-values that might already be known in the relationship y=mx+b. The array known-xs can include one or more sets of variables. If only one variable is used, known-ys and known-xs can be ranges of any shape, as long as they have equal dimensions. If more than one variable is used, known-ys shall be a vector. If known-xs is omitted, it is assumed to be the array {1,2,3,...} that is the same size as known-ys. |
new-xs |
array |
New x-values for which |
const-flag |
logical |
Specifies whether to force the constant b to equal 0. If |
Return Type and Value: array – The values along a linear trend, as an array of numbers.