Module liba.regress_simple

simple linear regression

Functions

new (coef, bias) constructor for simple linear regression
init (ctx, coef, bias) initialize for simple linear regression
eval (ctx, val) calculate predicted value for simple linear regression
evar (ctx, val) calculate predicted value for simple linear regression
ols_ (ctx, x, y, x_mean, y_mean) ordinary least squares for simple linear regression
olsx (ctx, x, y, x_mean) ordinary least squares for simple linear regression
olsy (ctx, x, y, y_mean) ordinary least squares for simple linear regression
ols (ctx, x, y) ordinary least squares for simple linear regression
zero (ctx) zeroing for simple linear regression


Functions

new (coef, bias)
constructor for simple linear regression

Parameters:

  • coef number regression coefficient
  • bias number intercept

Returns:

    a.regress_simple simple linear regression userdata
init (ctx, coef, bias)
initialize for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • coef number regression coefficient
  • bias number intercept

Returns:

    a.regress_simple simple linear regression userdata
eval (ctx, val)
calculate predicted value for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • val number independent variable

Returns:

    number predicted value
evar (ctx, val)
calculate predicted value for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • val number dependent variable

Returns:

    number predicted value
ols_ (ctx, x, y, x_mean, y_mean)
ordinary least squares for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • x table predictor data, specified as a numeric vector
  • y table response data, specified as a numeric vector
  • x_mean number mean of predictor data
  • y_mean number mean of response data

Returns:

    a.regress_simple simple linear regression userdata
olsx (ctx, x, y, x_mean)
ordinary least squares for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • x table predictor data, specified as a numeric vector
  • y table response data, specified as a numeric vector
  • x_mean number mean of predictor data

Returns:

    a.regress_simple simple linear regression userdata
olsy (ctx, x, y, y_mean)
ordinary least squares for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • x table predictor data, specified as a numeric vector
  • y table response data, specified as a numeric vector
  • y_mean number mean of response data

Returns:

    a.regress_simple simple linear regression userdata
ols (ctx, x, y)
ordinary least squares for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata
  • x table predictor data, specified as a numeric vector
  • y table response data, specified as a numeric vector

Returns:

    a.regress_simple simple linear regression userdata
zero (ctx)
zeroing for simple linear regression

Parameters:

  • ctx a.regress_simple simple linear regression userdata

Returns:

    a.regress_simple simple linear regression userdata
generated by LDoc 1.5.0 Last updated 2024-09-30 14:51:04