Include

pylm.py file defines a class LM to fit linear regression models. Other functions like sim_dat1 allows for data simuation.


In [1]:
from pylm import LM, sim_dat1

An exanmple with simulated data


In [2]:
(y, X) = sim_dat1()

In [3]:
mod = LM(y, X)
mod


Out[3]:
Linear Model (not fitted yet)
 -- 100 observations, 3 predictors

In [4]:
mod.fit()
mod


Out[4]:
Liner Model (fitted)
 -- 100 observations, 3 predictors
 -- beta: [[ 2.96041161  1.93810276  1.4367427 ]]

In [5]:
mod.plot()