Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#Main GLM classes
__author__ = "Taylor Oshan tayoshan@gmail.com"
import numpy as np
import numpy.linalg as la
from spreg.utils import RegressionPropsY, spdot
import spreg.user_output as USER
from .utils import cache_readonly
from .base import LikelihoodModelResults
from .iwls import iwls
from . import family
__all__ = ['GLM']
class GLM(RegressionPropsY):
"""
Generalised linear models. Can currently estimate Guassian, Poisson and
Logisitc regression coefficients. GLM object prepares model input and fit
method performs estimation which then returns a GLMResults object.
Parameters
----------
y : array
n*1, dependent variable.
X : array
n*k, independent variable, exlcuding the constant.
family : string
Model type: 'Gaussian', 'Poisson', 'Binomial'
offset : array
n*1, the offset variable at the ith location. For Poisson model
this term is often the size of the population at risk or