Generalized Linear Models

class pymc3.glm.linear.LinearComponent(x, y, intercept=True, labels=None, priors=None, vars=None, name=”, model=None)

Creates linear component, y_est is accessible via attribute

Parameters:
  • name (str - name, associated with the linear component) –
  • x (pd.DataFrame or np.ndarray) –
  • y (pd.Series or np.array) –
  • intercept (bool - fit with intercept or not?) –
  • labels (list - replace variable names with these labels) –
  • priors (dict - priors for coefficients) –
    use Intercept key for defining Intercept prior
    defaults to Flat.dist()
    use Regressor key for defining default prior for all regressors
    defaults to Normal.dist(mu=0, tau=1.0E-6)
  • vars (dict - random variables instead of creating new ones) –
class pymc3.glm.linear.GLM(x, y, intercept=True, labels=None, priors=None, vars=None, family=’normal’, name=”, model=None)

Creates glm model, y_est is accessible via attribute

Parameters:
  • name (str - name, associated with the linear component) –
  • x (pd.DataFrame or np.ndarray) –
  • y (pd.Series or np.array) –
  • intercept (bool - fit with intercept or not?) –
  • labels (list - replace variable names with these labels) –
  • priors (dict - priors for coefficients) –
    use Intercept key for defining Intercept prior
    defaults to Flat.dist()
    use Regressor key for defining default prior for all regressors
    defaults to Normal.dist(mu=0, tau=1.0E-6)
  • init (dict - test_vals for coefficients) –
  • vars (dict - random variables instead of creating new ones) –
  • family (pymc3..families object) –