Skip to content

forecast_linear

Predict a y value from linear regression at a single x.

v = forecast_linear(x, knownys, knownxs)

Returns the y value predicted by linear regression of (knownxs, knownys) evaluated at x. Equivalent to one application of trend with a scalar newxs.

forecast_linear(5, [2 4 6 8], [1 2 3 4]) % 10
  • trend — Linear-trend predictions.
  • linest — Linear regression coefficients (with optional statistics).