"""Results for GMM estimation with Stata gmm

autogenerated, but edited
"""

import numpy as np

from statsmodels.tools.testing import ParamsTableTestBunch

# gmm twostep

est = dict(
    rank=13,
    N=758,
    Q=0.0153053843867424,
    J=11.60148136515076,
    J_df=2,
    k_1=13,
    converged=1,
    has_xtinst=0,
    type=1,
    n_eq=1,
    k=13,
    n_moments=15,
    k_aux=13,
    k_eq_model=0,
    k_eq=13,
    cmdline="gmm (lw - {xb:s iq expr tenure rns smsa dyear*} - {b0}), instruments(expr tenure rns smsa dyear* med kww age mrt)",
    cmd="gmm",
    estat_cmd="gmm_estat",
    predict="gmm_p",
    marginsnotok="_ALL",
    eqnames="1",
    technique="gn",
    winit="Unadjusted",
    estimator="twostep",
    wmatrix="robust",
    vce="robust",
    vcetype="Robust",
    params="xb_s xb_iq xb_expr xb_tenure xb_rns xb_smsa xb_dyear_67 xb_dyear_68 xb_dyear_69 xb_dyear_70 xb_dyear_71 xb_dyear_73 b0",
    inst_1="expr tenure rns smsa dyear_67 dyear_68 dyear_69 dyear_70 dyear_71 dyear_73 med kww age mrt _cons",
    params_1="xb_s xb_iq xb_expr xb_tenure xb_rns xb_smsa xb_dyear_67 xb_dyear_68 xb_dyear_69 xb_dyear_70 xb_dyear_71 xb_dyear_73 b0",
    sexp_1="lw - ({xb_s} *s + {xb_iq} *iq + {xb_expr} *expr + {xb_tenure} *tenure + {xb_rns} *rns + {xb_smsa} *smsa + {xb_dyear_67} *dyear_67 + {xb_dyear_68} *dyear_68 + {xb_dyear_69} *dyear_69 + {xb_dyear_70} *dyear_70 + {xb_dyear_71} *dyear_71 + {xb_dyear_73} *dyear_73) - {b0}",
    properties="b V",
)

params_table = np.array(
    [
        0.17579576802018,
        0.02085135579518,
        8.4309034744314,
        3.430065999e-17,
        0.1349278616328,
        0.21666367440756,
        np.nan,
        1.9599639845401,
        0,
        -0.00928615655842,
        0.00491818692744,
        -1.8881259893969,
        0.05900903858228,
        -0.01892562580544,
        0.00035331268861,
        np.nan,
        1.9599639845401,
        0,
        0.05028275907275,
        0.00810402250669,
        6.2046667603925,
        5.481292387e-10,
        0.03439916682973,
        0.06616635131577,
        np.nan,
        1.9599639845401,
        0,
        0.04252138311466,
        0.00956014552889,
        4.4477757149388,
        8.676405373e-06,
        0.02378384219108,
        0.06125892403824,
        np.nan,
        1.9599639845401,
        0,
        -0.10409306762507,
        0.03372997947655,
        -3.0860696994324,
        0.00202821272955,
        -0.17020261259839,
        -0.03798352265175,
        np.nan,
        1.9599639845401,
        0,
        0.12475123236049,
        0.03098732229429,
        4.0258797186699,
        0.00005676270037,
        0.06401719668634,
        0.18548526803464,
        np.nan,
        1.9599639845401,
        0,
        -0.0530431735239,
        0.05178756424595,
        -1.0242453819993,
        0.30571938841786,
        -0.15454493429301,
        0.04845858724521,
        np.nan,
        1.9599639845401,
        0,
        0.045954590377,
        0.0500069437958,
        0.91896418554698,
        0.35811430537838,
        -0.05205721843969,
        0.14396639919369,
        np.nan,
        1.9599639845401,
        0,
        0.15548006235586,
        0.04801256009054,
        3.238320599082,
        0.00120235613037,
        0.06137717377284,
        0.24958295093889,
        np.nan,
        1.9599639845401,
        0,
        0.16698745541498,
        0.06133412154231,
        2.7225865670836,
        0.00647730609718,
        0.04677478616864,
        0.28720012466132,
        np.nan,
        1.9599639845401,
        0,
        0.08464846645187,
        0.05581696231774,
        1.516536603515,
        0.12938372202927,
        -0.02475076941733,
        0.19404770232108,
        np.nan,
        1.9599639845401,
        0,
        0.0996068440051,
        0.06123938652803,
        1.6265160324477,
        0.10383992558646,
        -0.02042014802516,
        0.21963383603536,
        np.nan,
        1.9599639845401,
        0,
        4.0039243732137,
        0.33647541282379,
        11.899604608883,
        1.189091957e-32,
        3.3444446823958,
        4.6634040640315,
        np.nan,
        1.9599639845401,
        0,
    ]
).reshape(13, 9)

params_table_colnames = "b se z pvalue ll ul df crit eform".split()

params_table_rownames = ["_cons"] * 13

cov = np.array(
    [
        0.0004347790385,
        -0.00007935266682,
        0.00002810133321,
        0.00001482865838,
        -0.00017806902959,
        -6.657494262e-06,
        -0.00011587283596,
        -0.00018806600631,
        -0.00012201035826,
        -0.00008278800394,
        -0.00031494508432,
        -0.00063549805233,
        0.00264135978484,
        -0.00007935266682,
        0.00002418856265,
        4.931157962e-06,
        -0.00001114070074,
        0.00006618982562,
        -0.0000220304377,
        4.705098991e-07,
        0.00003206383766,
        -0.00002261417242,
        -0.00006024150154,
        -0.00001412826237,
        0.00001471698858,
        -0.00144299517314,
        0.00002810133321,
        4.931157962e-06,
        0.00006567518079,
        -0.00002036677634,
        0.00005210753053,
        -0.00003295500811,
        0.00003592276303,
        0.00008754309097,
        0.00003052996731,
        0.00001691178156,
        -0.00008575591893,
        -0.00013143657018,
        -0.00094318538399,
        0.00001482865838,
        -0.00001114070074,
        -0.00002036677634,
        0.00009139638253,
        -0.00003771101246,
        7.851603106e-06,
        0.00008478298315,
        0.00006722294295,
        0.00011231163007,
        0.0001007216652,
        0.00011202284802,
        0.00009437878507,
        0.00075643538833,
        -0.00017806902959,
        0.00006618982562,
        0.00005210753053,
        -0.00003771101246,
        0.00113771151549,
        0.0001300530702,
        0.00018006693931,
        0.00018772842105,
        -9.500874246e-06,
        0.00001633701903,
        -0.00005338908155,
        0.00008260866257,
        -0.00499436928105,
        -6.657494262e-06,
        -0.0000220304377,
        -0.00003295500811,
        7.851603106e-06,
        0.0001300530702,
        0.00096021414297,
        0.00005702363753,
        0.00011167528598,
        0.00025281311283,
        0.00010653704891,
        0.00030212216421,
        0.000307795004,
        0.00157107924026,
        -0.00011587283596,
        4.705098991e-07,
        0.00003592276303,
        0.00008478298315,
        0.00018006693931,
        0.00005702363753,
        0.00268195181053,
        0.00085892679447,
        0.00091106709634,
        0.00096277498668,
        0.00090313286214,
        0.00102719488714,
        0.00034624154943,
        -0.00018806600631,
        0.00003206383766,
        0.00008754309097,
        0.00006722294295,
        0.00018772842105,
        0.00011167528598,
        0.00085892679447,
        0.0025006944278,
        0.00092531815147,
        0.00088200162521,
        0.00082339570405,
        0.00095012566921,
        -0.0020631120951,
        -0.00012201035826,
        -0.00002261417242,
        0.00003052996731,
        0.00011231163007,
        -9.500874246e-06,
        0.00025281311283,
        0.00091106709634,
        0.00092531815147,
        0.00230520592645,
        0.00118209509709,
        0.00111002620771,
        0.00129242901685,
        0.00256100032752,
        -0.00008278800394,
        -0.00006024150154,
        0.00001691178156,
        0.0001007216652,
        0.00001633701903,
        0.00010653704891,
        0.00096277498668,
        0.00088200162521,
        0.00118209509709,
        0.00376187446537,
        0.00124524263644,
        0.00155856745623,
        0.00599140534858,
        -0.00031494508432,
        -0.00001412826237,
        -0.00008575591893,
        0.00011202284802,
        -0.00005338908155,
        0.00030212216421,
        0.00090313286214,
        0.00082339570405,
        0.00111002620771,
        0.00124524263644,
        0.00311553328238,
        0.00184297728198,
        0.00431291320555,
        -0.00063549805233,
        0.00001471698858,
        -0.00013143657018,
        0.00009437878507,
        0.00008260866257,
        0.000307795004,
        0.00102719488714,
        0.00095012566921,
        0.00129242901685,
        0.00155856745623,
        0.00184297728198,
        0.00375026246233,
        0.00538820067052,
        0.00264135978484,
        -0.00144299517314,
        -0.00094318538399,
        0.00075643538833,
        -0.00499436928105,
        0.00157107924026,
        0.00034624154943,
        -0.0020631120951,
        0.00256100032752,
        0.00599140534858,
        0.00431291320555,
        0.00538820067052,
        0.11321570343494,
    ]
).reshape(13, 13)

cov_colnames = ["_cons"] * 13

cov_rownames = ["_cons"] * 13


results_twostep = ParamsTableTestBunch(
    params_table=params_table,
    params_table_colnames=params_table_colnames,
    params_table_rownames=params_table_rownames,
    cov=cov,
    cov_colnames=cov_colnames,
    cov_rownames=cov_rownames,
    **est,
)

# begin gmm onestep

est = dict(
    rank=13,
    N=758,
    Q=0.0175043949471787,
    J=13.26833136996146,
    J_df=2,
    k_1=13,
    converged=1,
    has_xtinst=0,
    type=1,
    n_eq=1,
    k=13,
    n_moments=15,
    k_aux=13,
    k_eq_model=0,
    k_eq=13,
    cmdline="gmm (lw - {xb:s iq expr tenure rns smsa dyear*} - {b0}), instruments(expr tenure rns smsa dyear* med kww age mrt) onestep",
    cmd="gmm",
    estat_cmd="gmm_estat",
    predict="gmm_p",
    marginsnotok="_ALL",
    eqnames="1",
    technique="gn",
    winit="Unadjusted",
    estimator="onestep",
    wmatrix="robust",
    vce="robust",
    vcetype="Robust",
    params="xb_s xb_iq xb_expr xb_tenure xb_rns xb_smsa xb_dyear_67 xb_dyear_68 xb_dyear_69 xb_dyear_70 xb_dyear_71 xb_dyear_73 b0",
    inst_1="expr tenure rns smsa dyear_67 dyear_68 dyear_69 dyear_70 dyear_71 dyear_73 med kww age mrt _cons",
    params_1="xb_s xb_iq xb_expr xb_tenure xb_rns xb_smsa xb_dyear_67 xb_dyear_68 xb_dyear_69 xb_dyear_70 xb_dyear_71 xb_dyear_73 b0",
    sexp_1="lw - ({xb_s} *s + {xb_iq} *iq + {xb_expr} *expr + {xb_tenure} *tenure + {xb_rns} *rns + {xb_smsa} *smsa + {xb_dyear_67} *dyear_67 + {xb_dyear_68} *dyear_68 + {xb_dyear_69} *dyear_69 + {xb_dyear_70} *dyear_70 + {xb_dyear_71} *dyear_71 + {xb_dyear_73} *dyear_73) - {b0}",
    properties="b V",
)

params_table = np.array(
    [
        0.1724253119448,
        0.02073946970972,
        8.3138727440057,
        9.262847838e-17,
        0.13177669825528,
        0.21307392563431,
        np.nan,
        1.9599639845401,
        0,
        -0.00909883104783,
        0.00488623921543,
        -1.8621337692816,
        0.06258423710802,
        -0.01867568392991,
        0.00047802183425,
        np.nan,
        1.9599639845401,
        0,
        0.04928948974112,
        0.00804979771953,
        6.1230718408647,
        9.178828333e-10,
        0.033512176128,
        0.06506680335423,
        np.nan,
        1.9599639845401,
        0,
        0.04221709210829,
        0.00946363451925,
        4.4609808232133,
        8.158539147e-06,
        0.0236687092877,
        0.06076547492887,
        np.nan,
        1.9599639845401,
        0,
        -0.10179345005432,
        0.0337105276595,
        -3.0196338390938,
        0.00253080446805,
        -0.16786487016678,
        -0.03572202994187,
        np.nan,
        1.9599639845401,
        0,
        0.12611094948071,
        0.0308113805617,
        4.0929989887401,
        0.00004258295784,
        0.06572175326583,
        0.18650014569559,
        np.nan,
        1.9599639845401,
        0,
        -0.0596171062088,
        0.05171372339438,
        -1.1528295062831,
        0.24898037089783,
        -0.16097414156825,
        0.04173992915064,
        np.nan,
        1.9599639845401,
        0,
        0.04867955998567,
        0.04981322392381,
        0.97724170714436,
        0.32844950450919,
        -0.04895256485883,
        0.14631168483017,
        np.nan,
        1.9599639845401,
        0,
        0.15281763323761,
        0.04792849748935,
        3.188450321681,
        0.00143037585682,
        0.05887950432536,
        0.24675576214986,
        np.nan,
        1.9599639845401,
        0,
        0.17443605153365,
        0.06112514589814,
        2.8537527227227,
        0.00432061472141,
        0.05463296702353,
        0.29423913604377,
        np.nan,
        1.9599639845401,
        0,
        0.0916659665856,
        0.0554618025144,
        1.6527765494425,
        0.09837634840443,
        -0.01703716886029,
        0.20036910203149,
        np.nan,
        1.9599639845401,
        0,
        0.09323976498299,
        0.06084900556261,
        1.5323137021041,
        0.125445041459,
        -0.02602209441479,
        0.21250162438078,
        np.nan,
        1.9599639845401,
        0,
        4.0335098954259,
        0.33503289261392,
        12.03914595954,
        2.212341104e-33,
        3.3768574922664,
        4.6901622985855,
        np.nan,
        1.9599639845401,
        0,
    ]
).reshape(13, 9)

params_table_colnames = "b se z pvalue ll ul df crit eform".split()

params_table_rownames = ["_cons"] * 13

cov = np.array(
    [
        0.00043012560384,
        -0.00007821948168,
        0.00002814664044,
        0.00001470659469,
        -0.00018137297337,
        -8.404214163e-06,
        -0.000116495836,
        -0.00019098604401,
        -0.00012670601919,
        -0.00008672920733,
        -0.00031350033095,
        -0.00062509206531,
        0.00258704275396,
        -0.00007821948168,
        0.00002387533367,
        4.911669728e-06,
        -0.00001098678322,
        0.00006618473561,
        -0.00002158670034,
        8.107545213e-07,
        0.00003255315461,
        -0.00002143051924,
        -0.0000597535309,
        -0.00001402380853,
        0.00001385883996,
        -0.00142630446035,
        0.00002814664044,
        4.911669728e-06,
        0.00006479924333,
        -0.00001977796199,
        0.00005110284341,
        -0.00003232809926,
        0.00003557970376,
        0.00008581782553,
        0.00002961847494,
        0.00001478700432,
        -0.00008727552546,
        -0.00012994173168,
        -0.00094120116335,
        0.00001470659469,
        -0.00001098678322,
        -0.00001977796199,
        0.00008956037831,
        -0.00003784800308,
        7.059546860e-06,
        0.00008151950631,
        0.00006348047144,
        0.00010852497856,
        0.00009624187488,
        0.00010823787214,
        0.00009132957164,
        0.00074787094553,
        -0.00018137297337,
        0.00006618473561,
        0.00005110284341,
        -0.00003784800308,
        0.00113639967508,
        0.00013313518183,
        0.00019039509438,
        0.0002000965573,
        7.191780465e-06,
        0.00002329093697,
        -0.00005087978271,
        0.00009086571425,
        -0.00495748724374,
        -8.404214163e-06,
        -0.00002158670034,
        -0.00003232809926,
        7.059546860e-06,
        0.00013313518183,
        0.00094934117212,
        0.00006195450052,
        0.00011810217311,
        0.00025505395817,
        0.00011081126685,
        0.00030134673539,
        0.00030676742472,
        0.00155300401754,
        -0.000116495836,
        8.107545213e-07,
        0.00003557970376,
        0.00008151950631,
        0.00019039509438,
        0.00006195450052,
        0.00267430918731,
        0.00086135304709,
        0.00092017339035,
        0.00095567351479,
        0.000887006474,
        0.00102883960359,
        0.0003167617596,
        -0.00019098604401,
        0.00003255315461,
        0.00008581782553,
        0.00006348047144,
        0.0002000965573,
        0.00011810217311,
        0.00086135304709,
        0.00248135727768,
        0.0009302682109,
        0.0008777378644,
        0.00081079994623,
        0.00094288525746,
        -0.00207087031796,
        -0.00012670601919,
        -0.00002143051924,
        0.00002961847494,
        0.00010852497856,
        7.191780465e-06,
        0.00025505395817,
        0.00092017339035,
        0.0009302682109,
        0.00229714087159,
        0.00117701812554,
        0.00109484405919,
        0.00129252524238,
        0.00250083573173,
        -0.00008672920733,
        -0.0000597535309,
        0.00001478700432,
        0.00009624187488,
        0.00002329093697,
        0.00011081126685,
        0.00095567351479,
        0.0008777378644,
        0.00117701812554,
        0.00373628346107,
        0.00123495172035,
        0.00154490399953,
        0.00600809353679,
        -0.00031350033095,
        -0.00001402380853,
        -0.00008727552546,
        0.00010823787214,
        -0.00005087978271,
        0.00030134673539,
        0.000887006474,
        0.00081079994623,
        0.00109484405919,
        0.00123495172035,
        0.00307601153815,
        0.0018118788444,
        0.00430884303498,
        -0.00062509206531,
        0.00001385883996,
        -0.00012994173168,
        0.00009132957164,
        0.00009086571425,
        0.00030676742472,
        0.00102883960359,
        0.00094288525746,
        0.00129252524238,
        0.00154490399953,
        0.0018118788444,
        0.00370260147796,
        0.00534911865442,
        0.00258704275396,
        -0.00142630446035,
        -0.00094120116335,
        0.00074787094553,
        -0.00495748724374,
        0.00155300401754,
        0.0003167617596,
        -0.00207087031796,
        0.00250083573173,
        0.00600809353679,
        0.00430884303498,
        0.00534911865442,
        0.11224703913325,
    ]
).reshape(13, 13)

cov_colnames = ["_cons"] * 13

cov_rownames = ["_cons"] * 13


results_onestep = ParamsTableTestBunch(
    params_table=params_table,
    params_table_colnames=params_table_colnames,
    params_table_rownames=params_table_rownames,
    cov=cov,
    cov_colnames=cov_colnames,
    cov_rownames=cov_rownames,
    **est,
)
