1.20.0
User Documentation for Apache MADlib
glm.sql_in File Reference

SQL functions for GLM (Poisson) More...

Functions

bytea8 __glm_merge_states (bytea8 state1, bytea8 state2)
 
bytea8 __glm_final (bytea8 state)
 
bytea8 __glm_poisson_log_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_poisson_log_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_poisson_identity_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_poisson_identity_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_poisson_sqrt_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_poisson_sqrt_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_gaussian_identity_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_gaussian_identity_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_gaussian_log_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_gaussian_log_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_gaussian_inverse_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_gaussian_inverse_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_gamma_log_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_gamma_log_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_gamma_inverse_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_gamma_inverse_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_gamma_identity_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_gamma_identity_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_binomial_probit_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_binomial_probit_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_inverse_gaussian_identity_transition (bytea8, float8, float8[], bytea8)
 
bytea8 __glm_binomial_logit_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_binomial_logit_agg (float8 y, float8[] x, bytea8 previous_state)
 
__glm_result_type __glm_result_z_stats (bytea8 state)
 
aggregate bytea8 __glm_inverse_gaussian_identity_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_inverse_gaussian_log_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_inverse_gaussian_log_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_inverse_gaussian_inverse_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_inverse_gaussian_inverse_agg (float8 y, float8[] x, bytea8 previous_state)
 
bytea8 __glm_inverse_gaussian_sqr_inverse_transition (bytea8, float8, float8[], bytea8)
 
aggregate bytea8 __glm_inverse_gaussian_sqr_inverse_agg (float8 y, float8[] x, bytea8 previous_state)
 
__glm_result_type __glm_result_t_stats (bytea8 state)
 
float8 __glm_loglik_diff (bytea8 state1, bytea8 state2)
 
void glm (varchar source_table, varchar model_table, varchar dependent_varname, varchar independent_varname, varchar family_params, varchar grouping_col, varchar optim_params, boolean verbose)
 
void glm (varchar source_table, varchar model_table, varchar dependent_varname, varchar independent_varname, varchar family_params, varchar grouping_col, varchar optim_params)
 
void glm (varchar source_table, varchar model_table, varchar dependent_varname, varchar independent_varname, varchar family_params, varchar grouping_col)
 
void glm (varchar source_table, varchar model_table, varchar dependent_varname, varchar independent_varname, varchar family_params)
 
text glm (text message)
 
text glm ()
 
float8 glm_predict (float8[] coef, float8[] col_ind_var, text link)
 Predict the estimated mean value for the response variable given a specific predictor variable value in a generalized linear model. More...
 
boolean glm_predict_binomial (float8[] coef, float8[] col_ind_var, text link)
 Predict the output category for the response variable given a specific predictor variable value in a generalized linear model. More...
 
float8 glm_predict_poisson (float8[] coef, float8[] col_ind_var, text link)
 Predict the estimated count for the response variable given a specific predictor variable value in a generalized linear model. More...
 
text glm_predict (text message)
 
text glm_predict ()
 
text glm_predict_poisson (text message)
 
text glm_predict_binomial (text message)
 

Detailed Description

Date
June 2014
See also
For a brief introduction to GLM (Poisson), see the module description grp_poisson.

Function Documentation

◆ __glm_binomial_logit_agg()

aggregate bytea8 __glm_binomial_logit_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_binomial_logit_transition()

bytea8 __glm_binomial_logit_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_binomial_probit_agg()

aggregate bytea8 __glm_binomial_probit_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_binomial_probit_transition()

bytea8 __glm_binomial_probit_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_final()

bytea8 __glm_final ( bytea8  state)

◆ __glm_gamma_identity_agg()

aggregate bytea8 __glm_gamma_identity_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_gamma_identity_transition()

bytea8 __glm_gamma_identity_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_gamma_inverse_agg()

aggregate bytea8 __glm_gamma_inverse_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_gamma_inverse_transition()

bytea8 __glm_gamma_inverse_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_gamma_log_agg()

aggregate bytea8 __glm_gamma_log_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_gamma_log_transition()

bytea8 __glm_gamma_log_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_gaussian_identity_agg()

aggregate bytea8 __glm_gaussian_identity_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_gaussian_identity_transition()

bytea8 __glm_gaussian_identity_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_gaussian_inverse_agg()

aggregate bytea8 __glm_gaussian_inverse_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_gaussian_inverse_transition()

bytea8 __glm_gaussian_inverse_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_gaussian_log_agg()

aggregate bytea8 __glm_gaussian_log_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_gaussian_log_transition()

bytea8 __glm_gaussian_log_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_inverse_gaussian_identity_agg()

aggregate bytea8 __glm_inverse_gaussian_identity_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_inverse_gaussian_identity_transition()

bytea8 __glm_inverse_gaussian_identity_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_inverse_gaussian_inverse_agg()

aggregate bytea8 __glm_inverse_gaussian_inverse_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_inverse_gaussian_inverse_transition()

bytea8 __glm_inverse_gaussian_inverse_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_inverse_gaussian_log_agg()

aggregate bytea8 __glm_inverse_gaussian_log_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_inverse_gaussian_log_transition()

bytea8 __glm_inverse_gaussian_log_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_inverse_gaussian_sqr_inverse_agg()

aggregate bytea8 __glm_inverse_gaussian_sqr_inverse_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_inverse_gaussian_sqr_inverse_transition()

bytea8 __glm_inverse_gaussian_sqr_inverse_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_loglik_diff()

float8 __glm_loglik_diff ( bytea8  state1,
bytea8  state2 
)

◆ __glm_merge_states()

bytea8 __glm_merge_states ( bytea8  state1,
bytea8  state2 
)

◆ __glm_poisson_identity_agg()

aggregate bytea8 __glm_poisson_identity_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_poisson_identity_transition()

bytea8 __glm_poisson_identity_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_poisson_log_agg()

aggregate bytea8 __glm_poisson_log_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_poisson_log_transition()

bytea8 __glm_poisson_log_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_poisson_sqrt_agg()

aggregate bytea8 __glm_poisson_sqrt_agg ( float8  y,
float8 []  x,
bytea8  previous_state 
)

◆ __glm_poisson_sqrt_transition()

bytea8 __glm_poisson_sqrt_transition ( bytea8  ,
float8  ,
float8  [],
bytea8   
)

◆ __glm_result_t_stats()

__glm_result_type __glm_result_t_stats ( bytea8  state)

◆ __glm_result_z_stats()

__glm_result_type __glm_result_z_stats ( bytea8  state)

◆ glm() [1/6]

void glm ( varchar  source_table,
varchar  model_table,
varchar  dependent_varname,
varchar  independent_varname,
varchar  family_params,
varchar  grouping_col,
varchar  optim_params,
boolean  verbose 
)

◆ glm() [2/6]

void glm ( varchar  source_table,
varchar  model_table,
varchar  dependent_varname,
varchar  independent_varname,
varchar  family_params,
varchar  grouping_col,
varchar  optim_params 
)

◆ glm() [3/6]

void glm ( varchar  source_table,
varchar  model_table,
varchar  dependent_varname,
varchar  independent_varname,
varchar  family_params,
varchar  grouping_col 
)

◆ glm() [4/6]

void glm ( varchar  source_table,
varchar  model_table,
varchar  dependent_varname,
varchar  independent_varname,
varchar  family_params 
)

◆ glm() [5/6]

text glm ( text  message)

◆ glm() [6/6]

text glm ( )

◆ glm_predict() [1/3]

float8 glm_predict ( float8 []  coef,
float8 []  col_ind_var,
text  link 
)
Parameters
coefCoefficients obtained by running generalized linear model.
col_indPredictor variable array
linkLink function used in training. Can be one of probit/logit
Returns
Numeric value of the predicted mean

This function computes the dot product of the independent variables and the coefficients. This requires the length of the two vectors to be the same.

◆ glm_predict() [2/3]

text glm_predict ( text  message)

◆ glm_predict() [3/3]

text glm_predict ( )

◆ glm_predict_binomial() [1/2]

boolean glm_predict_binomial ( float8 []  coef,
float8 []  col_ind_var,
text  link 
)
Parameters
coefCoefficients obtained by running generalized linear model.
col_indPredictor variable array
linkLink function used in training. Can be one of probit/logit.
Returns
True/False Boolean value corresponding to output category True if predicted probability >= 0.5, False otherwise

This function computes the dot product of the independent variables and the coefficients. This requires the length of the two vectors to be the same.

◆ glm_predict_binomial() [2/2]

text glm_predict_binomial ( text  message)

◆ glm_predict_poisson() [1/2]

float8 glm_predict_poisson ( float8 []  coef,
float8 []  col_ind_var,
text  link 
)
Parameters
coefCoefficients obtained by running generalized linear model.
col_indPredictor variable array
linkLink function used in training
Returns
Numeric value of the predicted count, obtained by rounding the predicted mean to the nearest integral value.

This function computes the dot product of the independent variables and the coefficients. This requires the length of the two vectors to be the same.

◆ glm_predict_poisson() [2/2]

text glm_predict_poisson ( text  message)