Module Expr Str Assign NameStore Num Import alias identifier ImportFrom alias Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias Assign NameStore Lambda arguments args NameParam defaults BinOpDiv BinOpSub NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore Lambda arguments args NameParam defaults BinOpSub NameLoad Call AttributeLoad NameLoad attr Assign NameStore Num Assign TupleStore NameStore NameStore TupleLoad Num Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore BinOpAdd NameLoad Call AttributeLoad NameLoad attr BinOpDiv NameLoad Num Assign NameStore BinOpMult Num Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore Lambda arguments args NameParam defaults BinOpSub BinOpSub BinOpMult Num NameLoad BinOpMult Num BinOpPow NameLoad Num BinOpMult Num BinOpPow NameLoad Num Assign NameStore Lambda arguments args NameParam defaults BinOpSub NameLoad BinOpMult Num BinOpPow NameLoad Num Assign NameStore BinOpAdd Call NameLoad Call NameLoad NameLoad Call NameLoad Call NameLoad NameLoad Assign NameStore BinOpAdd Call NameLoad NameLoad Num Assign NameStore BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad AugAssignSub NameStore Call AttributeLoad NameLoad attr NameLoad Print TupleLoad Str Call AttributeLoad NameLoad attr Print TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign NameStore NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr ListLoad NameLoad NameLoad attr If CompareEq NameLoad Num body Print Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Print NameLoad Import alias alias If CompareEq NameLoad Num body Print Str Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListComp Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Print BinOpSub NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore NameLoad If CompareEq NameLoad Num body Print Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Print BinOpSub NameLoad NameLoad If CompareGt NameLoad Num body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad ListLoad Str Str Str ListLoad NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num Num NameLoad Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpAdd Str NameLoad Str NameLoad AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Str keyword Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Str keyword Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad Call SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad Call NameLoad NameLoad keyword Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad Call SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad Call NameLoad Call NameLoad NameLoad keyword Num
N/A N/A first examples for gam and PolynomialSmoother used for debugging

This example was written as a test case.
The data generating process is chosen so the parameters are well identified
and estimated.


Note: uncomment plt.show() to display graphs
 N/A example 2 N/A numpy np statsmodels.compat.python zip N/A numpy.random R N/A matplotlib.pyplot plt statsmodels.sandbox.gam AdditiveModel statsmodels.sandbox.gam Model GAM statsmodels.genmod families statsmodels.genmod.generalized_linear_model GLM N/A standardize N/A N/A N/A x N/A N/A N/A x N/A N/A x mean N/A N/A x std N/A demean N/A N/A N/A x N/A N/A x N/A N/A x mean N/A nobs 500 N/A N/A lb ub N/A -1.0 1.0 N/A x1 N/A N/A R uniform lb ub nobs N/A x1 N/A N/A np linspace lb ub nobs N/A N/A N/A x1 sort N/A x2 N/A N/A R uniform lb ub nobs N/A N/A N/A x2 sort N/A x2 N/A x2 N/A N/A np exp N/A x2 2.0 N/A y N/A 0.5 N/A N/A R uniform lb ub nobs N/A f1 N/A N/A N/A x1 N/A N/A N/A N/A 2 x1 N/A 0.5 N/A x1 2 N/A 0.75 N/A x1 3 N/A f2 N/A N/A N/A x2 N/A N/A x2 N/A 1 N/A x2 2 N/A z N/A N/A standardize N/A f1 x1 N/A standardize N/A f2 x2 N/A z N/A N/A standardize z 1 N/A z N/A N/A f1 x1 N/A f2 x2 N/A z N/A N/A np median z N/A N/A z.std() N/A N/A z std N/A N/A N/A N/A z mean N/A N/A z min N/A N/A z max N/A y z N/A d N/A N/A N/A np array N/A x1 x2 T N/A N/A example 1 N/A N/A normal N/A m N/A AdditiveModel d N/A N/A N/A m fit y N/A x N/A N/A np linspace -2 2 50 N/A m N/A scipy.stats time N/A N/A example 2 N/A N/A binomial N/A mod_name Binomial N/A f N/A N/A families Binomial N/A b N/A N/A np asarray N/A N/A N/A N/A N/A scipy stats bernoulli rvs p N/A p N/A N/A N/A f link inverse z N/A N/A b shape N/A y shape N/A m N/A GAM b d family f N/A toc N/A N/A time time N/A N/A N/A m fit b N/A tic N/A N/A time time N/A N/A tic toc N/A yp N/A N/A N/A f link inverse y N/A p b N/A N/A example 3 N/A N/A Poisson N/A f N/A N/A families Poisson N/A yp N/A N/A N/A f link inverse z N/A p N/A N/A np asarray N/A N/A N/A N/A N/A scipy stats poisson rvs p N/A p N/A N/A N/A f link inverse z float N/A N/A p shape N/A y shape N/A m N/A GAM p d family f N/A toc N/A N/A time time N/A N/A N/A m fit p N/A tic N/A N/A time time N/A N/A tic toc N/A N/A example 1 N/A N/A y_pred N/A N/A m results mu N/A N/A N/A plt figure N/A N/A N/A plt subplot 2 2 1 N/A N/A N/A plt plot p . N/A N/A N/A plt plot yp b- label true N/A N/A N/A plt plot y_pred r- label GAM N/A N/A N/A plt legend loc upper left N/A N/A N/A plt title N/A gam.GAM  mod_name N/A counter 2 N/A N/A ii xx N/A zip N/A z x1 x2 N/A z x1 x2 N/A N/A sortidx N/A N/A np argsort xx N/A N/A N/A plt subplot 2 2 counter N/A N/A N/A plt plot N/A xx N/A sortidx N/A p N/A sortidx . N/A N/A N/A plt plot N/A xx N/A sortidx N/A yp N/A sortidx b. label true N/A N/A N/A plt plot N/A xx N/A sortidx N/A y_pred N/A sortidx r. label GAM N/A N/A N/A plt legend loc upper left N/A N/A N/A plt title N/A N/A N/A gam.GAM  mod_name ii N/A counter 1 N/A N/A N/A plt figure N/A N/A N/A plt plot z b- label true N/A N/A N/A plt plot N/A N/A np log N/A N/A m results mu r- label GAM N/A N/A N/A plt title GAM Poisson, raw N/A N/A N/A plt figure N/A N/A N/A plt plot x1 N/A standardize N/A N/A N/A m smoothers N/A 0 x1 r N/A N/A N/A plt plot x1 N/A standardize N/A f1 x1 linewidth 2 N/A N/A N/A plt figure N/A N/A N/A plt plot x2 N/A standardize N/A N/A N/A m smoothers N/A 1 x2 r N/A N/A N/A plt plot x2 N/A standardize N/A f2 x2 linewidth 2