trend
Linear-trend predictions.
Syntax
Section titled “Syntax”v = trend(knownys, knownxs, newxs, const)Description
Section titled “Description”Computes a linear regression on (knownxs, knownys) and returns predicted y values for newxs. With const = false, forces the intercept to zero.
Example
Section titled “Example”trend([2 4 6 8], [1 2 3 4], [5 6 7]) % [10 12 14]See also
Section titled “See also”growth— Exponential-trend predictions.linest— Linear regression coefficients (with optional statistics).forecast_linear— Predict a y value from linear regression at a single x.