index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
8.19k
signature
stringlengths
2
42.8k
embed_func_code
listlengths
768
768
42,826
linearmodels.panel.model
_info
Information about panel structure
def _info(self) -> tuple[Series, Series, DataFrame | None]: """Information about panel structure""" entity_info = panel_structure_stats( self.dependent.entity_ids.squeeze(), "Observations per entity" ) time_info = panel_structure_stats( self.dependent.time_ids.squeeze(), "Observations per time period" ) other_info = None return entity_info, time_info, other_info
(self) -> tuple[pandas.core.series.Series, pandas.core.series.Series, pandas.core.frame.DataFrame | None]
[ 0.038780342787504196, -0.0275861993432045, 0.018574116751551628, 0.011708611622452736, 0.030087584629654884, -0.0358886681497097, 0.015939678996801376, -0.02801196649670601, -0.008373431861400604, 0.016188042238354683, -0.02804744802415371, -0.03810621052980423, 0.015363117679953575, -0.0493180938065052, -0.016072731465101242, -0.004153452813625336, -0.02206895872950554, 0.006861069239675999, -0.03516131639480591, 0.01806851662695408, -0.004732230678200722, 0.022778572514653206, 0.007184830028563738, -0.06223304569721222, -0.0036301130894571543, 0.037857845425605774, 0.02513803541660309, -0.03585318848490715, 0.03390175476670265, 0.01581549644470215, -0.05683998763561249, -0.035835448652505875, -0.010732893832027912, -0.024055875837802887, -0.05886238440871239, 0.05403701961040497, -0.01685330457985401, 0.015904197469353676, -0.0173677746206522, 0.06819379329681396, -0.021927036345005035, -0.08032817393541336, -0.011522338725626469, -0.014830908738076687, -0.04672800749540329, -0.03542742133140564, 0.011637650430202484, -0.04435080289840698, -0.02792326547205448, -0.04069629684090614, 0.009349149651825428, 0.0204723309725523, -0.0143164386972785, 0.016800083220005035, 0.028490955010056496, 0.008524224162101746, 0.02256568893790245, 0.0410865843296051, 0.013988243415951729, 0.01572679542005062, 0.044812049716711044, 0.05201462283730507, -0.037893325090408325, -0.009934579953551292, -0.02024170570075512, -0.014174516312777996, 0.029981141909956932, -0.019549833610653877, -0.04232840612530708, 0.02602505125105381, 0.015008311718702316, -0.02987470105290413, -0.009100784547626972, 0.03732563555240631, -0.04218648374080658, -0.11140921711921692, 0.01903536356985569, -0.0297505185008049, 0.09714599698781967, -0.05683998763561249, -0.03565804660320282, -0.0025590413715690374, -0.038780342787504196, 0.02112872153520584, 0.05765604227781296, -0.016108211129903793, 0.020809397101402283, 0.04477657005190849, -0.01242709532380104, 0.04459916800260544, -0.058826904743909836, 0.006643750239163637, 0.011682001873850822, 0.015842106193304062, -0.03718371316790581, 0.0112473638728261, -0.02135934680700302, -0.012187600135803223, -0.022157661616802216, 0.028029708191752434, -0.03496617451310158, -0.04906972870230675, -0.055172398686409, 0.05492403358221054, -0.06450380384922028, -0.018308011814951897, 0.012613368220627308, 0.0007428759709000587, -0.011912625283002853, -0.00020526106527540833, -0.008058540523052216, 0.03347598761320114, -0.027728121727705002, 0.0027430972550064325, 0.040376972407102585, -0.03301473706960678, -0.015824366360902786, -0.016250133514404297, -0.060459014028310776, -0.03180839493870735, -0.04992126300930977, 0.025918608531355858, -0.02520899660885334, -0.027178172022104263, 0.01662268117070198, 0.011061090044677258, -0.01871603913605213, -0.0408736988902092, -0.012480315752327442, -0.03924158960580826, 0.004191150888800621, -0.04385407269001007, 0.004379641730338335, 0.08855967968702316, 0.016170302405953407, -0.02128838561475277, 0.06258784979581833, -0.03546290099620819, -0.026344377547502518, 0.0388513021171093, -0.051021162420511246, 0.025812167674303055, -0.04921165108680725, 0.017589528113603592, -0.015141364187002182, 0.005246699787676334, 0.015292156487703323, -0.03853197768330574, -0.016054989770054817, -0.03895774483680725, -0.0015777797671034932, -0.056804507970809937, -0.030850417912006378, -0.04743761941790581, -0.04559262469410896, -0.052192024886608124, 0.029732778668403625, -0.011930366046726704, 0.013287500478327274, -0.001424769521690905, -0.07262887805700302, -0.06893888860940933, 0.01767822913825512, 0.021607711911201477, -0.00029382406501099467, 0.05169529467821121, 0.019407911226153374, -0.0780574157834053, 0.04605387523770332, -0.013065746054053307, 0.011602169834077358, 0.018857961520552635, -0.013890671543776989, -0.01012085285037756, -0.07220310717821121, 0.047756943851709366, 0.014014854095876217, -0.008298034779727459, 0.041973598301410675, -0.014884129166603088, -0.002707616426050663, -0.021572230383753777, -0.0986361876130104, 0.050098665058612823, -0.01789998449385166, -0.010688543319702148, 0.020028822124004364, -0.041122063994407654, 0.019869159907102585, 0.03700631111860275, -0.030052103102207184, 0.02726687304675579, -0.01423660758882761, 0.01942565105855465, 0.030176285654306412, 0.02373654954135418, 0.023754289373755455, -0.02439294196665287, 0.009287058375775814, -0.028366772457957268, 0.02886350266635418, -0.04942453280091286, -0.03533871844410896, 0.05162433534860611, -0.021572230383753777, 0.07883798331022263, -0.012471445836126804, 0.0195320937782526, -0.09139813482761383, 0.02206895872950554, -0.010555490851402283, 0.00779687101021409, -0.00273866206407547, -0.010342607274651527, 0.05992680415511131, -0.025741206482052803, -0.02148352935910225, -0.007615032605826855, -0.016808954998850822, -0.004011529963463545, 0.045237816870212555, -0.06524889916181564, 0.007184830028563738, 0.00214547012001276, 0.0012041243026033044, -0.01809512823820114, 0.03817716985940933, 0.007517461199313402, 0.010103113017976284, -0.05041799321770668, -0.019141806289553642, 0.02268987149000168, -0.08238605409860611, 0.008635100908577442, 0.007100563496351242, 0.002062312327325344, -0.022583428770303726, -0.028384514153003693, 0.011194142512977123, -0.03597737103700638, -0.03072623535990715, -0.01837897300720215, 0.022743090987205505, 0.014866389334201813, -0.014272088184952736, -0.11410574615001678, -0.003958309069275856, 0.026557261124253273, -0.026752404868602753, -0.042825136333703995, -0.003716597333550453, -0.02050781063735485, 0.010449049063026905, -0.019283728674054146, 0.011841664090752602, -0.08394719660282135, -0.026042791083455086, 0.019904639571905136, 0.022051218897104263, -0.09075948596000671, 0.017962075769901276, -0.01743873581290245, -0.024570344015955925, 0.01554052159190178, -0.0039871372282505035, 0.02831355296075344, 0.02909412607550621, -0.044421762228012085, -0.028615137562155724, 0.001254018978215754, 0.06180727854371071, 0.04573454707860947, -0.05024058744311333, -0.024109097197651863, -0.02987470105290413, -0.065426304936409, 0.03157776966691017, -0.05109212547540665, -0.0030202895868569613, 0.036101553589105606, 0.01674686372280121, -0.051056645810604095, -0.03799976781010628, -0.00867945235222578, -0.00850648432970047, -0.03246478736400604, -0.026716923341155052, -0.015088142827153206, -0.011140922084450722, 0.020880358293652534, -0.05158885195851326, 0.054285380989313126, -0.031684212386608124, 0.02726687304675579, -0.03760948032140732, 0.03729015588760376, -0.028526436537504196, 0.049034249037504196, 0.01361569669097662, 0.013393942266702652, -0.01505266223102808, -0.009198356419801712, 0.01221421081572771, -0.0005931920022703707, 0.003953874111175537, -0.012666589580476284, 0.06808735430240631, -0.02746201679110527, 0.02272535115480423, -0.026592740789055824, 0.00045404135016724467, 0.023984914645552635, 0.06343939155340195, 0.11382190138101578, -0.031719695776700974, -0.04172523692250252, -0.06673908978700638, 0.01864507794380188, -0.013837450183928013, 0.1270916610956192, 0.009437850676476955, -0.03418559953570366, 0.03721919283270836, 0.012152119539678097, 0.051056645810604095, -0.014112425036728382, -0.0013859625905752182, -0.0306907556951046, 0.05776248499751091, 0.05581105127930641, -0.10537751019001007, -0.04353474825620651, 0.04215100407600403, 0.020986799150705338, -0.004188933409750462, 0.027053989470005035, -0.06180727854371071, 0.006413125898689032, 0.058826904743909836, -0.003295264672487974, -0.007011862006038427, -0.06844215840101242, -0.061275068670511246, 0.033227622509002686, 0.06588755548000336, -0.05077279731631279, 0.08288277685642242, -0.025226736441254616, 0.03430978208780289, 0.03430978208780289, -0.0430380180478096, 0.033387284725904465, -0.028490955010056496, 0.038319092243909836, 0.009659605100750923, 0.051482412964105606, -0.023062417283654213, 0.012471445836126804, -0.020915837958455086, 0.07756068557500839, 0.056272298097610474, 0.015363117679953575, 0.017962075769901276, 0.006843328941613436, -0.030052103102207184, -0.025102553889155388, 0.026362117379903793, 0.052262984216213226, 0.04587646946310997, -0.033156659454107285, -0.019798198714852333, 0.005118082743138075, 0.0060538845136761665, -0.02494289167225361, -0.03370660915970802, 0.06624235957860947, 0.04630223661661148, -0.002240824280306697, -0.00905199907720089, -0.11751188337802887, -0.0027475322131067514, -0.02618471346795559, -0.01985142007470131, 0.011921496130526066, -0.03154229000210762, 0.02302693761885166, -0.03432752192020416, 0.01673799380660057, -0.08039913326501846, 0.023239821195602417, -0.01188601553440094, -0.02031266689300537, -0.057265754789114, -0.028721580281853676, 0.03849649801850319, -0.012773031368851662, 0.05169529467821121, 0.007468675263226032, -0.041547831147909164, -0.004488300997763872, 0.025191256776452065, -0.08486969769001007, -0.01662268117070198, 0.014458362013101578, -0.03425655886530876, -0.04055437445640564, -0.0019248247845098376, 0.040802739560604095, -0.00022826803615316749, -0.03108104318380356, 0.06485861539840698, -0.002592304488644004, -0.02093357965350151, -0.0032243032474070787, 0.04743761941790581, 0.012622238136827946, -0.031010081991553307, 0.07089032232761383, 0.06531985849142075, -0.0015389728359878063, 0.019390171393752098, -0.0004554273036774248, 0.006665925495326519, 0.057939887046813965, -0.014892999082803726, 0.03425655886530876, -0.08486969769001007, 0.04474109038710594, 0.014609154313802719, 0.014351919293403625, 0.011025609448552132, 0.02726687304675579, -0.014085815288126469, -0.03700631111860275, 0.02206895872950554, -0.03764495998620987, -0.004111319314688444, 0.01716376096010208, -0.0036500710994005203, 0.06109766662120819, 0.042399369180202484, 0.04686992987990379, 0.04410243779420853, 0.004603613168001175, -0.004171193111687899, 0.007570682093501091, -0.010005541145801544, -0.022388285025954247, -0.0117884436622262, -0.01185053400695324, 0.02902316488325596, 0.033653389662504196, 0.05361124873161316, -0.03523227944970131, -0.015105883590877056, -0.03736111521720886, 0.02194477804005146, -0.03228738531470299, 0.00772147485986352, -0.02256568893790245, -0.047295697033405304, -0.042754173278808594, -0.050630874931812286, 0.010821595788002014, 0.04867944121360779, -0.11176402121782303, 0.04147687181830406, -0.06627783924341202, -0.04012860730290413, 0.01810399815440178, 0.015877587720751762, 0.048147231340408325, -0.031595513224601746, -0.013464903458952904, 0.005907526705414057, -0.006696971133351326, 0.009659605100750923, -0.005801084917038679, 0.0306552741676569, -0.02116420306265354, -0.02034814842045307, 0.00680784834548831, -0.016480758786201477, -0.01724359206855297, -0.002714269096031785, -0.014121295884251595, -0.014813167974352837, -0.0039605265483260155, -0.007038472220301628, -0.034433964639902115, -0.01709279976785183, -0.005455148871988058, -0.013012525625526905, -0.03225190192461014, -0.013704397715628147, 0.032500267028808594, 0.04420888051390648, -0.026131492108106613, 0.005171303637325764, 0.009996671229600906, 0.029608596116304398, -0.03888678550720215, 0.06649072468280792, -0.031134262681007385, 0.0012007979676127434, -0.05815277248620987, 0.0357467457652092, -0.03732563555240631, -0.009078609757125378, 0.025510581210255623, 0.00974830612540245, -0.011486858129501343, 0.004874153062701225, 0.0056502921506762505, 0.001546734245494008, 0.008967732079327106, -0.006581658963114023, 0.034629106521606445, 0.03305021673440933, 0.009757176972925663, 0.024481642991304398, -0.024996113032102585, 0.05492403358221054, 0.019603054970502853, -0.008599620312452316, 0.04761502146720886, -0.03970284014940262, 0.026557261124253273, -0.05644970014691353, 0.02004656195640564, 0.004166757687926292, -0.07890895009040833, -0.0000056564599617559, 0.009721696376800537, -0.013828580267727375, -0.008071846328675747, 0.02769264206290245, -0.025776686146855354, -0.029182828962802887, 0.0388513021171093, 0.026787884533405304, -0.059571996331214905, -0.03223416209220886, -0.030548833310604095, 0.04537974298000336, -0.05077279731631279, 0.013526994735002518, 0.02811840921640396, 0.021217424422502518, 0.012373873963952065, 0.01744760572910309, -0.042754173278808594, 0.02226410247385502, -0.024996113032102585, -0.001606607809662819, 0.07458031177520752, 0.011371545493602753, -0.02661048248410225, -0.000409413332818076, -0.016693642362952232, 0.00757511705160141, -0.052653271704912186, -0.0011303910287097096, 0.019212767481803894, 0.02808292768895626, -0.01884022168815136, 0.06950657814741135, 0.06631331890821457, -0.034363001585006714, -0.012435965240001678, 0.007872267626225948, 0.0595010370016098, -0.0034926256630569696, -0.018822479993104935, 0.024073615670204163, -0.03920610994100571, 0.020064303651452065, 0.04914068803191185, 0.01919502764940262, -0.0060538845136761665, 0.009384630247950554, 0.028952203691005707, 0.03693534806370735, 0.007952098734676838, -0.0033396154176443815, 0.024570344015955925, -0.04587646946310997, -0.042434848845005035, 0.08146355301141739, 0.027408795431256294, -0.021572230383753777, -0.020206226035952568, 0.011194142512977123, -0.015123623423278332, 0.017110539600253105, 0.044492725282907486, -0.03631443902850151, -0.03619025647640228, -0.009007647633552551, -0.026983028277754784, -0.0184499341994524, 0.00772147485986352, 0.010626452043652534, -0.01686217449605465, -0.00031793981906957924, -0.051021162420511246, 0.06024612858891487, 0.03661602362990379, -0.033192139118909836, -0.010537751019001007, 0.02334626205265522, -0.025067074224352837, 0.03336954489350319, -0.07507704198360443, 0.007916618138551712, -0.03778688237071037, 0.008031930774450302, -0.012019067071378231, 0.02229958400130272, 0.0026433079037815332, -0.005020510870963335, 0.041583310812711716, -0.045202337205410004, 0.037964288145303726, -0.017997555434703827, 0.008027494885027409, 0.025581542402505875, -0.08259893208742142, 0.05804632976651192, -0.03475328907370567, 0.00986361876130104, 0.031329408288002014, 0.0034504923969507217, -0.0409446619451046, -0.02873932011425495, 0.017997555434703827, 0.0060849301517009735, -0.0003794765507336706, 0.009083044715225697, 0.049743860960006714, 0.017234722152352333, 0.032571230083703995, -0.001738551422022283, -0.00128949957434088, 0.03345824405550957, 0.03636765852570534, -0.058365657925605774, -0.037467557936906815, 0.0337243489921093, -0.005410797894001007, -0.023825250566005707, 0.01751856692135334, -0.019336950033903122, -0.0013715486275032163, 0.02187381498515606, 0.0065683540888130665, -0.03187935799360275, 0.012054548598825932, -0.02233506366610527, 0.007685994263738394, -0.013464903458952904, -0.02684110589325428, 0.03966735675930977, -0.004927373956888914, 0.12035033851861954, 0.021377086639404297, -0.05613037571310997, 0.04346378520131111, 0.05989132449030876, -0.04044793173670769, 0.06010420620441437, 0.03523227944970131, 0.08550834655761719, 0.015576002188026905, -0.0038895653560757637, 0.02485419064760208, 0.03248252719640732, 0.0779864490032196, 0.033422764390707016, 0.019088584929704666, 0.0943075492978096, -0.007858961820602417, 0.0017296812729910016, -0.060352571308612823, 0.01441401056945324, -0.018325751647353172, -0.005357576999813318, -0.0337953120470047, 0.00296263350173831, 0.003000331809744239, -0.00520678423345089, -0.031595513224601746, 0.03743207827210426, 0.012906083837151527, 0.02547510154545307, -0.052688755095005035, 0.03418559953570366, -0.01139815617352724, 0.08728238195180893, -0.02187381498515606, -0.018964402377605438, -0.009686214849352837, 0.0019470002735033631, 0.05208558216691017, 0.026752404868602753, 0.04427983984351158, 0.020028822124004364, 0.0033307452686131, 0.024144576862454414, -0.03924158960580826, -0.015629222616553307, 0.05978488177061081, 0.028579657897353172, -0.021270645782351494, -0.011744092218577862, 0.03941899165511131, 0.012906083837151527, 0.050595395267009735, -0.012906083837151527, 0.0052866158075630665, 0.010901426896452904, 0.05354028940200806, 0.05403701961040497, 0.03970284014940262, 0.0036922043655067682, 0.11644747108221054, 0.024073615670204163, -0.006847763899713755, 0.04257677122950554, -0.0112473638728261, -0.010608712211251259, -0.001805077656172216, -0.05520787835121155, 0.024251019582152367, 0.006204677280038595, 0.009260447695851326, 0.013908411376178265, 0.01441401056945324, -0.017917724326252937, -0.015487300232052803, 0.03729015588760376, 0.014147905632853508, 0.011504597961902618, 0.049034249037504196, 0.0009186160168610513, -0.01260449830442667, 0.036296695470809937, 0.0009624123922549188, -0.023364003747701645, -0.04587646946310997, 0.07507704198360443, 0.007415454369038343, -0.01177070289850235, -0.02373654954135418, -0.009091914631426334, -0.02268987149000168, 0.05786892771720886, -0.01926598884165287, 0.03145359084010124, -0.02419779822230339, 0.007898878306150436, 0.006865504197776318, 0.03970284014940262, 0.06496505439281464, -0.005978488363325596, 0.032730892300605774, -0.05602393299341202, 0.015975158661603928 ]
42,827
linearmodels.panel.model
_postestimation
Common post-estimation values
def _postestimation( self, params: Float64Array, cov: CovarianceEstimator, debiased: bool, df_resid: int, weps: Float64Array, y: Float64Array, x: Float64Array, root_w: Float64Array, ) -> AttrDict: """Common post-estimation values""" f_info = self._f_statistic_robust(params) f_stat = self._f_statistic(weps, y, x, root_w, df_resid) r2o, r2w, r2b = self._rsquared(params) c2o, c2w, c2b = self._rsquared_corr(params) f_pooled = InapplicableTestStatistic( reason="Model has no effects", name="Pooled F-stat" ) entity_info, time_info, other_info = self._info() nobs = weps.shape[0] sigma2 = float(np.squeeze(weps.T @ weps) / nobs) if sigma2 > 0.0: loglik = -0.5 * nobs * (np.log(2 * np.pi) + np.log(sigma2) + 1) else: loglik = np.nan res = AttrDict( params=params, deferred_cov=cov.deferred_cov, f_info=f_info, f_stat=f_stat, debiased=debiased, name=self._name, var_names=self.exog.vars, r2w=r2w, r2b=r2b, r2=r2w, r2o=r2o, c2o=c2o, c2b=c2b, c2w=c2w, s2=cov.s2, model=self, cov_type=cov.name, index=self.dependent.index, entity_info=entity_info, time_info=time_info, other_info=other_info, f_pooled=f_pooled, loglik=loglik, not_null=self._not_null, original_index=self._original_index, ) return res
(self, params: numpy.ndarray, cov: Union[linearmodels.panel.covariance.ACCovariance, linearmodels.panel.covariance.ClusteredCovariance, linearmodels.panel.covariance.DriscollKraay, linearmodels.panel.covariance.HeteroskedasticCovariance, linearmodels.panel.covariance.HomoskedasticCovariance], debiased: bool, df_resid: int, weps: numpy.ndarray, y: numpy.ndarray, x: numpy.ndarray, root_w: numpy.ndarray) -> linearmodels.shared.utility.AttrDict
[ 0.0370292030274868, -0.03248073160648346, 0.005568958818912506, 0.05053854361176491, -0.014189667999744415, -0.0529877208173275, -0.050655171275138855, -0.046417709439992905, 0.022664593532681465, 0.034346770495176315, 0.0030104450415819883, 0.02524983324110508, 0.00317323743365705, 0.025774657726287842, -0.037087514996528625, 0.06717738509178162, -0.02699924446642399, 0.0359601192176342, -0.017464954406023026, -0.030498066917061806, -0.038836926221847534, -0.045523565262556076, -0.051938071846961975, 0.03699032589793205, -0.008236810564994812, -0.043813031166791916, -0.007488451432436705, -0.05427062138915062, 0.050577420741319656, 0.024472318589687347, -0.040469709783792496, -0.05971323326230049, 0.0023374075535684824, -0.00656029162928462, 0.06251229345798492, 0.00915039237588644, 0.004035794176161289, 0.03656269237399101, -0.05388186126947403, -0.014034165069460869, -0.025774657726287842, -0.06507809460163116, 0.020856868475675583, -0.02624116651713848, -0.0055106449872255325, 0.03407464176416397, 0.019350429996848106, 0.04921676591038704, 0.035843491554260254, -0.00906292162835598, 0.008251389488577843, -0.05858583375811577, 0.029117977246642113, 0.00594799779355526, 0.019884973764419556, 0.025424774736166, 0.021809324622154236, 0.0307701975107193, 0.03951725363731384, -0.05905234441161156, 0.05730293318629265, 0.005029556807130575, 0.021245626732707024, -0.00296913948841393, -0.01207093708217144, 0.016901254653930664, -0.02357817441225052, -0.025658030062913895, -0.0015076522249728441, 0.028107205405831337, 0.040897343307733536, -0.04408515989780426, -0.030789636075496674, 0.044668298214673996, 0.03850648179650307, -0.01919492706656456, -0.0034745249431580305, -0.03842873126268387, -0.02948729693889618, 0.0013217773521319032, -0.03364700824022293, -0.011740492656826973, -0.07090946286916733, -0.02375311590731144, -0.009680074639618397, -0.042646754533052444, -0.003428359981626272, -0.02315054088830948, 0.02165382169187069, 0.01598767377436161, -0.0025147784035652876, 0.043890781700611115, 0.03343319147825241, 0.02015710435807705, 0.05419287085533142, 0.004597063641995192, -0.030498066917061806, 0.01923380419611931, 0.044240664690732956, -0.003508541267365217, 0.004864335060119629, 0.03539641946554184, -0.022334149107336998, 0.034171830862760544, 0.008270827122032642, -0.02499714121222496, -0.001039927708916366, -0.0055106449872255325, 0.009646059013903141, -0.0634453073143959, -0.04661208763718605, -0.016969287768006325, -0.06177365034818649, -0.013956413604319096, -0.022489652037620544, -0.051160555332899094, -0.02453063242137432, 0.03362756967544556, -0.0014614872634410858, 0.021848201751708984, -0.01876729354262352, 0.024705572053790092, -0.08311646431684494, -0.012751263566315174, -0.03364700824022293, -0.033666446805000305, 0.0402364544570446, 0.04447392001748085, -0.0017749234102666378, -0.0423746258020401, -0.03745683655142784, -0.023403232917189598, 0.009422522969543934, 0.00014198779535945505, -0.005019837990403175, 0.005695305299013853, 0.029584486037492752, 0.019399026408791542, 0.004733128938823938, -0.04497930407524109, 0.03735964745283127, 0.034774404019117355, -0.04832262173295021, 0.0361156202852726, -0.001013200613670051, 0.0132274916395545, 0.003547416999936104, -0.003800109727308154, -0.02756294421851635, 0.015569758601486683, 0.0013157029170542955, 0.019000548869371414, -0.0201182272285223, -0.027932263910770416, 0.016998445615172386, -0.09983306378126144, 0.03557135909795761, 0.027873950079083443, -0.03436620905995369, -0.014772805385291576, -0.043813031166791916, -0.04497930407524109, 0.05687529966235161, 0.0013363556936383247, 0.03119783103466034, 0.038545358926057816, -0.055320266634225845, -0.004407544154673815, 0.02243133820593357, 0.003975050989538431, -0.020643051713705063, -0.02075967937707901, -0.060412999242544174, -0.03047863021492958, -0.07083171606063843, 0.07880125194787979, 0.018708979710936546, -0.06255116313695908, -0.0486336275935173, -0.010545061901211739, 0.04416291043162346, -0.049372270703315735, -0.008319421671330929, -0.028262708336114883, -0.02495826594531536, 0.0297011137008667, -0.011711335740983486, -0.0327528640627861, -0.025347024202346802, 0.021751010790467262, -0.03273342549800873, 0.02217864617705345, 0.013509341515600681, -0.014811680652201176, 0.03700976446270943, -0.012226440012454987, 0.042569003999233246, -0.004966383799910545, 0.08793706446886063, 0.0005643065669573843, -0.02453063242137432, -0.02837933599948883, 0.010117427445948124, -0.0037588041741400957, -0.031022891402244568, 0.013101145625114441, -0.0361156202852726, 0.0033433190546929836, -0.034385647624731064, 0.029254041612148285, 0.009961924515664577, 0.024725010618567467, 0.006881017237901688, -0.007308650761842728, 0.03526035323739052, -0.0190102681517601, 0.0488668829202652, 0.02208145521581173, 0.0060500469990074635, -0.023208854719996452, -0.01716366782784462, -0.038545358926057816, -0.00605490617454052, 0.018456287682056427, 0.027018683031201363, -0.01207093708217144, 0.025133207440376282, 0.02353929914534092, 0.05722518265247345, -0.06814928352832794, -0.02517208270728588, 0.04505705460906029, -0.02118731290102005, -0.07526355236768723, 0.026046788319945335, -0.0425301268696785, -0.04661208763718605, -0.017173385247588158, -0.00223900331184268, -0.02495826594531536, -0.0036834822967648506, -0.011565551161766052, -0.016726315021514893, 0.01262491662055254, -0.010768597014248371, -0.0444350428879261, 0.057030804455280304, 0.040042076259851456, 0.025755219161510468, 0.0010356756392866373, 0.07693521678447723, -0.04241349920630455, -0.04295776039361954, 0.022159207612276077, 0.010340963490307331, 0.02346154674887657, 0.06185140088200569, 0.05419287085533142, 0.07930663973093033, -0.045173682272434235, 0.03094513900578022, -0.014073040336370468, -0.027621258050203323, 0.03910905867815018, -0.03613505885004997, 0.007323229219764471, -0.00473555875942111, -0.047272976487874985, -0.019146332517266273, 0.028962472453713417, -0.0445905476808548, 0.03485215827822685, -0.048944637179374695, -0.06888791918754578, -0.020429234951734543, 0.05819707736372948, 0.003967761527746916, -0.04155823215842247, 0.027543505653738976, 0.03629056364297867, 0.04700084403157234, -0.07961764186620712, 0.020001601427793503, 0.032208602875471115, 0.013431590050458908, 0.008523520082235336, -0.02791282720863819, 0.038759175688028336, 0.06713850796222687, -0.03215028718113899, -0.01433545257896185, 0.026416108012199402, 0.04365752637386322, -0.013071988709270954, 0.027718447148799896, -0.007469013798981905, -0.010593656450510025, -0.012508289888501167, 0.016405588015913963, 0.017581582069396973, 0.026124538853764534, 0.029254041612148285, 0.021420568227767944, 0.01196402870118618, 0.023480985313653946, 0.03506597504019737, 0.07160922884941101, -0.031178394332528114, -0.018135562539100647, -0.03281117603182793, -0.01566694863140583, 0.03570742532610893, 0.0034453680273145437, 0.04917789250612259, -0.013003956526517868, -0.06881017237901688, -0.002085929736495018, -0.01534622348845005, 0.018679823726415634, 0.06468933820724487, -0.014131354168057442, 0.006414507515728474, 0.03146996349096298, -0.0011340801138430834, 0.04999428242444992, 0.0180966854095459, 0.010554780252277851, 0.011546113528311253, -0.013752315193414688, 0.01157527044415474, -0.030498066917061806, -0.028223833069205284, -0.012313910759985447, 0.04735072702169418, -0.018106404691934586, 0.004315214231610298, 0.014267419464886189, -0.017863431945443153, 0.054076243191957474, -0.006492258980870247, -0.020915182307362556, -0.03458002582192421, -0.0369514524936676, 0.018757574260234833, -0.014403484761714935, -0.038545358926057816, 0.04078071564435959, 0.014520112425088882, 0.040119826793670654, 0.022625716403126717, -0.04781723767518997, 0.027057558298110962, 0.04735072702169418, 0.09936655312776566, 0.04968327656388283, 0.05259896069765091, -0.02880696952342987, 0.03125614672899246, 0.024880513548851013, -0.023850305005908012, 0.015307347290217876, 0.0196225605905056, 0.0008206439088098705, 0.04567907005548477, 0.07098721712827682, -0.01890335977077484, -0.02845708839595318, 0.030031558126211166, 0.02019597962498665, -0.07961764186620712, -0.02517208270728588, -0.06457270681858063, -0.04027533158659935, 0.03261679783463478, 0.050188660621643066, -0.00833400059491396, -0.05252121016383171, -0.032636236399412155, 0.03996432572603226, 0.02717418596148491, -0.023053351789712906, -0.040508586913347244, -0.007206602022051811, -0.025230396538972855, 0.029895491898059845, -0.011293420568108559, 0.05434837192296982, -0.01705675944685936, 0.03831210359930992, -0.052404582500457764, 0.02208145521581173, 0.002784479409456253, -0.03154771402478218, 0.03154771402478218, -0.013246930204331875, 0.00989875104278326, 0.021770449355244637, -0.006093781907111406, -0.07227011770009995, -0.02062361314892769, -0.054970383644104004, -0.008402032777667046, -0.04494042694568634, 0.02225639671087265, -0.010175741277635098, -0.08770380914211273, -0.027018683031201363, 0.02075967937707901, 0.04688422009348869, 0.06496146321296692, -0.007838333956897259, 0.005811932496726513, -0.007848052307963371, -0.039614442735910416, 0.009038624353706837, 0.03716526925563812, -0.01947677694261074, 0.022100893780589104, 0.06500034034252167, -0.031528275460004807, 0.06383407115936279, 0.005598115734755993, 0.05419287085533142, 0.0465732105076313, -0.010788035579025745, -0.03238354250788689, -0.06251229345798492, -0.01136145368218422, -0.021984266117215157, 0.01975862681865692, 0.008489503525197506, -0.0003025023324880749, -0.06842141598463058, 0.016152895987033844, 0.026979807764291763, -0.013762034475803375, -0.019272679463028908, 0.009709231555461884, 0.021420568227767944, 0.043890781700611115, -0.04334652051329613, 0.05854696035385132, 0.0077848793007433414, -0.05259896069765091, -0.023519860580563545, -0.0055300830863416195, 0.0401587039232254, -0.04999428242444992, -0.05975211039185524, -0.03741795942187309, 0.09291316568851471, 0.006113220006227493, 0.058741338551044464, 0.011264263652265072, -0.047700610011816025, -0.021770449355244637, 0.013373276218771935, -0.05372636020183563, -0.009903610683977604, 0.028223833069205284, -0.01559891551733017, -0.01577385701239109, -0.05633103847503662, -0.019379587844014168, 0.0001272575173061341, 0.05652541667222977, 0.010778316296637058, -0.027621258050203323, 0.017795398831367493, -0.012965080328285694, 0.024686135351657867, -0.000676681927870959, -0.016716595739126205, -0.03531866520643234, -0.033355437219142914, 0.0029885773546993732, -0.055786777287721634, -0.006322177592664957, 0.04210249334573746, -0.0011632369132712483, 0.019923849031329155, -0.022120332345366478, 0.0132274916395545, 0.00468210456892848, 0.017727365717291832, -0.05217132717370987, 0.01189599558711052, -0.0010873075807467103, 0.027251938357949257, 0.008625568822026253, 0.007454435341060162, -0.024861076846718788, 0.05415399372577667, 0.063367560505867, -0.09120263159275055, 0.03549360856413841, 0.05808044970035553, -0.04190811514854431, 0.05765281617641449, -0.10683070868253708, 0.0339774526655674, -0.04707859829068184, -0.032208602875471115, -0.030634133145213127, -0.03222804144024849, -0.05213245004415512, -0.0401587039232254, 0.05442612245678902, 0.00894143432378769, 0.02307278849184513, -0.012566603720188141, -0.05376523360610008, 0.004171859472990036, -0.019846096634864807, 0.005398876965045929, -0.014500674791634083, -0.00442455243319273, 0.024763885885477066, -0.001482140040025115, -0.020487548783421516, 0.05127718299627304, 0.023228291422128677, 0.03792334720492363, -0.0035522764082998037, 0.046028949320316315, 0.043385397642850876, -0.02678542770445347, 0.021323377266526222, 0.06857691705226898, 0.041324976831674576, -0.06923780590295792, -0.0742916613817215, 0.04482379928231239, 0.018990829586982727, 0.025424774736166, -0.015268472023308277, 0.027271375060081482, -0.06741064041852951, -0.0658167377114296, -0.03197534754872322, -0.002156392205506563, -0.029681675136089325, -0.020390357822179794, -0.04929451644420624, 0.02952617220580578, -0.02243133820593357, 0.0003307480365037918, 0.00899002980440855, -0.003970191348344088, -0.03368588164448738, 0.027485191822052002, -0.02460838295519352, 0.033316563814878464, 0.04754510521888733, 0.025424774736166, 0.03321937471628189, 0.004098967649042606, 0.018679823726415634, 0.002519638044759631, 0.019807221367955208, -0.04661208763718605, -0.025055455043911934, 0.09594548493623734, -0.03846760839223862, -0.021167874336242676, 0.06111276149749756, 0.03870085999369621, 0.05170481652021408, -0.04408515989780426, -0.03835098072886467, 0.013208054006099701, 0.02101237140595913, 0.03463834151625633, 0.008465206250548363, -0.008766493760049343, 0.015793295577168465, 0.0403919592499733, -0.036912575364112854, -0.008095885626971722, -0.027757322415709496, 0.03026481345295906, -0.01602654904127121, 0.01562807336449623, -0.058235954493284225, -0.0307313222438097, 0.040936220437288284, -0.051121681928634644, 0.056991927325725555, 0.06111276149749756, 0.00223900331184268, -0.078334741294384, 0.018524320796132088, -0.04610670357942581, -0.05162706598639488, 0.020565299317240715, 0.026979807764291763, -0.04913901537656784, 0.017047040164470673, -0.009709231555461884, -0.012313910759985447, -0.02983717806637287, -0.0030055854003876448, 0.03903130441904068, -0.04081959277391434, -0.009067781269550323, -0.028087766841053963, -0.027932263910770416, 0.04124722629785538, 0.021906515583395958, 0.008946293964982033, 0.023830866441130638, -0.016172334551811218, 0.035376980900764465, 0.004448849707841873, -0.0006614960730075836, -0.015394818037748337, -0.05209357663989067, 0.03887580335140228, 0.04828374832868576, 0.017358046025037766, 0.02062361314892769, -0.019272679463028908, -0.00860127154737711, 0.029331794008612633, -0.03487159684300423, -0.011167074553668499, 0.0681104063987732, -0.1146836206316948, -0.02144000492990017, -0.024064121767878532, -0.0065311347134411335, 0.046028949320316315, 0.05252121016383171, -0.04311326518654823, 0.023830866441130638, 0.022975599393248558, 0.0762743279337883, 0.00013059840421192348, -0.010710284113883972, -0.013936975039541721, 0.05263783782720566, 0.04280225932598114, -0.009033764712512493, -0.019739188253879547, -0.02375311590731144, 0.03757346421480179, 0.0038900100626051426, -0.021692698821425438, 0.043463148176670074, 0.016230648383498192, -0.008766493760049343, -0.012848452664911747, -0.05559239909052849, -0.02589128538966179, 0.03743739798665047, 0.015035216696560383, -0.01515184435993433, 0.04999428242444992, -0.0009275523480027914, 0.011925152502954006, 0.0014493385097011924, -0.02353929914534092, -0.0000025910874228429748, -0.05819707736372948, 0.030109308660030365, 0.0122167207300663, -0.033880263566970825, -0.0034259301610291004, -0.0025123488157987595, -0.05166594311594963, 0.03364700824022293, 0.007240618113428354, -0.019583685323596, 0.0011134273372590542, 0.024686135351657867, -0.05800269916653633, 0.004023645538836718, 0.03269455209374428, -0.04315214231610298, -0.0092961760237813, 0.1445402354001999, 0.04536806046962738, -0.00003940730675822124, -0.016502778977155685, 0.08179468661546707, -0.032247480005025864, 0.0014274709392338991, 0.002022756729274988, -0.035376980900764465, 0.007624516729265451, -0.03463834151625633, -0.07759610563516617, 0.02845708839595318, 0.026610486209392548, 0.02769901044666767, -0.07044295221567154, -0.028826408088207245, 0.0077848793007433414, 0.016463901847600937, -0.0306924469769001, -0.026591049507260323, -0.0021806894801557064, 0.006662340834736824, 0.0031319318804889917, 0.005394017789512873, 0.06418395042419434, -0.008897699415683746, -0.01178908720612526, 0.036232247948646545, -0.07946214079856873, -0.04054746404290199, 0.010447871871292591, 0.01570582389831543, -0.03928399831056595, 0.009889032691717148, 0.05345422774553299, 0.008261107839643955, -0.004504733718931675, -0.02884584665298462, 0.002786909230053425, 0.0014213965041562915, 0.03835098072886467, 0.016425026580691338, -0.005486347712576389, -0.026338355615735054, -0.05221020430326462, 0.04478492587804794, -0.03685425966978073, 0.09120263159275055, 0.0019207076402381063, 0.020021038129925728, 0.0004479828930925578, 0.004072240553796291, -0.041286103427410126, -0.05843033269047737, -0.04536806046962738, 0.06052962690591812, -0.018708979710936546, -0.04754510521888733, 0.04567907005548477, -0.03910905867815018, 0.02795170247554779, -0.037690091878175735, -0.019846096634864807, -0.02876809425652027, 0.04626220464706421, 0.015589197166264057, -0.02495826594531536, 0.04789498820900917, -0.046845342963933945, 0.10302087664604187, 0.02050698548555374, 0.0296622384339571, 0.016250085085630417, 0.05629216134548187, 0.010710284113883972, 0.07518580555915833, -0.02756294421851635, 0.011691898107528687, -0.014733929187059402, -0.0031124940142035484, -0.024511193856596947, -0.004074669908732176, 0.04544581472873688, 0.012741544283926487, 0.03150883689522743, 0.02200370468199253, 0.05217132717370987 ]
42,828
linearmodels.panel.model
_prepare_between
Prepare values for between estimation of R2
def _prepare_between(self) -> tuple[Float64Array, Float64Array, Float64Array]: """Prepare values for between estimation of R2""" weights = self.weights if self._is_weighted else None y = np.asarray(self.dependent.mean("entity", weights=weights)) x = np.asarray(self.exog.mean("entity", weights=weights)) # Weight transformation wcount, wmean = self.weights.count("entity"), self.weights.mean("entity") wsum = wcount * wmean w = np.asarray(wsum) w = w / w.mean() return y, x, w
(self) -> tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
[ 0.026823772117495537, -0.007656066212803125, -0.002128597581759095, -0.016312746331095695, 0.01456855796277523, -0.04589967802166939, -0.0062653059139847755, -0.0402081161737442, 0.008996336720883846, 0.04817630350589752, 0.021517768502235413, 0.013797443360090256, 0.04791926220059395, 0.03884948790073395, -0.05272955074906349, 0.06135869026184082, -0.02206856571137905, -0.02408815175294876, -0.03962060064077377, 0.01652388460934162, -0.04388009011745453, -0.04538560286164284, -0.06323139369487762, -0.010823143646121025, -0.0017728750826790929, -0.01058446615934372, -0.06080789491534233, -0.025336621329188347, -0.003869342850521207, -0.006366285495460033, -0.026015937328338623, -0.06653617322444916, 0.030550826340913773, -0.04314569756388664, 0.05100372061133385, -0.017414337024092674, 0.028017163276672363, 0.04483480378985405, -0.0059072887524962425, 0.032496970146894455, -0.008367511443793774, -0.08034279942512512, 0.027851924300193787, 0.04138315096497536, -0.07740521430969238, -0.0076973759569227695, -0.0018543469486758113, -0.1012730523943901, 0.024951064959168434, 0.009648112580180168, 0.07421059906482697, -0.0072934590280056, 0.05177483707666397, 0.03789477422833443, 0.02120565064251423, 0.015302952378988266, -0.026823772117495537, 0.09951049834489822, -0.008381281048059464, -0.015826208516955376, 0.05291314795613289, 0.017928414046764374, -0.009492053650319576, 0.0028962697833776474, 0.00026062410324811935, 0.01305386796593666, -0.04645047336816788, 0.018947387114167213, 0.004952575080096722, 0.09121184051036835, 0.004532593302428722, 0.017304178327322006, -0.01435741875320673, 0.016321925446391106, -0.006260715890675783, 0.005613530520349741, 0.021774807944893837, 0.06044069677591324, 0.03370872512459755, -0.031450457870960236, -0.008730119094252586, 0.06734400987625122, 0.0049112653359770775, -0.02017749845981598, 0.006595783866941929, -0.01709304004907608, -0.08643827587366104, 0.02968791127204895, 0.006499394308775663, -0.04692783206701279, -0.07270509004592896, 0.03458999842405319, -0.010676264762878418, 0.030587544664740562, 0.08717266470193863, 0.025979217141866684, -0.03330480679869652, -0.009436973370611668, -0.005898108705878258, 0.0036857440136373043, -0.014274800196290016, -0.002039093291386962, -0.028935156762599945, 0.058641429990530014, 0.019938819110393524, -0.01761629618704319, 0.02662181295454502, -0.031909454613924026, -0.0054069822654128075, -0.020452896133065224, -0.06455330550670624, -0.021958405151963234, -0.04164018854498863, 0.043586332350969315, -0.09297438710927963, -0.038555730134248734, -0.018855588510632515, 0.028880076482892036, 0.010235628113150597, 0.046009838581085205, 0.014173820614814758, 0.0040231067687273026, -0.023739313706755638, 0.032992687076330185, -0.03741741552948952, -0.02160956896841526, 0.05728279799222946, 0.00479651615023613, -0.05849454924464226, -0.07395356148481369, -0.01909426599740982, -0.03479195758700371, -0.034993913024663925, 0.013154847547411919, -0.06774792075157166, -0.010887403972446918, 0.012576512061059475, 0.019902100786566734, 0.0776989758014679, -0.001988603500649333, 0.028512880206108093, 0.03734397888183594, 0.000784310745075345, -0.017974313348531723, -0.02621789649128914, 0.007215429563075304, -0.010538565926253796, 0.06425955146551132, 0.016018986701965332, 0.010400867089629173, -0.04086907207965851, 0.011768677271902561, 0.03236845135688782, -0.02208692580461502, 0.0032496971543878317, -0.06671977043151855, 0.024951064959168434, -0.022876398637890816, 0.007642296142876148, 0.004709307104349136, -0.043586332350969315, -0.03585682809352875, 0.05596088618040085, -0.005218793172389269, 0.04975524917244911, 0.06290091574192047, 0.002517597284168005, -0.016964521259069443, 0.052619390189647675, -0.036940060555934906, -0.0051086340099573135, -0.028990237042307854, -0.020416175946593285, -0.018910666927695274, -0.10450438410043716, -0.005700740031898022, 0.013209926895797253, -0.040428437292575836, -0.003419525921344757, 0.03222157433629036, 0.08129750937223434, -0.03376380354166031, 0.0012209314154461026, -0.03066098503768444, -0.012530611827969551, 0.003011018969118595, 0.046487193554639816, -0.021444329991936684, -0.002873319899663329, 0.0016822231700643897, 0.037931494414806366, 0.00009273169416701421, -0.02764996513724327, 0.0035228002816438675, 0.01511017419397831, 0.05485929548740387, 0.06242356076836586, -0.006751842796802521, -0.012925349175930023, 0.01914934627711773, -0.011474919505417347, -0.06135869026184082, -0.06400251388549805, 0.040465157479047775, 0.020746653899550438, 0.019810300320386887, -0.027833564206957817, 0.00016308728663716465, -0.03572830930352211, 0.016358645632863045, -0.022858040407299995, 0.015578350983560085, -0.0564749650657177, -0.022821320220828056, 0.026052657514810562, 0.020911892876029015, -0.0025267773307859898, 0.03914324566721916, -0.01387088280171156, -0.020324377343058586, 0.025960857048630714, -0.08026935905218124, 0.00615514675155282, -0.025061223655939102, 0.05445537716150284, 0.024510428309440613, -0.007536727003753185, -0.023518994450569153, -0.015238692983984947, 0.029082035645842552, 0.04417385160923004, 0.0059348284266889095, -0.019424743950366974, -0.02271115966141224, 0.011447379365563393, 0.009065186604857445, -0.022362323477864265, -0.02307835780084133, -0.05243579298257828, 0.02722768858075142, -0.02827420085668564, 0.010446766391396523, -0.00954713299870491, -0.00389917753636837, -0.00029347106465138495, -0.062203243374824524, 0.029375793412327766, -0.024290109053254128, -0.015183613635599613, 0.007862614467740059, -0.02425338886678219, 0.017818255349993706, 0.008987156674265862, 0.007265918888151646, -0.01862609013915062, -0.04678095132112503, 0.03361692279577255, -0.023445555940270424, -0.001020120340399444, -0.03818853199481964, 0.06866592168807983, -0.012558151967823505, -0.04674423113465309, -0.015706868842244148, -0.0006575128645636141, 0.06172588840126991, -0.018240531906485558, 0.0009300422389060259, -0.008794378489255905, 0.02107713185250759, 0.0009294684859924018, 0.012686670757830143, -0.04259490221738815, -0.009492053650319576, 0.00935435388237238, 0.010639545507729053, 0.03638926520943642, -0.07821305096149445, -0.010621185414493084, 0.0291738361120224, -0.0023684233892709017, -0.021976765245199203, -0.019332943484187126, -0.0004578492953442037, 0.017294999212026596, -0.03117506206035614, -0.010299887508153915, -0.08048967272043228, 0.07164021581411362, -0.018286431208252907, -0.03541618958115578, 0.04274177923798561, -0.0006070232484489679, 0.021370889618992805, 0.02972463145852089, -0.04178706556558609, 0.005457471590489149, -0.04035499691963196, 0.08195846527814865, 0.01434823963791132, -0.018424130976200104, 0.02206856571137905, 0.011777857318520546, 0.04795598238706589, 0.008059983141720295, 0.007311818655580282, 0.10604661703109741, -0.026419853791594505, -0.017322538420557976, -0.04160346835851669, -0.055079612880945206, 0.008753068745136261, 0.02671361155807972, -0.025942498818039894, 0.01387088280171156, -0.04384337365627289, 0.015468191355466843, 0.031468819826841354, -0.006228586193174124, 0.07428403943777084, -0.010015309788286686, -0.02019585855305195, 0.018304791301488876, 0.006324975751340389, 0.006361695472151041, 0.03508571535348892, -0.05221547186374664, 0.003990977071225643, 0.061652448028326035, 0.050049006938934326, -0.04028155654668808, 0.027833564206957817, 0.0037867233622819185, 0.053647544234991074, 0.04017139971256256, 0.02616281621158123, 0.030844584107398987, 0.015918008983135223, 0.059632860124111176, -0.030514106154441833, -0.04090579226613045, -0.04986540973186493, -0.016982881352305412, 0.03458999842405319, 0.047625504434108734, -0.036481063812971115, 0.019241144880652428, -0.020232578739523888, 0.046560633927583694, -0.008115063421428204, -0.09995114058256149, 0.05181155726313591, 0.007651476189494133, 0.03559979051351547, 0.006848231889307499, 0.032441891729831696, -0.08115062862634659, 0.015918008983135223, 0.027374567463994026, 0.03862917050719261, -0.013411886058747768, 0.06848231703042984, -0.03020198829472065, 0.026291335001587868, 0.012282753363251686, 0.00806916318833828, -0.007082320284098387, 0.04520200192928314, -0.046119995415210724, 0.002430388005450368, -0.017753995954990387, -0.022343963384628296, -0.03714201971888542, 0.050012290477752686, -0.021297451108694077, 0.006728892680257559, -0.032441891729831696, -0.04343945533037186, 0.03183601796627045, 0.0014676421415060759, -0.006940031424164772, 0.006228586193174124, -0.03286416828632355, 0.018800508230924606, 0.012677490711212158, -0.012971249409019947, 0.04828646034002304, -0.01658814400434494, -0.04325585812330246, -0.011924736201763153, -0.004649637266993523, -0.008216042071580887, -0.016992060467600822, -0.019259504973888397, 0.023261956870555878, -0.006398415192961693, 0.025869058445096016, -0.005503371357917786, -0.026419853791594505, -0.007968183606863022, -0.046377032995224, -0.022968199104070663, -0.023922912776470184, 0.006875771563500166, -0.04641375318169594, -0.057649996131658554, -0.013228286989033222, 0.0851898044347763, 0.0255753006786108, 0.0009243047679774463, -0.09804171323776245, 0.013815803453326225, -0.00043862880556844175, -0.003339201444759965, -0.003793608397245407, -0.013164027594029903, 0.03014690801501274, 0.029798069968819618, 0.029577752575278282, 0.027374567463994026, 0.0030844584107398987, -0.02871483750641346, 0.00952877290546894, -0.008987156674265862, -0.000714887457434088, -0.008739298209547997, -0.012255214154720306, -0.01955326274037361, 0.01607406698167324, 0.0010115141049027443, 0.015862928703427315, 0.018754608929157257, -0.07887400686740875, -0.027851924300193787, 0.016698302701115608, 0.03361692279577255, 0.021517768502235413, 0.02619953639805317, 0.04968181252479553, -0.006297435611486435, -0.039547163993120193, 0.03539783135056496, 0.06804168224334717, -0.030073469504714012, -0.07909432798624039, -0.07534891366958618, -0.037931494414806366, -0.038004934787750244, -0.06429626792669296, -0.05753983557224274, 0.041493307799100876, 0.007247559260576963, 0.04428400844335556, 0.005361082497984171, -0.006031217519193888, 0.004583082627505064, -0.009299274533987045, -0.09392909705638885, 0.008335381746292114, -0.00980417151004076, 0.02660345286130905, 0.005044374614953995, -0.06447986513376236, 0.04277849942445755, -0.0076790158636868, -0.04116282984614372, 0.013742363080382347, -0.09400253742933273, -0.026952290907502174, 0.03559979051351547, 0.019810300320386887, -0.03829869255423546, 0.01808447390794754, -0.02160956896841526, 0.031046541407704353, 0.02171972766518593, 0.023243596777319908, -0.00527387298643589, 0.06260716170072556, -0.049975570291280746, -0.02465730719268322, -0.04130971059203148, -0.014981654472649097, 0.014403318986296654, 0.011493279598653316, 0.02311507798731327, -0.06642601639032364, 0.00693544140085578, -0.020801734179258347, 0.022380683571100235, -0.013448605313897133, 0.029926590621471405, 0.026438213884830475, -0.013145667500793934, -0.056144487112760544, 0.009556313045322895, 0.03214813396334648, 0.013209926895797253, 0.03570995107293129, -0.01383416261523962, 0.02572217956185341, -0.05948598310351372, 0.011768677271902561, -0.0211322121322155, -0.009684831835329533, -0.026566732674837112, -0.06205636262893677, -0.03530603274703026, -0.03418608009815216, 0.038004934787750244, 0.060661014169454575, -0.019975539296865463, -0.0004828072269447148, -0.005604350473731756, -0.008440950885415077, -0.023610794916749, -0.0266952533274889, 0.07946152240037918, -0.030440665781497955, -0.02972463145852089, -0.055630408227443695, 0.024767465889453888, 0.011144441552460194, -0.01254897192120552, 0.0024831725750118494, -0.008156373165547848, -0.05724607780575752, -0.028549600392580032, 0.036077145487070084, -0.05849454924464226, -0.010997562669217587, -0.059155505150556564, 0.03563651069998741, -0.04428400844335556, -0.022949839010834694, -0.0011400332441553473, 0.029889870434999466, 0.006503984332084656, -0.08900865167379379, 0.0022582642268389463, 0.012172594666481018, -0.018304791301488876, -0.052068594843149185, 0.00415621604770422, 0.03286416828632355, 0.020324377343058586, -0.03962060064077377, 0.018258891999721527, -0.07332932204008102, -0.02171972766518593, 0.015982268378138542, -0.05474913492798805, 0.04725831001996994, 0.038041651248931885, 0.009886790998280048, -0.015982268378138542, -0.0311383418738842, 0.007913104258477688, -0.004415548872202635, 0.04079563543200493, -0.020012259483337402, -0.04813958331942558, 0.004057531710714102, 0.06297435611486435, -0.061615727841854095, 0.02364751324057579, 0.017946774140000343, 0.021976765245199203, -0.05794375389814377, 0.017910053953528404, -0.008395050652325153, 0.0674174502491951, -0.0019358189310878515, -0.006311205681413412, 0.013246647082269192, -0.022380683571100235, 0.009574673138558865, -0.05518977344036102, -0.05394130200147629, -0.022509202361106873, 0.05283970758318901, 0.018350690603256226, 0.013081408105790615, -0.06444314867258072, 0.03424115851521492, -0.0013414181303232908, -0.04729502648115158, 0.05882502719759941, 0.052619390189647675, 0.026878850534558296, -0.01085068378597498, 0.019388023763895035, -0.03134030103683472, -0.03433296084403992, 0.02272951975464821, -0.007959004491567612, -0.011474919505417347, -0.024840906262397766, -0.028843358159065247, 0.018782148137688637, 0.06179932504892349, -0.004732256755232811, 0.029449233785271645, 0.03271729126572609, -0.002321376232430339, -0.04369649291038513, -0.022307243198156357, -0.05588744953274727, -0.04215426370501518, 0.024418627843260765, 0.05225219205021858, -0.024785825982689857, 0.05291314795613289, -0.003568700049072504, 0.03315792605280876, 0.004709307104349136, -0.020985333248972893, -0.017414337024092674, 0.006123017054051161, 0.06047741696238518, 0.004158510826528072, -0.009377304464578629, 0.008647499606013298, 0.03433296084403992, 0.01707467995584011, -0.02511630393564701, 0.0917259156703949, -0.07784585654735565, 0.05272955074906349, 0.009464513510465622, 0.002988069085404277, -0.04578951746225357, 0.07578954845666885, -0.06785808503627777, -0.027851924300193787, 0.07241132855415344, 0.06921671330928802, 0.004801106173545122, 0.03631582483649254, 0.004248015116900206, 0.04241130128502846, 0.04211754351854324, 0.020893532782793045, 0.02474910579621792, 0.0027654555160552263, -0.0402081161737442, -0.018800508230924606, -0.029577752575278282, -0.022894758731126785, 0.04145658761262894, 0.004369649104773998, -0.010621185414493084, -0.014742976054549217, 0.009184525348246098, -0.03358020260930061, 0.011915556155145168, -0.019847020506858826, 0.0043535842560231686, 0.030000029131770134, 0.003593944711610675, -0.046083275228738785, 0.044467609375715256, 0.05893518775701523, 0.02364751324057579, 0.008413410745561123, 0.03895964473485947, -0.03629746660590172, 0.03121178038418293, -0.00905600655823946, -0.021921686828136444, 0.039510443806648254, -0.019259504973888397, 0.026530014351010323, 0.03536111116409302, -0.006848231889307499, -0.000598417071159929, 0.0027172609698027372, -0.026548374444246292, -0.012172594666481018, 0.02513466402888298, 0.0573195181787014, 0.04700126871466637, -0.026823772117495537, -0.04670751094818115, 0.061101652681827545, -0.036536142230033875, -0.053133465349674225, 0.05335378646850586, -0.011676877737045288, 0.03536111116409302, -0.014164640568196774, -0.03921668604016304, -0.008675038814544678, -0.03370872512459755, 0.008840277791023254, -0.06892295926809311, -0.016432084143161774, -0.02208692580461502, 0.029320714995265007, 0.011943096294999123, -0.016294386237859726, -0.04689111188054085, -0.027301128953695297, -0.0012071615783497691, 0.024969425052404404, -0.009675651788711548, 0.040061239153146744, -0.011970635503530502, 0.042044103145599365, -0.015321312472224236, -0.0023248186334967613, -0.01563343033194542, 0.011796217411756516, -0.042044103145599365, 0.02419831044971943, 0.06877607852220535, -0.03275401145219803, 0.04700126871466637, -0.01819463260471821, 0.0053289528004825115, -0.031028181314468384, 0.002932989504188299, 0.05239907279610634, -0.02111385203897953, -0.006214816588908434, 0.060587573796510696, 0.05148107931017876, -0.054675694555044174, -0.0018107423093169928, -0.016735022887587547, -0.03236845135688782, 0.01713893935084343, -0.007600986864417791, 0.05100372061133385, -0.012640771456062794, 0.0003889997606165707, -0.04670751094818115, -0.003775248536840081, 0.013320086523890495, 0.05588744953274727, 0.014926575124263763, 0.04134643077850342, 0.015220332890748978, -0.018369050696492195, -0.020324377343058586, 0.003359856316819787, 0.008303252048790455, -0.029375793412327766, 0.0025244823191314936, -0.04017139971256256, 0.05651168152689934, 0.0717136561870575, 0.09385566413402557, -0.004537183325737715, 0.04288865998387337, -0.0018933616811409593, 0.08533667773008347, -0.02357407473027706, -0.052105315029621124, -0.02764996513724327, 0.028145682066679, 0.047037988901138306, -0.006857411935925484, 0.08107718825340271, -0.013558764941990376, 0.04813958331942558, 0.04061203449964523, 0.07365979999303818 ]
42,829
linearmodels.panel.model
_rsquared
Compute alternative measures of R2
def _rsquared( self, params: Float64Array, reweight: bool = False ) -> tuple[float, float, float]: """Compute alternative measures of R2""" if self.has_constant and self.exog.nvar == 1: # Constant only fast track return 0.0, 0.0, 0.0 ############################################# # R2 - Between ############################################# y, x, w = self._prepare_between() if np.all(self.weights.values2d == 1.0) and not reweight: w = root_w = np.ones_like(w) else: root_w = cast(Float64Array, np.sqrt(w)) wx = root_w * x wy = root_w * y weps = wy - wx @ params residual_ss = float(np.squeeze(weps.T @ weps)) e = y if self.has_constant: e = y - (w * y).sum() / w.sum() total_ss = float(np.squeeze(w.T @ (e**2))) r2b = 1 - residual_ss / total_ss if total_ss > 0.0 else 0.0 ############################################# # R2 - Overall ############################################# y = self.dependent.values2d x = self.exog.values2d w = self.weights.values2d root_w = cast(Float64Array, np.sqrt(w)) wx = root_w * x wy = root_w * y weps = wy - wx @ params residual_ss = float(np.squeeze(weps.T @ weps)) mu = (w * y).sum() / w.sum() if self.has_constant else 0 we = wy - root_w * mu total_ss = float(np.squeeze(we.T @ we)) r2o = 1 - residual_ss / total_ss if total_ss > 0.0 else 0.0 ############################################# # R2 - Within ############################################# weights = self.weights if self._is_weighted else None wy = cast( Float64Array, self.dependent.demean("entity", weights=weights, return_panel=False), ) wx = cast( Float64Array, self.exog.demean("entity", weights=weights, return_panel=False), ) assert isinstance(wy, np.ndarray) assert isinstance(wx, np.ndarray) weps = wy - wx @ params residual_ss = float(np.squeeze(weps.T @ weps)) total_ss = float(np.squeeze(wy.T @ wy)) if self.dependent.nobs == 1 or (self.exog.nvar == 1 and self.has_constant): r2w = 0.0 else: r2w = 1.0 - residual_ss / total_ss if total_ss > 0.0 else 0.0 return r2o, r2w, r2b
(self, params: numpy.ndarray, reweight: bool = False) -> tuple[float, float, float]
[ 0.048547931015491486, -0.031060030683875084, -0.0023000389337539673, 0.04900413751602173, 0.006196799222379923, -0.05942084267735481, -0.032865844666957855, -0.049498360604047775, 0.02497728168964386, 0.043567679822444916, 0.022164011374115944, 0.04584870859980583, 0.054782744497060776, 0.05428852140903473, -0.044822245836257935, 0.07485581189393997, -0.04330155998468399, -0.026307882741093636, -0.04295940697193146, 0.018238738179206848, -0.06310850381851196, -0.006249072961509228, -0.02309543266892433, 0.05580921098589897, -0.0016406786162406206, 0.00999851617962122, -0.01365766953676939, -0.018552379682660103, -0.059230756014585495, -0.024064870551228523, -0.019559836015105247, -0.057025760412216187, -0.01883750967681408, -0.020567290484905243, 0.00955656636506319, -0.035184893757104874, -0.0025685352738946676, 0.05675964057445526, -0.09831240773200989, 0.020681342110037804, -0.010502244345843792, -0.03355015441775322, 0.05877454951405525, -0.02995753288269043, -0.04793965443968773, -0.028018657118082047, -0.013933293521404266, -0.030204644426703453, -0.01709822379052639, -0.0012616949388757348, 0.06660608947277069, -0.03908165544271469, -0.016005229204893112, 0.025965729728341103, 0.020149102434515953, 0.016689538955688477, -0.032010458409786224, 0.07477977871894836, 0.04432802274823189, -0.06938134133815765, 0.05999109894037247, -0.04140070080757141, 0.017896583303809166, 0.07295495271682739, -0.014627107419073582, 0.01596721261739731, -0.030432747676968575, -0.003027117345482111, 0.025642583146691322, 0.055314987897872925, -0.017060207203030586, 0.015691587701439857, -0.00006775521615054458, -0.0423511303961277, -0.011034484021365643, 0.027866587042808533, 0.010692330077290535, -0.03113606385886669, -0.00024562657927162945, -0.048129741102457047, 0.046723105013370514, 0.05854644626379013, 0.0354890301823616, -0.0666441023349762, -0.0444800928235054, -0.021878883242607117, -0.02636490948498249, 0.007598682306706905, -0.00881523173302412, -0.03896760195493698, -0.04276932030916214, 0.019559836015105247, 0.02666904591023922, 0.016527965664863586, 0.05866049602627754, 0.004015563987195492, -0.04364371299743652, -0.061777904629707336, 0.002113517140969634, -0.061777904629707336, 0.0030318694189190865, 0.035070840269327164, -0.03501381725072861, 0.040260184556245804, 0.04314948990941048, -0.010179097764194012, 0.006087499670684338, -0.008639402687549591, 0.029615378007292747, -0.015881674364209175, -0.05025870352983475, 0.019978024065494537, -0.07930382341146469, 0.030679859220981598, -0.09876861423254013, 0.01010306365787983, -0.028094690293073654, 0.07538805156946182, 0.012251034379005432, 0.06276635080575943, 0.025566548109054565, 0.030945979058742523, -0.05885058268904686, 0.011984913609921932, 0.025471506640315056, -0.024064870551228523, 0.03218153491616249, 0.02444504201412201, -0.035317953675985336, -0.0306988675147295, -0.01164275873452425, -0.0029320744797587395, 0.0021598506718873978, 0.028018657118082047, -0.016784582287073135, 0.031820375472307205, 0.05558110773563385, -0.001652559032663703, 0.056151363998651505, -0.03581217676401138, 0.03432950749993324, 0.06329859048128128, -0.026193831115961075, -0.012688231654465199, 0.02094746194779873, 0.016385400667786598, 0.011186553165316582, 0.04676112160086632, 0.04569664224982262, 0.04288337007164955, -0.029501326382160187, -0.01122457068413496, 0.04189492389559746, 0.04470819607377052, 0.032333604991436005, -0.05660757049918175, 0.04793965443968773, 0.017944104969501495, -0.030128609389066696, -0.002250141464173794, -0.036990709602832794, -0.05664558708667755, 0.0360022634267807, -0.018181713297963142, 0.04432802274823189, 0.02203095145523548, -0.019730912521481514, 0.0015254390891641378, 0.02571861818432808, 0.009062343277037144, -0.02752443216741085, -0.05105706304311752, -0.07135823369026184, -0.0529199056327343, -0.049270257353782654, 0.05972497910261154, -0.0063726287335157394, -0.04607681185007095, -0.032751794904470444, -0.011595238000154495, 0.07249874621629715, -0.06474324315786362, -0.0031364166643470526, -0.06272833794355392, 0.0033787761349231005, 0.1016579195857048, 0.07915175706148148, -0.03685764968395233, -0.013629156164824963, 0.011842349544167519, 0.0026683302130550146, -0.0020422351080924273, -0.010521252639591694, 0.002860792214050889, 0.04474621266126633, -0.0016882000491023064, 0.08455019444227219, 0.032561708241701126, 0.030432747676968575, 0.0016870120307430625, -0.012279546819627285, 0.00479491613805294, -0.04474621266126633, 0.013676677830517292, -0.014075858518481255, -0.00823547039180994, 0.004170008469372988, -0.004825804848223925, -0.011528708040714264, 0.05155128613114357, -0.036268383264541626, 0.04995456337928772, -0.01988298073410988, -0.0322955884039402, 0.03613532334566116, 0.048319827765226364, -0.015092817135155201, 0.03374024108052254, -0.023019397631287575, -0.0052131046541035175, 0.02518637664616108, -0.1048513650894165, -0.01990198902785778, 0.009185899049043655, 0.04379578307271004, -0.004980249796062708, 0.02117556519806385, 0.0413246676325798, 0.027239304035902023, 0.00043363336590118706, 0.02372271567583084, 0.019730912521481514, 0.03355015441775322, -0.06592177599668503, -0.002385577652603388, 0.009347472339868546, -0.053071971982717514, 0.03554605692625046, -0.02573762647807598, 0.026821115985512733, -0.04626689851284027, -0.04193294048309326, -0.05227361246943474, 0.03662954643368721, -0.009295199066400528, -0.04200897738337517, 0.06215807795524597, -0.005374677944928408, 0.005868901032954454, -0.008392291143536568, 0.011889871209859848, -0.019151151180267334, 0.0024497315753251314, 0.005488729104399681, -0.0012925838818773627, -0.03163028880953789, 0.01846684142947197, 0.003659152891486883, 0.023646680638194084, -0.05006861686706543, 0.0751979649066925, 0.03208649531006813, -0.025699608027935028, -0.0073468186892569065, -0.07325909286737442, 0.05261576548218727, -0.030185634270310402, 0.010065046139061451, -0.0018200721824541688, 0.037751052528619766, 0.01856188476085663, 0.03258071839809418, -0.03737087920308113, 0.00714247627183795, -0.023133449256420135, 0.05866049602627754, 0.05250171571969986, -0.025566548109054565, 0.026326892897486687, 0.025889694690704346, -0.048738013952970505, -0.031060030683875084, 0.04041225463151932, 0.02965339459478855, 0.010293149389326572, -0.008972052484750748, -0.006819330155849457, -0.02094746194779873, 0.03461463749408722, -0.002151534426957369, 0.007237519137561321, -0.019978024065494537, 0.022677242755889893, 0.049270257353782654, 0.09352224320173264, 0.0004698685079347342, -0.013847755268216133, -0.018409816548228264, 0.06485729664564133, 0.022468149662017822, -0.051171112805604935, 0.03908165544271469, 0.02444504201412201, 0.014408508315682411, 0.04326354339718819, 0.0033787761349231005, 0.06972349435091019, -0.04801568761467934, 0.036059290170669556, -0.013733703643083572, -0.03938579186797142, 0.023114440962672234, 0.009456771425902843, 0.014722149819135666, -0.0020244144834578037, -0.008753454312682152, 0.0017618583515286446, 0.018438328057527542, 0.027904605492949486, 0.05037275329232216, 0.017060207203030586, 0.005198848433792591, 0.048129741102457047, -0.016062255948781967, 0.023969827219843864, -0.010739851742982864, -0.038910575211048126, -0.013876267708837986, 0.0625002309679985, 0.0018996705766767263, 0.0009664678364060819, -0.025471506640315056, 0.01186135783791542, 0.015606049448251724, 0.013220472261309624, -0.02467314526438713, 0.06234816461801529, 0.011728297919034958, 0.04850991070270538, -0.021954916417598724, 0.03364519774913788, -0.021346641704440117, -0.014189910143613815, 0.007646203972399235, -0.009727643802762032, -0.020890437066555023, 0.025015300139784813, -0.022791294381022453, 0.02782857045531273, -0.01682259887456894, -0.022563191130757332, -0.0018367046723142266, 0.014760167337954044, 0.04212302714586258, 0.006548457778990269, 0.061017561703920364, -0.08903621882200241, 0.01568208448588848, 0.04314948990941048, -0.017459386959671974, -0.06710030883550644, 0.06504738330841064, -0.05025870352983475, 0.026992192491889, -0.0010365620255470276, 0.007845793850719929, -0.030090592801570892, 0.053071971982717514, -0.021042505279183388, -0.028950076550245285, -0.06299445778131485, -0.036268383264541626, -0.028094690293073654, -0.0036496485117822886, 0.007427605334669352, 0.05630343407392502, -0.01992099918425083, -0.02974843792617321, 0.04486026242375374, -0.04432802274823189, -0.002031542593613267, 0.0003356203669682145, -0.05812825635075569, -0.012298555113375187, 0.05284386873245239, 0.011034484021365643, 0.016908137127757072, 0.016461435705423355, 0.010720842517912388, -0.0039062644354999065, -0.004647599533200264, 0.010074551217257977, 0.02338056080043316, -0.03567911684513092, -0.026440944522619247, 0.055619124323129654, 0.03957587853074074, 0.0423131138086319, -0.0910131111741066, -0.0063203549943864346, -0.06611186265945435, -0.01992099918425083, -0.0016691915225237608, -0.01677507720887661, -0.03803618252277374, -0.031497228890657425, 0.0009474592516198754, 0.06960944086313248, 0.01603374257683754, 0.01800113171339035, -0.08827587217092514, 0.006695774383842945, -0.003492827760055661, -0.021669788286089897, -0.056683603674173355, 0.012659718282520771, -0.004490778315812349, 0.04676112160086632, 0.05124714970588684, 0.04189492389559746, 0.02986248955130577, -0.0508289597928524, 0.03364519774913788, 0.03189640864729881, 0.0031958185136318207, -0.010017525404691696, -0.004927976056933403, -0.0038064694963395596, 0.0003255220362916589, 0.009922482073307037, -0.018913542851805687, 0.006477175746113062, -0.04911818727850914, -0.056797657161951065, 0.009299950674176216, -0.017497403547167778, 0.003968042321503162, 0.017316821962594986, 0.009437763132154942, -0.005141822621226311, 0.030128609389066696, 0.03389231115579605, 0.00674804812297225, -0.03957587853074074, -0.023532630875706673, -0.06763254851102829, -0.0020659957081079483, -0.02106151357293129, -0.07793520390987396, -0.07538805156946182, 0.034139420837163925, 0.009437763132154942, 0.051703356206417084, 0.0051133097149431705, -0.011034484021365643, -0.016318870708346367, -0.031706321984529495, -0.038264285773038864, -0.015948204323649406, -0.059230756014585495, 0.0014315841253846884, 0.026003746315836906, -0.06063739210367203, 0.0019056107848882675, -0.03375925123691559, -0.019978024065494537, 0.03586920350790024, -0.06402091681957245, -0.008796223439276218, -0.004559684544801712, 0.011367134749889374, -0.046723105013370514, 0.003093647537752986, -0.025585556402802467, 0.039651911705732346, 0.026402926072478294, -0.053984384983778, -0.019246194511651993, 0.025984738022089005, -0.04322552680969238, -0.05641748383641243, -0.029824472963809967, -0.019350741058588028, -0.006396389100700617, 0.04181889072060585, -0.036249373108148575, -0.04801568761467934, -0.009276189841330051, 0.009238173253834248, -0.007845793850719929, -0.014684133231639862, 0.05196947604417801, 0.017383351922035217, 0.03984199836850166, -0.07238470017910004, 0.025148360058665276, 0.04200897738337517, -0.008938787505030632, 0.029691411182284355, -0.02159375324845314, 0.0645911768078804, -0.08348571509122849, -0.036268383264541626, -0.01100597158074379, -0.006315602920949459, -0.025281419977545738, -0.07740296423435211, -0.029710421338677406, -0.0009029078646562994, 0.05497283115983009, -0.015587041154503822, -0.026821115985512733, 0.06097954511642456, -0.0053556691855192184, 0.034994807094335556, -0.015995725989341736, -0.002050551353022456, 0.06234816461801529, 0.0008143990999087691, -0.01668003387749195, -0.031402185559272766, -0.005992456804960966, 0.0037613241001963615, 0.006524697411805391, 0.04071639105677605, -0.025699608027935028, -0.05866049602627754, -0.04771155118942261, 0.03623036667704582, -0.05546705424785614, -0.03638243302702904, -0.0571778267621994, -0.02837982028722763, -0.03463364392518997, -0.003827854059636593, -0.02128961682319641, 0.03569812700152397, -0.05219757929444313, -0.07295495271682739, 0.0028203988913446665, 0.00994149036705494, -0.016413914039731026, 0.008530103601515293, -0.033512137830257416, -0.0031601774971932173, 0.013752711936831474, 0.0111105190590024, 0.04668508842587471, -0.00635361997410655, -0.04786362126469612, 0.018476346507668495, -0.0423131138086319, 0.03780807927250862, 0.023570647463202477, 0.02244914136826992, 0.007037929259240627, -0.026745080947875977, -0.004885206930339336, -0.0026065523270517588, 0.009228669106960297, -0.017060207203030586, -0.0413246676325798, 0.02338056080043316, -0.026821115985512733, -0.04105854779481888, 0.017687490209937096, 0.05390835180878639, 0.03480472043156624, -0.06025721877813339, 0.03451959416270256, -0.051399216055870056, 0.059002652764320374, 0.036040280014276505, -0.0040963501669466496, 0.015092817135155201, -0.012213016860187054, 0.0667201355099678, -0.07322107255458832, -0.0391576886177063, -0.030679859220981598, 0.010768364183604717, -0.008406546898186207, 0.015415963716804981, -0.0306988675147295, 0.026307882741093636, 0.02106151357293129, -0.018808996304869652, 0.07261279970407486, -0.011984913609921932, 0.02645995281636715, -0.00485906982794404, 0.04010811820626259, -0.01783955842256546, -0.06299445778131485, 0.0036520245485007763, 0.006396389100700617, -0.024216938763856888, 0.009010070003569126, 0.0007799460436217487, 0.05451662465929985, -0.028322793543338776, -0.041210614144802094, 0.041438717395067215, -0.02571861818432808, -0.06097954511642456, -0.02837982028722763, 0.016005229204893112, -0.04702724143862724, -0.030888952314853668, 0.0042199064046144485, 0.04064035788178444, -0.015929196029901505, 0.03988001495599747, 0.01658499240875244, 0.028759991750121117, 0.002981971949338913, -0.05512490123510361, 0.04204699397087097, 0.002996228402480483, 0.0031886904034763575, -0.01901809126138687, 0.028208741918206215, 0.014037840999662876, 0.0038468625862151384, -0.028626931831240654, 0.026954175904393196, 0.060295235365629196, -0.08918828517198563, 0.022087978199124336, -0.020510265603661537, -0.008544359356164932, -0.0005984734743833542, 0.04489828273653984, -0.048852067440748215, 0.016347384080290794, 0.031079038977622986, 0.061397735029459, 0.0017380976350978017, -0.01874246634542942, 0.06767056882381439, 0.03495679050683975, 0.04911818727850914, -0.02127060852944851, 0.03856842219829559, -0.027334347367286682, 0.028950076550245285, -0.00013944580859970301, -0.017801541835069656, 0.007631947286427021, 0.038264285773038864, -0.006386884953826666, 0.035070840269327164, -0.0044290004298090935, -0.005331908352673054, 0.028817016631364822, -0.0161477942019701, 0.01719326712191105, -0.02488224022090435, 0.007755503058433533, -0.017364343628287315, 0.01936974935233593, 0.009057591669261456, 0.029140163213014603, -0.023969827219843864, -0.05649351701140404, 0.002036294899880886, 0.019407765939831734, 0.03856842219829559, 0.00011189820361323655, -0.06504738330841064, 0.041210614144802094, -0.019217681139707565, -0.014408508315682411, 0.05006861686706543, -0.0002411714376648888, -0.008858000859618187, -0.042617250233888626, 0.0008868693839758635, -0.016480443999171257, 0.013248984701931477, 0.030831927433609962, 0.06801272183656693, -0.04052630439400673, -0.03712376952171326, 0.09413052350282669, -0.05599929392337799, -0.015748614445328712, 0.050562839955091476, -0.01767798513174057, -0.023798750713467598, -0.06375479698181152, -0.03643945977091789, -0.005878405179828405, -0.023836767300963402, 0.042503200471401215, -0.05729188024997711, -0.027904605492949486, -0.004390983376652002, 0.06105557829141617, -0.00931420736014843, 0.0045525566674768925, -0.04638095200061798, 0.0017321574268862605, 0.017658976837992668, 0.016442427411675453, 0.07113012671470642, -0.0017713626148179173, -0.013077907264232635, 0.013581635430455208, -0.03482373058795929, -0.04619086533784866, -0.014655619859695435, 0.01700318045914173, -0.043339576572179794, -0.022487157955765724, 0.010720842517912388, 0.026954175904393196, -0.0016656273510307074, -0.018685439601540565, 0.01577712595462799, -0.01978793926537037, 0.019084621220827103, 0.03822626546025276, 0.018713952973484993, -0.02127060852944851, 0.04200897738337517, 0.03535597026348114, -0.035622090101242065, 0.017535420134663582, -0.02075737714767456, -0.02001604065299034, -0.018362294882535934, -0.018248243257403374, 0.020700350403785706, 0.0006272833561524749, 0.003245716216042638, 0.0037755805533379316, -0.03448157384991646, 0.00038908200804144144, 0.02625085785984993, 0.011443168856203556, 0.01519736461341381, -0.02022513560950756, -0.06276635080575943, -0.05691170692443848, 0.04288337007164955, 0.010540260933339596, 0.005455464124679565, 0.035393986850976944, -0.07253676652908325, 0.08424605429172516, 0.008378034457564354, 0.08006416261196136, 0.020073067396879196, 0.023228492587804794, 0.017782531678676605, 0.027182279154658318, -0.03242864832282066, -0.055429037660360336, 0.012032435275614262, 0.03374024108052254, 0.01450355164706707, 0.0216887965798378, 0.08827587217092514, -0.05698774382472038, 0.02931123971939087, -0.02687814086675644, 0.05196947604417801 ]
42,830
linearmodels.panel.model
_rsquared_corr
Correlation-based measures of R2
def _rsquared_corr(self, params: Float64Array) -> tuple[float, float, float]: """Correlation-based measures of R2""" # Overall y = self.dependent.values2d x = self.exog.values2d xb = x @ params r2o = 0.0 if y.std() > 0 and xb.std() > 0: r2o = np.corrcoef(y.T, (x @ params).T)[0, 1] # Between y = np.asarray(self.dependent.mean("entity")) x = np.asarray(self.exog.mean("entity")) xb = x @ params r2b = 0.0 if y.std() > 0 and xb.std() > 0: r2b = np.corrcoef(y.T, (x @ params).T)[0, 1] # Within y = self.dependent.demean("entity", return_panel=False) x = self.exog.demean("entity", return_panel=False) xb = x @ params r2w = 0.0 if y.std() > 0 and xb.std() > 0: r2w = np.corrcoef(y.T, xb.T)[0, 1] return r2o**2, r2w**2, r2b**2
(self, params: numpy.ndarray) -> tuple[float, float, float]
[ 0.01867010071873665, -0.012961357831954956, 0.04351569712162018, 0.021775798872113228, 0.02238616906106472, -0.05241989716887474, -0.010304459370672703, -0.006601855158805847, 0.04150506854057312, 0.03459354117512703, 0.019244564697146416, 0.053281594067811966, 0.016812065616250038, 0.020698677748441696, -0.03258291631937027, 0.008477841503918171, -0.03610151261091232, -0.07238253951072693, -0.044377394020557404, 0.0072167119942605495, -0.020716629922389984, 0.037555623799562454, -0.048649974167346954, -0.009496618062257767, 0.012234301306307316, -0.0025806028861552477, -0.04261809587478638, -0.013589679263532162, -0.029172031208872795, -0.016318386420607567, -0.046998389065265656, -0.05970841646194458, -0.041002411395311356, 0.0033749795984476805, -0.03050048090517521, -0.024899451062083244, 0.00898049771785736, 0.027269117534160614, -0.03005168028175831, 0.02949516847729683, -0.03468330204486847, 0.0009419200359843671, 0.008931130170822144, -0.03642464801669121, -0.032726529985666275, -0.02312220074236393, -0.04376702383160591, 0.007665512152016163, -0.06688922643661499, 0.007382768206298351, 0.06071373075246811, -0.07166446000337601, -0.051378678530454636, -0.015770848840475082, 0.026461277157068253, 0.040643371641635895, -0.028651423752307892, 0.08796489238739014, 0.03459354117512703, -0.037268392741680145, 0.057733695954084396, -0.01858033984899521, -0.017215987667441368, 0.057302847504615784, 0.02156037464737892, -0.002715243026614189, 0.015519521199166775, -0.010241626761853695, 0.04225905239582062, 0.013104974292218685, -0.03330099582672119, 0.03687344864010811, 0.004317460581660271, -0.05579487606883049, 0.01174062117934227, -0.006359503138810396, 0.027646109461784363, -0.015959344804286957, 0.03139808401465416, -0.022170744836330414, -0.02238616906106472, 0.014442400075495243, 0.05662066861987114, -0.05827225372195244, -0.03240339457988739, -0.03701706603169441, -0.024360891431570053, 0.010483979247510433, -0.0391354039311409, -0.019585654139518738, -0.032170020043849945, -0.0032897077035158873, 0.009074745699763298, -0.007346863858401775, 0.03520391136407852, 0.013760223053395748, -0.01506174448877573, 0.0055112699046730995, 0.0484345480799675, -0.017655810341238976, -0.004461077041924, 0.04739333316683769, -0.019459988921880722, 0.039530348032712936, 0.028651423752307892, -0.007593704387545586, 0.0034243478439748287, -0.02130904793739319, 0.006063294596970081, 0.01708134636282921, -0.07202350348234177, 0.03428835794329643, 0.004259116481989622, 0.01670435443520546, -0.05005022883415222, -0.007149391807615757, -0.04696248471736908, 0.07022830098867416, 0.013472991064190865, 0.03367798775434494, 0.03387546166777611, 0.04470052942633629, -0.01196502149105072, 0.012727981433272362, 0.0036936281248927116, 0.02766406163573265, -0.005004125647246838, 0.016228625550866127, -0.05723103880882263, -0.018634196370840073, -0.007898888550698757, -0.07162855565547943, 0.028974559158086777, -0.010062106885015965, 0.023983897641301155, 0.038919977843761444, 0.07116180658340454, -0.02556367591023445, 0.053568825125694275, -0.036532361060380936, 0.043731119483709335, 0.09773079305887222, -0.02446860261261463, -0.02376847341656685, 0.008845857344567776, 0.06261664628982544, 0.02813081443309784, 0.04326436668634415, 0.008432961069047451, 0.0032201434951275587, -0.00920040998607874, -0.014253903180360794, 0.06290387362241745, 0.04803960397839546, 0.02502511441707611, -0.029082272201776505, 0.02721526101231575, -0.006220374722033739, -0.02640742063522339, -0.00460020499303937, -0.02866937592625618, -0.02965673618018627, 0.05841587111353874, -0.02965673618018627, 0.07683464139699936, 0.010708379559218884, -0.008441937156021595, -0.057733695954084396, -0.003895588219165802, -0.030554337427020073, -0.07970696687698364, -0.05249170586466789, -0.051199160516262054, -0.07626017928123474, -0.0475369468331337, 0.03906359523534775, -0.046998389065265656, -0.04836273938417435, -0.027233213186264038, -0.009882587008178234, 0.04581355303525925, -0.054574139416217804, 0.022422071546316147, -0.018167443573474884, 0.001753687858581543, 0.08918563276529312, 0.08193301409482956, -0.039638061076402664, 0.025061018764972687, -0.012934430502355099, -0.021524472162127495, 0.01461294386535883, -0.033731844276189804, 0.036729831248521805, 0.03852503374218941, -0.032726529985666275, 0.07604475319385529, 0.019908789545297623, 0.025330299511551857, -0.02403775416314602, 0.011614956893026829, 0.017952019348740578, -0.022960633039474487, 0.029979873448610306, 0.004932317417114973, -0.016587665304541588, 0.027233213186264038, 0.0022383923642337322, -0.01744038611650467, 0.01621067337691784, 0.00960433017462492, 0.048829492181539536, -0.027717918157577515, -0.07575752586126328, -0.002212586347013712, 0.05995974689722061, 0.004452100954949856, -0.0182931087911129, -0.023983897641301155, 0.015304096974432468, 0.06455545872449875, -0.06204218044877052, -0.019513845443725586, -0.005044517572969198, 0.013867935165762901, -0.004680989310145378, 0.005170181859284639, 0.021165430545806885, 0.022637495771050453, -0.04750104248523712, -0.008302808739244938, -0.023229913786053658, 0.03324713930487633, -0.07410593330860138, -0.0057715740986168385, -0.020052405074238777, -0.014586015604436398, 0.0689716562628746, -0.029261792078614235, 0.05672838166356087, -0.039530348032712936, 0.0014664556365460157, 0.007625120226293802, 0.039638061076402664, 0.004057156387716532, -0.0493321493268013, 0.05881081521511078, 0.0029575952794402838, 0.017772499471902847, -0.006067782640457153, 0.01688387431204319, -0.03798647224903107, -0.004775237292051315, -0.018454676494002342, 0.028615519404411316, -0.060282882302999496, 0.01228815782815218, 0.015519521199166775, 0.05213266611099243, -0.03159555420279503, 0.02685622125864029, 0.062473028898239136, -0.02184760756790638, 0.0030810153111815453, -0.05389196425676346, 0.013616606593132019, -0.06480678915977478, 0.020178070291876793, 0.016892850399017334, 0.010466027073562145, 0.041720494627952576, 0.05525631457567215, -0.030087584629654884, 0.010169818997383118, -0.027466589584946632, 0.0030226712115108967, 0.04886539652943611, -0.06710465252399445, 0.03392931818962097, 0.02820262312889099, -0.04854226112365723, -0.019819030538201332, 0.034719206392765045, -0.023086296394467354, 0.033175330609083176, 0.0003051843377761543, -0.01769171468913555, -0.0365862175822258, 0.005592054221779108, 0.043372079730033875, -0.025258490815758705, -0.020770486444234848, -0.007351351901888847, 0.05227627977728844, 0.067176453769207, 0.023427385836839676, 0.006292182952165604, -0.0042411647737026215, 0.03769924119114876, 0.03206230700016022, -0.041684590280056, 0.05342521145939827, 0.010690427385270596, -0.0114713404327631, 0.030985185876488686, -0.02446860261261463, 0.08229205757379532, -0.04807550832629204, 0.0021048742346465588, 0.05360472947359085, -0.006363990716636181, 0.02357100136578083, 0.023535097017884254, -0.023409433662891388, -0.01847262866795063, 0.02057301439344883, 0.015537473373115063, -0.004595716949552298, 0.061036866158246994, 0.03242134675383568, 0.02994396910071373, -0.03222387656569481, 0.03547319024801254, 0.0125215332955122, 0.02130904793739319, -0.008361153304576874, -0.05295845866203308, 0.004757285118103027, 0.06214989349246025, 0.021003862842917442, 0.017673762515187263, -0.02965673618018627, -0.026353564113378525, 0.0008510379120707512, 0.09708452224731445, -0.010690427385270596, 0.06236531585454941, -0.007086559664458036, 0.057733695954084396, -0.005906214471906424, 0.02840009517967701, -0.03967396169900894, 0.012404845096170902, -0.015824705362319946, -0.048721782863140106, 0.020339637994766235, 0.04125374183058739, 0.006238326895982027, 0.0003626869001891464, -0.09234518557786942, -0.006521071307361126, -0.026981884613633156, 0.02057301439344883, 0.027269117534160614, -0.017808403819799423, 0.09313508123159409, -0.05780550464987755, 0.023517144843935966, 0.0509837344288826, 0.0034131277352571487, -0.0019298420520499349, 0.016417121514678, 0.008244465105235577, -0.007687952369451523, -0.0467829629778862, 0.06455545872449875, -0.06753549724817276, 0.06214989349246025, -0.01151622086763382, -0.027233213186264038, -0.05687199905514717, 0.019459988921880722, -0.016515858471393585, -0.00458898488432169, -0.01264719758182764, 0.04911672696471214, -0.03168531507253647, -0.04552632197737694, 0.036191269755363464, -0.06577619910240173, -0.02111157588660717, -0.03103904239833355, -0.01835593953728676, -0.020590966567397118, -0.03315737843513489, 0.02750249393284321, 0.0065704393200576305, 0.007840544916689396, -0.04204363003373146, 0.025096923112869263, 0.0005730621051043272, -0.028148766607046127, 0.023229913786053658, -0.051270969212055206, -0.04488004744052887, 0.018634196370840073, 0.07439316809177399, 0.0382378026843071, -0.06186265870928764, -0.03057228960096836, -0.04868587851524353, -0.022691352292895317, 0.035814277827739716, -0.04222315177321434, 0.0009464080212637782, -0.005066957324743271, -0.009640234522521496, 0.01884962059557438, 0.01306906994432211, 0.0040863286703825, -0.09457124024629593, 0.017341651022434235, 0.07453678548336029, -0.00020658847643062472, -0.04240266978740692, -0.000009922698154696263, -0.03920721262693405, 0.03139808401465416, 0.06469907611608505, 0.027789726853370667, 0.006444775033742189, -0.07051553577184677, 0.014173119328916073, 0.044915951788425446, 0.002986767329275608, 0.033821605145931244, 0.017215987667441368, -0.006054318509995937, 0.009765898808836937, -0.051199160516262054, -0.02484559454023838, 0.04922443628311157, -0.05949299409985542, -0.04143325984477997, 0.006606343202292919, -0.028076957911252975, -0.014855296351015568, 0.05514860525727272, -0.02376847341656685, 0.00950559414923191, -0.004829093348234892, 0.05539993196725845, 0.02191941626369953, -0.08049685508012772, -0.057123325765132904, -0.03416269272565842, 0.0108699481934309, -0.03802237659692764, -0.057015612721443176, -0.04362340644001961, 0.05109144747257233, 0.029549024999141693, 0.03620922192931175, 0.02412751503288746, -0.0034804476890712976, 0.010708379559218884, -0.01802382804453373, -0.027915390208363533, -0.027340926229953766, -0.07345966249704361, -0.018688052892684937, 0.011785500682890415, -0.02974649704992771, -0.02301448956131935, -0.028884800150990486, -0.012620269320905209, 0.02576114796102047, -0.04821912571787834, -0.025958620011806488, 0.018418772146105766, 0.024450650438666344, -0.03005168028175831, -0.01831105910241604, -0.011785500682890415, 0.017431411892175674, 0.02692802995443344, -0.027825631201267242, -0.004045936278998852, -0.0011825893307104707, -0.0007747418712824583, -0.0797787755727768, -0.026281757280230522, -0.048829492181539536, -0.02358895353972912, 0.028992511332035065, -0.05033746361732483, -0.03094928152859211, -0.03992529213428497, -0.006130614783614874, -0.013104974292218685, 0.022422071546316147, 0.09945418685674667, -0.020878199487924576, 0.04276170954108238, -0.002017358085140586, 0.025886811316013336, 0.05076831206679344, -0.022799065336585045, -0.01753014698624611, 0.011022539809346199, 0.030895425006747246, -0.05762598291039467, -0.029279744252562523, -0.0015225557144731283, -0.004748309031128883, -0.07819899916648865, -0.07855803519487381, -0.028687328100204468, -0.01703646592795849, 0.031182657927274704, -0.03683754429221153, -0.0254918672144413, 0.04190001264214516, -0.026515133678913116, -0.005493318196386099, -0.04053565859794617, 0.008931130170822144, 0.04240266978740692, -0.02037554234266281, 0.016937730833888054, -0.014442400075495243, 0.0057805501855909824, -0.043731119483709335, 0.03992529213428497, 0.023158105090260506, -0.024091610684990883, -0.025258490815758705, -0.05744646117091179, 0.013490942306816578, -0.06825357675552368, -0.041181933134794235, -0.07040782272815704, -0.03392931818962097, -0.015636209398508072, -0.027089597657322884, 0.02220664732158184, -0.0005099495756439865, -0.05166591331362724, -0.08071228116750717, 0.01419107150286436, -0.016677426174283028, -0.034449923783540726, 0.0006782497512176633, 0.01424492709338665, 0.016695378348231316, 0.0010434611467644572, 0.05478956550359726, -0.008257929235696793, 0.005215061828494072, 0.01528614480048418, 0.04444919899106026, -0.04534680023789406, -0.0015057256678119302, 0.00784952100366354, -0.04656754061579704, 0.030464576557278633, -0.022511832416057587, -0.040463853627443314, -0.0026546549052000046, 0.004743820987641811, 0.045993074774742126, -0.015214337036013603, 0.024827642366290092, -0.012889550067484379, -0.009900539182126522, 0.03488077223300934, 0.07306472212076187, 0.05399967357516289, -0.05733875185251236, 0.021524472162127495, -0.06681741774082184, 0.07877346128225327, 0.01069940347224474, 0.031164705753326416, 0.04660344123840332, 0.015187408775091171, 0.06994106620550156, -0.07094638049602509, -0.04796779528260231, -0.014855296351015568, 0.0019668680615723133, -0.0072167119942605495, 0.01797894760966301, -0.039638061076402664, 0.014855296351015568, 0.03662211820483208, -0.06692513078451157, 0.05970841646194458, 0.022547736763954163, -0.002528990851715207, -0.005309309810400009, 0.05051698163151741, -0.04868587851524353, -0.04707019403576851, 0.011211035773158073, 0.033444613218307495, -0.036191269755363464, 0.01911890134215355, -0.011094348505139351, 0.04775237292051315, -0.03852503374218941, -0.029836256057024002, 0.04312074929475784, 0.01015186682343483, -0.0493321493268013, -0.031793028116226196, 0.00932607427239418, -0.03301376476883888, -0.014729632064700127, 0.03141603246331215, 0.00025216976064257324, -0.026371516287326813, 0.026730557903647423, 0.003240339457988739, 0.03656826540827751, -0.02064482308924198, -0.06861262023448944, 0.032636772841215134, -0.03349846974015236, 0.014325711876153946, -0.001859156065620482, -0.0022058545146137476, -0.007791176438331604, 0.01674923487007618, -0.04139735549688339, 0.06678151339292526, -0.00825344119220972, -0.06236531585454941, 0.01893938146531582, -0.01920866034924984, 0.0030159393791109324, -0.006597367115318775, 0.02191941626369953, -0.03830961138010025, 0.019190708175301552, 0.025150779634714127, 0.053676538169384, 0.01679411344230175, -0.016587665304541588, 0.045274991542100906, 0.027987198904156685, 0.04635211452841759, -0.03552704676985741, 0.02475583553314209, -0.03841732069849968, -0.016910802572965622, -0.025617532432079315, -0.022422071546316147, 0.02412751503288746, -0.012934430502355099, 0.0019747221376746893, 0.039997100830078125, 0.007925816811621189, 0.019065044820308685, 0.061395905911922455, -0.06423232704401016, -0.0035343037452548742, 0.005224037915468216, 0.010582715272903442, -0.01209966093301773, 0.0353834293782711, 0.01683899387717247, 0.049834806472063065, -0.027197308838367462, -0.054035577923059464, -0.029710592702031136, 0.025455962866544724, 0.0019949181005358696, 0.0005077055539004505, -0.06337063014507294, 0.07762452960014343, 0.0008925519650802016, -0.015178432688117027, 0.035006437450647354, 0.002499818801879883, -0.007391744293272495, -0.02547391504049301, 0.03816599398851395, 0.013535822741687298, 0.036909352988004684, 0.04186410829424858, 0.0722748339176178, -0.01587856188416481, -0.041684590280056, 0.0731724351644516, -0.053676538169384, 0.029459264129400253, 0.026084285229444504, -0.03549114242196083, -0.018490580841898918, -0.04771646857261658, 0.007710392586886883, 0.006063294596970081, -0.06100096181035042, 0.04387473687529564, -0.001020460156723857, -0.058020927011966705, -0.01132772397249937, 0.027430685237050056, 0.039458539336919785, 0.006790351588279009, -0.018526483327150345, 0.004003300331532955, 0.06753549724817276, 0.015851633623242378, 0.05378425121307373, 0.039279017597436905, -0.017476290464401245, -0.002419034717604518, -0.01520536094903946, -0.02357100136578083, 0.010430123656988144, 0.04204363003373146, -0.022152792662382126, -0.032277729362249374, 0.01710827462375164, 0.020878199487924576, 0.019459988921880722, 0.01037626713514328, -0.019424084573984146, -0.008293832652270794, 0.03874045982956886, 0.045274991542100906, 0.03202640265226364, 0.04186410829424858, 0.0250430665910244, 0.08976009488105774, 0.004151404369622469, 0.013903839513659477, -0.037735145539045334, -0.012279181741178036, -0.05005022883415222, -0.010546811856329441, 0.03075180947780609, -0.0003133188292849809, 0.02148856781423092, 0.0037317760288715363, -0.06319110840559006, -0.021793751046061516, -0.005098373629152775, -0.015851633623242378, 0.006440286990255117, 0.017772499471902847, -0.028256479650735855, -0.03978167474269867, 0.03012348897755146, -0.0019668680615723133, -0.015133552253246307, 0.04742923751473427, -0.06426823139190674, 0.042007725685834885, 0.006274230778217316, 0.06602752953767776, -0.008634921163320541, -0.05618982017040253, 0.005493318196386099, 0.008836881257593632, -0.025168731808662415, -0.04369521513581276, 0.03383955731987953, 0.05845177546143532, 0.018490580841898918, 0.004027984570711851, 0.047931890934705734, -0.013024190440773964, -0.007113487925380468, 0.013939742930233479, 0.0613240972161293 ]
42,831
linearmodels.panel.model
_setup_clusters
Return covariance estimator reformat clusters
def _setup_clusters( self, cov_config: Mapping[str, bool | float | str | IntArray | DataFrame | PanelData], ) -> dict[str, bool | float | str | IntArray | DataFrame | PanelData]: """Return covariance estimator reformat clusters""" cov_config_upd = dict(cov_config) if "clusters" not in cov_config: return cov_config_upd clusters = cov_config.get("clusters", None) if clusters is not None: cluster_data = cast(Union[IntArray, DataFrame, PanelData], clusters) clusters_panel = self.reformat_clusters(cluster_data) cluster_max = np.nanmax(clusters_panel.values3d, axis=1) delta = cluster_max - np.nanmin(clusters_panel.values3d, axis=1) if np.any(delta != 0): raise ValueError("clusters must not vary within an entity") index = clusters_panel.panel.minor_axis reindex = clusters_panel.entities clusters_frame = DataFrame( cluster_max.T, index=index, columns=clusters_panel.vars ) # TODO: Bug in pandas-stubs prevents using Hashable | None clusters_frame = clusters_frame.loc[reindex].astype( np.int64 ) # type: ignore cov_config_upd["clusters"] = clusters_frame return cov_config_upd
(self, cov_config: collections.abc.Mapping[str, bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData]) -> dict[str, bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData]
[ -0.0071823569014668465, -0.052986010909080505, 0.022325996309518814, -0.02643566206097603, -0.06059367209672928, 0.032495029270648956, -0.008348355069756508, 0.05160975083708763, 0.024180123582482338, 0.015731416642665863, -0.03125257045030594, 0.009667270816862583, -0.01982196792960167, -0.009380550123751163, 0.0311569981276989, 0.009122501127421856, -0.01910516433417797, -0.027391396462917328, 0.07951724529266357, -0.02255537174642086, -0.0184552650898695, -0.06953936070203781, -0.0025446475483477116, -0.023816945031285286, 0.012204750441014767, 0.0005462629487738013, -0.011621750891208649, -0.023568453267216682, 0.07164198160171509, -0.009629041887819767, -0.08135225623846054, -0.01458453293889761, -0.029111722484230995, 0.06877477467060089, 0.03540046513080597, -0.04881900176405907, 0.035820990800857544, 0.013275174424052238, 0.03564895689487457, 0.03228476643562317, -0.00994921289384365, -0.04228176549077034, 0.010532212443649769, -0.003220830811187625, 0.02339642122387886, 0.09580299258232117, -0.032705292105674744, 0.024772681295871735, -0.03295378014445305, -0.040714360773563385, -0.04824556037783623, -0.05887334421277046, -0.0042195748537778854, 0.057153020054101944, -0.01862729713320732, -0.05665603652596474, 0.05290955305099487, 0.020968850702047348, -0.031481947749853134, 0.0029771181289106607, 0.0013822333421558142, -0.0022220865357667208, -0.0012818811228498816, -0.0035625065211206675, -0.04140248894691467, -0.04916306585073471, -0.008620739914476871, 0.030354179441928864, 0.023530224338173866, -0.01716502010822296, 0.017107676714658737, -0.00022534465824719518, 0.0038229445926845074, 0.0036150719970464706, 0.04690752923488617, -0.03201716020703316, -0.010255048982799053, 0.038841117173433304, 0.04140248894691467, 0.03180689737200737, -0.03662380948662758, -0.020624784752726555, -0.03297289460897446, -0.037598658353090286, 0.0632697343826294, 0.009547803550958633, -0.011010080575942993, 0.028175100684165955, 0.03918518126010895, 0.024600647389888763, 0.027582544833421707, -0.0020727526862174273, 0.029513131827116013, -0.017480414360761642, 0.012892880477011204, 0.06739851087331772, 0.019449230283498764, -0.025078516453504562, 0.03941455855965614, -0.028423592448234558, 0.049124836921691895, 0.008491715416312218, 0.05160975083708763, -0.006661480758339167, -0.04388740286231041, -0.07183312624692917, 0.0016593968030065298, 0.005227876827120781, -0.0234919935464859, 0.03169221058487892, -0.04281697794795036, 0.00957647617906332, 0.02593867853283882, 0.033183157444000244, 0.014794794842600822, -0.04102019593119621, -0.01893313229084015, -0.010666015557944775, -0.041861243546009064, 0.02291855216026306, -0.03624151274561882, 0.04136426001787186, 0.007129791658371687, 0.008606404066085815, -0.010694687254726887, 0.005925564095377922, -0.0034263140987604856, 0.05287132412195206, 0.014316927641630173, 0.005552826914936304, 0.046678151935338974, -0.05822344496846199, -0.03169221058487892, -0.03983508050441742, 0.03132903203368187, 0.003091806313022971, -0.013600124977529049, 0.012711290270090103, -0.0004232118953950703, 0.013284732587635517, 0.060440752655267715, 0.050806932151317596, -0.0028576510958373547, 0.01311269961297512, -0.05462987720966339, 0.04258760064840317, 0.00722058629617095, -0.0884629338979721, -0.08762189000844955, -0.026722382754087448, -0.001778863836079836, 0.0015913007082417607, -0.017384840175509453, -0.023090584203600883, -0.023816945031285286, -0.0311569981276989, -0.000569558993447572, -0.03532400727272034, 0.040829047560691833, 0.00870197732001543, -0.01963081955909729, 0.0063413092866539955, 0.0620846189558506, 0.028633855283260345, -0.0347505658864975, 0.008491715416312218, 0.02121734246611595, -0.09282109141349792, -0.048666082322597504, -0.01683051325380802, -0.04954536259174347, 0.03585921972990036, -0.005648400634527206, 0.033641912043094635, 0.01848393678665161, 0.037407513707876205, -0.006250514183193445, -0.07615305483341217, -0.028825001791119576, -0.023358190432190895, -0.04973650723695755, -0.012730405665934086, 0.009428337216377258, 0.017145905643701553, -0.018828000873327255, 0.022287767380475998, 0.021771669387817383, 0.016161497682332993, 0.015349121764302254, -0.012185635976493359, -0.0023773936554789543, -0.005528933368623257, -0.011421047151088715, 0.06747496873140335, 0.02603425271809101, -0.04579887539148331, -0.029321983456611633, -0.011870242655277252, -0.08571041375398636, -0.020720358937978745, -0.03178778290748596, 0.007540758233517408, 0.031940702348947525, -0.017728904262185097, 0.04239645600318909, 0.00962426234036684, 0.000016921383576118387, -0.016591578722000122, -0.013810386881232262, 0.034387387335300446, -0.02152317762374878, -0.0059637934900820255, 0.05065401643514633, 0.002422790974378586, 0.016400432214140892, -0.0417083241045475, 0.027907494455575943, 0.029666049405932426, -0.03322138637304306, 0.00048294541193172336, 0.07481502741575241, -0.006890857592225075, 0.0800524577498436, 0.05501217022538185, -0.05325361713767052, -0.038630854338407516, 0.00820977333933115, -0.03861173987388611, 0.05325361713767052, -0.02387428842484951, -0.016400432214140892, -0.023262618109583855, -0.05700010433793068, -0.042511142790317535, 0.028079526498913765, -0.032418567687273026, 0.04323750361800194, 0.04086727648973465, 0.00757420901209116, 0.051686208695173264, -0.007206250447779894, -0.027334053069353104, 0.02293766662478447, 0.029513131827116013, 0.004415500909090042, 0.004568418487906456, 0.048283789306879044, 0.020433638244867325, -0.008955247700214386, 0.06028783321380615, 0.021102653816342354, -0.04021737724542618, -0.010264606215059757, 0.02632097341120243, 0.036012135446071625, -0.03243768587708473, -0.03593567758798599, 0.03629885986447334, 0.045072514563798904, -0.028289789333939552, -0.0625433698296547, -0.047710347920656204, 0.05275663360953331, 0.05803229659795761, -0.0178531501442194, -0.02735316753387451, -0.011726882308721542, 0.024562418460845947, -0.009055599570274353, -0.0028863230254501104, -0.05570030212402344, 0.09473256766796112, 0.032705292105674744, 0.012911994941532612, 0.002704733284190297, 0.017193693667650223, -0.024294812232255936, -0.07588544487953186, 0.021102653816342354, 0.07684118300676346, 0.05222142115235329, -0.03725459426641464, -0.03603125363588333, -0.034597646445035934, 0.037139907479286194, -0.02161875180900097, -0.07447095960378647, -0.0028289789333939552, 0.026263628154993057, -0.009614705108106136, -0.0800524577498436, -0.036929644644260406, -0.021064424887299538, -0.01472789328545332, -0.04113488271832466, -0.027028217911720276, 0.00502239353954792, 0.03471233695745468, 0.007507307454943657, 0.0091081652790308, -0.023740485310554504, -0.07248302549123764, 0.03394774720072746, 0.00879755150526762, 0.0692717507481575, -0.028825001791119576, 0.044307928532361984, -0.06196993216872215, 0.049392443150281906, 0.03991154208779335, -0.01325605995953083, 0.030163032934069633, -0.015693187713623047, -0.034960828721523285, -0.0030631343834102154, -0.0011456887004896998, 0.03926163911819458, -0.05160975083708763, 0.049774736166000366, 0.02546081133186817, -0.03433004021644592, -0.08563395589590073, -0.044575534760951996, 0.008716313168406487, 0.04579887539148331, 0.02056744135916233, 0.06525766104459763, -0.02926464006304741, -0.000759212882257998, 0.017767135053873062, -0.07603836804628372, -0.03765600174665451, -0.0007162047550082207, 0.02859562449157238, -0.03297289460897446, -0.057994067668914795, 0.01812075637280941, 0.005834768991917372, 0.006193170323967934, 0.006542013958096504, 0.009523910470306873, -0.02511674538254738, -0.04518720507621765, -0.006240956950932741, -0.02368314191699028, 0.027295824140310287, 0.04851316660642624, 0.012166520580649376, -0.04056144133210182, 0.08257560431957245, -0.012080504558980465, -0.002699954668059945, 0.02471533603966236, 0.07278886437416077, 0.07194781303405762, 0.03297289460897446, 0.028710313141345978, -0.11919941008090973, 0.014183124527335167, -0.05505039915442467, 0.06992165744304657, -0.05333007499575615, 0.061128880828619, -0.003290121676400304, -0.030793817713856697, 0.039223410189151764, -0.03606948256492615, 0.015157975256443024, 0.08395186066627502, -0.021312914788722992, 0.00841525662690401, -0.016027694568037987, 0.02416100911796093, -0.03180689737200737, 0.06961581856012344, -0.0306791290640831, -0.07519731670618057, -0.0060354736633598804, -0.03744574263691902, 0.0007872876594774425, 0.0045230211690068245, -0.010341065004467964, 0.0013511719880625606, 0.0007926636608317494, -0.036088597029447556, -0.014345599338412285, 0.03094673529267311, -0.011153440922498703, 0.024772681295871735, 0.007211029063910246, 0.010446195490658283, 0.03926163911819458, 0.046295858919620514, -0.006403432227671146, -0.03501817211508751, 0.026932643726468086, 0.0024753566831350327, -0.02423746883869171, 0.007621995639055967, 0.015243991278111935, -0.00757420901209116, -0.02351110801100731, 0.020548326894640923, 0.030832046642899513, -0.015024172142148018, -0.005643622018396854, 0.012300323694944382, 0.007225364912301302, 0.01576964557170868, 0.00818588025867939, 0.036566462367773056, 0.009375771507620811, 0.027869265526533127, -0.011010080575942993, -0.023740485310554504, -0.019411001354455948, -0.07519731670618057, -0.035801876336336136, 0.037522200495004654, -0.012080504558980465, 0.017480414360761642, -0.03696787357330322, 0.03528577834367752, 0.011115211062133312, 0.08035829663276672, 0.010503539815545082, -0.009724615141749382, -0.01939188688993454, 0.001897136215120554, -0.022440684959292412, -0.011296801269054413, 0.03434915468096733, -0.001966427080333233, -0.011096096597611904, 0.0311569981276989, 0.0029771181289106607, -0.01648644730448723, 0.032322995364665985, -0.04209062084555626, 0.028442706912755966, -0.00539990933611989, -0.02444772981107235, -0.004317537881433964, 0.004429836757481098, -0.015081516467034817, 0.031845126301050186, -0.03624151274561882, -0.036757610738277435, -0.007277930621057749, -0.039223410189151764, 0.027620773762464523, -0.04102019593119621, -0.08517520129680634, -0.014307369478046894, 0.021159997209906578, 0.040523212403059006, 0.015979908406734467, 0.03964393585920334, 0.023243501782417297, 0.04774857684969902, -0.03809564188122749, -0.041211340576410294, -0.04503428563475609, 0.017585543915629387, 0.02171432413160801, 0.03559161350131035, 0.04847493767738342, 0.0016008580569177866, -0.0041383374482393265, -0.02718113549053669, 0.019143395125865936, -0.03597390651702881, 0.0025565940886735916, 0.021312914788722992, -0.021676095202565193, 0.015263105742633343, -0.003973472863435745, -0.0018780215177685022, -0.05443872883915901, 0.04484313726425171, -0.014116222970187664, 0.015979908406734467, 0.015215319581329823, -0.029876312240958214, 0.010197704657912254, -0.06346087902784348, 0.0221730787307024, -0.027219364419579506, 0.010465310886502266, 0.02020426094532013, -0.053559452295303345, 0.03677672520279884, 0.008658968843519688, 0.022956781089305878, 0.051686208695173264, 0.04644877463579178, 0.05199204385280609, 0.037407513707876205, 0.0424346849322319, -0.03528577834367752, 0.026493005454540253, 0.03387128934264183, -0.039873309433460236, -0.01843615062534809, -0.0030535769183188677, -0.0323612242937088, 0.006919529754668474, 0.02567107230424881, -0.009586033411324024, 0.006451218854635954, -0.015110188163816929, -0.00034227300784550607, 0.0532153882086277, 0.00008937626262195408, 0.004556471947580576, 0.0071011194959282875, -0.05688541382551193, -0.011029195040464401, -0.022134847939014435, 0.028633855283260345, 0.034865252673625946, 0.01014991756528616, 0.011765112169086933, -0.031214341521263123, 0.007803585380315781, 0.022880323231220245, 0.08494582772254944, 0.003337908536195755, 0.00314915063790977, 0.024008091539144516, -0.10291366279125214, -0.08249913901090622, -0.015731416642665863, 0.116982102394104, 0.005638842936605215, -0.0055719418451189995, -0.022880323231220245, 0.048666082322597504, 0.061472948640584946, 0.01023593358695507, -0.05313893035054207, -0.019879311323165894, -0.0016725382301956415, -0.031118769198656082, 0.03343164920806885, -0.0002027952577918768, 0.06086127832531929, 0.001837402698583901, -0.02725759521126747, -0.011057866737246513, 0.013322961516678333, 0.029417557641863823, 0.03815298527479172, 0.029742509126663208, 0.033469878137111664, 0.00368197332136333, -0.02907349355518818, -0.09526778012514114, 0.02492559887468815, 0.026837069541215897, -0.007813142612576485, 0.0071919141337275505, 0.06751319766044617, -0.04323750361800194, 0.05933209881186485, -0.0003204702807124704, -0.030430639162659645, 0.036662038415670395, -0.05673249810934067, -0.036184169352054596, 0.03587833419442177, -0.03369925543665886, -0.027200249955058098, 0.032896436750888824, -0.07470033317804337, 0.004365324974060059, -0.0006690152804367244, -0.002082310151308775, 0.013380305841565132, -0.04774857684969902, -0.09465610235929489, 0.03297289460897446, 0.04897191748023033, -0.0074834139086306095, -0.002972339279949665, 0.02773546241223812, -0.040905505418777466, 0.002659335732460022, 0.0041311695240437984, 0.024333041161298752, -0.03333607688546181, -0.0006391485221683979, -0.03471233695745468, 0.015033729374408722, 0.008305346593260765, -0.015138859860599041, -0.008133314549922943, 0.004183734767138958, 0.024313926696777344, -0.03385217487812042, -0.04503428563475609, -0.011851128190755844, 0.0020524433348327875, 0.03842059150338173, 0.0006194364978000522, -0.022631831467151642, -0.01241501234471798, 0.0080903060734272, 0.015502040274441242, 0.007153684739023447, 0.02104531042277813, 0.06028783321380615, -0.009136836975812912, -0.02632097341120243, 0.030029229819774628, -0.06250514090061188, -0.02718113549053669, -0.04763389006257057, -0.0028648190200328827, -0.019525688141584396, 0.055356238037347794, -0.03444473072886467, 0.009241968393325806, 0.007760577369481325, -0.07794983685016632, -0.022765634581446648, -0.015740973874926567, -0.05971439182758331, -0.03001011349260807, -0.02775457687675953, 0.027429627254605293, -0.0005486522568389773, 0.02463887818157673, -0.05455341935157776, 0.008400920778512955, -0.0036843628622591496, 0.03771334886550903, -0.0007825089269317687, 0.04159363731741905, 0.0028552617877721786, 0.06074658781290054, -0.04897191748023033, 0.04144071787595749, 0.010264606215059757, -0.06456953287124634, -0.0721389651298523, 0.07164198160171509, -0.022708291187882423, 0.03018214739859104, 0.03842059150338173, 0.02603425271809101, 0.0023045188281685114, -0.02850005216896534, 0.002419207012280822, 0.025422580540180206, -0.0031849907245486975, -0.01386773120611906, 0.03677672520279884, 0.022803863510489464, -0.0647224485874176, -0.027219364419579506, 0.06525766104459763, -0.04102019593119621, -0.019315427169203758, 0.07829390466213226, 0.04683107137680054, 0.04587533324956894, 0.022058390080928802, 0.014383828267455101, 0.014202238991856575, 0.026760611683130264, 0.005457253195345402, -0.042969897389411926, -0.005911227781325579, 0.035438694059848785, -0.05891157314181328, -0.03914695233106613, 0.03503728657960892, -0.048169102519750595, -0.01742306910455227, 0.0005364068783819675, 0.03243768587708473, -0.044575534760951996, 0.039949771016836166, 0.02794572524726391, -0.03878377377986908, 0.008754543028771877, -0.07890557497739792, -0.0008452291367575526, 0.014288255013525486, 0.04709867760539055, 0.04560772702097893, -0.00189355225302279, -0.019124280661344528, -0.038554396480321884, 0.002821811009198427, -0.07110676914453506, -0.047901496291160583, -0.030640900135040283, 0.05803229659795761, 0.05172443762421608, 0.011354145593941212, -0.09045086801052094, -0.0026927865110337734, -0.003751264186576009, 0.00016307247278746217, 0.02406543493270874, -0.0068000624887645245, -0.023855173960328102, 0.008276674896478653, 0.004955491982400417, 0.07064801454544067, 0.04843670874834061, -0.03463587537407875, -0.0321127325296402, 0.07733816653490067, 0.02058655582368374, -0.012749520130455494, -0.021943701431155205, -0.034482959657907486, 0.045072514563798904, 0.024485958740115166, -0.02179078385233879, 0.04748097062110901, -0.007435627281665802, -0.09802030026912689, 0.022861208766698837, 0.026741497218608856, 0.03842059150338173, -0.028729427605867386, 0.02546081133186817, 0.03190247341990471, -0.006217063404619694, 0.0462576299905777, -0.039108723402023315, -0.01217607781291008, -0.0004817507287953049, -0.004649656359106302, -0.05390351638197899, 0.010455753654241562, -0.022574488073587418, -0.013179601170122623, -0.042969897389411926, 0.012042275629937649, -0.010178590193390846, -0.007641110103577375, 0.04059967026114464, 0.025766646489501, 0.07087738811969757, -0.0007442795322276652, -0.010455753654241562, 0.012328996323049068, -0.004955491982400417, -0.00890268199145794, -0.02406543493270874, -0.074776791036129, 0.025040285661816597, 0.019688164815306664, 0.052986010909080505, -0.0364326611161232, -0.0009951601969078183, -0.006131047382950783, 0.00035063570248894393, 0.009017370641231537, 0.0306791290640831, 0.025996021926403046, 0.058452822268009186, 0.010666015557944775 ]
42,832
linearmodels.panel.model
_validate_data
Check input shape and remove missing
def _validate_data(self) -> None: """Check input shape and remove missing""" y = self._y = cast(Float64Array, self.dependent.values2d) x = self._x = cast(Float64Array, self.exog.values2d) w = self._w = cast(Float64Array, self.weights.values2d) if y.shape[0] != x.shape[0]: raise ValueError( "dependent and exog must have the same number of " "observations. The number of observations in dependent " f"is {y.shape[0]}, and the number of observations in exog " f"is {x.shape[0]}." ) if y.shape[0] != w.shape[0]: raise ValueError( "weights must have the same number of " "observations as dependent." ) all_missing = np.any(np.isnan(y), axis=1) & np.all(np.isnan(x), axis=1) missing = ( np.any(np.isnan(y), axis=1) | np.any(np.isnan(x), axis=1) | np.any(np.isnan(w), axis=1) ) missing_warning(np.asarray(all_missing ^ missing), stacklevel=4) if np.any(missing): self.dependent.drop(missing) self.exog.drop(missing) self.weights.drop(missing) x = cast(Float64Array, self.exog.values2d) self._not_null = np.asarray(~missing) w_df = self.weights.dataframe if np.any(np.asarray(w_df) <= 0): raise ValueError("weights must be strictly positive.") w_df = w_df / w_df.mean() self.weights = PanelData(w_df) rank_of_x = self._check_exog_rank() self._constant, self._constant_index = has_constant(x, rank_of_x)
(self) -> NoneType
[ 0.011455113999545574, -0.007194484584033489, -0.013819016516208649, 0.06028417497873306, 0.001897895708680153, -0.03429059684276581, -0.03776637092232704, -0.024199629202485085, 0.026255197823047638, 0.01319300290197134, 0.0016479574842378497, 0.010062934830784798, 0.040999218821525574, -0.03677596151828766, -0.022984975948929787, 0.03804667666554451, -0.004244278650730848, 0.03707495331764221, 0.05333261936903, 0.008731488138437271, -0.06129327043890953, -0.08767927438020706, -0.07205697149038315, 0.03785980865359306, -0.011034657247364521, 0.03901840001344681, -0.028366824612021446, 0.015089730732142925, 0.03380473330616951, -0.016285696998238564, -0.04511035233736038, -0.0023966042790561914, 0.030796131119132042, 0.010716979391872883, 0.03995274752378464, -0.03301988169550896, 0.041372958570718765, -0.029301173985004425, -0.031338054686784744, 0.030515827238559723, -0.012034410610795021, -0.06282560527324677, 0.04682955518364906, 0.024722864851355553, -0.013024820014834404, 0.015183165669441223, -0.019995061680674553, 0.055163946002721786, -0.06861856579780579, -0.0002160681178793311, 0.021060219034552574, 0.0038938981015235186, 0.046306319534778595, 0.04686692729592323, 0.018911216408014297, 0.06734784692525864, 0.027843588963150978, 0.03750475496053696, 0.08334390074014664, -0.10584301501512527, -0.018621569499373436, 0.03238452598452568, 0.017453633248806, -0.04910936579108238, 0.005138917360454798, 0.01700514554977417, -0.026759745553135872, -0.036308787763118744, -0.001625766628421843, 0.018098333850502968, -3.969156807670515e-7, -0.006204075179994106, -0.016734184697270393, 0.053930602967739105, 0.007245873566716909, -0.030478453263640404, 0.03498201444745064, 0.00929676927626133, 0.019228896126151085, -0.08319440484046936, 0.017874090000987053, 0.016696810722351074, -0.036065857857465744, 0.04473661258816719, 0.031711794435977936, -0.0026979318354278803, 0.011511174961924553, 0.10113389790058136, 0.028329450637102127, 0.0035972422920167446, 0.0005544775049202144, 0.04025173932313919, 0.012903355062007904, -0.0007953642634674907, 0.05893871188163757, 0.04398913308978081, -0.03593504801392555, -0.060246799141168594, -0.02238699421286583, 0.005951800849288702, -0.012987446039915085, -0.0018651934806257486, -0.008652068674564362, 0.0673852264881134, -0.026647623628377914, -0.02597489207983017, 0.03014208748936653, -0.052360899746418, -0.057032641023397446, -0.025638526305556297, -0.03666384145617485, -0.023396089673042297, -0.020574357360601425, 0.031823914498090744, -0.007161782588809729, -0.0403638631105423, -0.0374486930668354, 0.041821446269750595, -0.06450743228197098, 0.013398559764027596, 0.019397078081965446, 0.030609261244535446, -0.06959028542041779, -0.0011212184326723218, 0.070786252617836, -0.009250051341950893, 0.030609261244535446, -0.00010336231935070828, 0.016547314822673798, -0.055163946002721786, -0.025152666494250298, -0.015846552327275276, -0.016986457630991936, 0.03520625829696655, -0.03879415616393089, 0.021153653040528297, 0.03070269711315632, -0.04518510028719902, 0.012445524334907532, -0.04118608683347702, 0.04331640154123306, 0.033169377595186234, 0.01607079617679119, 0.023059723898768425, 0.03705626726150513, 0.053893230855464935, -0.008030726574361324, -0.014706647954881191, 0.00843716785311699, 0.005909755360335112, -0.034234534949064255, -0.0076850177720189095, -0.014202099293470383, -0.08917423337697983, -0.0004090695292688906, -0.037205763161182404, -0.01737888529896736, -0.04705379903316498, 0.03457089886069298, -0.012613707222044468, -0.07553274184465408, -0.006129327230155468, 0.022237498313188553, -0.010343239642679691, -0.029955217614769936, 0.07299131900072098, 0.01883646845817566, -0.025339534506201744, 0.011455113999545574, 0.0361219197511673, 0.024778926745057106, -0.009960156865417957, -0.038644660264253616, -0.010175056755542755, -0.07908327132463455, 0.018275858834385872, 0.0018803765997290611, -0.028647130355238914, -0.00492401747033, 0.027581973001360893, 0.001167351845651865, -0.001324439188465476, -0.06256398558616638, 0.013221033848822117, 0.005213665310293436, 0.04522247612476349, -0.012127845548093319, -0.03625272586941719, 0.030609261244535446, 0.023433463647961617, -0.05038008093833923, -0.005124902352690697, -0.01737888529896736, 0.03387948125600815, 0.04223255813121796, 0.022200124338269234, 0.03984062746167183, 0.030926940962672234, 0.002342879306524992, -0.0608447827398777, 0.016650093719363213, -0.07340242713689804, 0.041036590933799744, -0.030067339539527893, -0.09014596045017242, -0.005442580673843622, -0.06207812577486038, -0.007474789395928383, 0.0011650159722194076, 0.0016537971096113324, 0.02173294872045517, -0.009726569056510925, -0.032160282135009766, -0.017397571355104446, 0.06398419290781021, -0.015444783493876457, 0.019938999786973, -0.03591636195778847, 0.018462728708982468, -0.00017183255113195628, 0.01969606988132, -0.009226692840456963, -0.024237003177404404, -0.007839185185730457, 0.04395176097750664, -0.0077691092155873775, 0.03780374675989151, 0.03593504801392555, 0.03434665501117706, -0.011025314219295979, 0.010016217827796936, -0.01360411662608385, -0.01830388978123665, -0.02234962023794651, 0.04111133888363838, 0.012202593497931957, -0.021676888689398766, -0.05011846125125885, 0.05994781106710434, 0.00385418813675642, -0.04578308388590813, -0.06817007809877396, -0.025302160531282425, -0.04073760285973549, 0.024891048669815063, -0.00998818688094616, 0.04432550072669983, 0.049034617841243744, -0.0014424007385969162, -0.029656225815415382, -0.03298250585794449, 0.01619226299226284, -0.019920313730835915, -0.00014394808385986835, 0.024031447246670723, -0.04507298022508621, 0.030310269445180893, -0.04167195037007332, 0.05669627711176872, -0.07033776491880417, 0.020125869661569595, 0.01255764625966549, 0.017930150032043457, 0.08446511626243591, -0.04705379903316498, 0.01879909448325634, 0.05628516152501106, -0.02145264483988285, 0.014332908205688, 0.0024760239757597446, -0.04223255813121796, 0.0893237292766571, -0.006334883626550436, -0.020611731335520744, 0.008287672884762287, 0.03690677136182785, 0.04298003762960434, -0.047651782631874084, 0.06129327043890953, 0.06764683872461319, 0.007278576027601957, -0.038682032376527786, 0.024255691096186638, 0.02687186747789383, -0.010408643633127213, -0.032160282135009766, -0.05322049930691719, -0.12707141041755676, 0.005592076573520899, -0.019640007987618446, -0.03438403084874153, 0.009558387100696564, 0.06495591998100281, 0.040475983172655106, -0.034440092742443085, -0.04081235080957413, -0.005218337289988995, -0.027880962938070297, 0.0019235903164371848, 0.015071043744683266, -0.01052076555788517, 0.052996255457401276, 0.033094629645347595, -0.004580644425004721, 0.005479954648762941, -0.06099427863955498, 0.03363655135035515, -0.01941576413810253, 0.017556410282850266, -0.024180943146348, 0.00014226918574422598, 0.01219324953854084, 0.020163243636488914, 0.04428812488913536, 0.06297510117292404, -0.03434665501117706, 0.04058810696005821, -0.005297756753861904, 0.008128833025693893, 0.096723772585392, 0.031618356704711914, -0.009105227887630463, -0.0011305618099868298, -0.04638106748461723, -0.08797826617956161, 0.011015970259904861, 0.061106402426958084, -0.010969253256917, 0.00042337673949077725, -0.005199650302529335, -0.03245927020907402, -0.054827578365802765, 0.028684504330158234, 0.005891068372875452, 0.05000634118914604, -0.018584195524454117, -0.003454754129052162, -0.04249417781829834, 0.08827725797891617, 0.04223255813121796, -0.028890060260891914, 0.009063181467354298, -0.010184400714933872, -0.009086540900170803, 0.037168391048908234, -0.07011352479457855, 0.016463223844766617, -0.027507225051522255, -0.011595266871154308, 0.07108524441719055, -0.034028977155685425, 0.06970240920782089, -0.020331427454948425, 0.003162770066410303, 0.022274872288107872, -0.011408396996557713, -0.01814505085349083, 0.023601647466421127, 0.013650833629071712, 0.04298003762960434, 0.026722371578216553, 0.034963324666023254, -0.035094134509563446, 0.02014455758035183, 0.03094562701880932, -0.028572382405400276, 0.020910723134875298, -0.032066844403743744, -0.06005993112921715, -0.007348651997745037, -0.028292076662182808, -0.04040123522281647, -0.04615682363510132, -0.0009390204213559628, 0.011772792786359787, 0.04918411374092102, 0.016080141067504883, 0.015173821710050106, 0.02801177278161049, -0.011361679993569851, 0.0045432704500854015, 0.0011346496175974607, -0.027301667258143425, 0.0037303869612514973, -0.004881971515715122, -0.030104713514447212, -0.033374935388565063, 0.022031940519809723, -0.023713769391179085, -0.026890553534030914, 0.03600979596376419, -0.016771558672189713, -0.001472767093218863, 0.022517802193760872, 0.014146038331091404, 0.04488610848784447, 0.03186129033565521, 0.03156229853630066, -0.03772899881005287, -0.011427083984017372, -0.07250545173883438, -0.04873562604188919, -0.04249417781829834, 0.05834072828292847, -0.0013758284039795399, -0.009791973978281021, -0.040924470871686935, 0.04596995189785957, 0.015454126521945, 0.06944078952074051, 0.03615929186344147, 0.03759818896651268, 0.06839431822299957, 0.014893517829477787, -0.006694607902318239, -0.008843610063195229, -0.022368306294083595, -0.00180913251824677, 0.044063881039619446, 0.012922042049467564, 0.04686692729592323, 0.012305371463298798, 0.04570833593606949, 0.035579998046159744, -0.0453345961868763, -0.016864992678165436, -0.07557012140750885, -0.017154641449451447, 0.02634863182902336, 0.018612224608659744, -0.037411320954561234, 0.009941469877958298, -0.06902968138456345, -0.06839431822299957, -0.027376415207982063, -0.020331427454948425, -0.019808191806077957, 0.052547767758369446, -0.0027913665398955345, 0.06207812577486038, 0.006082609761506319, 0.026927927508950233, 0.07878427952528, 0.0066058449447155, -0.04066285490989685, -0.01663140580058098, 0.02162082865834236, 0.017135953530669212, -0.07153373211622238, 0.0025881456676870584, 0.05778012052178383, 0.015043012797832489, 0.028049146756529808, -0.045446719974279404, -0.05052957311272621, 0.023171845823526382, -0.02186375856399536, -0.05680839717388153, -0.012996789999306202, -0.01105334423482418, -0.027339041233062744, -0.001906071207486093, -0.09119243174791336, -0.025918832048773766, -0.027133485302329063, 0.03498201444745064, 0.020032435655593872, -0.020574357360601425, 0.013940481469035149, 0.06417106837034225, 0.03728051111102104, 0.00298757990822196, 0.018369294703006744, -0.02776884101331234, -0.01055813953280449, -0.007119736634194851, 0.027619346976280212, 0.05105280876159668, 0.08252166956663132, -0.023582959547638893, 0.035579998046159744, 0.025096604600548744, -0.03159967064857483, 0.03746737912297249, -0.012884668074548244, 0.0030973658431321383, -0.051164932548999786, -0.02221881039440632, 0.008983762003481388, 0.006979584228247404, -0.02511529251933098, -0.015809178352355957, 0.03341230750083923, 0.01472533494234085, -0.014622556045651436, -0.004248950630426407, 0.004307347349822521, -0.025339534506201744, 0.10352583229541779, -0.05071644484996796, 0.051239680498838425, 0.024050133302807808, -0.018686972558498383, -0.028759252279996872, -0.02789965085685253, -0.04126083478331566, -0.013136941939592361, 0.010147026740014553, -0.024367813020944595, -0.04649318754673004, -0.08110146224498749, 0.005671496503055096, 0.04040123522281647, 0.020705165341496468, 0.04208306223154068, -0.022928915917873383, -0.01574377529323101, 0.03629010170698166, -0.013277093879878521, 0.025675900280475616, 0.008002696558833122, 0.0015942323952913284, 0.014753364957869053, 0.016444535925984383, -0.005671496503055096, 0.02231224626302719, -0.04787602648139, -0.03567343205213547, 0.0175750982016325, -0.009642478078603745, -0.037785060703754425, -0.05378110706806183, 0.0664134994149208, 0.04114871472120285, -0.051650792360305786, -0.04682955518364906, 0.049445729702711105, -0.029207738116383553, -0.08939848095178604, 0.03776637092232704, -0.012482898309826851, -0.012566989287734032, 0.03821485862135887, -0.04062547907233238, -0.0036369520239531994, 0.024648116901516914, 0.01864025555551052, 0.04249417781829834, -0.055276066064834595, 0.022536490112543106, -0.032440584152936935, -0.026890553534030914, 0.08117621392011642, 0.023601647466421127, 0.05778012052178383, -0.05180028825998306, 0.021676888689398766, 0.04791339859366417, 0.03498201444745064, -0.00003970981924794614, -0.053482115268707275, -0.07631760090589523, 0.028049146756529808, -0.05359423905611038, -0.053444743156433105, -0.009007121436297894, -0.0013174315681681037, 0.00037724326830357313, -0.02735772915184498, 0.03707495331764221, -0.036551717668771744, 0.03629010170698166, -0.0119690066203475, -0.01664074882864952, -0.004456843249499798, -0.015799835324287415, -0.01274451520293951, 0.008427824825048447, -0.06476905196905136, -0.056658901274204254, 0.042643673717975616, 0.007189813069999218, -0.015108417719602585, -0.04686692729592323, 0.040961842983961105, -0.02931986004114151, -0.056845773011446, -0.0005781282088719308, 0.014379626139998436, 0.015183165669441223, 0.03849516436457634, 0.04163457453250885, -0.027226919308304787, -0.02376982942223549, 0.04529722407460213, 0.054005350917577744, -0.014118008315563202, -0.036925457417964935, 0.027918336912989616, -0.006736653856933117, -0.023807203397154808, 0.007245873566716909, 0.008862297050654888, -0.024012761190533638, -0.008390450850129128, -0.04735279083251953, -0.020649105310440063, 0.01205309759825468, -0.005970487836748362, -0.051613420248031616, -0.0008677762816660106, 0.02300366386771202, -0.0053725047037005424, -0.05606091767549515, -0.013221033848822117, -0.02724560722708702, -0.057966988533735275, 0.005578061565756798, 0.03470170870423317, 0.03572949394583702, 0.027600659057497978, -0.05052957311272621, -0.015239226631820202, 0.01472533494234085, -0.006180716212838888, -0.044138628989458084, 0.06304984539747238, -0.030852193012833595, -0.03477645665407181, -0.023994073271751404, 0.018789751455187798, -0.029618851840496063, 0.011473800987005234, -0.021751636639237404, 0.030235521495342255, 0.033374935388565063, 0.023508211597800255, -0.016780901700258255, 0.01688368059694767, 0.034683022648096085, 0.00022526562679558992, -0.024891048669815063, 0.0296935997903347, 0.037205763161182404, 0.0005290749249979854, 0.015276600606739521, -0.031543608754873276, -0.016220292076468468, 0.02556377835571766, 0.004681086633354425, -0.016706153750419617, -0.011044001206755638, -0.03748606890439987, -0.05740638077259064, 0.057817492634058, 0.049520477652549744, -0.0017075221985578537, -0.032926447689533234, 0.017201358452439308, 0.0014797747135162354, 0.007414056453853846, 0.026759745553135872, 0.02117234095931053, 0.006176044698804617, 0.05905083566904068, 0.018733689561486244, 0.01618291810154915, -0.0014447366120293736, 0.031954724341630936, 0.014239473268389702, -0.029861783608794212, 0.01476270891726017, 0.016827618703246117, 0.027376415207982063, 0.0122119365260005, -0.015370035544037819, -0.0047815293073654175, 0.007231858558952808, -0.02593751810491085, 0.004550277721136808, 0.03946688771247864, 0.061554890125989914, -0.0062087466940283775, -0.048137642443180084, 0.055649805814027786, -0.06077003479003906, -0.03230977803468704, -0.011576579883694649, 0.031057748943567276, 0.005423893686383963, -0.03238452598452568, 0.006339555606245995, 0.0464184395968914, -0.012333402410149574, -0.036308787763118744, -0.10232986509799957, -0.011202840134501457, -0.0006756508955731988, 0.009773286990821362, -0.02552640438079834, 0.009651821106672287, -0.00492401747033, -0.02410619519650936, 0.043129533529281616, 0.03976587951183319, 0.030646635219454765, -0.06129327043890953, 0.03372998535633087, 0.004248950630426407, -0.042307306081056595, -0.008521259762346745, 0.02659156173467636, -0.009904095903038979, -0.04824976250529289, -0.01875237748026848, 0.03328149765729904, 0.010885161347687244, 0.021134966984391212, -0.011314962059259415, -0.00667592091485858, 0.009689195081591606, 0.0826711654663086, -0.01272582821547985, 0.0011685197241604328, -0.04574570804834366, 0.06510541588068008, -0.002203894779086113, -0.12565121054649353, 0.031786542385816574, -0.034440092742443085, 0.032720889896154404, 0.01871500350534916, -0.01737888529896736, 0.09806923568248749, -0.006853447295725346, -0.016939740628004074, -0.008479214273393154, 0.024442560970783234, -0.017238732427358627, 0.021134966984391212, 0.013043507002294064, -0.028908746317029, -0.0003378254477865994, -0.00889032706618309, 0.01267911121249199, 0.04212043806910515, 0.03350574150681496, -0.01164198387414217, -0.022162750363349915, -0.048548754304647446, 0.05183766409754753, -0.015201852656900883, 0.008423153311014175, 0.007577567361295223, 0.024199629202485085, 0.03238452598452568, 0.01671549677848816, -0.04294266551733017, -0.03242189809679985, -0.047128546983003616, -0.0036112575326114893, 0.022368306294083595, 0.015239226631820202, 0.05852760002017021, -0.02279810793697834, 0.0459325797855854, 0.014360939152538776, 0.04354064539074898 ]
42,833
linearmodels.panel.model
fit
Estimate model parameters Parameters ---------- reweight : bool Flag indicating to reweight observations if the input data is unbalanced using a WLS estimator. If weights are provided, these are accounted for when reweighting. Has no effect on balanced data. cov_type : str Name of covariance estimator. See Notes. debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional covariance-specific options. See Notes. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import BetweenOLS >>> mod = BetweenOLS(y, x) >>> res = mod.fit(cov_type='robust') Notes ----- Three covariance estimators are supported: * "unadjusted", "homoskedastic" - Assume residual are homoskedastic * "robust", "heteroskedastic" - Control for heteroskedasticity using White's estimator * "clustered` - One- or two-way clustering. Configuration options are: * ``clusters`` - Input containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables When using a clustered covariance estimator, all cluster ids must be identical within an entity.
def fit( self, *, reweight: bool = False, cov_type: str = "unadjusted", debiased: bool = True, **cov_config: bool | float | str | IntArray | DataFrame | PanelData, ) -> PanelResults: """ Estimate model parameters Parameters ---------- reweight : bool Flag indicating to reweight observations if the input data is unbalanced using a WLS estimator. If weights are provided, these are accounted for when reweighting. Has no effect on balanced data. cov_type : str Name of covariance estimator. See Notes. debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional covariance-specific options. See Notes. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import BetweenOLS >>> mod = BetweenOLS(y, x) >>> res = mod.fit(cov_type='robust') Notes ----- Three covariance estimators are supported: * "unadjusted", "homoskedastic" - Assume residual are homoskedastic * "robust", "heteroskedastic" - Control for heteroskedasticity using White's estimator * "clustered` - One- or two-way clustering. Configuration options are: * ``clusters`` - Input containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables When using a clustered covariance estimator, all cluster ids must be identical within an entity. """ y, x, w = self._prepare_between() if np.all(self.weights.values2d == 1.0) and not reweight: w = root_w = np.ones_like(y) else: root_w = cast(Float64Array, np.sqrt(w)) wx = root_w * x wy = root_w * y params = _lstsq(wx, wy, rcond=None)[0] df_resid = y.shape[0] - x.shape[1] df_model = (x.shape[1],) nobs = y.shape[0] cov_config = self._setup_clusters(cov_config) extra_df = 0 if "extra_df" in cov_config: cov_config = cov_config.copy() _extra_df = cov_config.pop("extra_df") assert isinstance(_extra_df, (str, int)) extra_df = int(_extra_df) cov = setup_covariance_estimator( self._cov_estimators, cov_type, wy, wx, params, self.dependent.entity_ids, self.dependent.time_ids, debiased=debiased, extra_df=extra_df, **cov_config, ) weps = wy - wx @ params index = self.dependent.index fitted = DataFrame(self.exog.values2d @ params, index, ["fitted_values"]) eps = y - x @ params effects = DataFrame(eps, self.dependent.entities, ["estimated_effects"]) idx = cast(MultiIndex, fitted.index) entities = idx.levels[0][idx.codes[0]] effects = effects.loc[entities] effects.index = idx dep = self.dependent.dataframe fitted = fitted.reindex(dep.index) effects = effects.reindex(dep.index) idiosyncratic = DataFrame( np.asarray(dep) - np.asarray(fitted) - np.asarray(effects), dep.index, ["idiosyncratic"], ) residual_ss = float(np.squeeze(weps.T @ weps)) e = y if self._constant: e = y - (w * y).sum() / w.sum() total_ss = float(np.squeeze(w.T @ (e**2))) r2 = 1 - residual_ss / total_ss res = self._postestimation( params, cov, debiased, df_resid, weps, wy, wx, root_w ) res.update( dict( df_resid=df_resid, df_model=df_model, nobs=nobs, residual_ss=residual_ss, total_ss=total_ss, r2=r2, wresids=weps, resids=eps, index=self.dependent.entities, fitted=fitted, effects=effects, idiosyncratic=idiosyncratic, ) ) return PanelResults(res)
(self, *, reweight: bool = False, cov_type: str = 'unadjusted', debiased: bool = True, **cov_config: bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData) -> linearmodels.panel.results.PanelResults
[ 0.025642136111855507, -0.027480045333504677, 0.011990688741207123, -0.0054694367572665215, 0.0038142125122249126, -0.041186850517988205, -0.04492909833788872, -0.06572181731462479, -0.005740694236010313, 0.020128412172198296, -0.005245234351605177, -0.01171389501541853, 0.0167404618114233, 0.03624885901808739, -0.03447737917304039, 0.0861823782324791, -0.02938438393175602, -0.006371783092617989, 0.013895026408135891, -0.013828596100211143, -0.04614698886871338, -0.06058453023433685, -0.046811293810606, 0.01754869893193245, -0.0008573674131184816, -0.044530514627695084, -0.026550019159913063, 0.00587909109890461, 0.00780557282269001, -0.0279893446713686, -0.019143028184771538, -0.010252426378428936, -0.057838741689920425, -0.042581889778375626, 0.023981377482414246, 0.0005750381969846785, 0.054162923246622086, 0.03746674954891205, 0.046014126390218735, 0.014836124144494534, -0.024247098714113235, -0.0465012826025486, 0.09619122743606567, 0.011265489272773266, -0.050664257258176804, 0.02053806744515896, -0.0705048069357872, 0.07028336822986603, 0.009427581913769245, 0.0020316631998866796, 0.03133300691843033, -0.05092997848987579, 0.0391053669154644, -0.024247098714113235, 0.04428693652153015, -0.006294281221926212, -0.010728511027991772, 0.05947735533118248, 0.10354285687208176, -0.07311773300170898, 0.03700173646211624, -0.010883514769375324, -0.01886623539030552, -0.007556458935141563, 0.0014095702208578587, -0.004038414917886257, -0.020216986536979675, 0.004899242427200079, 0.022763485088944435, 0.011879971250891685, 0.01526792161166668, -0.0035318832378834486, -0.021357376128435135, 0.03551812469959259, 0.009898130781948566, -0.01613151654601097, 0.013795381411910057, -0.027945058420300484, -0.02553141862154007, -0.017570842057466507, 0.01744905300438404, 0.028299352154135704, -0.04911421239376068, -0.008829708211123943, -0.011857827194035053, -0.02104736678302288, -0.049689944833517075, -0.010357607156038284, 0.06523466110229492, -0.0041131493635475636, -0.016209019348025322, 0.027679335325956345, 0.029960112646222115, -0.015323280356824398, 0.05668728053569794, 0.010418501682579517, -0.010556899011135101, -0.035030968487262726, 0.005452828947454691, -0.002978296484798193, -0.022121325135231018, 0.05146142095327377, 0.009942417033016682, 0.062400296330451965, -0.023981377482414246, -0.042050447314977646, -0.03104514256119728, 0.00968776736408472, -0.002798380795866251, -0.07502207159996033, -0.042227596044540405, -0.0012607937678694725, -0.024623537436127663, -0.012865355238318443, -0.020980937406420708, 0.005823732353746891, -0.05730729550123215, 0.028210779651999474, -0.04991137981414795, 0.04712130129337311, -0.0073903826996684074, 0.049335647374391556, -0.07626210898160934, -0.015755077823996544, 0.039083223789930344, -0.003000440075993538, 0.018821949139237404, 0.0009902282617986202, 0.023184211924672127, -0.06713899970054626, -0.010866907425224781, -0.03186445310711861, -0.03587241843342781, -0.023560650646686554, -0.0036315289326012135, 0.05947735533118248, -0.041806869208812714, 0.005297824740409851, -0.033635929226875305, -0.009410974569618702, 0.05947735533118248, 0.08790957182645798, 0.008231834508478642, 0.019663400948047638, 0.002509131794795394, 0.04614698886871338, 0.018390150740742683, -0.05606726184487343, -0.01022474654018879, 0.08108938485383987, -0.054960090667009354, -0.0391053669154644, -0.031155860051512718, -0.04526124894618988, -0.0494685098528862, -0.08511949330568314, -0.02455710619688034, 0.020294489338994026, 0.008669167757034302, 0.024534963071346283, -0.04849419742822647, -0.01824621856212616, 0.054162923246622086, 0.02217668481171131, 0.008176475763320923, 0.01658545807003975, -0.04911421239376068, -0.03673601523041725, 0.012455700896680355, -0.009975632652640343, 0.006421606056392193, -0.016120444983243942, -0.011038519442081451, -0.044774092733860016, -0.06527894735336304, 0.02007305435836315, 0.020460564643144608, -0.028432214632630348, -0.04185115545988083, -0.020980937406420708, 0.05677585303783417, 0.003703495254740119, -0.0485827699303627, -0.003714566817507148, -0.04238259792327881, 0.018368007615208626, -0.005178803578019142, -0.0070914458483457565, -0.002978296484798193, 0.001918177935294807, -0.031620875000953674, -0.015334351919591427, 0.017925137653946877, -0.04605841636657715, -0.011780325323343277, 0.010191531851887703, 0.06306459754705429, -0.01929803378880024, 0.04027897119522095, 0.027480045333504677, -0.01272142305970192, -0.024136381223797798, 0.026527876034379005, -0.025199268013238907, -0.04694415256381035, 0.03939323127269745, -0.019574826583266258, -0.033104486763477325, 0.004774685483425856, -0.017426909878849983, 0.03237375244498253, 0.02965010516345501, -0.010407430119812489, -0.03024797886610031, 0.06076167896389961, 0.0180690698325634, -0.04641271010041237, -0.021645240485668182, 0.019419822841882706, -0.019165171310305595, -0.011254417710006237, -0.029096517711877823, -0.02657216228544712, 0.036891017109155655, 0.0380646213889122, -0.03576170280575752, 0.010855835862457752, 0.018633728846907616, 0.05394148826599121, -0.044774092733860016, 0.0070914458483457565, 0.025464989244937897, 0.031067287549376488, -0.06093882769346237, 0.01430468074977398, -0.006892154458910227, -0.07356060296297073, 0.027125749737024307, -0.04519481956958771, 0.012145692482590675, -0.014670047909021378, -0.02027234621345997, -0.020837003365159035, -0.007268593646585941, -0.01075065415352583, -0.018833020702004433, 0.05261288210749626, 0.049778517335653305, -0.01333036832511425, -0.02253097854554653, 0.04836133494973183, -0.004088237881660461, -0.030580129474401474, 0.014127532951533794, -0.002451005158945918, -0.01693975366652012, 0.05270145460963249, -0.048892777413129807, 0.005029335152357817, -0.050664257258176804, -0.004522803705185652, -0.009416510351002216, -0.033038053661584854, 0.03596099466085434, -0.06133740767836571, 0.00019790725491475314, -0.014315752312541008, -0.05349862203001976, 0.00912310928106308, 0.0607173927128315, -0.11550033092498779, 0.05930021032691002, -0.011481388472020626, -0.010451717302203178, -0.022785630077123642, 0.05146142095327377, 0.0030890139751136303, -0.06607610732316971, 0.053720057010650635, 0.05580154061317444, 0.013917170464992523, -0.04579269513487816, -0.019253745675086975, 0.011536747217178345, -0.014636833220720291, -0.03616028279066086, -0.04304690286517143, -0.0035125077702105045, 0.02770148031413555, 0.01744905300438404, -0.018478725105524063, 0.017061542719602585, 0.06005308777093887, 0.005145588424056768, 0.006936441641300917, -0.046988438814878464, 0.06036309525370598, -0.018755517899990082, 0.032285176217556, 0.005901234224438667, -0.010717438533902168, 0.049424223601818085, 0.01596544124186039, 0.004068862181156874, 0.009444189257919788, -0.02096986398100853, 0.07041622698307037, -0.0859166607260704, 0.020980937406420708, 0.006565538700670004, -0.014360039494931698, 0.0705048069357872, -0.010988696478307247, 0.03939323127269745, -0.00027592838159762323, -0.04720987379550934, -0.010163852013647556, -0.019707687199115753, 0.02393708936870098, 0.0891496017575264, -0.011470316909253597, -0.029517244547605515, 0.03976966813206673, -0.02219882793724537, 0.012201051227748394, 0.03815319761633873, 0.025996431708335876, 0.04552697017788887, 0.012112477794289589, -0.011525675654411316, -0.04506195709109306, -0.024247098714113235, 0.03009297326207161, 0.014780765399336815, -0.00484388368204236, -0.03184230625629425, 0.04632413759827614, -0.022608481347560883, 0.0894596129655838, 0.02378208562731743, 0.03195302560925484, -0.0012919330038130283, -0.03175373375415802, -0.0035567947197705507, -0.032130174338817596, -0.04867134615778923, 0.06417176872491837, 0.05070854350924492, 0.05465007945895195, 0.05903448909521103, -0.04041182994842529, 0.058015886694192886, 0.05394148826599121, 0.029340095818042755, -0.023715654388070107, 0.01556685846298933, -0.015666503459215164, 0.04233831167221069, 0.03886178880929947, -0.04920278862118721, -0.034167371690273285, 0.01700618490576744, -0.04247117415070534, 0.043201908469200134, -0.01144817378371954, 0.005250770132988691, -0.0007162028341554105, -0.027170035988092422, 0.0260628629475832, -0.02411423809826374, -0.028697935864329338, -0.0408768430352211, -0.03602742403745651, 0.026727166026830673, 0.005068086553364992, 0.022829916328191757, -0.03735603019595146, -0.02956153079867363, 0.09061107039451599, 0.0007431901758536696, 0.012732494622468948, -0.0559786893427372, -0.032949481159448624, -0.012555346824228764, 0.00987045094370842, -0.020947720855474472, 0.029074374586343765, -0.02544284611940384, 0.02745790034532547, -0.03813105449080467, 0.07116910815238953, -0.028299352154135704, 0.0038529634475708008, 0.01648581214249134, -0.02156773768365383, -0.001359055400826037, 0.025487132370471954, 0.027767909690737724, -0.05575725436210632, -0.004807900637388229, -0.023405646905303, -0.008015935309231281, 0.03474310413002968, 0.031798020005226135, -0.04461909085512161, -0.04300261661410332, -0.013341439887881279, 0.06979621201753616, -0.011724966578185558, 0.017925137653946877, -0.033281631767749786, 0.0391053669154644, -0.039348945021629333, 0.011182451620697975, -0.050221387296915054, 0.02885293960571289, -0.0001987722353078425, 0.023361358791589737, 0.08427803963422775, -0.0004335276025813073, 0.0956597849726677, -0.01912088505923748, 0.07488921284675598, 0.02586357109248638, 0.021113798022270203, 0.029716534540057182, -0.03447737917304039, 0.006759293843060732, 0.0030059758573770523, -0.017083685845136642, 0.011957473121583462, -0.02378208562731743, -0.06483607739210129, -0.02648358792066574, -0.00028267523157410324, 0.009543835185468197, 0.0036702798679471016, 0.04506195709109306, -0.000889890652615577, 0.042139019817113876, -0.01604294218122959, 0.03166516125202179, -0.011370670981705189, -0.007484492380172014, -0.06434892117977142, -0.018002640455961227, 0.06257744133472443, -0.04481837898492813, -0.1024799719452858, -0.025309985503554344, 0.08582808822393417, 0.042759038507938385, 0.03168730437755585, 0.02989368326961994, -0.043290480971336365, -0.029605817049741745, 0.005790517199784517, -0.04796275496482849, -0.02621786668896675, -0.006737150251865387, 0.019951265305280685, -0.02404780685901642, -0.016430454328656197, -0.014548258855938911, -0.03972538188099861, 0.048007041215896606, 0.02387065999209881, -0.04395478591322899, 0.01904338225722313, 0.021877747029066086, 0.01196854468435049, -0.000870515126734972, 0.009200611151754856, -0.008563986979424953, -0.021169155836105347, 0.06563324481248856, 0.0001100253575714305, 0.019519466906785965, 0.054960090667009354, -0.02131308801472187, 0.023715654388070107, -0.028875082731246948, -0.022243114188313484, -0.0020773340947926044, 0.02289634756743908, -0.046191275119781494, -0.034167371690273285, 0.004442533478140831, 0.01491362601518631, 0.043999072164297104, -0.018567299470305443, 0.02203275077044964, 0.023649225011467934, 0.028277209028601646, -0.05903448909521103, 0.0208812914788723, 0.01531220879405737, -0.05181571841239929, 0.045482683926820755, -0.061691705137491226, 0.085606649518013, -0.02956153079867363, -0.009554906748235226, -0.024357816204428673, -0.02393708936870098, -0.06023023650050163, -0.008802028372883797, -0.0004432153655216098, -0.04238259792327881, -0.02131308801472187, -0.004807900637388229, 0.009521691128611565, 0.028100062161684036, 0.000252919940976426, 0.010307785123586655, -0.03009297326207161, 0.025907859206199646, 0.07945076376199722, 0.013883954845368862, -0.0167404618114233, 0.03788747638463974, 0.00041449806303717196, 0.05323289707303047, 0.005344879813492298, 0.058813054114580154, 0.027679335325956345, -0.03753317892551422, -0.01746012456715107, 0.04955708235502243, 0.011636393144726753, -0.012389270588755608, -0.0784764513373375, -0.019685544073581696, 0.0610274001955986, 0.022852059453725815, -0.04623556137084961, -0.028011487796902657, -0.05447293445467949, -0.04025682434439659, 0.010435109958052635, -0.03560669720172882, -0.007960576564073563, 0.02701503224670887, 0.00028181023662909865, 0.03666958585381508, 0.008868459612131119, 0.028188636526465416, 0.010003311559557915, -0.05053139477968216, -0.005314432550221682, -0.025575706735253334, -0.03647029399871826, 0.03299376741051674, 0.06178027763962746, 0.03948180377483368, -0.020504852756857872, -0.01886623539030552, 0.006676255725324154, -0.01744905300438404, 0.01893266662955284, -0.010484931990504265, -0.03585027530789375, 0.042759038507938385, -0.04076612740755081, 0.04362263157963753, 0.03976966813206673, 0.06833474338054657, 0.015910081565380096, -0.02659430541098118, -0.022409189492464066, 0.010014384053647518, 0.046368423849344254, -0.04300261661410332, 0.029583673924207687, -0.006045166868716478, 0.023051351308822632, 0.028631504625082016, -0.018666943535208702, -0.07692641019821167, 0.004987816326320171, 0.030402982607483864, -0.057927314192056656, -0.009006856009364128, -0.015190419740974903, 0.027679335325956345, -0.006903226487338543, -0.018179787322878838, 0.03886178880929947, 0.02455710619688034, 0.005494348239153624, -0.028919370844960213, 0.05221429839730263, -0.03505311161279678, -0.008663631975650787, 0.03339235112071037, 0.06133740767836571, -0.05194857716560364, -0.006543395109474659, 0.028742222115397453, 0.024756398051977158, -0.008796492591500282, -0.021545594558119774, 0.0512399859726429, -0.005380862858146429, -0.01571079157292843, -0.008431125432252884, -0.0021548361983150244, 0.03771032765507698, 0.03027012199163437, -0.030845852568745613, 0.028299352154135704, -0.022829916328191757, 0.016530100256204605, -0.02911866083741188, -0.005934449844062328, -0.026970744132995605, -0.04105399176478386, -0.002480068476870656, 0.07116910815238953, 0.014847195707261562, 0.0521257258951664, -0.0009078822331503034, 0.02683788351714611, 0.03892821818590164, -0.04543839767575264, 0.03104514256119728, 0.041452571749687195, -0.12639491260051727, 0.02570856735110283, -0.036691728979349136, 0.027767909690737724, 0.07152340561151505, 0.03976966813206673, -0.016640815883874893, 0.0305137000977993, 0.05287860333919525, 0.05841447040438652, -0.005873554851859808, 0.042847611010074615, -0.021645240485668182, 0.03164301812648773, 0.018821949139237404, 0.0331709161400795, 0.021645240485668182, -0.019984479993581772, 0.027767909690737724, -0.007661640178412199, 0.006665184162557125, 0.006432677619159222, 0.0008054686477407813, 0.005494348239153624, -0.02027234621345997, -0.057838741689920425, -0.026505732908844948, 0.04333476722240448, -0.003482060506939888, 0.03467667102813721, 0.0055303312838077545, 0.07081481069326401, 0.00456155464053154, 0.024269241839647293, -0.014160748571157455, 0.06036309525370598, -0.013418941758573055, 0.03531883284449577, 0.0060340953059494495, 0.01649688370525837, -0.012178908102214336, 0.004237706307321787, -0.022309545427560806, 0.006548930890858173, -0.0562886968255043, -0.05190429091453552, 0.0012905490584671497, -0.00016624901036266237, -0.05079711601138115, -0.020050911232829094, 0.007119125220924616, -0.02360493689775467, -0.018644800409674644, 0.07201056182384491, 0.07249771803617477, -0.0017562538851052523, -0.039681095629930496, 0.12940643727779388, -0.01884409226477146, -0.018534082919359207, -0.006775901652872562, 0.0017714775167405605, -0.029362238943576813, -0.03682458773255348, -0.0018379079410806298, -0.028720078989863396, -0.046988438814878464, 0.0542072132229805, -0.11975187808275223, -0.026461444795131683, -0.06496893614530563, -0.01298714429140091, -0.0024371654726564884, 0.01227855309844017, -0.005638280883431435, 0.006294281221926212, 0.054782941937446594, -0.0034267017617821693, 0.05159428343176842, -0.004589234013110399, 0.012090333737432957, 0.049601368606090546, -0.10504861921072006, -0.042847611010074615, 0.01904338225722313, 0.03365807235240936, -0.029760822653770447, 0.026727166026830673, -0.005021031480282545, 0.002482836367562413, 0.03042512573301792, -0.03252875432372093, 0.018035855144262314, 0.017825491726398468, 0.015334351919591427, 0.012455700896680355, -0.037843186408281326, 0.031975168734788895, -0.029937969520688057, 0.029450813308358192, -0.0027568619698286057, 0.03649243712425232, -0.021523451432585716, 0.05695300176739693, -0.020914506167173386, -0.01851193979382515, -0.010357607156038284, 0.011802468448877335, -0.023117780685424805, -0.02772362343966961, 0.004102077800780535, -0.02289634756743908, 0.011957473121583462, -0.03288305178284645, 0.013662519864737988, -0.03731174394488335, -0.06200171262025833, -0.031443726271390915, 0.03560669720172882, 0.016065087169408798, -0.008973640389740467, 0.0554029606282711, -0.05110712721943855, 0.02624000981450081, -0.03334806486964226, 0.05553581938147545, -0.004431461915373802, 0.026417158544063568, 0.031244434416294098, -0.010999768041074276, -0.006781437434256077, -0.03624885901808739, -0.03137729689478874, 0.0247342549264431, -0.004816204309463501, 0.045216962695121765, 0.03673601523041725, 0.0391053669154644, 0.022874202579259872, -0.001228270586580038, 0.020670928061008453 ]
42,834
linearmodels.panel.model
predict
Predict values for additional data Parameters ---------- params : array_like Model parameters (nvar by 1) exog : array_like Exogenous regressors (nobs by nvar) data : DataFrame Values to use when making predictions from a model constructed from a formula context : int Depth of use when evaluating formulas. Returns ------- DataFrame Fitted values from supplied data and parameters Notes ----- If `data` is not None, then `exog` must be None. Predictions from models constructed using formulas can be computed using either `exog`, which will treat these are arrays of values corresponding to the formula-processed data, or using `data` which will be processed using the formula used to construct the values corresponding to the original model specification.
def predict( self, params: ArrayLike, *, exog: PanelDataLike | None = None, data: PanelDataLike | None = None, eval_env: int = 1, context: Mapping[str, Any] | None = None, ) -> DataFrame: """ Predict values for additional data Parameters ---------- params : array_like Model parameters (nvar by 1) exog : array_like Exogenous regressors (nobs by nvar) data : DataFrame Values to use when making predictions from a model constructed from a formula context : int Depth of use when evaluating formulas. Returns ------- DataFrame Fitted values from supplied data and parameters Notes ----- If `data` is not None, then `exog` must be None. Predictions from models constructed using formulas can be computed using either `exog`, which will treat these are arrays of values corresponding to the formula-processed data, or using `data` which will be processed using the formula used to construct the values corresponding to the original model specification. """ if data is not None and self.formula is None: raise ValueError( "Unable to use data when the model was not " "created using a formula." ) if data is not None and exog is not None: raise ValueError( "Predictions can only be constructed using one " "of exog or data, but not both." ) if exog is not None: exog = PanelData(exog).dataframe else: assert self._formula is not None assert data is not None if context is None: context = capture_context(eval_env) parser = PanelFormulaParser(self._formula, data, context=context) exog = parser.exog x = exog.values params = np.atleast_2d(np.asarray(params)) if params.shape[0] == 1: params = params.T if x.shape[1] != params.shape[0]: raise ValueError( EXOG_PREDICT_MSG.format( x_shape=x.shape[1], params_shape=params.shape[0] ) ) pred = DataFrame(x @ params, index=exog.index, columns=["predictions"]) return pred
(self, params: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, exog: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, data: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, eval_env: int = 1, context: Optional[collections.abc.Mapping[str, Any]] = None) -> pandas.core.frame.DataFrame
[ 0.0779208317399025, -0.053939443081617355, -0.00805449578911066, -0.01380237191915512, 0.029509807005524635, -0.009609363973140717, -0.027884898707270622, -0.0779208317399025, 0.008740879595279694, 0.027567388489842415, 0.050316087901592255, -0.011906646192073822, 0.01968565583229065, 0.027530035004019737, 0.0071673342026770115, -0.0006869668141007423, 0.026558825746178627, -0.008287959732115269, 0.01571677438914776, -0.005126861855387688, 0.0053649949841201305, -0.05248263105750084, -0.04116431251168251, -0.011887969449162483, 0.008241266943514347, -0.01283116266131401, -0.010244385339319706, 0.0019237406086176634, -0.003980555571615696, 0.024336252361536026, 0.008404691703617573, -0.07672549784183502, -0.04269583523273468, 0.001797670149244368, 0.018742462620139122, -0.04295731335878372, -0.04930752515792847, 0.019087988883256912, -0.012933886609971523, -0.016202377155423164, -0.021254532039165497, -0.05860871821641922, 0.03139619156718254, 0.011075516231358051, -0.07373715937137604, -0.01996581256389618, -0.01910666562616825, -0.013204704970121384, 0.02762342058122158, -0.05401415377855301, -0.007279396988451481, 0.009464616887271404, 0.004856043960899115, -0.011421042494475842, -0.008796910755336285, 0.06604219973087311, 0.014063850976526737, 0.05121259018778801, 0.044302064925432205, -0.07358774542808533, 0.04818689823150635, -0.02330901101231575, -0.011514428071677685, 0.014951013028621674, 0.006522974465042353, 0.045123856514692307, -0.007895740680396557, -0.03810127079486847, -0.0317884124815464, -0.040977541357278824, -0.050316087901592255, -0.037036675959825516, -0.01452143955975771, -0.0068591623567044735, -0.0200965516269207, 0.020731572061777115, 0.027305910363793373, -0.03309580683708191, 0.011607812717556953, 0.02512069046497345, -0.06593013554811478, -0.01248563639819622, -0.0619332380592823, 0.002046308945864439, -0.025923805311322212, -0.032442111521959305, -0.04489973187446594, 0.01910666562616825, 0.031489577144384384, 0.021814843639731407, 0.016052961349487305, 0.01703350804746151, 0.00831130612641573, 0.01764051429927349, 0.060513779520988464, -0.036793872714042664, 0.0045875608921051025, 0.05203438177704811, 0.02011522836983204, 0.02695104479789734, 0.00635488098487258, 0.05804840475320816, -0.04377910494804382, 0.025867773219943047, -0.018723785877227783, -0.027660774067044258, -0.024877887219190598, 0.032442111521959305, 0.01180392224341631, -0.053080298006534576, -0.07254182547330856, 0.03600943461060524, -0.029341712594032288, -0.04202345758676529, -0.005182893015444279, 0.04758923128247261, -0.03993162512779236, 0.04680479317903519, -0.07694961875677109, -0.003340865019708872, -0.0014159571146592498, 0.08232862502336502, -0.052109088748693466, 0.005033476278185844, 0.01458680909126997, -0.015315216034650803, 0.041948750615119934, -0.0006052545504644513, -0.029416421428322792, -0.1118384301662445, 0.010253723710775375, -0.011747891083359718, -0.002827244810760021, 0.0018396936357021332, -0.003686391282826662, 0.04056664556264877, 0.05274410918354988, 0.013494199141860008, -0.024616409093141556, -0.020824957638978958, 0.04531062766909599, 0.010888745076954365, -0.015119106508791447, 0.029341712594032288, -0.0052062394097447395, -0.02805299311876297, 0.042919959872961044, 0.02220706269145012, 0.018471645191311836, 0.05472388118505478, 0.024205511435866356, 0.010580573230981827, -0.0015712104504927993, -0.0739612877368927, 0.02527010627090931, -0.012644391506910324, 0.011626490391790867, -0.0045875608921051025, 0.02622263878583908, -0.005220247432589531, -0.010589911602437496, -0.020899666473269463, 0.0008107025641947985, 0.0364016555249691, 0.007540876045823097, 0.0635768249630928, -0.026054544374346733, -0.007727647200226784, 0.05091375485062599, -0.015343232080340385, 0.045123856514692307, -0.013260736130177975, 0.04288260638713837, -0.03221798315644264, -0.056890424340963364, 0.058123111724853516, 0.02175881341099739, -0.013270074501633644, -0.013326105661690235, 0.022823408246040344, 0.014213267713785172, -0.00025199484662152827, -0.08838000148534775, -0.03501955047249794, -0.025494230911135674, -0.015875529497861862, -0.020059198141098022, 0.019610946998000145, -0.035803988575935364, 0.036793872714042664, -0.04288260638713837, -0.04852308705449104, 0.03408569470047951, 0.0053089638240635395, -0.01005761418491602, -0.022692667320370674, 0.03582266345620155, 0.014764241874217987, 0.02835182659327984, 0.03896041586995125, -0.002442029770463705, -0.02848256565630436, 0.03741021826863289, 0.0025774387177079916, -0.06566865742206573, 0.009417924098670483, -0.0048420364037156105, -0.03896041586995125, -0.02192690782248974, -0.08569049835205078, 0.015483309514820576, -0.02108643762767315, -0.0019424177007749677, 0.02902420237660408, 0.05692777782678604, 0.06854493170976639, 0.0068031311966478825, -0.015772804617881775, 0.02385064773261547, -0.01242960523813963, -0.021572042256593704, -0.06570601463317871, -0.011579797603189945, 0.0667145773768425, 0.09248896688222885, -0.07022587209939957, 0.04811219125986099, 0.004031917545944452, 0.0485977940261364, -0.012877855449914932, -0.017108216881752014, 0.002736194059252739, 0.014465408399701118, -0.08419633656740189, 0.08442045748233795, 0.028818754479289055, -0.02749267965555191, -0.0034132387954741716, 0.004814020823687315, 0.07101030647754669, 0.021740136668086052, 0.026745596900582314, 0.0002697964373510331, 0.003870827378705144, 0.025905128568410873, -0.026540149003267288, 0.0446382500231266, 0.04534798115491867, -0.017070863395929337, -0.08658700436353683, 0.05614333972334862, 0.05195967108011246, 0.011523766443133354, 0.047925420105457306, 0.0006192623404785991, 0.035224996507167816, 0.09121891856193542, 0.022711344063282013, 0.04172462597489357, -0.03389892354607582, -0.01966697908937931, -0.0057151904329657555, -0.024765824899077415, -0.006228810641914606, -0.002182885305956006, -0.012018709443509579, -0.013512876816093922, -0.03268491104245186, 0.0477760024368763, 0.026745596900582314, -0.04336820915341377, 0.096523217856884, 0.01136501133441925, -0.01527786161750555, 0.026932368054986, 0.054088860750198364, 0.028109025210142136, -0.08113329112529755, 0.022113677114248276, -0.013288751244544983, -0.00027738400967791677, -0.06876905262470245, -0.004281723406165838, -0.014334668405354023, 0.0014824942918494344, -0.011701198294758797, 0.017995378002524376, 0.013680970296263695, 0.09928742796182632, -0.008848272264003754, -0.004732308443635702, 0.08105858415365219, 0.02779151313006878, 0.03587869554758072, -0.05315500497817993, -0.002416348783299327, 0.025027304887771606, 0.006088732276111841, 0.0026941706892102957, 0.013774355873465538, 0.02805299311876297, 0.015371247194707394, 0.04064135253429413, -0.010870068334043026, -0.054200924932956696, -0.027175169438123703, 0.07851849496364594, -0.013550231233239174, -0.008161889389157295, -0.05371531844139099, 0.027716806158423424, 0.09443137794733047, -0.017005493864417076, 0.011906646192073822, -0.0555083192884922, -0.08158154040575027, 0.04325614869594574, -0.02119849994778633, 0.06790991127490997, -0.0069151935167610645, 0.02904287911951542, 0.016146346926689148, 0.047103628516197205, -0.06032700836658478, 0.03707402944564819, 0.04377910494804382, 0.04441412538290024, -0.011280964128673077, 0.05162348598241806, -0.013512876816093922, -0.011477073654532433, -0.040940187871456146, 0.04762658476829529, 0.02738061733543873, -0.0062381490133702755, -0.049867838621139526, -0.010468510910868645, 0.02216970920562744, 0.03888570889830589, 0.06607955694198608, -0.02385064773261547, -0.04314408451318741, -0.029752608388662338, -0.02076892741024494, 0.006345542147755623, -0.04729039967060089, 0.02928568236529827, 0.04493708536028862, 0.006756438408046961, 0.03414172679185867, -0.04912075400352478, 0.026073221117258072, 0.026484116911888123, -0.03782111406326294, -0.012466959655284882, -0.0195175614207983, -0.01849966123700142, 0.05091375485062599, 0.010636604391038418, -0.024896563962101936, 0.005117523483932018, -0.010982130654156208, -0.028295796364545822, 0.02078760415315628, -0.018798494711518288, -0.027828868478536606, -0.0058319224044680595, 0.03948337584733963, 0.02943509817123413, -0.00760157685726881, 0.01284983940422535, -0.013101981021463871, 0.01067395880818367, 0.030051441863179207, 0.008736209943890572, 0.03303977847099304, -0.006672391202300787, -0.07672549784183502, 0.03981956094503403, -0.039968978613615036, -0.015940899029374123, -0.04168727248907089, -0.0145774707198143, -0.03186311945319176, 0.03866158053278923, 0.013905095867812634, 0.044302064925432205, 0.01150508876889944, 0.038288041949272156, -0.0390351228415966, -0.017005493864417076, -0.03737286105751991, -0.020750250667333603, 0.037596989423036575, -0.04519856348633766, -0.015128444880247116, -0.00998290628194809, 0.012392250820994377, -0.09196600317955017, -0.0008410528535023332, -0.060775261372327805, 0.01424128282815218, 0.050577566027641296, -0.028986848890781403, -0.01798604056239128, -0.017407050356268883, -0.015922222286462784, -0.008068503811955452, -0.025774387642741203, 0.013615600764751434, -0.019069312140345573, 0.0195175614207983, 0.009170452132821083, 0.00010994679178111255, -0.010132323019206524, 0.04699156433343887, -0.004106625914573669, 0.012336219660937786, 0.04441412538290024, -0.01038446370512247, 0.042471710592508316, -0.011831938289105892, -0.02274869941174984, 0.04030516743659973, -0.006070055067539215, 0.06761107593774796, -0.04729039967060089, -0.022300448268651962, -0.016529226675629616, 0.0071113030426204205, -0.062157366424798965, -0.07579164206981659, -0.0474398173391819, 0.024504344910383224, 0.005878614727407694, -0.029827317222952843, -0.007993795908987522, 0.012999256141483784, -0.042770542204380035, 0.03404834121465683, -0.018705109134316444, -0.00866617076098919, 0.050577566027641296, 0.02680162899196148, -0.059393156319856644, -0.006793792359530926, 0.02999541163444519, -0.008530762046575546, -0.08135741949081421, -0.056330110877752304, 0.08838000148534775, 0.05670365318655968, 0.062157366424798965, 0.030649108812212944, -0.02441095933318138, -0.04658066853880882, -0.023196948692202568, -0.057301320135593414, 0.025475554168224335, 0.040678709745407104, -0.008470061235129833, -0.028165055438876152, 0.000196109467651695, -0.03303977847099304, -0.04437677189707756, 0.05356590077280998, 0.0466180220246315, -0.04359233379364014, -0.008498077280819416, -0.0011521431151777506, 0.004727639257907867, -0.01562338788062334, 0.010720651596784592, -0.018172811716794968, -0.044600896537303925, 0.06944143027067184, 0.010795359499752522, -0.02498994953930378, 0.05733867362141609, -0.022263094782829285, -0.005430364515632391, -0.009908197447657585, 0.021329239010810852, 0.03556118533015251, -0.00044037081534042954, 0.019723009318113327, 0.00795644149184227, -0.012112095020711422, 0.006686399225145578, 0.02971525490283966, 0.00904438178986311, 0.02428022027015686, 0.02859462983906269, 0.0635768249630928, -0.03487013280391693, 0.006821807939559221, 0.06152234226465225, 0.001873545814305544, 0.019461531192064285, -0.07687491178512573, 0.03432849794626236, -0.01567941904067993, 0.010281739756464958, -0.03767169639468193, -0.015987591817975044, -0.06888111680746078, -0.00837667565792799, 0.047962773591279984, -0.05102581903338432, 0.0069712246768176556, -0.06936672329902649, -0.006382896564900875, 0.032442111521959305, 0.023831970989704132, 0.013970465399324894, 0.011663844808936119, 0.04964371398091316, 0.022991500794887543, -0.026596179232001305, 0.007358774542808533, 0.05446240305900574, -0.0036256907042115927, 0.03974485397338867, -0.028818754479289055, -0.006107409484684467, 0.03584134206175804, 0.0002155161346308887, 0.02076892741024494, 0.007059941068291664, 0.03643900901079178, -0.036775194108486176, -0.05640482157468796, 0.013718324713408947, 0.04800012707710266, -0.01994713582098484, -0.019050635397434235, 0.020171260461211205, -0.016650628298521042, -0.0000954282731981948, 0.027044430375099182, -0.013568907976150513, -0.046692732721567154, 0.0015443620504811406, -0.020563479512929916, 0.022300448268651962, -0.04968106746673584, 0.04008104279637337, 0.03572927787899971, -0.011972016654908657, -0.029210973531007767, -0.028968170285224915, -0.04295731335878372, 0.05195967108011246, 0.08061033487319946, 0.021721458062529564, 0.006625698879361153, 0.03832539543509483, 0.05726396664977074, -0.027810191735625267, -0.03070514090359211, -0.004305069800466299, -0.05173554643988609, 0.058384593576192856, -0.028669336810708046, 0.017761915922164917, 0.019760364666581154, -0.022655313834547997, 0.018462305888533592, -0.067872554063797, -0.04008104279637337, -0.016594596207141876, 0.037746403366327286, 0.01979771815240383, -0.004888729192316532, 0.010356447659432888, 0.015184476040303707, 0.0159782525151968, -0.025718357414007187, -0.00712064141407609, 0.02314091846346855, -0.03346934914588928, -0.019087988883256912, -0.06581807136535645, -0.02164675109088421, 0.005379002541303635, 0.016893429681658745, -0.010449833236634731, 0.061335571110248566, -0.007741654757410288, -0.02596115879714489, -0.01595957577228546, 0.05039079487323761, 0.00432841619476676, 0.017089540138840675, 0.0372234471142292, 0.00676577677950263, -0.062157366424798965, -0.02345842868089676, 0.02498994953930378, -0.025288783013820648, -0.04310673102736473, 0.013503538444638252, 0.03251681849360466, -0.03832539543509483, 0.0053743333555758, -0.07358774542808533, -0.04224758222699165, 0.07216828316450119, 0.01387707982212305, -0.06469745188951492, 0.03305845335125923, 0.006424919702112675, -0.04224758222699165, -0.0046295844949781895, -0.023327689617872238, 0.025737034156918526, -0.04814954474568367, 0.05767486244440079, -0.008124534972012043, 0.015968915075063705, 0.041911397129297256, -0.023551814258098602, -0.015259184874594212, 0.04366704449057579, -0.04172462597489357, -0.003464600769802928, 0.05259469151496887, -0.06929201632738113, -0.02179616689682007, -0.03888570889830589, 0.010711312294006348, 0.05472388118505478, 0.03163899481296539, -0.004963437560945749, 0.06256826221942902, -0.002736194059252739, 0.047514524310827255, 0.01312065776437521, -0.00013774355466011912, -0.04882191866636276, -0.03165767341852188, -0.025214076042175293, -0.0034272465854883194, 0.004001567140221596, 0.022561928257346153, 0.045684169977903366, -0.020974375307559967, -0.007428813725709915, 0.056666299700737, -0.000057198598369723186, 0.04411529377102852, -0.06451068073511124, -0.009796135127544403, 0.017687207087874413, 0.06238149106502533, 0.05345384031534195, 0.014689533039927483, 0.009730765596032143, 0.005603127647191286, 0.027193846181035042, -0.017780592665076256, -0.021105114370584488, 0.02956583723425865, 0.008073173463344574, 0.03430981934070587, 0.03630826994776726, -0.03154560923576355, -0.01752845197916031, 0.018443629145622253, 0.01031909417361021, -0.029229650273919106, -0.00897901225835085, -0.04575887694954872, 0.02900552563369274, 0.04814954474568367, -0.06712546944618225, -0.009543994441628456, 0.0025284113362431526, -0.01733234152197838, -0.006504297722131014, 0.02162807434797287, 0.029752608388662338, 0.0626056119799614, -0.0518849641084671, 0.02986467070877552, -0.0899488776922226, 0.03533706068992615, 0.0028225756250321865, 0.00147432298399508, -0.03098529763519764, -0.022001614794135094, -0.016052961349487305, 0.021553365513682365, -0.05035344138741493, -0.021105114370584488, -0.0971955880522728, -0.033151838928461075, -0.03602811321616173, -0.022020291537046432, 0.02551290951669216, -0.057413384318351746, 0.024336252361536026, 0.009721427224576473, 0.019013280048966408, 0.03266623616218567, 0.04803748428821564, -0.030649108812212944, 0.013970465399324894, -0.017201602458953857, -0.11034426093101501, -0.033973630517721176, 0.004202345851808786, 0.05528419464826584, -0.023346366360783577, 0.06402507424354553, 0.010515202768146992, -0.0010704308515414596, 0.03642033040523529, -0.07582899928092957, 0.03825068473815918, 0.020880989730358124, 0.01688409224152565, 0.04564681649208069, -0.018238181248307228, -0.014381361193954945, -0.020862312987446785, -0.019610946998000145, -0.05476123467087746, 0.076426662504673, -0.005668497644364834, 0.006126086227595806, 0.024317575618624687, 0.012401589192450047, -0.02248721942305565, -0.02956583723425865, -0.05382738262414932, -0.030929265543818474, -0.06854493170976639, -0.019442854449152946, -0.005696513224393129, -0.0030770511366426945, 0.008965004235506058, -0.015455294400453568, -0.05278146266937256, 0.015950236469507217, 0.03531838208436966, 0.0020836631301790476, -0.04433941841125488, 0.04426471143960953, -0.023626523092389107, 0.024186834692955017, -0.02188955247402191, 0.044152647256851196, 0.004893398378044367, 0.047962773591279984, 0.04785071313381195, 0.02357049100100994, -0.0008328816038556397, -0.010487187653779984, -0.010496526025235653, -0.03795185312628746, 0.0055611045099794865, -0.01220547966659069, -0.003824134822934866, -0.03109735995531082, -0.03029424510896206, 0.03582266345620155, 0.008792241103947163 ]
42,835
linearmodels.panel.model
reformat_clusters
Reformat cluster variables Parameters ---------- clusters : array_like Values to use for variance clustering Returns ------- PanelData Original data with matching axis and observation dropped where missing in the model data. Notes ----- This is exposed for testing and is not normally needed for estimation
def reformat_clusters(self, clusters: IntArray | PanelDataLike) -> PanelData: """ Reformat cluster variables Parameters ---------- clusters : array_like Values to use for variance clustering Returns ------- PanelData Original data with matching axis and observation dropped where missing in the model data. Notes ----- This is exposed for testing and is not normally needed for estimation """ clusters_pd = PanelData(clusters, var_name="cov.cluster", convert_dummies=False) if clusters_pd.shape[1:] != self._original_shape[1:]: raise ValueError( "clusters must have the same number of entities " "and time periods as the model data." ) clusters_pd.drop(~self.not_null) return clusters_pd.copy()
(self, clusters: Union[numpy.ndarray, linearmodels.panel.data.PanelData, pandas.core.frame.DataFrame, pandas.core.series.Series]) -> linearmodels.panel.data.PanelData
[ -0.007820669561624527, 0.017116937786340714, 0.019084401428699493, -0.008504810743033886, -0.016732387244701385, -0.0019473423017188907, 0.022339660674333572, 0.03332168608903885, 0.025577032938599586, 0.06914741545915604, -0.0352533794939518, -0.022053483873605728, -0.02677539736032486, -0.05623370036482811, 0.04149560630321503, 0.03108593262732029, -0.04564516618847847, -0.01951366662979126, 0.04968741163611412, -0.04682564362883568, -0.019638868048787117, -0.027669697999954224, -0.01928114704787731, -0.033446889370679855, 0.04314111918210983, -0.061814144253730774, 0.016088489443063736, -0.0007707764161750674, 0.021534787490963936, 0.0007601565448567271, -0.04682564362883568, 0.008759686723351479, -0.04950854927301407, 0.07183032482862473, -0.014818581752479076, -0.05541094020009041, 0.009783661924302578, -0.01679498888552189, 0.06904010474681854, 0.025505488738417625, 0.020855119451880455, -0.013834848999977112, -0.01255599781870842, -0.0017338276375085115, 0.032194867730140686, 0.018690908327698708, 0.05151178687810898, 0.024003060534596443, -0.05533939599990845, -0.019764071330428123, -0.015712883323431015, -0.030960729345679283, 0.030567236244678497, 0.04031512513756752, 0.0028282294515520334, -0.006769864819943905, 0.06946936994791031, 0.038633838295936584, -0.02484370581805706, -0.03716718405485153, -0.0009703175164759159, 0.004218868911266327, -0.031211134046316147, 0.035789959132671356, -0.03959968686103821, -0.012940547429025173, 0.007310917600989342, 0.02148113027215004, 0.006242226809263229, -0.0030026184394955635, -0.018780339509248734, 0.019406350329518318, 0.038705382496118546, 0.005736946128308773, 0.05405160412192345, -0.0022111611906439066, 0.019996589049696922, -0.012681200169026852, -0.01852993480861187, 0.016732387244701385, -0.04553784802556038, -0.025809550657868385, -0.014693379402160645, 0.019334806129336357, 0.04965163767337799, -0.03917042165994644, -0.004909717012196779, 0.021499015390872955, 0.007619451731443405, -0.021677875891327858, 0.028349367901682854, 0.008469038642942905, 0.012681200169026852, -0.028724975883960724, 0.006644662469625473, 0.01928114704787731, 0.025773778557777405, -0.03453793749213219, 0.0303347185254097, -0.032427385449409485, 0.09293584525585175, 0.014094197191298008, 0.010508046485483646, 0.0063271853141486645, -0.024289237335324287, -0.005079634487628937, 0.005365810822695494, -0.002644897671416402, -0.03362574800848961, 0.05430200695991516, -0.009050334803760052, 0.05533939599990845, 0.03342900425195694, 0.0332680270075798, -0.012332422658801079, -0.04242568090558052, -0.009273909963667393, 0.022357545793056488, -0.05544671416282654, -0.0009261613595299423, -0.050474394112825394, 0.046646784991025925, -0.004753214307129383, 0.015793370082974434, -0.05752149596810341, 0.017403114587068558, -0.021069752052426338, 0.025022566318511963, -0.016213692724704742, -0.019495779648423195, -0.039420824497938156, -0.07097179442644119, -0.05873774364590645, -0.03892001509666443, 0.018655136227607727, -0.026721738278865814, 0.021194953471422195, -0.007060512900352478, 0.03952814266085625, -0.00399082200601697, 0.021194953471422195, 0.09150496125221252, -0.0014353544684126973, 0.011169830337166786, -0.05086788907647133, 0.03650540113449097, 0.06614256650209427, -0.03723872825503349, -0.09851629287004471, -0.04839961603283882, 0.015703940764069557, -0.046539466828107834, 0.008048716932535172, -0.04764840006828308, 0.006497102789580822, 0.02423558011651039, -0.025201424956321716, -0.06814579665660858, -0.012618598528206348, -0.039993178099393845, -0.05426623672246933, -0.02239331789314747, 0.041316743940114975, 0.02986968122422695, -0.023251848295331, 0.01852993480861187, 0.03756067901849747, -0.05068902671337128, -0.03831189125776291, 0.0029400172643363476, -0.04353461414575577, 0.0887862890958786, -0.03611190989613533, 0.0009015680407173932, -0.00620198342949152, 0.01535516232252121, -0.0019395170966163278, -0.11683159321546555, 0.012582826428115368, 0.012475511059165001, -0.06578484177589417, -0.0401720367372036, 0.021946167573332787, 0.006904010195285082, -0.0031345279421657324, -0.0339655838906765, 0.009989351965487003, 0.01625840738415718, -0.02874286100268364, -0.02945830300450325, -0.018816109746694565, 0.03389403969049454, -0.015051099471747875, 0.1003764346241951, 0.014755980111658573, -0.040672846138477325, -0.014764923602342606, -0.019406350329518318, -0.017796605825424194, -0.024557529017329216, -0.02287624031305313, 0.046002887189388275, 0.005361339543014765, -0.009247081354260445, -0.012359251268208027, 0.013137293979525566, -0.007699938956648111, -0.027097346261143684, -0.003662165952846408, -0.0059828790836036205, 0.03952814266085625, 0.035986706614494324, 0.08342047780752182, 0.008589768782258034, 0.02806319110095501, -0.025702234357595444, 0.025738006457686424, 0.006054423283785582, 0.019495779648423195, 0.0401720367372036, -0.04811343923211098, -0.004348542541265488, -0.015927515923976898, 0.06027594208717346, -0.09279275685548782, -0.016464097425341606, 0.040780164301395416, -0.003639808390289545, -0.0020244757179170847, -0.01742994226515293, 0.025648577138781548, -0.05558980256319046, -0.07640914618968964, -0.044106967747211456, 0.040064722299575806, 0.01352184358984232, 0.022947784513235092, 0.013360869139432907, 0.00010291457874700427, 0.02867131680250168, -0.049329690635204315, -0.04417851194739342, 0.024271352216601372, 0.02450386993587017, 0.04242568090558052, 0.013897450640797615, 0.013790134340524673, 0.01427305769175291, -0.026381904259324074, 0.06678646057844162, 0.026632308959960938, -0.027204662561416626, 0.01735839806497097, 0.04446468874812126, 0.03523549064993858, -0.03423387557268143, -0.030316831544041634, 0.027937989681959152, 0.03210543468594551, -0.018216928467154503, -0.09157650917768478, -0.03206966444849968, -0.006966611370444298, 0.025326628237962723, 0.04364192858338356, -0.0339655838906765, -0.023502252995967865, 0.04958009347319603, 0.07286771386861801, -0.02318030409514904, -0.0305135790258646, 0.07576525211334229, 0.018440503627061844, 0.02284046821296215, -0.010821051895618439, 0.015453536063432693, 0.002685141284018755, -0.08943018317222595, 0.024020947515964508, 0.06768076121807098, 0.026721738278865814, 0.009247081354260445, -0.02874286100268364, -0.030889185145497322, 0.047290682792663574, -0.01168852485716343, -0.040744390338659286, -0.08020098507404327, -0.02412826381623745, 0.028295710682868958, -0.02715100347995758, -0.0422825925052166, 0.007954814471304417, -0.030388375744223595, -0.07404819130897522, 0.027365636080503464, -0.04557362198829651, 0.03260624408721924, -0.017492543905973434, 0.02276892401278019, -0.03705986961722374, -0.06510517746210098, 0.049258146435022354, -0.0071588861756026745, 0.06077675148844719, -0.025004679337143898, -0.0034184688702225685, -0.04342729598283768, 0.06070520728826523, 0.07733922451734543, 0.013852735050022602, 0.002714205998927355, -0.011402348056435585, -0.02704368717968464, -0.025684349238872528, 0.004469273611903191, 0.08299121260643005, -0.05079634487628937, 0.05051016807556152, 0.053264617919921875, -0.0017248846124857664, -0.10688695311546326, -0.013137293979525566, 0.04771994426846504, 0.02700791507959366, 0.051869507879018784, 0.022286001592874527, -0.02250063419342041, 0.009899921715259552, -0.01883399672806263, -0.0469687320291996, -0.029744479805231094, -0.0010429795365780592, -0.005115406587719917, -0.03618345409631729, -0.07369047403335571, 0.018440503627061844, -0.0448581799864769, 0.04721913859248161, 0.01876245252788067, -0.008777572773396969, -0.035754188895225525, -0.05229877308011055, -0.03949236869812012, 0.005379225593060255, 0.04947277903556824, -0.0034765983000397682, 0.028939606621861458, -0.0810595154762268, 0.07383356243371964, 0.02344859391450882, -0.0008188451174646616, 0.012225106358528137, 0.07805466651916504, 0.03063878044486046, -0.00043094169814139605, 0.10066261142492294, -0.01075845118612051, 0.007789369206875563, -0.06764499098062515, 0.030459919944405556, -0.01776977814733982, 0.07454900443553925, 0.017608802765607834, -0.020998207852244377, -0.006148325279355049, -0.019406350329518318, -0.05029553547501564, 0.07891319692134857, -0.0405297577381134, 0.0058934492990374565, 0.01531939022243023, 0.036398082971572876, -0.033339571207761765, 0.001605271827429533, -0.0200860183686018, -0.0375964492559433, -0.04031512513756752, 0.03856229409575462, -0.014791752211749554, -0.0202648788690567, -0.049937814474105835, -0.023770542815327644, 0.00897879060357809, 0.011992587707936764, 0.04707605019211769, 0.017716119065880775, -0.07419127970933914, 0.007467420306056738, 0.0035123704001307487, 0.007677581161260605, 0.013226724229753017, 0.04757685959339142, -0.01599906012415886, -0.009327568113803864, 0.05176218971610069, -0.035682644695043564, -0.051261380314826965, -0.004806872457265854, -0.00026675345725379884, 0.0037985469680279493, -0.047791488468647, 0.011214544996619225, 0.034394849091768265, -0.04836384207010269, -0.020211221650242805, 0.03301762416958809, -0.011456006206572056, -0.018145384266972542, 0.046002887189388275, 0.022625835612416267, 0.0699344053864479, 0.04453623294830322, -0.0589166060090065, 0.07447745651006699, -0.0014062896370887756, -0.05866619944572449, -0.02945830300450325, 0.03716718405485153, -0.011223488487303257, -0.024718502536416054, -0.046575240790843964, 0.027133118361234665, -0.004775571636855602, 0.02854611538350582, -0.01683076098561287, -0.03260624408721924, -0.009953579865396023, 0.017385227605700493, 0.026793282479047775, 0.0062958849593997, 0.0002329376875422895, -0.023001443594694138, -0.01988927274942398, 0.03187291696667671, 0.005093048792332411, -0.026453448459506035, 0.07247421890497208, -0.04875733703374863, 0.05619792640209198, 0.012153562158346176, 0.002895302139222622, 0.03648751601576805, -0.009569029323756695, -0.011089342646300793, 0.014890125952661037, -0.04507281258702278, -0.008947489783167839, -0.08342047780752182, -0.015364105813205242, 0.023269733414053917, -0.006904010195285082, -0.044679321348667145, -0.04950854927301407, 0.04045821353793144, 0.030388375744223595, 0.011026741936802864, 0.014282000251114368, 0.04432160034775734, 0.01671450212597847, -0.027705470100045204, -0.01795758120715618, -0.04056553170084953, 0.05415891855955124, 0.03616556525230408, -0.018959198147058487, 0.013763305731117725, -0.06918319314718246, 0.03312493860721588, 0.01242185290902853, -0.0017573031364008784, -0.06292307376861572, 0.01981772854924202, 0.00527638103812933, -0.030316831544041634, 0.03491354361176491, -0.0004781720053870231, -0.019692527130246162, -0.06002553924918175, 0.07826929539442062, -0.05541094020009041, 0.012377137318253517, -0.009408054873347282, -0.004259112291038036, 0.0037985469680279493, 0.018744567409157753, -0.00006895905244164169, 0.0100430091843009, 0.02216080017387867, 0.003921513445675373, -0.01860147900879383, 0.015283618122339249, -0.0469687320291996, 0.05752149596810341, 0.021320154890418053, 0.01442508865147829, 0.013566559180617332, 0.03816880285739899, 0.029994884505867958, -0.014076311141252518, 0.01776977814733982, 0.018368959426879883, 0.0016030360711738467, -0.07304657250642776, 0.01637466624379158, -0.028993265703320503, 0.06227917969226837, 0.009063749574124813, 0.03441273421049118, 0.012681200169026852, -0.020014476031064987, -0.03330380097031593, 0.04625329002737999, 0.019120173528790474, -0.0000651862210361287, 0.012028359808027744, -0.08785621076822281, -0.00244367984123528, -0.0037225314881652594, 0.05952472984790802, 0.014568177051842213, -0.015712883323431015, -0.011339747346937656, 0.016437267884612083, -0.035181835293769836, 0.0030026184394955635, 0.00531215313822031, -0.01776977814733982, -0.02042585425078869, 0.00973894726485014, -0.046575240790843964, -0.06410355865955353, 0.021803079172968864, 0.03824034705758095, 0.01709905080497265, -0.02189250849187374, -0.03663060441613197, -0.0015393170760944486, -0.006658077239990234, -0.014755980111658573, -0.0037940754555165768, 0.0075166067108511925, 0.0008210808737203479, -0.015292561613023281, 0.01159015204757452, 0.00037169421557337046, 0.03389403969049454, -0.028796520084142685, -0.028492456302046776, 0.03187291696667671, -0.01754620112478733, 0.016955962404608727, 0.008598712272942066, 0.005093048792332411, 0.057271089404821396, 0.03877692669630051, -0.050009358674287796, -0.04714759439229965, 0.0392419658601284, 0.030084313824772835, 0.016088489443063736, -0.03414444252848625, 0.1233421117067337, -0.02216080017387867, -0.004923131782561541, -0.011822670698165894, -0.0202648788690567, 0.0006047716015018523, -0.07433436810970306, -0.009882035665214062, 0.02046162635087967, 0.0039818789809942245, 0.0028282294515520334, 0.05279957875609398, -0.02117706835269928, 0.026346132159233093, 0.017492543905973434, 0.010221869684755802, 0.013038921169936657, 0.003029447514563799, -0.07057829946279526, -0.0015572031261399388, 0.009175537154078484, -0.03781108185648918, -0.007069455925375223, 0.036666374653577805, -0.018163269385695457, -0.009855206124484539, 0.04832807183265686, 0.03550378233194351, 0.011241374537348747, 0.0007635101792402565, -0.028957493603229523, 0.03305339440703392, -0.005678816698491573, -0.029994884505867958, 0.03203389048576355, 0.03949236869812012, -0.010051952674984932, -0.022590063512325287, -0.008008472621440887, -0.00904139131307602, 0.024682730436325073, 0.0534077063202858, 0.06091983988881111, -0.029297327622771263, -0.009291796013712883, 0.04306957498192787, 0.010186097584664822, -0.006474745459854603, -0.010311299934983253, 0.05498167872428894, -0.022286001592874527, -0.006658077239990234, 0.05355079472064972, 0.012636484578251839, -0.008822287432849407, -0.07340429723262787, -0.04149560630321503, -0.02620304375886917, 0.05072480067610741, -0.012314536608755589, -0.022107141092419624, 0.020443739369511604, -0.048614248633384705, -0.02647133357822895, -0.013003149069845676, -0.0029713178519159555, -0.03299973905086517, -0.0602043978869915, -0.023806314915418625, -0.011867385357618332, -0.02208925597369671, 0.012234048917889595, -0.018923426046967506, 0.006023122929036617, 0.017868150025606155, -0.006452387664467096, 0.04149560630321503, -0.021499015390872955, 0.07376201450824738, -0.05344347655773163, 0.02242908999323845, 0.039349280297756195, -0.06134910508990288, -0.104239821434021, 0.07533598691225052, -0.023037215694785118, 0.013852735050022602, 0.023323392495512962, -0.013968994840979576, -0.02722254768013954, -0.03573630005121231, -0.015891743823885918, 0.025577032938599586, -0.005714588798582554, 0.02722254768013954, 0.057879213243722916, 0.00797717273235321, -0.08134569227695465, -0.01454134751111269, 0.04543053358793259, -0.019030742347240448, -0.0005240049795247614, 0.10302357375621796, 0.05827270820736885, 0.061814144253730774, 0.05444509536027908, 0.03264201804995537, 0.01614214852452278, -0.011965758167207241, 0.003695702413097024, -0.03995740786194801, -0.008455623872578144, -0.0003373194776941091, -0.06260112673044205, -0.030531464144587517, 0.014344601891934872, -0.041388288140296936, -0.0004468714469112456, -0.005249551963061094, 0.026596536859869957, -0.01094625424593687, -0.014398260042071342, -0.002387785818427801, -0.04167446494102478, 0.014317772351205349, -0.046646784991025925, -0.01928114704787731, -0.018708795309066772, -0.0004689495253842324, 0.053908515721559525, 0.004417851101607084, -0.011411291547119617, -0.04814920946955681, 0.01913805864751339, -0.001480069593526423, -0.019710412248969078, -0.013155180029571056, 0.08342047780752182, 0.013512901030480862, -0.007914571091532707, -0.07383356243371964, 0.03586150333285332, -0.0063271853141486645, 0.025648577138781548, 0.002707498846575618, -0.02867131680250168, -0.05093943327665329, -0.0071588861756026745, 0.0038700911682099104, 0.06521248817443848, 0.05219145491719246, 0.016625070944428444, -0.027240434661507607, 0.002975789364427328, -0.03913464769721031, -0.026149386540055275, 0.015605567023158073, 0.0202648788690567, 0.043212663382291794, 0.04160292074084282, 0.011312917806208134, 0.05684182420372963, -0.021767307072877884, -0.05630524456501007, -0.005012561567127705, 0.039993178099393845, 0.05111829191446304, -0.04425005614757538, 0.04085170850157738, 0.06156373769044876, 0.010901539586484432, 0.03391192480921745, -0.014478746801614761, 0.03709563985466957, 0.011080400086939335, 0.008325950242578983, -0.05444509536027908, 0.017000677064061165, -0.04761262983083725, -0.0008289060206152499, -0.0268827136605978, 0.003349160309880972, -0.045323215425014496, -0.010069838725030422, 0.005911335349082947, 0.05541094020009041, 0.03346477448940277, -0.04414273798465729, 0.010901539586484432, 0.0011480599641799927, -0.02749083936214447, 0.011089342646300793, 0.0061170244589447975, -0.05101097747683525, 0.013852735050022602, 0.0038790341932326555, 0.0803440734744072, -0.033142827451229095, -0.0021809786558151245, -0.016347836703062057, -0.002412379253655672, 0.03108593262732029, -0.008012944832444191, 0.008214162662625313, 0.03586150333285332, -0.018368959426879883 ]
42,836
linearmodels.panel.model
FamaMacBeth
Pooled coefficient estimator for panel data Parameters ---------- dependent : array_like Dependent (left-hand-side) variable (time by entity) exog : array_like Exogenous or right-hand-side variables (variable by time by entity). weights : array_like Weights to use in estimation. Assumes residual variance is proportional to inverse of weight to that the residual time the weight should be homoskedastic. Notes ----- The model is given by .. math:: y_{it}=\beta^{\prime}x_{it}+\epsilon_{it} The Fama-MacBeth estimator is computed by performing T regressions, one for each time period using all available entity observations. Denote the estimate of the model parameters as :math:`\hat{\beta}_t`. The reported estimator is then .. math:: \hat{\beta} = T^{-1}\sum_{t=1}^T \hat{\beta}_t While the model does not explicitly include time-effects, the implementation based on regressing all observation in a single time period is "as-if" time effects are included. Parameter inference is made using the set of T parameter estimates with either the standard covariance estimator or a kernel-based covariance, depending on ``cov_type``.
class FamaMacBeth(_PanelModelBase): r""" Pooled coefficient estimator for panel data Parameters ---------- dependent : array_like Dependent (left-hand-side) variable (time by entity) exog : array_like Exogenous or right-hand-side variables (variable by time by entity). weights : array_like Weights to use in estimation. Assumes residual variance is proportional to inverse of weight to that the residual time the weight should be homoskedastic. Notes ----- The model is given by .. math:: y_{it}=\beta^{\prime}x_{it}+\epsilon_{it} The Fama-MacBeth estimator is computed by performing T regressions, one for each time period using all available entity observations. Denote the estimate of the model parameters as :math:`\hat{\beta}_t`. The reported estimator is then .. math:: \hat{\beta} = T^{-1}\sum_{t=1}^T \hat{\beta}_t While the model does not explicitly include time-effects, the implementation based on regressing all observation in a single time period is "as-if" time effects are included. Parameter inference is made using the set of T parameter estimates with either the standard covariance estimator or a kernel-based covariance, depending on ``cov_type``. """ def __init__( self, dependent: PanelDataLike, exog: PanelDataLike, *, weights: PanelDataLike | None = None, check_rank: bool = True, ): super().__init__(dependent, exog, weights=weights, check_rank=check_rank) self._validate_blocks() def _validate_blocks(self) -> None: x = self._x root_w = np.sqrt(self._w) wx = root_w * x exog = self.exog.dataframe wx_df = DataFrame( wx[self._not_null], index=exog.notnull().index, columns=exog.columns ) def validate_block(ex: Float64Array | DataFrame) -> bool: _ex = np.asarray(ex, dtype=float) def _mr(ex: Float64Array) -> int: """lstsq based matrix_rank""" return _lstsq(ex, np.ones(ex.shape[0]))[2] return _ex.shape[0] >= _ex.shape[1] and _mr(_ex) == _ex.shape[1] valid_blocks = wx_df.groupby(level=1).apply(validate_block) if not valid_blocks.any(): err = ( "Model cannot be estimated. All blocks of time-series observations " "are rank deficient, and so it is not possible to estimate any" "cross-sectional regressions." ) raise ValueError(err) if valid_blocks.sum() < exog.shape[1]: import warnings warnings.warn( "The number of time-series observation available to estimate " "cross-sectional\nregressions, {}, is less than the number of " "parameters in the model. Parameter\ninference is not " "available.".format(valid_blocks.sum()), InferenceUnavailableWarning, stacklevel=3, ) elif valid_blocks.sum() < valid_blocks.shape[0]: import warnings warnings.warn( "{} of the time-series regressions cannot be estimated due to " "deficient rank.".format(valid_blocks.shape[0] - valid_blocks.sum()), MissingValueWarning, stacklevel=3, ) def fit( self, cov_type: str = "unadjusted", debiased: bool = True, bandwidth: float | None = None, kernel: str | None = None, ) -> FamaMacBethResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator (see notes). Default is "unadjusted". debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. bandwidth : float The bandwidth to use when cov_type is "kernel". If None, it is automatically computed. kernel : str The kernel to use. None chooses the default kernel. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import FamaMacBeth >>> mod = FamaMacBeth(y, x) >>> res = mod.fit(cov_type="kernel", kernel="Parzen") Notes ----- Two covariance estimators are supported: * "unadjusted", "homoskedastic", "robust", "heteroskedastic" use the standard covariance estimator of the T parameter estimates. * "kernel" is a HAC estimator. Configurations options are: """ y = cast(Float64Array, self._y) x = cast(Float64Array, self._x) root_w = cast(Float64Array, np.sqrt(self._w)) wy = cast(Float64Array, root_w * y) wx = cast(Float64Array, root_w * x) dep = self.dependent.dataframe exog = self.exog.dataframe index = self.dependent.index wy_df = DataFrame(wy[self._not_null], index=index, columns=dep.columns) wx_df = DataFrame( wx[self._not_null], index=exog.notnull().index, columns=exog.columns ) yx = DataFrame( np.c_[wy_df.values, wx_df.values], columns=list(wy_df.columns) + list(wx_df.columns), index=wy_df.index, ) has_constant = self.has_constant def single(z: DataFrame) -> Series: exog = z.iloc[:, 1:].values cols = list(z.columns) + ["r2", "adv_r2"] if exog.shape[0] < exog.shape[1]: return Series([np.nan] * (len(z.columns) + 2), index=cols) dep = z.iloc[:, :1].values params, _, rank, _ = _lstsq(exog, dep) nexog = exog.shape[1] if rank != nexog: return Series([np.nan] * (len(z.columns) + 2), index=cols) err = dep - exog @ params sse = float(np.squeeze(err.T @ err)) if has_constant: dep_demean = dep - dep.mean() tss = float(np.squeeze(dep_demean.T @ dep_demean)) else: tss = float(np.squeeze(dep.T @ dep)) r2 = 1 - sse / tss nobs = exog.shape[0] if nobs - nexog > 0: adj_r2 = 1 - (sse / (nobs - nexog)) / (tss / (nobs - int(has_constant))) else: adj_r2 = np.nan return Series(np.r_[np.nan, params.ravel(), r2, adj_r2], index=cols) all_params = yx.groupby(level=1).apply(single) avg_r2 = np.nanmean(all_params.iloc[:, -2]) avg_adj_r2_values = all_params.iloc[:, -1] if np.any(np.isfinite(avg_adj_r2_values)): avg_adj_r2 = np.nanmean(avg_adj_r2_values) else: avg_adj_r2 = np.nan all_params = all_params.iloc[:, 1:-2] params = np.asarray(all_params.mean(axis=0).values[:, None], dtype=float) wy = np.asarray(wy_df) wx = np.asarray(wx_df) index = self.dependent.index fitted = DataFrame(self.exog.values2d @ params, index, ["fitted_values"]) effects = DataFrame(np.full(fitted.shape, np.nan), index, ["estimated_effects"]) idiosyncratic = DataFrame( self.dependent.values2d - fitted.values, index, ["idiosyncratic"] ) eps = self.dependent.values2d - fitted.values weps = wy - wx @ params w = self.weights.values2d root_w = cast(Float64Array, np.sqrt(w)) # residual_ss = float(np.squeeze(weps.T @ weps)) y = e = self.dependent.values2d if self.has_constant: e = y - (w * y).sum() / w.sum() total_ss = float(np.squeeze(w.T @ (e**2))) r2 = 1 - residual_ss / total_ss if cov_type not in ( "robust", "unadjusted", "homoskedastic", "heteroskedastic", "kernel", ): raise ValueError("Unknown cov_type") bandwidth = 0.0 if cov_ty
(dependent: 'PanelDataLike', exog: 'PanelDataLike', *, weights: 'PanelDataLike | None' = None, check_rank: 'bool' = True)
[ 0.04474792629480362, -0.05328165367245674, 0.015497163869440556, 0.04136908799409866, -0.0033544700127094984, -0.049816180020570755, -0.09417423605918884, -0.04652398079633713, -0.006416540592908859, 0.009806206449866295, -0.004729829728603363, -0.004783977754414082, 0.04039442539215088, 0.04199720546603203, -0.0534549281001091, 0.06852973997592926, 0.003005215199664235, 0.022438939660787582, 0.006800991483032703, -0.006508592050522566, -0.05388811230659485, -0.09192167967557907, -0.049902815371751785, 0.04825671762228012, -0.0035439881030470133, 0.005940037779510021, -0.032120607793331146, -0.015313060954213142, -0.010510130785405636, -0.017977142706513405, -0.020760351791977882, -0.05722362920641899, -0.017738891765475273, -0.0692228302359581, 0.042863573879003525, -0.04743366688489914, 0.030691098421812057, -0.022265667095780373, -0.03978796675801277, -0.03309527039527893, 0.03311692923307419, -0.06099233031272888, 0.09833280742168427, -0.012497363612055779, -0.05882640928030014, 0.015507993288338184, -0.017229899764060974, 0.09954572468996048, 0.00846875086426735, 0.0021361394319683313, 0.010862093418836594, -0.06034255400300026, 0.029456524178385735, 0.025449570268392563, 0.018756873905658722, 0.048213399946689606, -0.013352902606129646, 0.027117328718304634, 0.08473082631826401, -0.08754651993513107, 0.030474506318569183, -0.012075008824467659, 0.024258313700556755, 0.01900595612823963, -0.005087206605821848, -0.016623442992568016, -0.024496564641594887, -0.007115050218999386, 0.003852631663903594, 0.0011580907739698887, 0.02664082683622837, 0.0068497247993946075, 0.001926315831951797, 0.03225056082010269, -0.025081364437937737, -0.03233719989657402, -0.03924648463726044, -0.03965801000595093, -0.023023739457130432, -0.03575935214757919, 0.03612755984067917, 0.06480435281991959, -0.03463307395577431, -0.021680867299437523, 0.007396619766950607, -0.0271606482565403, -0.018486134707927704, 0.05713699385523796, 0.024496564641594887, -0.03303029388189316, -0.012963036075234413, 0.02363019622862339, 0.05934623256325722, 0.031470831483602524, 0.05219869315624237, -0.011999201960861683, -0.014749920926988125, -0.040004558861255646, 0.012139986269176006, -0.008317136205732822, -0.016775056719779968, 0.024431588128209114, -0.016558464616537094, 0.08308472484350204, -0.024648180231451988, 0.006995924282819033, -0.03426486998796463, -0.005945452954620123, -0.004762318450957537, -0.06554076820611954, -0.06081905961036682, 0.021810824051499367, -0.031795717775821686, -0.042018864303827286, -0.019320014864206314, 0.0028671377804130316, -0.05943286791443825, 0.0400262176990509, 0.0026194106321781874, 0.0464373454451561, 0.01960158348083496, 0.03801191225647926, -0.05011940747499466, -0.0049139331094920635, 0.056010715663433075, -0.023651855066418648, 0.02590441331267357, -0.024171676486730576, 0.02824360877275467, -0.03894325718283653, -0.025406252592802048, -0.019590754061937332, -0.009952406398952007, 0.00943258497864008, -0.008122202940285206, 0.015973666682839394, 0.0014619965804740787, -0.05102909728884697, -0.0006958020967431366, -0.025557866320014, 0.051332324743270874, 0.0744643583893776, -0.004345378838479519, -0.007472427096217871, 0.0005722768837586045, 0.006887628231197596, 0.038661688566207886, -0.05159223452210426, 0.0048056370578706264, 0.027009032666683197, -0.02254723571240902, -0.019298354163765907, -0.0490797683596611, -0.019038444384932518, 0.02631593868136406, -0.0193525031208992, -0.004553848411887884, 0.023651855066418648, 0.01324460655450821, 0.011771779507398605, -0.08707001805305481, -0.06783664226531982, 0.0027859157416969538, 0.02421499602496624, -0.013233776204288006, 0.04197554662823677, -0.034828007221221924, 0.009654592722654343, 0.0014971927739679813, 0.0047596110962331295, -0.005436461418867111, -0.03383168578147888, -0.05713699385523796, -0.03920316696166992, -0.05834990739822388, 0.06536749005317688, -0.0023053521290421486, -0.04531106352806091, -0.0066818660125136375, -0.02479979395866394, 0.040589358657598495, -0.020175553858280182, -0.058869730681180954, -0.017078286036849022, -0.02999800443649292, 0.02889338508248329, 0.02850351855158806, -0.007326227147132158, 0.043036848306655884, 0.03729715570807457, -0.053584881126880646, -0.013851064257323742, 0.038921598345041275, -0.009746643714606762, -0.00011946407175855711, -0.011035366915166378, 0.07424777001142502, 0.012746443971991539, 0.05037932097911835, -0.03887828066945076, 0.004648607689887285, -0.02882840670645237, 0.025514548644423485, -0.01047764252871275, -0.006606058683246374, -0.01567043736577034, -0.0011364315869286656, 0.005950867664068937, -0.03868334740400314, 0.009995725005865097, -0.03993958234786987, -0.010862093418836594, -0.005750520154833794, 0.008403773419559002, 0.07255835086107254, -0.026207642629742622, 0.01009860634803772, 0.011019122786819935, 0.03324688598513603, -0.011945053935050964, 0.002359500154852867, -0.024258313700556755, -0.05076918378472328, 0.010872922837734222, 0.053758155554533005, -0.039181508123874664, 0.03426486998796463, 0.0557941235601902, 0.05791672319173813, -0.04071931168437004, 0.016309384256601334, 0.03127589821815491, 0.009280971251428127, -0.0476069413125515, 0.016905011609196663, 0.006042919121682644, -0.03610590100288391, 0.0011641824385151267, -0.05406138673424721, -0.019569095224142075, -0.012583999894559383, -0.042105503380298615, 0.0032218073029071093, 0.02389010787010193, -0.01599532552063465, 0.005680127535015345, 0.100498728454113, 0.058783091604709625, -0.0444013774394989, -0.03588930889964104, 0.009990310296416283, -0.0029889708384871483, -0.0053796060383319855, 0.007797315251082182, -0.042018864303827286, -0.07987916469573975, 0.06740345805883408, 0.009275556541979313, 0.042452048510313034, -0.03937644138932228, -0.005352532025426626, 0.01800963282585144, -0.04752030223608017, 0.039917923510074615, -0.03450312092900276, 0.03567271679639816, -0.029716433957219124, 0.0032651256769895554, -0.03294365480542183, 0.04130411148071289, -0.039181508123874664, 0.0578300878405571, -0.030799394473433495, -0.01844281703233719, -0.032965317368507385, 0.025319615378975868, 0.0077919005416333675, -0.042018864303827286, 0.014977342449128628, 0.023240331560373306, -0.023586878553032875, -0.0703924298286438, -0.018995126709342003, 0.05128900706768036, -0.025709480047225952, -0.03619253635406494, -0.03134087473154068, -0.0648476704955101, 0.04513779282569885, -0.0029050414450466633, -0.03173074126243591, -0.023738492280244827, 0.056617170572280884, 0.014067656360566616, 0.05453788861632347, 0.00643278518691659, 0.01685086451470852, 0.0010802530450746417, 0.011078685522079468, 0.015313060954213142, 0.03166576474905014, 0.0697859674692154, 0.04968622326850891, 0.032380517572164536, -0.00013638533710036427, -0.03662572056055069, 0.053758155554533005, -0.026944056153297424, 0.016775056719779968, -0.012724785134196281, 0.010466812178492546, 0.042018864303827286, 0.015096468850970268, 0.018876001238822937, 0.006059163715690374, -0.041780613362789154, -0.009318874217569828, 0.012378238141536713, 0.06800991296768188, 0.08992903679609299, 0.002772378735244274, -0.05137564241886139, 0.04734703153371811, -0.023348627611994743, 0.03476303070783615, -0.011501040309667587, 0.06861637532711029, -0.00971957016736269, -0.011403573676943779, -0.011869246140122414, -0.053844794631004333, -0.027247285470366478, 0.015702925622463226, 0.015085638500750065, -0.006893043406307697, -0.004358915612101555, -0.008766564540565014, -0.004835418425500393, 0.0593029148876667, -0.02028384990990162, 0.04708711802959442, 0.021832482889294624, -0.03266208618879318, 0.02389010787010193, 0.00897232722491026, -0.08564051240682602, 0.051332324743270874, 0.03560774028301239, 0.004924762528389692, 0.07208184897899628, 0.0022525577805936337, 0.04282025620341301, 0.038098547607660294, 0.06969933211803436, 0.022157371044158936, 0.05553421005606651, -0.04743366688489914, 0.013461198657751083, 0.0038661686703562737, -0.0013293339870870113, 0.0035927211865782738, 0.03734047710895538, -0.05016272887587547, 0.03744877129793167, -0.014717432670295238, -0.009546296671032906, -0.02070620283484459, 0.01850779354572296, 0.02949984185397625, -0.05683376267552376, -0.023240331560373306, -0.04045940190553665, 0.00897232722491026, 0.008712416514754295, -0.011251959018409252, 0.03794693201780319, -0.038401778787374496, -0.00975747313350439, 0.05085582286119461, -0.0021605060901492834, 0.060212600976228714, -0.04006953537464142, -0.04154236242175102, 0.0018938271095976233, 0.033051952719688416, -0.008577046915888786, 0.009199748747050762, -0.06744677573442459, 0.020002279430627823, -0.07351135462522507, 0.06792327761650085, -0.034719713032245636, 0.010152754373848438, 0.022092392668128014, -0.038163524121046066, 0.011945053935050964, 0.029434865340590477, 0.06995924562215805, -0.06294166296720505, 0.006806406192481518, -0.047390349209308624, -0.03578101471066475, 0.021475104615092278, 0.019038444384932518, -0.03829348087310791, -0.054581206291913986, 0.02850351855158806, 0.05973609909415245, -0.03309527039527893, 0.07047906517982483, -0.030799394473433495, 0.015193934552371502, -0.057700131088495255, 0.0004162629193160683, -0.02982473000884056, 0.011890905909240246, -0.010997463017702103, -0.0348929837346077, 0.07684687525033951, 0.012096667662262917, 0.05380147323012352, -0.012952206656336784, 0.04197554662823677, 0.03173074126243591, 0.02126934379339218, 0.010255635716021061, -0.07268830388784409, 0.008880275301635265, -0.025016386061906815, -0.02003476768732071, -0.008436261676251888, -0.029868049547076225, -0.07381458580493927, -0.02471315674483776, -0.008122202940285206, -0.01758727803826332, -0.0039040723349899054, 0.015475505031645298, 0.00404485734179616, 0.001705662696622312, 0.015724586322903633, 0.03612755984067917, 0.015518822707235813, -0.01568126678466797, -0.07147538661956787, -0.01936333253979683, 0.0171649232506752, -0.015302230603992939, -0.11020205169916153, -0.015388867817819118, 0.08464419096708298, 0.06406793743371964, 0.04275527969002724, 0.029283249750733376, -0.03428652882575989, 0.0029754338320344687, 0.05176550894975662, -0.05562084913253784, -0.006925532128661871, 0.00319473329000175, -0.002519236644729972, 0.023738492280244827, -0.03714554384350777, -0.008040981367230415, 0.0030837298836559057, 0.048559945076704025, 0.05016272887587547, -0.020987773314118385, 0.029716433957219124, 0.03818518668413162, 0.0016853571869432926, -0.01248653419315815, -0.014143463224172592, -0.043859899044036865, 0.01952577754855156, 0.009936162270605564, -0.04331841692328453, 0.00897232722491026, 0.03718886151909828, -0.01282225176692009, -0.020316338166594505, -0.03125423938035965, 0.008317136205732822, 0.014262588694691658, 0.028980020433664322, -0.01590868830680847, 0.016396021470427513, -0.049642905592918396, 0.014760750345885754, -0.0016867108643054962, -0.04165065661072731, 0.02648921310901642, 0.04171563684940338, 0.07234175503253937, -0.07502749562263489, 0.04139074683189392, 0.023067057132720947, -0.031470831483602524, 0.053931429982185364, -0.06502094119787216, 0.02648921310901642, 0.007732337340712547, -0.07689019292593002, -0.04253868758678436, -0.014847387559711933, -0.0522853285074234, -0.041434064507484436, -0.017414003610610962, -0.03491464629769325, -0.010163583792746067, 0.005122402682900429, -0.030821053311228752, 0.022308984771370888, -0.021074410527944565, 0.005436461418867111, -0.016905011609196663, 0.014825728721916676, 0.03656074404716492, 0.038098547607660294, -0.0030404115095734596, 0.04050271958112717, -0.01609279215335846, 0.037578728049993515, -0.016114450991153717, 0.06216192990541458, 0.041195813566446304, -0.007537404540926218, -0.01828037202358246, 0.057180311530828476, 0.025492887943983078, -0.032813701778650284, -0.027377240359783173, 0.023521900177001953, 0.06757672876119614, 0.012984695844352245, -0.0648476704955101, -0.003906779922544956, -0.04968622326850891, -0.050639230757951736, -0.017782211303710938, -0.026359256356954575, -0.01248653419315815, 0.028005357831716537, -0.039441417902708054, -0.007374960463494062, -0.005934623070061207, 0.007429108489304781, -0.0011702741030603647, -0.03108096495270729, -0.005642224103212357, 0.000992262503132224, -0.01286557037383318, 0.060559146106243134, 0.041260793805122375, 0.03965801000595093, -0.006124141160398722, 0.014944854192435741, 0.014295077882707119, -0.01568126678466797, 0.010147339664399624, -0.024193335324525833, -0.030972668901085854, 0.05102909728884697, -0.08698338270187378, 0.010580523870885372, 0.011197810992598534, 0.03419988974928856, 0.041195813566446304, -0.040935903787612915, -0.0015215594321489334, -0.0365174263715744, 0.05657385289669037, 0.00909686740487814, 0.01759810745716095, -0.03190401569008827, 0.008614949882030487, 0.0348929837346077, -0.015627119690179825, -0.05670380964875221, -0.022828806191682816, 0.015356378629803658, -0.017143264412879944, -0.006828065495938063, -0.03209894895553589, 0.017641425132751465, 0.01458747684955597, -0.02965145744383335, 0.032965317368507385, -0.030517825856804848, 0.0014186782063916326, -0.028633473441004753, 0.058436546474695206, -0.03487132489681244, -0.04275527969002724, 0.012085838243365288, 0.08633360266685486, -0.07017583400011063, 0.03025791421532631, 0.03820684552192688, 0.047043800354003906, -0.029521500691771507, 0.004908518400043249, 0.05202541872859001, -0.0198614951223135, 0.02807033434510231, -0.012508193030953407, 0.007916441187262535, -0.006199948489665985, 0.010932485572993755, -0.026185983791947365, 0.010461397469043732, 0.018583601340651512, 0.015323890373110771, -0.003105388954281807, -0.020738692954182625, -0.03173074126243591, -0.05284846946597099, 0.018486134707927704, 0.054018065333366394, -0.0032461739610880613, 0.01169597264379263, 0.02052210085093975, -0.014771580696105957, 0.03597594425082207, -0.017652254551649094, -0.009595029056072235, 0.052328649908304214, -0.09356778115034103, 0.0029943855479359627, -0.010093191638588905, 0.02078201062977314, 0.030539484694600105, 0.036084242165088654, -0.04920972138643265, 0.02588275447487831, 0.022742168977856636, 0.027377240359783173, 0.010932485572993755, -0.013688620179891586, 0.02657584846019745, 0.006795576773583889, 0.027290603145956993, 0.006551910657435656, 0.019818175584077835, -0.005783008877187967, 0.036842312663793564, -0.039506398141384125, -0.010872922837734222, 0.02865513227880001, 0.023067057132720947, -0.009773718193173409, -0.04063267633318901, -0.04734703153371811, -0.019915642216801643, 0.045700930058956146, 0.0024732109159231186, -0.0016054888255894184, 0.008490409702062607, 0.047303710132837296, -0.014067656360566616, 0.026857418939471245, -0.02295876108109951, 0.019200889393687248, -0.015204764902591705, 0.04418478533625603, -0.011544357985258102, 0.00431830482557416, -0.00009306691208621487, 0.006914702244102955, 0.00981162115931511, 0.0030512409284710884, -0.041347429156303406, -0.06333152949810028, -0.005940037779510021, -0.008073469623923302, -0.019211718812584877, -0.02917495369911194, 0.013342072255909443, -0.005146769341081381, -0.021886629983782768, 0.100498728454113, 0.060125961899757385, -0.011078685522079468, -0.021410128101706505, 0.07550400495529175, -0.03848841413855553, -0.013017184101045132, 0.006622303277254105, -0.010001139715313911, -0.06701359152793884, -0.04925303906202316, -0.009075208567082882, -0.0049734958447515965, 0.036149218678474426, 0.00733164232224226, -0.09296132624149323, -0.01650431752204895, -0.013775256462395191, 0.008658268488943577, 0.0005377575289458036, -0.01203169021755457, 0.004061101470142603, -0.010114850476384163, 0.03225056082010269, 0.010261050425469875, 0.08771979808807373, -0.04004787653684616, 0.017132434993982315, 0.0024204165674746037, -0.09634015709161758, -0.03441648185253143, 0.03954971581697464, 0.03571603447198868, 0.0031216335482895374, 0.026337597519159317, 0.006362392567098141, -0.03025791421532631, -0.0006430077482946217, -0.02313203550875187, 0.052588559687137604, 0.01725156046450138, 0.07940266281366348, 0.005130525212734938, 0.008831541985273361, -0.043123483657836914, 0.0011296630837023258, 0.00830089207738638, -0.015702925622463226, 0.03500128164887428, -0.03268374502658844, 0.05873977392911911, 0.001417324529029429, -0.0032678330317139626, 0.03476303070783615, 0.01917922869324684, -0.030387869104743004, -0.004488870967179537, -0.02363019622862339, -0.022807147353887558, 0.04946963116526604, -0.012833081185817719, -0.021583400666713715, -0.06471771746873856, -0.055101025849580765, -0.011122004128992558, 0.05830658972263336, 0.008084299974143505, 0.001777408760972321, 0.06558408588171005, -0.04054603725671768, 0.05709367245435715, -0.03965801000595093, 0.013764427043497562, 0.05999600887298584, 0.06437116861343384, 0.02102026157081127, 0.016146939247846603, -0.013179628178477287, -0.05912964046001434, -0.05440793186426163, -0.015128957107663155, 0.010851263999938965, 0.050076089799404144, 0.0645444393157959, -0.009356778115034103, 0.0016339165158569813, -0.018204564228653908, 0.047043800354003906 ]
42,837
linearmodels.panel.model
__init__
null
def __init__( self, dependent: PanelDataLike, exog: PanelDataLike, *, weights: PanelDataLike | None = None, check_rank: bool = True, ): super().__init__(dependent, exog, weights=weights, check_rank=check_rank) self._validate_blocks()
(self, dependent: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, weights: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, check_rank: bool = True)
[ 0.030892642214894295, -0.03334825485944748, -0.019988346844911575, 0.05824783071875572, -0.044853575527668, -0.009745177812874317, -0.02256416529417038, 0.0009551991242915392, -0.004078378435224295, -0.0058428137563169, 0.024109655991196632, 0.05179111286997795, 0.0035374565050005913, -0.000720155774615705, -0.04924963787198067, 0.021276256069540977, 0.04880316182971001, 0.020555026829242706, -0.01384072843939066, 0.02750973589718342, -0.047772835940122604, -0.020949985831975937, -0.03540891036391258, 0.07487043738365173, -0.011264909990131855, 0.10371959954500198, -0.036610957235097885, 0.021757075563073158, 0.008186807855963707, -0.02780166082084179, -0.03980497270822525, -0.004346692934632301, -0.048494067043066025, 0.06333077698945999, 0.036610957235097885, -0.012973536737263203, -0.005898623261600733, 0.04928398132324219, -0.10062862187623978, 0.05797307565808296, 0.07487043738365173, -0.048837509006261826, 0.09341633319854736, 0.00880929734557867, -0.027166293933987617, 0.031579528003931046, 0.04550611600279808, 0.027217809110879898, -0.026410719379782677, -0.04341111704707146, 0.02227223850786686, -0.0029450184665620327, 0.06501364707946777, 0.020091379061341286, -0.02203182876110077, 0.05780135467648506, 0.05134463682770729, 0.05038299784064293, 0.07342798262834549, -0.008143877610564232, -0.042689889669418335, 0.0038787524681538343, 0.0013834289275109768, -0.03322805091738701, -0.03496243432164192, -0.005555180832743645, -0.07129863649606705, -0.024006623774766922, -0.009169911965727806, 0.015798350796103477, 0.043308086693286896, 0.03300481289625168, -0.018889332190155983, 0.05780135467648506, -0.003106007119640708, -0.010217411443591118, -0.014381649903953075, 0.00831989198923111, 0.03382907435297966, -0.03250682353973389, 0.026135966181755066, 0.02287326380610466, -0.03898071125149727, 0.02275305800139904, -0.013128085061907768, -0.08146453648805618, 0.025071294978260994, 0.023800557479262352, 0.05045168846845627, -0.013437183573842049, -0.08015945553779602, 0.020589372143149376, 0.012424028478562832, 0.0033399772364646196, 0.054366931319236755, 0.015540768392384052, -0.006212014239281416, -0.06230045109987259, -0.024006623774766922, 0.013033638708293438, -0.021156052127480507, 0.00038046977715566754, -0.0053276498802006245, 0.00862899050116539, -0.04660513252019882, -0.04138480871915817, -0.024951089173555374, -0.04097267612814903, -0.06298733502626419, -0.06989052891731262, -0.02828248031437397, 0.026702646166086197, -0.05192849040031433, 0.04973045736551285, -0.01725798100233078, 0.02840268611907959, -0.001360890455543995, -0.007873416878283024, -0.015403390862047672, 0.017129188403487206, 0.024899573996663094, 0.02912391535937786, -0.06199135258793831, 0.02845420129597187, 0.03369169682264328, 0.018889332190155983, 0.009633558802306652, -0.0040934039279818535, 0.025912728160619736, -0.07919781655073166, 0.05859127268195152, -0.06491061300039291, -0.07068044692277908, 0.003917389549314976, -0.0281622763723135, 0.02790469489991665, 0.07226027548313141, -0.0027303670067340136, -0.019267117604613304, -0.0005111388745717704, 0.06621569395065308, -0.014046793803572655, 0.015326116234064102, 0.007203704211860895, -0.00008089678158285096, 0.03405231237411499, -0.03825948387384415, -0.06817331165075302, 0.018030725419521332, 0.0058943298645317554, -0.002489957259967923, 0.012913433834910393, -0.009144153445959091, -0.015901383012533188, -0.005289013031870127, 0.018391339108347893, -0.024092484265565872, -0.021327773109078407, 0.059312500059604645, 0.014716506004333496, -0.05155070126056671, -0.014055379666388035, 0.031837109476327896, 0.02762993983924389, -0.020915642380714417, 0.04014841467142105, -0.03453313186764717, -0.09685075283050537, -0.03309067338705063, 0.018356995657086372, 0.021379288285970688, -0.08455551415681839, -0.01390941720455885, 0.003282021265476942, -0.04475054517388344, 0.03254116699099541, 0.018666094169020653, 0.001677501481026411, -0.0022924779914319515, -0.03451596200466156, 0.021757075563073158, 0.015729662030935287, -0.009745177812874317, -0.014132654294371605, 0.006649903487414122, -0.00816534273326397, 0.03388059139251709, -0.008083775639533997, 0.047292016446590424, 0.005143049638718367, -0.014888227917253971, 0.015626627951860428, -0.012904847972095013, -0.019438838586211205, 0.04001103714108467, 0.014287203550338745, 0.05306185036897659, 0.0036855661310255527, -0.026582440361380577, -0.008070896379649639, 0.02905522659420967, -0.02220354974269867, 0.031373463571071625, -0.035614974796772, -0.025998588651418686, 0.0816705971956253, -0.009556284174323082, 0.036748334765434265, 0.013420011848211288, -0.013591732829809189, 0.013411425054073334, 0.0017086259322240949, 0.0011709239333868027, 0.03554628789424896, 0.03496243432164192, -0.048494067043066025, -0.06463585793972015, -0.004235073924064636, 0.05220324173569679, 0.02750973589718342, 0.07782404869794846, -0.012492717243731022, -0.05766397714614868, -0.004722333047538996, 0.014115482568740845, 0.004245806485414505, 0.0465707890689373, -0.036061450839042664, -0.02890067733824253, 0.03558063134551048, -0.03302198648452759, 0.0020155776292085648, -0.0354432538151741, -0.020228756591677666, -0.004967035725712776, 0.03846554830670357, -0.05192849040031433, -0.03491091728210449, -0.06758946180343628, 0.007388304453343153, -0.01674281619489193, -0.029965348541736603, 0.0024126828648149967, -0.04083529859781265, 0.009109809063374996, -0.03918677568435669, 0.027028916403651237, 0.0463990680873394, -0.04183128476142883, -0.0020467019639909267, -0.04124743118882179, -0.012939192354679108, -0.03770997375249863, -0.013711937703192234, -0.01118763629347086, 0.0065039400942623615, 0.015515009872615337, -0.07445830851793289, 0.027063259854912758, -0.06913495063781738, -0.009908312931656837, -0.013651834800839424, -0.04952439293265343, 0.05309619382023811, 0.005490784998983145, 0.02787034958600998, -0.007800435181707144, -0.012784643098711967, -0.0002689851389732212, -0.01418417040258646, -0.020537855103611946, 0.06879150867462158, 0.047463737428188324, 0.004898346960544586, -0.004082671366631985, -0.018305478617548943, 0.0141669986769557, -0.014124068431556225, -0.0013930881395936012, 0.026788506656885147, 0.04423537850379944, -0.012578577734529972, -0.02910674177110195, 0.018202446401119232, -0.03503112494945526, -0.048768818378448486, -0.019576216116547585, -0.06559749692678452, -0.047944556921720505, -0.03503112494945526, -0.05251234024763107, 0.05179111286997795, 0.047429393976926804, 0.06343381106853485, 0.024727853015065193, -0.04560915008187294, 0.020194413140416145, 0.06298733502626419, -0.015403390862047672, 0.021396460011601448, 0.00716077396646142, -0.05704578012228012, 0.003925975877791643, -0.001898592454381287, -0.024951089173555374, -0.07068044692277908, 0.06178528442978859, -0.010930053889751434, 0.013900830410420895, -0.012432614341378212, 0.07095519453287125, 0.08826469630002975, 0.02878047153353691, 0.048013247549533844, 0.06113274395465851, -0.03357149288058281, 0.03849989175796509, -0.023731868714094162, 0.015369047410786152, 0.10344484448432922, 0.009461837820708752, -0.047429393976926804, -0.02845420129597187, -0.004507681354880333, -0.08709698915481567, 0.01146238949149847, 0.07308454066514969, -0.013007880188524723, 0.006860261783003807, 0.05021127685904503, -0.06635306775569916, -0.03283309191465378, 0.053405292332172394, -0.0465707890689373, -0.04911226034164429, 0.007542853709310293, 0.006989052519202232, 0.01779031567275524, 0.059587255120277405, -0.017266565933823586, 0.04928398132324219, -0.0472576729953289, -0.018597405403852463, 0.026548096910119057, 0.009710833430290222, -0.053954798728227615, 0.02768145687878132, -0.037297844886779785, 0.031459324061870575, 0.09856796264648438, -0.016287755221128464, 0.009109809063374996, -0.02814510464668274, -0.003619024297222495, 0.030308790504932404, -0.0004942350788041949, -0.019541872665286064, 0.018666094169020653, -0.031321946531534195, -0.004179264418780804, 0.035924073308706284, -0.01768728345632553, -0.018253963440656662, 0.029742110520601273, 0.0008580693393014371, -0.0465707890689373, 0.04564349353313446, -0.0019307901384308934, 0.03602710738778114, 0.026496579870581627, -0.013205359689891338, -0.054469961673021317, -0.02878047153353691, 0.005392045713961124, 0.012724540196359158, 0.024985434487462044, -0.03939284384250641, 0.001313667162321508, 0.06127012148499489, -0.054195210337638855, 0.025277359411120415, -0.012922019697725773, 0.021087363362312317, -0.00700622471049428, -0.07157339155673981, -0.0006858115084469318, -0.013085154816508293, 0.04619299992918968, 0.03540891036391258, -0.015102879144251347, 0.059140779078006744, -0.03343411535024643, 0.029484529048204422, -0.018751954659819603, -0.05127594992518425, 0.01779031567275524, 0.06195700541138649, 0.002895648591220379, -0.05199717730283737, -0.04083529859781265, -0.03491091728210449, -0.06394897401332855, -0.019181257113814354, 0.03932415321469307, 0.002155100926756859, -0.017094844952225685, -0.013514458201825619, 0.09204255789518356, 0.036370549350976944, 0.010741161182522774, 0.006323632784187794, 0.04488791897892952, 0.030978502705693245, 0.0045334394089877605, -0.029879488050937653, -0.029879488050937653, 0.01162552461028099, 0.0038680199068039656, 0.019936831668019295, -0.036748334765434265, 0.04172825068235397, 0.03602710738778114, 0.06861978769302368, 0.0010695010423660278, 0.024298548698425293, 0.01748121716082096, -0.04505963996052742, -0.013334150426089764, 0.008092361502349377, -0.017455458641052246, -0.07885437458753586, 0.042518168687820435, -0.025723835453391075, -0.020640887320041656, 0.05234061926603317, -0.01760142296552658, -0.02261568047106266, 0.005009965971112251, 0.0017708748346194625, 0.03571800887584686, 0.04059489071369171, 0.01129925437271595, 0.03513415530323982, -0.029467357322573662, -0.05749225616455078, 0.015755420550704002, -0.011737143620848656, 0.03326239436864853, -0.04955873638391495, -0.02874612808227539, 0.05491643771529198, 0.03386342152953148, 0.036233171820640564, -0.012054827995598316, -0.08503633737564087, -0.025449080392718315, -0.03477354347705841, -0.02802489884197712, 0.02775014564394951, -0.031596701592206955, -0.011986139230430126, -0.020331788808107376, -0.07349666953086853, -0.036610957235097885, -0.03231792896986008, 0.03551194444298744, 0.04591824859380722, -0.026788506656885147, 0.02356014773249626, 0.013892244547605515, 0.025826867669820786, 0.006448131054639816, 0.02251264825463295, -0.042483825236558914, 0.023920763283967972, 0.0022087639663368464, 0.0288491602987051, -0.030257275328040123, 0.013153843581676483, -0.024521786719560623, -0.0015723222168162465, 0.024350065737962723, 0.02307932823896408, -0.0073668393306434155, -0.006881726905703545, -0.024435926228761673, -0.054023489356040955, -0.01701757125556469, -0.003636196255683899, 0.020520683377981186, -0.05292447283864021, 0.0033077795524150133, 0.0035138449165970087, 0.05055471882224083, 0.01432154793292284, 0.026118794456124306, 0.024865228682756424, -0.030944159254431725, 0.08428075909614563, -0.06748642772436142, 0.019284289330244064, 0.03410382941365242, 0.024487443268299103, -0.054504308849573135, -0.02359449304640293, -0.04045751318335533, -0.006525405216962099, -0.0007829413516446948, -0.025019777938723564, 0.020245928317308426, 0.010277513414621353, 0.010371959768235683, 0.019679248332977295, 0.031596701592206955, 0.03250682353973389, -0.007843365892767906, -0.042518168687820435, 0.09266075491905212, 0.021035846322774887, 0.016682714223861694, 0.08331912755966187, 0.003915243316441774, 0.06515102088451385, 0.0073711322620511055, 0.042449478060007095, -0.0011548250913619995, -0.013960933312773705, -0.054469961673021317, 0.03523718938231468, 0.013462942093610764, 0.008178221993148327, -0.06102971360087395, -0.007693109568208456, 0.07487043738365173, -0.017043327912688255, 0.02338842675089836, 0.03274723142385483, 0.02860875055193901, -0.05234061926603317, 0.0018266842234879732, 0.0033077795524150133, 0.003767133690416813, 0.04114439710974693, -0.05831651762127876, -0.030119897797703743, 0.01689736545085907, 0.015995828434824944, 0.04976480081677437, -0.03898071125149727, -0.015532182529568672, -0.025603629648685455, -0.04557480663061142, -0.029776455834507942, -0.0013147403951734304, 0.05762963369488716, -0.04591824859380722, -0.025157155469059944, 0.0056667993776500225, 0.04372021555900574, 0.024899573996663094, 0.004507681354880333, 0.010346202179789543, -0.0007791849202476442, -0.03377755731344223, 0.026187481358647346, -0.04454447701573372, 0.023955106735229492, -0.017026156187057495, -0.016184723004698753, 0.02254699356853962, -0.00858605932444334, 0.043239396065473557, 0.019456012174487114, 0.031030019745230675, -0.005902916193008423, -0.024951089173555374, 0.021379288285970688, 0.02914108708500862, -0.04574652761220932, -0.05841955170035362, -0.03436141088604927, -0.031631045043468475, -0.02278740331530571, -0.027046088129281998, -0.002674557501450181, 0.0012063414324074984, -0.02750973589718342, 0.021053018048405647, -0.002575817983597517, 0.03365735337138176, 0.020383305847644806, 0.007929226383566856, -0.02228941023349762, 0.010586611926555634, 0.008036551997065544, 0.012999294325709343, -0.04578087106347084, -0.049043573439121246, 0.030738094821572304, 0.031837109476327896, -0.06999355554580688, 0.024727853015065193, 0.004157799296081066, 0.030772438272833824, 0.004282297100871801, -0.05220324173569679, -0.013720523566007614, 0.03575235232710838, -0.03898071125149727, -0.006954708602279425, 0.029742110520601273, 0.02362883649766445, 0.006954708602279425, -0.031510841101408005, -0.04643341153860092, -0.06703995168209076, -0.06247217208147049, 0.005224617198109627, 0.07844223827123642, 0.008903743699193, -0.013505872339010239, 0.007658765185624361, -0.01777314394712448, 0.03973628580570221, -0.053267914801836014, -0.013669007457792759, 0.03949587419629097, -0.0837312564253807, -0.002127196406945586, -0.0004365474742371589, 0.013231118209660053, 0.01691453717648983, -0.0026015760377049446, -0.043205052614212036, 0.021482322365045547, -0.037400875240564346, 0.006795866414904594, 0.002723927376791835, 0.031424976885318756, -0.016442304477095604, 0.0016367175849154592, -0.017043327912688255, 0.042758576571941376, 0.011264909990131855, -0.005825641565024853, -0.016682714223861694, -0.02289043553173542, 0.006018827669322491, -0.004084818065166473, -0.010801263153553009, -0.01700039766728878, 0.029192602261900902, -0.054366931319236755, -0.01705191470682621, 0.03973628580570221, 0.037469565868377686, 0.01097298413515091, -0.011556836776435375, 0.07569470256567001, -0.006392321549355984, -0.01161693874746561, 0.018356995657086372, 0.059758976101875305, 0.05127594992518425, 0.059209469705820084, 0.025157155469059944, 0.030909815803170204, -0.03266137093305588, -0.03812210634350777, -0.02368035353720188, -0.053473979234695435, -0.01169421337544918, -0.03245530650019646, -0.015970071777701378, -0.015884211286902428, -0.010449234396219254, -0.030720921233296394, 0.012063413858413696, 0.009728006087243557, 0.021602526307106018, 0.03479071334004402, 0.003971052821725607, -0.020091379061341286, -0.05591242015361786, 0.05199717730283737, 0.04135046526789665, -0.08723437041044235, 0.01784183271229267, 0.0139952776953578, -0.036336205899715424, -0.010234583169221878, -0.0017805341631174088, 0.053817421197891235, -0.009633558802306652, -0.01450185477733612, -0.07693109661340714, -0.0352715328335762, -0.053542669862508774, 0.024710679426789284, 0.009770936332643032, 0.024040967226028442, -0.03558063134551048, -0.043376773595809937, 0.05251234024763107, -0.02359449304640293, -0.003357149427756667, -0.07665634155273438, 0.019662076607346535, 0.042174726724624634, -0.047017261385917664, -0.009599214419722557, 0.03254116699099541, -0.0031639630906283855, -0.053714390844106674, -0.00880929734557867, 0.05199717730283737, 0.031167397275567055, 0.019249945878982544, -0.0552942231297493, 0.0032176258973777294, -0.020915642380714417, 0.025620801374316216, 0.013608904555439949, -0.0011043819831684232, 0.000952515983954072, 0.02311367355287075, 0.017541320994496346, -0.036576613783836365, 0.053817421197891235, -0.03822513669729233, 0.04705160856246948, -0.004434699658304453, -0.054538652300834656, 0.0027389531023800373, 0.029433012008666992, -0.010457821190357208, 0.012844745069742203, 0.05903774872422218, -0.008946673944592476, 0.03236944600939751, 0.03365735337138176, -0.04969611391425133, -0.030806781724095345, -0.016073103994131088, 0.025105638429522514, 0.03870595619082451, 0.0031403512693941593, 0.04145349562168121, 0.029467357322573662, -0.010715402662754059, 0.02289043553173542, -0.010930053889751434, 0.04104136675596237, 0.04687988758087158, 0.02831682562828064, -0.019610559567809105, 0.017215048894286156, -0.01742970198392868, -0.047292016446590424, -0.09616386890411377, -0.007791849318891764, -0.041487839072942734, 0.05488209426403046, 0.00732820201665163, 0.0007013737340457737, 0.019061053171753883, 0.059999383985996246, 0.03283309191465378 ]
42,849
linearmodels.panel.model
_setup_clusters
null
def _setup_clusters( self, cov_config: Mapping[str, bool | float | str | IntArray | DataFrame | PanelData], ) -> dict[str, bool | float | str | IntArray | DataFrame | PanelData]: cov_config_upd = dict(cov_config) cluster_types = ("clusters", "cluster_entity", "cluster_time") common = set(cov_config.keys()).intersection(cluster_types) if not common: return cov_config_upd cov_config_upd = {k: v for k, v in cov_config.items()} clusters = get_panel_data_like(cov_config, "clusters") clusters_frame: DataFrame | None = None if clusters is not None: formatted_clusters = self.reformat_clusters(clusters) for col in formatted_clusters.dataframe: cat = Categorical(formatted_clusters.dataframe[col]) # TODO: Bug in pandas-stubs # https://github.com/pandas-dev/pandas-stubs/issues/111 formatted_clusters.dataframe[col] = cat.codes.astype( np.int64 ) # type: ignore clusters_frame = formatted_clusters.dataframe cluster_entity = bool(cov_config_upd.pop("cluster_entity", False)) if cluster_entity: group_ids_arr = self.dependent.entity_ids.squeeze() name = "cov.cluster.entity" group_ids = Series(group_ids_arr, index=self.dependent.index, name=name) if clusters_frame is not None: clusters_frame[name] = group_ids else: clusters_frame = DataFrame(group_ids) cluster_time = bool(cov_config_upd.pop("cluster_time", False)) if cluster_time: group_ids_arr = self.dependent.time_ids.squeeze() name = "cov.cluster.time" group_ids = Series(group_ids_arr, index=self.dependent.index, name=name) if clusters_frame is not None: clusters_frame[name] = group_ids else: clusters_frame = DataFrame(group_ids) if self._singleton_index is not None and clusters_frame is not None: clusters_frame = clusters_frame.loc[~self._singleton_index] if clusters_frame is not None: cov_config_upd["clusters"] = np.asarray(clusters_frame) return cov_config_upd
(self, cov_config: collections.abc.Mapping[str, bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData]) -> dict[str, bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData]
[ 0.0067831953056156635, -0.06652156263589859, -0.010155522264540195, 0.026612479239702225, -0.058389436453580856, 0.03659456595778465, -0.02412659116089344, 0.06035501882433891, 0.006768742110580206, -0.004270811565220356, -0.041007496416568756, 0.011292478069663048, -0.003314515808597207, -0.022045383229851723, 0.023876076564192772, -0.022276628762483597, -0.025783849880099297, 0.007457660511136055, 0.07511617988348007, -0.045285534113645554, -0.011639346368610859, -0.05395723506808281, 0.006975899450480938, -0.005940113216638565, 0.013229157775640488, 0.00656640250235796, -0.02925252914428711, -0.014115598052740097, 0.06401640176773071, -0.01378800068050623, -0.06482576578855515, -0.021756326779723167, -0.05823527276515961, 0.05715612694621086, 0.029233258217573166, -0.04771361127495766, 0.026361962780356407, 0.006180993746966124, 0.0006630236166529357, 0.0399668924510479, -0.007269773632287979, -0.06521116942167282, 0.025263547897338867, -0.027460377663373947, 0.003671018872410059, 0.09026274085044861, -0.03329932317137718, 0.018913937732577324, -0.01796005107462406, -0.038540881127119064, -0.014192679896950722, -0.0680246576666832, -0.00638333335518837, 0.06062480807304382, -0.01561869215220213, -0.036247700452804565, 0.022835472598671913, 0.01904883049428463, -0.022623497992753983, 0.009962817654013634, 0.010107345879077911, 0.005178930703550577, -0.018229836598038673, 0.004827245604246855, -0.04659592732787132, -0.04717404022812843, -0.01347967330366373, 0.02250787429511547, 0.021756326779723167, -0.030273862183094025, 0.021062592044472694, 0.004355119541287422, 0.02784578688442707, 0.005015132017433643, 0.03992835432291031, -0.04790631681680679, -0.023163069039583206, 0.03297172486782074, 0.04035230353474617, 0.010126616805791855, -0.04883129522204399, -0.020812075585126877, -0.049486491829156876, -0.008840315043926239, 0.05318641662597656, 0.030273862183094025, -0.002397965406998992, 0.04385952278971672, 0.0323357991874218, -0.019906364381313324, 0.013142440468072891, 0.010897434316575527, 0.028019221499562263, 0.002397965406998992, 0.041469987481832504, 0.0497177354991436, 0.006971081718802452, -0.014414289966225624, 0.006730201188474894, -0.004022704437375069, 0.04004397615790367, -0.02339431457221508, 0.05792694538831711, 0.010194063186645508, -0.03667164966464043, -0.06524971127510071, -0.018807949498295784, 0.008252566680312157, -0.03977419063448906, 0.015358541160821915, -0.07326621562242508, -0.0010339795844629407, 0.008469359017908573, -0.002043871209025383, 0.018981384113430977, -0.03150717169046402, -0.016187170520424843, -0.00798278022557497, -0.051837485283613205, 0.01528145931661129, -0.022430792450904846, 0.039022643119096756, 0.013874717056751251, 0.00030064897146075964, 0.006898817606270313, 0.014414289966225624, -0.0023774905130267143, 0.059738367795944214, 0.027730165049433708, 0.012294541113078594, 0.0530707947909832, -0.04998752474784851, -0.03489876911044121, -0.016196805983781815, 0.04490012675523758, 0.002473842818289995, -0.026554666459560394, 0.011976579204201698, -0.02202611416578293, -0.0023618333507329226, 0.053880151361227036, 0.023837534710764885, -0.000038202142604859546, 0.008483811281621456, -0.05029584839940071, 0.04863859340548515, -0.01221745926886797, -0.09773967415094376, -0.0924210324883461, 0.0006196650792844594, -0.0010460235644131899, -0.023625560104846954, -0.0399668924510479, -0.04112312197685242, -0.044514719396829605, -0.04143144562840462, -0.0037914591375738382, -0.019646214321255684, 0.03800131008028984, -0.0016596666537225246, -0.05318641662597656, -0.018557434901595116, 0.05364890769124031, 0.020503748208284378, -0.047443825751543045, 0.011244301684200764, -0.021178213879466057, -0.1067582443356514, -0.04096895828843117, -0.014086692593991756, -0.027286944910883904, 0.049332328140735626, 0.016929082572460175, 0.02601509541273117, -0.007510654162615538, 0.02632342278957367, -0.004754981026053429, -0.09720010310411453, -0.006046100985258818, -0.03418576344847679, -0.06259039044380188, 0.0021414277143776417, -0.02418440394103527, 0.026920804753899574, -0.027460377663373947, 0.038810666650533676, 0.02015688084065914, -0.0021089089568704367, 0.048484429717063904, 0.029079094529151917, -0.02098551020026207, 0.009302805177867413, -0.006055735982954502, 0.06979753822088242, 0.04139290750026703, -0.042896002531051636, -0.016206441447138786, -0.02009906992316246, -0.08309414237737656, 0.005260830279439688, -0.01953059248626232, 0.010184427723288536, 0.033414945006370544, -0.011215396225452423, 0.030640000477433205, 0.002760490635409951, -0.005906390026211739, 0.006445962470024824, -0.04023668169975281, 0.043358489871025085, -0.03667164966464043, -0.02171778678894043, 0.03235507011413574, -0.007390214130282402, 0.032316528260707855, -0.0454396978020668, 0.006619396153837442, 0.02281620167195797, -0.029002012684941292, -0.008146578446030617, 0.06262893229722977, 0.0024605942890048027, 0.0500260628759861, 0.0506427176296711, -0.047019876539707184, -0.03857942298054695, 0.025783849880099297, -0.018798314034938812, 0.05218435451388359, -0.021852679550647736, -0.014346842654049397, 0.00313385552726686, -0.02349066734313965, -0.05218435451388359, 0.0265353973954916, -0.047135498374700546, 0.04154707118868828, 0.04621051624417305, 0.02019542269408703, 0.03894555941224098, -0.00965930800884962, -0.006445962470024824, 0.032740477472543716, 0.028558792546391487, -0.003478314494714141, -0.02187195047736168, 0.03364618867635727, 0.04035230353474617, -0.004844107199460268, 0.06097167357802391, 0.026092177256941795, -0.04813756048679352, -0.014260126277804375, 0.01313280500471592, 0.023741183802485466, -0.060740429908037186, -0.005463169887661934, 0.023529207333922386, 0.046133436262607574, -0.04108458012342453, -0.06043210253119469, -0.03464825078845024, 0.02009906992316246, 0.04983336105942726, -0.04158560931682587, -0.011658616364002228, -0.003502402687445283, 0.01874050311744213, -0.020445937290787697, 0.017083246260881424, -0.05222289264202118, 0.08139833807945251, 0.015898114070296288, 0.007592553738504648, 0.002132996916770935, 0.011754969134926796, -0.024088051170110703, -0.0790088102221489, 0.021698515862226486, 0.07079959660768509, 0.049486491829156876, -0.03580448031425476, -0.03711486980319023, -0.02568749710917473, 0.005414993967860937, -0.03486022725701332, -0.08309414237737656, -0.01858633942902088, 0.019405333325266838, -0.018229836598038673, -0.10182500630617142, -0.020850617438554764, -0.01020369865000248, -0.007626276928931475, -0.04624905809760094, -0.0029628302436321974, -0.0008834292530082166, 0.025302087888121605, 0.0032398428302258253, 0.008016503416001797, -0.01816239021718502, -0.059314414858818054, 0.04231788590550423, 0.027383295819163322, 0.054034315049648285, -0.04039084538817406, 0.05881338566541672, -0.0494094081223011, 0.026612479239702225, 0.035881560295820236, -0.020388126373291016, 0.04663446545600891, 0.004352710675448179, -0.0065760379657149315, 0.0031362641602754593, -0.009023384191095829, 0.011321383528411388, -0.030389485880732536, 0.046133436262607574, 0.050372932106256485, -0.040429383516311646, -0.08610033243894577, -0.050064604729413986, 0.03056291863322258, 0.07430681586265564, 0.02260422706604004, 0.09434808045625687, -0.027498919516801834, 0.008763233199715614, 0.02192976139485836, -0.08216916024684906, -0.03526490554213524, 0.019665485247969627, 0.04397514462471008, -0.003427729709073901, -0.03385816514492035, -0.014105962589383125, -0.01041567325592041, 0.032894641160964966, 0.008748780004680157, 0.02825046516954899, -0.03962002694606781, -0.06575074046850204, -0.011812780052423477, -0.009774930775165558, -0.00834891851991415, 0.056231144815683365, 0.02915617637336254, -0.04886983707547188, 0.05187602713704109, -0.008214025758206844, 0.018384000286459923, 0.017670994624495506, 0.08579200506210327, 0.07789111882448196, 0.04732820391654968, 0.0243963785469532, -0.11492890864610672, -0.011918767355382442, -0.04478450492024422, 0.08340246975421906, -0.04844588786363602, 0.06027793884277344, 0.011465911753475666, -0.04123874381184578, 0.029753560200333595, -0.03087124601006508, 0.011321383528411388, 0.0738057866692543, -0.03962002694606781, 0.01543562300503254, -0.016138993203639984, 0.03898410126566887, -0.02595728449523449, 0.04752090573310852, -0.015975195914506912, -0.0716860368847847, -0.009379887022078037, -0.044206392019987106, -0.015715043991804123, 0.010280780494213104, -0.01695798709988594, -0.021737057715654373, 0.013412226922810078, -0.04343557357788086, -0.03578520938754082, 0.046133436262607574, -0.027286944910883904, 0.043204326182603836, -0.0022763207089155912, 0.042896002531051636, 0.02019542269408703, 0.042896002531051636, 0.0009502735920250416, -0.021756326779723167, 0.009355799295008183, -0.0030447295866906643, 0.008883672766387463, 0.026978617534041405, 0.00971230212599039, 0.0034349560737609863, -0.037596628069877625, 0.040583547204732895, 0.0347638763487339, -0.005443899426609278, -0.024878138676285744, 0.02412659116089344, -0.004586365073919296, 0.005988289602100849, 0.012516151182353497, 0.027672352269291878, 0.016784554347395897, 0.01117685530334711, -0.01674601249396801, -0.03850233927369118, -0.023375043645501137, -0.05935295671224594, -0.001959563000127673, 0.059853989630937576, 0.0009532846161164343, 0.036247700452804565, -0.04975627735257149, 0.05195310711860657, 0.03489876911044121, 0.07195582240819931, 0.005511345807462931, -0.002731584943830967, 0.008223660290241241, -0.004834471736103296, -0.025841660797595978, 0.006547132041305304, 0.042009562253952026, -0.014992402866482735, -0.0020185785833746195, 0.040737710893154144, 0.013248427771031857, -0.016919447109103203, 0.03653675690293312, -0.012631773948669434, 0.04370535910129547, -0.011620075441896915, -0.02009906992316246, -0.007072251755744219, -0.0019186132121831179, -0.02638123370707035, 0.023413585498929024, -0.05318641662597656, -0.03601645305752754, 0.009037836454808712, -0.021004781126976013, 0.024512000381946564, -0.022430792450904846, -0.0527624674141407, -0.001273053465411067, -0.0005097633693367243, 0.032740477472543716, 0.0017981729470193386, 0.02894420176744461, 0.0035505786072462797, 0.02611144632101059, -0.029117636382579803, -0.04062208905816078, -0.05981544777750969, 0.005082578863948584, 0.03351129591464996, 0.03580448031425476, 0.03751954808831215, -0.009201635606586933, -0.013990339823067188, -0.02308598719537258, 0.006373698357492685, -0.01915481872856617, -0.0011116635287180543, 0.012516151182353497, -0.0017572232754901052, -0.01274739671498537, -0.018046768382191658, 0.004793521948158741, -0.06085605174303055, 0.036768000572919846, -0.018432175740599632, 0.027556730434298515, 0.019810013473033905, -0.03738465532660484, 0.0044201575219631195, -0.0863315761089325, 0.04836880788207054, -0.01183205097913742, 0.010290415026247501, 0.017295220866799355, -0.04902400076389313, 0.010290415026247501, 0.01224636472761631, 0.02663174830377102, 0.04813756048679352, 0.04077625274658203, 0.059006091207265854, 0.01946314424276352, 0.06151124835014343, -0.03324151039123535, 0.025263547897338867, 0.045131370425224304, -0.044090766459703445, -0.005704050417989492, 0.004889874253422022, -0.04120020195841789, 0.00719750951975584, 0.013807270675897598, -0.022893283516168594, 0.008040591143071651, -0.002570195123553276, 0.016100453212857246, 0.05098958685994148, -0.015454893000423908, 0.016707472503185272, 0.01763245277106762, -0.04621051624417305, 0.0024304843973368406, -0.01111904438585043, 0.030640000477433205, 0.027171321213245392, -0.002063141670078039, 0.03962002694606781, -0.008825861848890781, 0.009746025316417217, 0.023471396416425705, 0.0649799257516861, -0.007896062918007374, -0.01627388782799244, 0.016765283420681953, -0.11392684280872345, -0.08872111141681671, -0.01576322130858898, 0.11107482016086578, 0.013190616853535175, -0.01701579988002777, -0.016707472503185272, 0.04227934777736664, 0.057233210653066635, -0.0009279921650886536, -0.017353031784296036, -0.03351129591464996, 0.02056156098842621, -0.013238792307674885, 0.01957876794040203, -0.02187195047736168, 0.04717404022812843, -0.009399157017469406, -0.013691647909581661, 0.019713660702109337, 0.014452830888330936, 0.020600100979208946, 0.050372932106256485, 0.024743245914578438, 0.009678578935563564, -0.01044457871466875, -0.0067591071128845215, -0.07584845274686813, 0.009982088580727577, 0.033472754061222076, 0.008763233199715614, -0.012891924940049648, 0.06216644123196602, -0.05522908270359039, 0.04536261782050133, -0.026824453845620155, 0.002534062834456563, 0.043782442808151245, -0.040737710893154144, -0.03412795066833496, 0.03470606356859207, -0.0230281762778759, -0.03077489323914051, 0.008440452627837658, -0.06077897176146507, 0.006571220234036446, -0.004176868125796318, 0.000949069217313081, -0.00007949056453071535, -0.06482576578855515, -0.09357725828886032, 0.039427321404218674, 0.06351537257432938, -0.00007986694254213944, 0.0037914591375738382, 0.04798339679837227, -0.03711486980319023, 0.00701444037258625, 0.03067854233086109, 0.02403024025261402, -0.046287599951028824, 0.008917396888136864, -0.022045383229851723, 0.01649549789726734, 0.012111471965909004, 0.01915481872856617, -0.0017885378329083323, 0.002027009380981326, 0.03769298270344734, -0.03175768628716469, -0.04621051624417305, -0.011966943740844727, 0.012660679407417774, 0.011783874593675137, -0.0005329481209628284, -0.0248588677495718, -0.0033410126343369484, 0.0015777673106640577, -0.0006654324242845178, -0.0003456635167822242, 0.024897409602999687, 0.04158560931682587, 0.01895247772336006, -0.03915753588080406, 0.05426556244492531, -0.07203290611505508, -0.030736353248357773, -0.037346113473176956, 0.02403024025261402, -0.043050166219472885, 0.037866417318582535, -0.02428075484931469, -0.004456289578229189, 0.003755327081307769, -0.07195582240819931, -0.008002050220966339, 0.005337912123650312, -0.0655580386519432, -0.005198201164603233, -0.02830827794969082, 0.02214173600077629, 0.016929082572460175, 0.01979074254631996, -0.04898545891046524, 0.04266475513577461, -0.026207799091935158, 0.04443763568997383, -0.011273208074271679, 0.046750087291002274, 0.023625560104846954, 0.06339974701404572, -0.04135436564683914, 0.04621051624417305, 0.010618012398481369, -0.05865922197699547, -0.0634382888674736, 0.0524541400372982, -0.018779044970870018, 0.03800131008028984, 0.037596628069877625, 0.013653106987476349, -0.0022558460477739573, -0.059314414858818054, -0.014096327126026154, 0.025668226182460785, 0.004391251597553492, -0.04031376168131828, 0.0320274718105793, 0.04405222833156586, -0.040891874581575394, -0.0007160173263400793, 0.07122354954481125, -0.03474460542201996, -0.02034958451986313, 0.058736301958560944, 0.013017182238399982, 0.06324558705091476, 0.010126616805791855, 0.05071980133652687, 0.030967598780989647, 0.04197102040052414, -0.032374341040849686, -0.0539957731962204, 0.006142452824860811, 0.04008251801133156, -0.06629031896591187, -0.03349202498793602, 0.056963421404361725, -0.037866417318582535, -0.018278013914823532, -0.007269773632287979, 0.036247700452804565, -0.05923733487725258, 0.025706768035888672, 0.03281756117939949, -0.021602163091301918, 0.03460971266031265, -0.09658344835042953, 0.008642792701721191, -0.009466604329645634, 0.042626213282346725, 0.04077625274658203, -0.01293046586215496, 0.010945610702037811, -0.03426284343004227, -0.033260781317949295, -0.06401640176773071, -0.06571220606565475, -0.021428730338811874, 0.06644447892904282, 0.029117636382579803, -0.004429792519658804, -0.0738057866692543, 0.023375043645501137, 0.010791447013616562, 0.0251671951264143, 0.004087742418050766, 0.009437697939574718, 0.006720566190779209, -0.01847071759402752, -0.0009870078647509217, 0.07311205565929413, 0.07133917510509491, -0.03424357250332832, -0.0427032969892025, 0.05098958685994148, -0.005776314530521631, 0.0030760441441088915, -0.021158942952752113, -0.019289711490273476, 0.02559114433825016, 0.04316578805446625, -0.004056427627801895, 0.05569157376885414, 0.005212654359638691, -0.07372870296239853, 0.04170123487710953, 0.024897409602999687, 0.04478450492024422, 0.011639346368610859, 0.01494422648102045, 0.018200932070612907, -0.018962113186717033, 0.037288304418325424, -0.013344780541956425, -0.03455189988017082, -0.011957308277487755, 0.001515138428658247, -0.06563512235879898, 0.01020369865000248, -0.02668956108391285, -0.022488603368401527, -0.055344704538583755, -0.009774930775165558, -0.017699899151921272, 0.00858498178422451, 0.03861796483397484, 0.021024050191044807, 0.06355391442775726, -0.018499623984098434, -0.0072167799808084965, 0.0034325472079217434, -0.02339431457221508, 0.009322076104581356, -0.02287401258945465, -0.056346770375967026, 0.014558818191289902, 0.02198757231235504, 0.04355119541287422, -0.044244930148124695, 0.005501710809767246, -0.007915333844721317, 0.011475547216832638, 0.018451446667313576, 0.05129791423678398, 0.019665485247969627, 0.04944794997572899, 0.018403271213173866 ]
42,850
linearmodels.panel.model
_validate_blocks
null
def _validate_blocks(self) -> None: x = self._x root_w = np.sqrt(self._w) wx = root_w * x exog = self.exog.dataframe wx_df = DataFrame( wx[self._not_null], index=exog.notnull().index, columns=exog.columns ) def validate_block(ex: Float64Array | DataFrame) -> bool: _ex = np.asarray(ex, dtype=float) def _mr(ex: Float64Array) -> int: """lstsq based matrix_rank""" return _lstsq(ex, np.ones(ex.shape[0]))[2] return _ex.shape[0] >= _ex.shape[1] and _mr(_ex) == _ex.shape[1] valid_blocks = wx_df.groupby(level=1).apply(validate_block) if not valid_blocks.any(): err = ( "Model cannot be estimated. All blocks of time-series observations " "are rank deficient, and so it is not possible to estimate any" "cross-sectional regressions." ) raise ValueError(err) if valid_blocks.sum() < exog.shape[1]: import warnings warnings.warn( "The number of time-series observation available to estimate " "cross-sectional\nregressions, {}, is less than the number of " "parameters in the model. Parameter\ninference is not " "available.".format(valid_blocks.sum()), InferenceUnavailableWarning, stacklevel=3, ) elif valid_blocks.sum() < valid_blocks.shape[0]: import warnings warnings.warn( "{} of the time-series regressions cannot be estimated due to " "deficient rank.".format(valid_blocks.shape[0] - valid_blocks.sum()), MissingValueWarning, stacklevel=3, )
(self) -> NoneType
[ 0.059264298528432846, -0.036262087523937225, 0.0011291616829112172, 0.06858304888010025, -0.05049804225564003, -0.02093956060707569, -0.04003747180104256, -0.04136345908045769, -0.0422842837870121, 0.01366504281759262, 0.009171416983008385, -0.007716513704508543, 0.017072096467018127, -0.041031964123249054, -0.032431457191705704, 0.028600824996829033, -0.007403433322906494, -0.025304270908236504, 0.03585692495107651, -0.005373014137148857, -0.06943020969629288, -0.04121612757444382, -0.05782781168818474, 0.03462301939725876, -0.007002874277532101, 0.06228460371494293, 0.020221317186951637, 0.0104513643309474, 0.036170005798339844, 0.009917285293340683, -0.019945070147514343, -0.0007263007573783398, 0.014935782179236412, -0.019097911193966866, 0.0004048752598464489, -0.046777911484241486, 0.02591201663017273, -0.018913745880126953, -0.013048090972006321, 0.0027693812735378742, -0.008121676743030548, -0.03815899044275284, 0.041326627135276794, -0.002435582224279642, -0.04372077062726021, -0.01268896833062172, 0.008600506000220776, 0.08250591903924942, -0.01675901561975479, -0.017956087365746498, 0.01794688031077385, -0.04151079058647156, 0.03583851084113121, 0.03609634190797806, 0.011740518733859062, 0.03804849088191986, -0.006777272094041109, 0.021178975701332092, 0.07742296904325485, -0.056759655475616455, 0.001034777145832777, 0.03666725382208824, 0.04040580242872238, 0.03171321377158165, -0.005741343833506107, -0.013259880244731903, -0.04637274891138077, -0.01563560962677002, -0.02232079766690731, 0.026906507089734077, 0.0009611111017875373, 0.020479148253798485, -0.009622621349990368, 0.04803023114800453, -0.022191882133483887, -0.0506453774869442, -0.060406122356653214, 0.00699366582557559, 0.0069890618324279785, -0.026317179203033447, 0.024696527048945427, 0.04453109949827194, 0.010663153603672981, -0.02473336085677147, 0.011123565956950188, -0.02488069236278534, 0.03556226193904877, 0.0757286474108696, 0.05694381892681122, 0.0004840086621697992, -0.006146506872028112, 0.057201649993658066, 0.013775542378425598, 0.015856606885790825, 0.033554863184690475, 0.06486291438341141, -0.010368489660322666, -0.03412577509880066, -0.04025847092270851, -0.05281852185726166, 0.011593187227845192, 0.05119787156581879, -0.011372189037501812, 0.04655691236257553, -0.026169847697019577, 0.02340737171471119, -0.006547065917402506, -0.057054318487644196, -0.021713053807616234, -0.02423611469566822, -0.015285694971680641, -0.027201171964406967, -0.07171384990215302, 0.037532828748226166, -0.01563560962677002, -0.012642927467823029, 0.00030444777803495526, 0.03740391135215759, -0.033112868666648865, -0.0044176578521728516, 0.0639052540063858, -0.00339324027299881, -0.046630579978227615, -0.0056170327588915825, 0.032873451709747314, -0.0032919493969529867, 0.02340737171471119, 0.020442316308617592, 0.029724230989813805, -0.045893918722867966, 0.01120644062757492, -0.04887739196419716, 0.009742328897118568, 0.030258310958743095, -0.07219268381595612, 0.024457111954689026, 0.01726546883583069, -0.04688841104507446, 0.009880452416837215, -0.040884632617235184, 0.018987411633133888, 0.040774133056402206, 0.0037638721987605095, -0.007905283011496067, 0.007297538220882416, 0.021031644195318222, -0.03160271421074867, -0.010110658593475819, 0.03893248364329338, -0.008324258029460907, 0.014263579621911049, 0.004940226208418608, -0.0019475448643788695, -0.022394465282559395, 0.0028384430333971977, -0.005170432385057211, 0.012946799397468567, 0.0017069793539121747, 0.04390493780374527, -0.02915332093834877, -0.07675997167825699, -0.019042661413550377, 0.002308968687430024, 0.007219268009066582, -0.007955928333103657, 0.03628050535917282, -0.044862594455480576, -0.021013226360082626, -0.05024021118879318, 0.015957897529006004, -0.00651483703404665, 0.049724552780389786, -0.05539683252573013, -0.010653945617377758, -0.04891422390937805, 0.025285854935646057, 0.01579214818775654, -0.036317337304353714, -0.026630260050296783, -0.058527637273073196, 0.015377777628600597, -0.007477099075913429, -0.02340737171471119, -0.01672218181192875, -0.04025847092270851, 0.029042821377515793, 0.008098656311631203, -0.05635449290275574, 0.016142062842845917, -0.004399241413921118, -0.08780987560749054, -0.0030778576619923115, -0.0008788123959675431, -0.0027141317259520292, 0.030313558876514435, 0.03329703211784363, 0.029668981209397316, 0.0801486074924469, -0.012578469701111317, -0.07661264389753342, -0.000032354768336517736, -0.05252385884523392, 0.023186374455690384, -0.012992841191589832, -0.047956567257642746, -0.014153080992400646, -0.04537825658917427, 0.03314970061182976, -0.004217378795146942, 0.023683618754148483, -0.056170325726270676, -0.013213839381933212, -0.02576468326151371, 0.07808595895767212, 0.052929021418094635, 0.005879467818886042, 0.011666852980852127, -0.012642927467823029, 0.024954358115792274, 0.007025894708931446, 0.04202645272016525, -0.05664915591478348, -0.031142301857471466, -0.040737297385931015, 0.026022514328360558, -0.00818613450974226, 0.026575010269880295, 0.03471510484814644, 0.01833362691104412, 0.0007740685250610113, -0.009001064114272594, -0.00280161015689373, -0.029411152005195618, -0.023388955742120743, -0.03416260704398155, 0.0020914238411933184, -0.028453493490815163, -0.001965961419045925, 0.022707544267177582, -0.015433027409017086, -0.024899108335375786, -0.04198962077498436, -0.01270738523453474, -0.026759175583720207, 0.030516142025589943, -0.03165796399116516, 0.03530443087220192, 0.0009024085011333227, -0.021713053807616234, -0.020442316308617592, -0.027164338156580925, -0.003344896947965026, 0.002426374005153775, -0.021252641454339027, 0.0040838588029146194, -0.03198946267366409, 0.0287665743380785, 0.04243161529302597, 0.06515757739543915, -0.02685125730931759, 0.03845365345478058, 0.029337484389543533, -0.009889660403132439, 0.023830952122807503, -0.051161039620637894, 0.049245722591876984, 0.005354597698897123, 0.021123725920915604, -0.016501184552907944, 0.025691017508506775, -0.0344020240008831, 0.08073794096708298, -0.011289314366877079, -0.014088623225688934, -0.004746852908283472, 0.021160559728741646, 0.037385497242212296, -0.024843858554959297, -0.01563560962677002, 0.01779954694211483, 0.01770746521651745, -0.0011044144630432129, 0.014272787608206272, 0.050166547298431396, 0.00047767796786502004, -0.03889564797282219, -0.03432835638523102, -0.09952276945114136, -0.00231127068400383, -0.033757444471120834, -0.07440266013145447, -0.0368882492184639, 0.06003779172897339, 0.009604205377399921, 0.022302381694316864, -0.005966946016997099, -0.0007579540833830833, -0.004995475523173809, -0.02891390584409237, 0.02093956060707569, -0.03613317385315895, 0.016114437952637672, 0.05005604773759842, 0.032910287380218506, 0.05488117039203644, -0.024125615134835243, 0.01556194294244051, -0.03130805119872093, 0.022486547008156776, -0.038085322827100754, 0.025746267288923264, 0.058638136833906174, 0.09178783744573593, -0.0452309250831604, 0.05970629304647446, 0.011418229900300503, 0.036151591688394547, 0.02832457795739174, 0.03860098496079445, 0.06817788630723953, 0.02585676684975624, -0.022541796788573265, 0.06574690341949463, 0.009502913802862167, -0.007656659930944443, 0.011943100951611996, 0.08132726699113846, -0.048251230269670486, -0.07970661669969559, 0.0006031403900124133, -0.052929021418094635, -0.06504707783460617, 0.045415088534355164, 0.00833346601575613, -0.013195422478020191, -0.003416260704398155, -0.012145682238042355, -0.029319068416953087, 0.06924603879451752, -0.008798482827842236, 0.05009287968277931, 0.006892375182360411, 0.026022514328360558, -0.03038722649216652, 0.012514011934399605, -0.05370251461863518, 0.022983793169260025, 0.030258310958743095, -0.031105469912290573, 0.10983600467443466, -0.025875182822346687, 0.05668598785996437, 0.01681426540017128, -0.007136393804103136, 0.01185101829469204, 0.008761649951338768, 0.01489894837141037, 0.0012442647712305188, -0.003791497088968754, 0.02403353340923786, 0.044273268431425095, 0.02152888849377632, -0.037348661571741104, 0.0008845675620250404, 0.0014272787375375628, -0.02670392580330372, 0.0038237259723246098, 0.010304031893610954, 0.016344644129276276, -0.02659342624247074, -0.051308371126651764, -0.0015792149351909757, 0.004657072480767965, 0.005672282073646784, 0.018352042883634567, 0.04022163525223732, -0.015939481556415558, -0.004037817940115929, 0.015064697712659836, -0.019061077386140823, 0.014189913868904114, -0.020294982939958572, 0.011445854790508747, -0.04666741192340851, 0.009935702197253704, -0.03996380418539047, -0.04239478334784508, -0.009240479208528996, -0.004470605403184891, -0.046335913240909576, 0.0850842297077179, -0.05134520307183266, -0.030663473531603813, 0.01563560962677002, -0.035617511719465256, 0.044567931443452835, 0.060553453862667084, 0.03082922101020813, -0.04445743188261986, -0.03454935550689697, -0.06799372285604477, -0.027274837717413902, -0.043831270188093185, 0.02443869598209858, -0.011731310747563839, -0.017173387110233307, -0.005999174900352955, 0.02075539529323578, 0.026133013889193535, 0.00570451095700264, -0.012615302577614784, 0.027569500729441643, 0.029982062056660652, -0.004696207586675882, -0.039890140295028687, 0.008568276651203632, 0.004265721887350082, 0.03675933554768562, 0.005561782978475094, -0.03386794403195381, 0.07536032050848007, 0.005280931480228901, 0.04349977523088455, 0.014843699522316456, -0.011814185418188572, -0.0403321348130703, -0.06622573733329773, -0.02217346616089344, -0.012504803948104382, 0.010119866579771042, -0.04828806221485138, -0.005027704406529665, -0.0737764984369278, -0.003554384456947446, -0.026040932163596153, -0.05149253457784653, -0.027053838595747948, 0.021657804027199745, 0.004030911717563868, 0.05285535752773285, 0.04998238384723663, 0.04261578246951103, 0.02802991308271885, 0.006887771189212799, -0.00403321348130703, -0.026832841336727142, -0.007329767104238272, -0.0010854224674403667, -0.09613413363695145, 0.010589487850666046, 0.02222871594130993, 0.014659534208476543, 0.03477035090327263, -0.00581501005217433, -0.06427358835935593, 0.027164338156580925, -0.011694477871060371, -0.0398164726793766, -0.015129155479371548, 0.017771922051906586, 0.004047025926411152, 0.006579294800758362, -0.06003779172897339, 0.02326004020869732, -0.0297426488250494, 0.034236274659633636, 0.0015596473822370172, -0.02600409835577011, 0.06990903615951538, 0.036704085767269135, -0.003987172152847052, -0.04552558809518814, -0.02512010559439659, -0.0462254174053669, 0.018950579687952995, -0.011270898394286633, -0.0012845508754253387, -0.007251496892422438, 0.026906507089734077, -0.005059933289885521, -0.07484465837478638, 0.0028062141500413418, -0.00956737156957388, 0.03130805119872093, 0.021160559728741646, -0.015212029218673706, -0.04942988604307175, -0.04976138472557068, -0.03351803123950958, -0.01823233626782894, -0.059116967022418976, -0.026685509830713272, 0.026980172842741013, 0.06703606247901917, -0.02202613465487957, 0.008761649951338768, 0.023720452561974525, 0.003144617425277829, 0.08331624418497086, -0.0875152125954628, 0.048103898763656616, 0.08434756845235825, 0.01270738523453474, -0.03863781690597534, 0.00403321348130703, 0.0129099665209651, 0.016261769458651543, -0.060848116874694824, -0.01519361324608326, -0.04438376426696777, -0.05149253457784653, -0.03651991859078407, 0.03668566793203354, 0.05532316863536835, -0.007527744397521019, -0.0062247770838439465, 0.020479148253798485, 0.0013167797587811947, 0.07462365925312042, 0.027716832235455513, 0.06762538850307465, -0.057348981499671936, 0.05462333932518959, -0.01735755242407322, 0.043683938682079315, 0.05812247470021248, 0.028140412643551826, -0.014493785798549652, 0.003319574287161231, -0.022247131913900375, -0.00892739836126566, 0.0038904857356101274, 0.04611491784453392, 0.03710924834012985, -0.042947277426719666, -0.028692906722426414, 0.06456825137138367, -0.02149205654859543, -0.06151111051440239, 0.01878483034670353, -0.004661676473915577, 0.0006301896064542234, 0.04895105957984924, -0.029282236471772194, -0.015294903889298439, 0.01715496927499771, 0.05477067083120346, 0.01477003376930952, -0.035378098487854004, 0.00025855039712041616, 0.05326052010059357, 0.019392574205994606, 0.07558131963014603, -0.017191803082823753, 0.061437446624040604, -0.0194109920412302, 0.012053599581122398, 0.04537825658917427, 0.050277046859264374, -0.014447744935750961, 0.009604205377399921, -0.02502802386879921, 0.03486243635416031, -0.10615270584821701, -0.04902472347021103, -0.029374318197369576, 0.031087052077054977, 0.004291044548153877, -0.013388795778155327, 0.06950387358665466, -0.04788289964199066, 0.05919063091278076, 0.04217378422617912, -0.020829061046242714, 0.010313239879906178, -0.023720452561974525, -0.010147491469979286, 0.012072015553712845, -0.09996476769447327, -0.06563640385866165, 0.03716449812054634, -0.04405226930975914, 0.01587502285838127, -0.058232974261045456, 0.001193619449622929, -0.014779241755604744, -0.0658942386507988, -0.0006158017204143107, 0.006008383352309465, 0.0722663477063179, 0.01844412460923195, 0.04036897048354149, -0.03556226193904877, -0.0209027286618948, 0.03646467253565788, 0.0889885276556015, -0.038711484521627426, -0.00995411816984415, -0.01691555604338646, 0.024954358115792274, -0.031160717830061913, 0.02075539529323578, 0.021805135533213615, 0.001043985364958644, 0.011740518733859062, -0.027551084756851196, 0.008618921972811222, 0.025249021127820015, 0.003630352672189474, -0.03337069973349571, 0.031694795936346054, 0.05418134480714798, 0.011353772133588791, -0.0287665743380785, -0.0580119751393795, -0.04482576251029968, -0.04935622215270996, 0.03677774965763092, 0.07141918689012527, -0.0054282634519040585, 0.0072054555639624596, 0.022136634215712547, -0.018352042883634567, -0.0013559148646891117, -0.02502802386879921, -0.008872149512171745, 0.037680160254240036, -0.031731631606817245, 0.014014956541359425, -0.025285854935646057, 0.012366680428385735, -0.00862813089042902, 0.015515901148319244, -0.05650182440876961, 0.051455702632665634, -0.009438456036150455, 0.04268944635987282, -0.009990951046347618, -0.028453493490815163, 0.023370539769530296, -0.013287505134940147, -0.024696527048945427, 0.026482926681637764, 0.023904617875814438, -0.01373870950192213, 0.014374078251421452, -0.022449713200330734, 0.02694334089756012, 0.07712830603122711, 0.027808915823698044, -0.013121756725013256, 0.009825202636420727, 0.008038802072405815, -0.0978284478187561, 0.04408910125494003, 0.02105006016790867, -0.012495595961809158, -0.03900614753365517, 0.04607808217406273, -0.03762491047382355, 0.0026657884009182453, -0.010856526903808117, -0.03353644534945488, 0.0030870658811181784, 0.03659358620643616, -0.003961849492043257, 0.023186374455690384, 0.013950498774647713, -0.04346293956041336, 0.012514011934399605, -0.026759175583720207, -0.007955928333103657, -0.025838350877165794, 0.04799339920282364, -0.005989966914057732, -0.011473479680716991, -0.08795720338821411, -0.030866054818034172, -0.03742232918739319, -0.022155050188302994, 0.04342610761523247, 0.040737297385931015, -0.056870151311159134, -0.04976138472557068, 0.02093956060707569, -0.010847318917512894, -0.07480782270431519, -0.00044487358536571264, 0.02222871594130993, -0.05812247470021248, -0.009751536883413792, -0.005861051380634308, 0.03176846355199814, 0.05550733208656311, -0.048251230269670486, -0.02512010559439659, 0.026538176462054253, 0.06659406423568726, 0.011280106380581856, 0.03362853080034256, -0.002875276142731309, -0.028398243710398674, -0.03357328101992607, 0.05521266907453537, -0.006068236660212278, 0.04254211485385895, -0.06762538850307465, 0.05237652733922005, -0.016630100086331367, -0.032431457191705704, 0.015073905698955059, -0.04173178970813751, 0.029190152883529663, 0.00656548235565424, -0.020423898473381996, 0.025967266410589218, 0.0071317898109555244, 0.011234065517783165, 0.031087052077054977, -0.0104513643309474, -0.02167622186243534, 0.05908013507723808, -0.053076352924108505, -0.00828282069414854, -0.05451283976435661, 0.07381333410739899, 0.01769825629889965, -0.03572801128029823, 0.06792005151510239, -0.04313144460320473, 0.05252385884523392, 0.014484577812254429, -0.018849289044737816, 0.029024405404925346, 0.03762491047382355, -0.0003507767687551677, -0.01398733165115118, 0.013048090972006321, -0.029668981209397316, 0.013444045558571815, 0.06806738674640656, -0.02167622186243534, -0.01603156328201294, -0.05738581344485283, -0.042210619896650314, 0.07333450764417648, -0.00320216896943748, 0.04169495776295662, 0.0368698351085186, -0.05038754642009735, 0.04725674167275429, -0.022597046568989754, 0.042947277426719666, 0.04828806221485138, 0.03878514841198921, 0.016086813062429428, -0.010285615921020508, -0.014742408879101276, -0.01691555604338646, -0.03033197671175003, 0.026832841336727142, -0.00835648737847805, 0.02473336085677147, 0.09443981200456619, -0.07222951203584671, -0.005907092709094286, -0.01961357332766056, 0.04066363349556923 ]
42,852
linearmodels.panel.model
fit
Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator (see notes). Default is "unadjusted". debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. bandwidth : float The bandwidth to use when cov_type is "kernel". If None, it is automatically computed. kernel : str The kernel to use. None chooses the default kernel. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import FamaMacBeth >>> mod = FamaMacBeth(y, x) >>> res = mod.fit(cov_type="kernel", kernel="Parzen") Notes ----- Two covariance estimators are supported: * "unadjusted", "homoskedastic", "robust", "heteroskedastic" use the standard covariance estimator of the T parameter estimates. * "kernel" is a HAC estimator. Configurations options are:
def fit( self, cov_type: str = "unadjusted", debiased: bool = True, bandwidth: float | None = None, kernel: str | None = None, ) -> FamaMacBethResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator (see notes). Default is "unadjusted". debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. bandwidth : float The bandwidth to use when cov_type is "kernel". If None, it is automatically computed. kernel : str The kernel to use. None chooses the default kernel. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import FamaMacBeth >>> mod = FamaMacBeth(y, x) >>> res = mod.fit(cov_type="kernel", kernel="Parzen") Notes ----- Two covariance estimators are supported: * "unadjusted", "homoskedastic", "robust", "heteroskedastic" use the standard covariance estimator of the T parameter estimates. * "kernel" is a HAC estimator. Configurations options are: """ y = cast(Float64Array, self._y) x = cast(Float64Array, self._x) root_w = cast(Float64Array, np.sqrt(self._w)) wy = cast(Float64Array, root_w * y) wx = cast(Float64Array, root_w * x) dep = self.dependent.dataframe exog = self.exog.dataframe index = self.dependent.index wy_df = DataFrame(wy[self._not_null], index=index, columns=dep.columns) wx_df = DataFrame( wx[self._not_null], index=exog.notnull().index, columns=exog.columns ) yx = DataFrame( np.c_[wy_df.values, wx_df.values], columns=list(wy_df.columns) + list(wx_df.columns), index=wy_df.index, ) has_constant = self.has_constant def single(z: DataFrame) -> Series: exog = z.iloc[:, 1:].values cols = list(z.columns) + ["r2", "adv_r2"] if exog.shape[0] < exog.shape[1]: return Series([np.nan] * (len(z.columns) + 2), index=cols) dep = z.iloc[:, :1].values params, _, rank, _ = _lstsq(exog, dep) nexog = exog.shape[1] if rank != nexog: return Series([np.nan] * (len(z.columns) + 2), index=cols) err = dep - exog @ params sse = float(np.squeeze(err.T @ err)) if has_constant: dep_demean = dep - dep.mean() tss = float(np.squeeze(dep_demean.T @ dep_demean)) else: tss = float(np.squeeze(dep.T @ dep)) r2 = 1 - sse / tss nobs = exog.shape[0] if nobs - nexog > 0: adj_r2 = 1 - (sse / (nobs - nexog)) / (tss / (nobs - int(has_constant))) else: adj_r2 = np.nan return Series(np.r_[np.nan, params.ravel(), r2, adj_r2], index=cols) all_params = yx.groupby(level=1).apply(single) avg_r2 = np.nanmean(all_params.iloc[:, -2]) avg_adj_r2_values = all_params.iloc[:, -1] if np.any(np.isfinite(avg_adj_r2_values)): avg_adj_r2 = np.nanmean(avg_adj_r2_values) else: avg_adj_r2 = np.nan all_params = all_params.iloc[:, 1:-2] params = np.asarray(all_params.mean(axis=0).values[:, None], dtype=float) wy = np.asarray(wy_df) wx = np.asarray(wx_df) index = self.dependent.index fitted = DataFrame(self.exog.values2d @ params, index, ["fitted_values"]) effects = DataFrame(np.full(fitted.shape, np.nan), index, ["estimated_effects"]) idiosyncratic = DataFrame( self.dependent.values2d - fitted.values, index, ["idiosyncratic"] ) eps = self.dependent.values2d - fitted.values weps = wy - wx @ params w = self.weights.values2d root_w = cast(Float64Array, np.sqrt(w)) # residual_ss = float(np.squeeze(weps.T @ weps)) y = e = self.dependent.values2d if self.has_constant: e = y - (w * y).sum() / w.sum() total_ss = float(np.squeeze(w.T @ (e**2))) r2 = 1 - residual_ss / total_ss if cov_type not in ( "robust", "unadjusted", "homoskedastic", "heteroskedastic", "kernel", ): raise ValueError("Unknown cov_type") bandwidth = 0.0 if cov_type != "kernel" else bandwidth cov = FamaMacBethCovariance( wy, wx, params, all_params, debiased=debiased, kernel=kernel, bandwidth=bandwidth, ) df_resid = wy.shape[0] - params.shape[0] res = self._postestimation( params, cov, debiased, df_resid, weps, wy, wx, root_w ) index = self.dependent.index res.update( dict( df_resid=df_resid, df_model=x.shape[1], nobs=y.shape[0], residual_ss=residual_ss, total_ss=total_ss, r2=r2, resids=eps, wresids=weps, index=index, fitted=fitted, effects=effects, idiosyncratic=idiosyncratic, all_params=all_params, avg_r2=avg_r2, avg_adj_r2=avg_adj_r2, ) ) return FamaMacBethResults(res)
(self, cov_type: str = 'unadjusted', debiased: bool = True, bandwidth: Optional[float] = None, kernel: Optional[str] = None) -> linearmodels.panel.results.FamaMacBethResults
[ 0.04762786626815796, -0.029316069558262825, 0.03382954001426697, -0.0024071845691651106, -0.005206611473113298, -0.06520891189575195, -0.09594350308179855, -0.05493539199233055, -0.0070173731073737144, 0.018763143569231033, -0.00625975476577878, -0.007860962301492691, 0.004223319236189127, 0.045134712010622025, -0.036860015243291855, 0.0800388902425766, -0.005300641991198063, 0.034237902611494064, 0.000329107278957963, 0.009650231339037418, -0.054462552070617676, -0.09551364928483963, -0.06121126562356949, 0.05347388610243797, -0.001311055850237608, -0.01973031647503376, -0.020804952830076218, -0.026586493477225304, 0.016635365784168243, -0.002225839765742421, -0.012111147865653038, -0.06035155802965164, -0.00855410285294056, -0.061340223997831345, 0.04436097294092178, -0.01651715487241745, 0.039826009422540665, -0.0072967782616615295, -0.008054397068917751, -0.027510682120919228, 0.01676432229578495, -0.06731519848108292, 0.0892377719283104, 0.00013844334171153605, -0.03666657954454422, 0.014593556523323059, -0.05244223773479462, 0.08175830543041229, 0.012874139472842216, 0.013368471525609493, -0.00280748656950891, -0.08377861976623535, 0.03860092535614967, 0.0003124839859083295, 0.02950950339436531, 0.01099889911711216, -0.01808612421154976, 0.019332701340317726, 0.07853439450263977, -0.05979274585843086, 0.04128751531243324, -0.012250849977135658, 0.019042549654841423, 0.006952894851565361, -0.003379730274900794, 0.004988997709006071, -0.017967913299798965, -0.013486681506037712, 0.008812014944851398, 0.02148197405040264, 0.0320456437766552, 0.023577513173222542, -0.02252436988055706, 0.025791263207793236, -0.012755929492413998, -0.024781106039881706, -0.041609905660152435, -0.03664508834481239, -0.057600490748882294, -0.043845146894454956, 0.041437964886426926, 0.08438041806221008, -0.06262978166341782, -0.040664225816726685, -0.009591125883162022, -0.003532865783199668, -0.03079906664788723, 0.03580687195062637, 0.02604917623102665, -0.02336258627474308, -0.018322544172406197, -0.000595751334913075, 0.06765908002853394, 0.03907376527786255, 0.0456075519323349, -0.027467695996165276, -0.019708823412656784, -0.042512599378824234, 0.036301203072071075, -0.0033018190879374743, -0.02385691925883293, 0.027424709871411324, 0.015378041192889214, 0.08042575418949127, -0.01251950953155756, -0.003008980769664049, -0.022051529958844185, -0.018870608881115913, 0.015292069874703884, -0.07672900706529617, -0.059276919811964035, 0.002223153132945299, -0.0010544866090640426, -0.05386075749993324, -0.024394236505031586, -0.004994370974600315, -0.05050789192318916, 0.02828441932797432, -0.012734436430037022, 0.06542383879423141, 0.014357136562466621, 0.04453291371464729, -0.037031956017017365, -0.015829388052225113, 0.04487679898738861, -0.008715298026800156, 0.023620499297976494, -0.0013835938880220056, 0.04483381286263466, -0.0340229757130146, -0.022051529958844185, -0.01620551012456417, -0.012594733387231827, 0.0029498757794499397, -0.00789320096373558, 0.02269631251692772, 0.011853234842419624, -0.03810659050941467, -0.0025804697070270777, -0.04199677333235741, 0.04883145913481712, 0.08154337853193283, -0.001852403744123876, -0.024910062551498413, -0.01486221607774496, 0.020246142521500587, 0.04990609362721443, -0.06765908002853394, 0.004013765603303909, 0.051840439438819885, -0.024523193016648293, -0.0195153895765543, -0.07217255234718323, -0.016162525862455368, -0.0075117056258022785, -0.05377478525042534, -0.015625206753611565, 0.029702939093112946, 0.006351098883897066, 0.03737584128975868, -0.06989432126283646, -0.06254381686449051, 0.008645446971058846, 0.005179745610803366, -0.0010779942385852337, 0.023233629763126373, -0.046811144798994064, 0.0377197228372097, 0.017677761614322662, -0.008812014944851398, -0.00789320096373558, -0.03275490552186966, -0.0716567263007164, -0.029466519132256508, -0.051281630992889404, 0.05906199291348457, -0.0034280887339264154, -0.037225391715765, -0.0054564643651247025, -0.0139487748965621, 0.055193305015563965, -0.0186126958578825, -0.06009364500641823, -0.02660798653960228, -0.007995291613042355, 0.01867717318236828, 0.018709411844611168, 0.01330399326980114, 0.03838599845767021, 0.024114832282066345, -0.02437274344265461, -0.005770795047283173, 0.052743133157491684, -0.016581634059548378, -0.0025764398742467165, -0.02688739262521267, 0.08055471628904343, 0.011659800074994564, 0.06538085639476776, -0.03537701815366745, -0.001684491871856153, -0.030283242464065552, 0.015485504642128944, -0.006351098883897066, -0.0039304811507463455, -0.014099224470555782, 0.010069339536130428, -0.012981602922081947, -0.02063301019370556, 0.004336156416684389, -0.02133152447640896, -0.013733847998082638, -0.021739885210990906, -0.03802062198519707, 0.05093774572014809, -0.033571626991033554, 0.017720747739076614, 0.010149937123060226, 0.020299874246120453, -0.019579866901040077, -0.01074098702520132, -0.014066984876990318, -0.022330936044454575, 0.007318270858377218, 0.04453291371464729, -0.03924570605158806, 0.03152982145547867, 0.03866540268063545, 0.04221170023083687, -0.05691272020339966, 0.019955990836024284, 0.03604329004883766, 0.0072914049960672855, -0.06121126562356949, -0.00019712853827513754, 0.012616226449608803, -0.037074942141771317, 0.014851469546556473, -0.05355985835194588, -0.020718982443213463, 0.0260921623557806, -0.031164443120360374, 0.009456796571612358, 0.011735024861991405, -0.03286236897110939, -0.01066576223820448, 0.09817874431610107, 0.045865464955568314, -0.04732696712017059, -0.035076119005680084, 0.007995291613042355, -0.014088477939367294, 0.0005863482365384698, 0.012089654803276062, -0.03189519792795181, -0.048272646963596344, 0.07406391203403473, -0.008161860518157482, 0.05691272020339966, -0.031164443120360374, 0.007952306419610977, 0.021847350522875786, -0.03466775640845299, 0.04522068053483963, -0.05437657982110977, 0.021643169224262238, -0.023276615887880325, -0.01220786478370428, -0.034237902611494064, 0.05196939781308174, -0.0763421431183815, 0.043630219995975494, -0.034001484513282776, -0.032668933272361755, -0.026758436113595963, 0.0567837655544281, 0.019117774441838264, -0.053903739899396896, 0.02895069308578968, 0.02705933339893818, -0.005717063322663307, -0.07827648520469666, -0.0027779340744018555, 0.040943630039691925, -0.021761378273367882, -0.019214492291212082, -0.026178132742643356, -0.023770948871970177, 0.04390962794423103, -0.008000665344297886, 0.008151113986968994, -0.007044238969683647, 0.05566614493727684, 0.013583398424088955, 0.0640912875533104, -0.016678350046277046, 0.04646725952625275, -0.021815109997987747, 0.030648618936538696, 0.019880766049027443, 0.010832331143319607, 0.08115650713443756, 0.05450553819537163, 0.03802062198519707, 0.0002923345600720495, -0.013604891486465931, 0.07243046909570694, -0.0418248325586319, 0.014292658306658268, -0.012154133059084415, -0.004403321072459221, 0.03537701815366745, 0.009435304440557957, 0.02263183332979679, -0.026973363012075424, -0.04926131293177605, -0.00412122905254364, 0.02081569842994213, 0.04410305991768837, 0.09568558633327484, -0.007995291613042355, -0.033614613115787506, 0.06121126562356949, -0.04337230697274208, 0.03150832653045654, 0.014152956195175648, 0.0446188859641552, 0.013368471525609493, -0.017591791227459908, -0.03247550129890442, -0.028026506304740906, -0.02430826611816883, 0.011444873176515102, 0.02503901906311512, -0.00013550488802138716, 0.0012841899879276752, 0.00697438744828105, -0.006044827401638031, 0.04672517254948616, -0.006173783913254738, 0.02213750220835209, 0.008914105594158173, -0.021041372790932655, 0.00789320096373558, 0.0005880273529328406, -0.06727221608161926, 0.03374357149004936, 0.03486119210720062, 0.02682291343808174, 0.07303225994110107, -0.027747102081775665, 0.05235626548528671, 0.050894759595394135, 0.07591228932142258, 0.030648618936538696, 0.04294245317578316, -0.055580172687768936, 0.011949951760470867, 0.014260419644415379, 0.0019235984655097127, -0.020826445892453194, 0.06667041778564453, -0.06761609762907028, 0.05381777137517929, 0.0025294243823736906, -0.0025200212839990854, -0.044962771236896515, 0.02199779823422432, 0.03494716063141823, -0.05695570632815361, 0.0018053884850814939, -0.025167975574731827, -0.014948186464607716, 0.018945831805467606, 0.01741984859108925, 0.02454468607902527, -0.049605198204517365, -0.014357136562466621, 0.07148478925228119, 0.02665097266435623, 0.03458178788423538, -0.04298543930053711, -0.056138984858989716, -0.0017583731096237898, 0.024630656465888023, -0.0003156743186991662, -0.001689865137450397, -0.07488063722848892, 0.024974539875984192, -0.06783102452754974, 0.058890052139759064, -0.019440164789557457, -0.0043334695510566235, 0.03580687195062637, -0.03051966242492199, 0.012755929492413998, 0.02000972256064415, 0.04711204022169113, -0.061727091670036316, 0.013637131080031395, -0.047155026346445084, -0.018397768959403038, 0.0020256887655705214, 0.02772560901939869, -0.036408666521310806, -0.059663791209459305, 0.031658776104450226, 0.04672517254948616, -0.02347004972398281, 0.06082439795136452, -0.025060512125492096, -0.001520609948784113, -0.07672900706529617, 0.012949363328516483, -0.04646725952625275, 0.04745592549443245, 0.002987487940117717, -0.0335286445915699, 0.09276258200407028, 0.013422203250229359, 0.06847580522298813, -0.0011780697386711836, 0.04453291371464729, 0.02856382541358471, 0.03331371396780014, 0.04427500441670418, -0.06284471601247787, 0.01696850173175335, -0.03436685726046562, -0.03537701815366745, -0.00036638369783759117, -0.02385691925883293, -0.06254381686449051, -0.017967913299798965, -0.02049330808222294, 0.0009174704900942743, 0.005104520823806524, -0.005064222030341625, 0.030003836378455162, -0.004994370974600315, -0.008032904006540775, 0.02381393313407898, -0.0008563505252823234, -0.028800245374441147, -0.10178951919078827, -0.015485504642128944, 0.04539262503385544, -0.029939359053969383, -0.0968891829252243, -0.0269948560744524, 0.07419286668300629, 0.04565053805708885, 0.04229767248034477, 0.01718342863023281, -0.02437274344265461, -0.00998874194920063, 0.036473143845796585, -0.057600490748882294, -0.015066396445035934, 0.017484327778220177, 0.015130874700844288, 0.005093774758279324, -0.0311429500579834, -0.007597676478326321, 0.014324897900223732, 0.05252820625901222, 0.054247625172138214, -0.00940843764692545, 0.038880329579114914, 0.03279789164662361, -0.01644193008542061, -0.016162525862455368, -0.005620346404612064, -0.015528489835560322, 0.01805388368666172, 0.008709924295544624, -0.022739296779036522, 0.02761814557015896, 0.03458178788423538, -0.024996032938361168, -0.011831741780042648, -0.03045518323779106, -0.018773891031742096, 0.009048434905707836, 0.052571192383766174, -0.03466775640845299, 0.007570810616016388, -0.03017577901482582, 0.022158993408083916, 0.01054755225777626, -0.023448556661605835, 0.02147122658789158, 0.04210423678159714, 0.04595143347978592, -0.05901900678873062, 0.04315738007426262, 0.029079649597406387, -0.023792440071702003, 0.029445026069879532, -0.05506434664130211, 0.027295753359794617, -0.02091241627931595, -0.08829209208488464, -0.04453291371464729, -0.05012102425098419, -0.05024997889995575, -0.046252332627773285, -0.03198116645216942, -0.026479030027985573, -0.012573241256177425, -0.01054755225777626, -0.029251592233777046, 0.005760048981755972, -0.022330936044454575, -0.010386357083916664, -0.00956963375210762, 0.0283488966524601, 0.03522656857967377, 0.020471815019845963, -0.0005215342971496284, 0.017548805102705956, 0.01976255513727665, 0.03621523454785347, -0.0278975497931242, 0.0661545917391777, 0.03664508834481239, 0.00043220515362918377, -0.014658034779131413, 0.07376301288604736, 0.021761378273367882, -0.049046386033296585, -0.04913235828280449, 0.027854565531015396, 0.06912058591842651, 0.03374357149004936, -0.0680459514260292, -0.015259831212460995, -0.04818667843937874, -0.06284471601247787, -0.03793464973568916, -0.02011718600988388, -0.01959061436355114, 0.000029993258067406714, -0.04754189774394035, 0.006415576674044132, -0.003164802910760045, 0.00843051914125681, -0.0024098712019622326, -0.0002777262416202575, -0.024523193016648293, -0.026479030027985573, -0.019397178664803505, 0.07010924816131592, 0.04771383851766586, 0.016119539737701416, 0.008795895613729954, 0.009005449712276459, 0.019526135176420212, -0.01199293788522482, 0.003325998317450285, -0.034173425287008286, -0.017720747739076614, 0.04689711332321167, -0.07195762544870377, 0.012594733387231827, 0.04655323177576065, 0.03956809639930725, 0.04137348383665085, -0.030992502346634865, -0.019375687465071678, -0.042792003601789474, 0.040105413645505905, -0.009440677240490913, 0.025468872860074043, -0.02531842328608036, 0.02218048647046089, 0.0321316160261631, -0.025017526000738144, -0.05532225966453552, -0.009489036165177822, 0.02632858231663704, -0.023104673251509666, -0.01784970425069332, -0.0237494558095932, 0.011294424533843994, -0.001520609948784113, -0.036580607295036316, 0.0158186424523592, -0.01199293788522482, -0.018956579267978668, -0.05755750462412834, 0.05717063322663307, -0.05622495338320732, -0.04135199263691902, 0.007662154734134674, 0.06950745731592178, -0.062070973217487335, 0.019493896514177322, 0.013594144955277443, 0.028972186148166656, -0.008543356321752071, -0.00862395390868187, 0.05158252641558647, -0.02832740545272827, 0.014926694333553314, 0.013895043171942234, -0.0024904687888920307, 0.021707646548748016, 0.018279558047652245, -0.01788194291293621, 0.02011718600988388, -0.006173783913254738, 0.007619169075042009, 0.005249596666544676, -0.02291123941540718, -0.023276615887880325, -0.01976255513727665, 0.014195941388607025, 0.04332932457327843, 0.028069492429494858, 0.019085535779595375, 0.02347004972398281, 0.009693216532468796, 0.03438835218548775, -0.019913004711270332, 0.007124836556613445, 0.046080391854047775, -0.0986945703625679, 0.008833508007228374, -0.018913593143224716, 0.022739296779036522, 0.04163139685988426, 0.050335951149463654, -0.03544149547815323, 0.018881354480981827, 0.02598469890654087, 0.02693037874996662, 0.015249084681272507, -0.010343370959162712, 0.026865899562835693, 0.013658623211085796, 0.06082439795136452, 0.0274462029337883, 0.02426527999341488, -0.006463935598731041, 0.04453291371464729, -0.032454006373882294, -0.01899956353008747, 0.007114090025424957, 0.007597676478326321, -0.009908143430948257, -0.0465102456510067, -0.06843282282352448, -0.00036000306135974824, 0.04500575363636017, -0.0019464343786239624, 0.009096793830394745, 0.030326226726174355, 0.018806129693984985, -0.017516566440463066, 0.03152982145547867, -0.03744031861424446, 0.02301870286464691, -0.04509172588586807, 0.014421614818274975, 0.0020431517623364925, -0.0013654594076797366, -0.019160760566592216, -0.010209041647613049, -0.011756517924368382, 0.021396001800894737, -0.029939359053969383, -0.07144179940223694, -0.023513035848736763, -0.003898242022842169, -0.017967913299798965, -0.04075019806623459, 0.018773891031742096, 0.01665685698390007, -0.025017526000738144, 0.10462655872106552, 0.05919095128774643, 0.015625206753611565, 0.0047982498072087765, 0.09826471656560898, -0.03670956566929817, -0.004604815039783716, 0.008559475652873516, -0.03217460215091705, -0.0474129393696785, -0.05377478525042534, -0.02441572956740856, -0.002178824506700039, 0.021256299689412117, 0.03421641141176224, -0.0771588608622551, -0.016323721036314964, -0.026307089254260063, 0.0025012153200805187, -0.007925440557301044, -0.0031003248877823353, 0.008951717987656593, 0.007672900799661875, 0.031551312655210495, 0.004183020442724228, 0.07569736242294312, -0.013056827709078789, 0.011735024861991405, -0.00510720768943429, -0.08407951891422272, -0.02218048647046089, 0.026565002277493477, 0.01148785836994648, -0.0018349409801885486, 0.03142235800623894, -0.0015904612373560667, -0.039654068648815155, 0.010047846473753452, -0.020192410796880722, 0.05325895920395851, 0.010880689136683941, 0.06293068081140518, 0.00394660048186779, -0.004763323813676834, -0.015721924602985382, -0.030283242464065552, 0.000351271650288254, -0.0014144895831122994, 0.04474784433841705, -0.02817695587873459, 0.05751451849937439, -0.0190640427172184, -0.005085714627057314, 0.02839188277721405, -0.00855410285294056, -0.034409843385219574, 0.008446638472378254, -0.021256299689412117, 0.01433564443141222, 0.0558810718357563, -0.026522016152739525, 0.02364199236035347, -0.060007672756910324, -0.027317246422171593, 0.00040970498230308294, 0.04745592549443245, 0.0030734590254724026, -0.021245554089546204, 0.06576772034168243, -0.04908937215805054, 0.047026071697473526, -0.033163268119096756, 0.02120256796479225, 0.05282910540699959, 0.06331755220890045, 0.022502876818180084, 0.022717805579304695, -0.016925517469644547, -0.042555585503578186, -0.03928869217634201, -0.009107540361583233, 0.012498016469180584, 0.03488268330693245, 0.0474989116191864, -0.013583398424088955, 0.012068161740899086, -0.016807306557893753, 0.034904178231954575 ]
42,855
linearmodels.panel.model
FirstDifferenceOLS
First difference model for panel data Parameters ---------- dependent : array_like Dependent (left-hand-side) variable (time by entity) exog : array_like Exogenous or right-hand-side variables (variable by time by entity). weights : array_like Weights to use in estimation. Assumes residual variance is proportional to inverse of weight to that the residual time the weight should be homoskedastic. Notes ----- The model is given by .. math:: \Delta y_{it}=\beta^{\prime}\Delta x_{it}+\Delta\epsilon_{it}
class FirstDifferenceOLS(_PanelModelBase): r""" First difference model for panel data Parameters ---------- dependent : array_like Dependent (left-hand-side) variable (time by entity) exog : array_like Exogenous or right-hand-side variables (variable by time by entity). weights : array_like Weights to use in estimation. Assumes residual variance is proportional to inverse of weight to that the residual time the weight should be homoskedastic. Notes ----- The model is given by .. math:: \Delta y_{it}=\beta^{\prime}\Delta x_{it}+\Delta\epsilon_{it} """ def __init__( self, dependent: PanelDataLike, exog: PanelDataLike, *, weights: PanelDataLike | None = None, check_rank: bool = True, ): super().__init__(dependent, exog, weights=weights, check_rank=check_rank) if self._constant: raise ValueError( "Constants are not allowed in first difference regressions." ) if self.dependent.nobs < 2: raise ValueError("Panel must have at least 2 time periods") def _setup_clusters( self, cov_config: Mapping[str, bool | float | str | IntArray | DataFrame | PanelData], ) -> dict[str, bool | float | str | IntArray | DataFrame | PanelData]: cov_config_upd = dict(cov_config).copy() cluster_types = ("clusters", "cluster_entity") common = set(cov_config.keys()).intersection(cluster_types) if not common: return cov_config_upd clusters = cov_config.get("clusters", None) clusters_frame: DataFrame | None = None if clusters is not None: cluster_data = cast(Union[IntArray, DataFrame, PanelData], clusters) clusters_panel = self.reformat_clusters(cluster_data) fd = clusters_panel.first_difference() fd_array = fd.values2d if np.any(fd_array.flat[np.isfinite(fd_array.flat)] != 0): raise ValueError( "clusters must be identical for values used " "to compute the first difference" ) clusters_frame = clusters_panel.dataframe.copy() cluster_entity = cov_config_upd.pop("cluster_entity", False) if cluster_entity: group_ids = self.dependent.entity_ids.squeeze() name = "cov.cluster.entity" group_ids_s = Series(group_ids, index=self.dependent.index, name=name) if clusters_frame is not None: clusters_frame[name] = group_ids_s else: clusters_frame = DataFrame(group_ids_s) assert clusters_frame is not None cluster_data = PanelData(clusters_frame) values = cluster_data.values3d[:, 1:] cluster_frame = panel_to_frame( values, cluster_data.panel.items, cluster_data.panel.major_axis[1:], cluster_data.panel.minor_axis, True, ) cluster_frame = PanelData(cluster_frame).dataframe cluster_frame = cluster_frame.loc[self.dependent.first_difference().index] cluster_frame = cluster_frame.astype(np.int64) cov_config_upd["clusters"] = ( cluster_frame.values if cluster_frame is not None else None ) return cov_config_upd def fit( self, *, cov_type: str = "unadjusted", debiased: bool = True, **cov_config: bool | float | str | IntArray | DataFrame | PanelData, ) -> PanelResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator. See Notes. debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional covariance-specific options. See Notes. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import FirstDifferenceOLS >>> mod = FirstDifferenceOLS(y, x) >>> robust = mod.fit(cov_type="robust") >>> clustered = mod.fit(cov_type="clustered", cluster_entity=True) Notes ----- Three covariance estimators are supported: * "unadjusted", "homoskedastic" - Assume residual are homoskedastic * "robust", "heteroskedastic" - Control for heteroskedasticity using White's estimator * "clustered` - White's. Configuration options are: * ``clusters`` - Input containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables * ``cluster_entity`` - Boolean flag indicating to use entity clusters * "kernel" - Driscoll-Kraay HAC estimator. Configurations options are: * ``kernel`` - One of the supported kernels (bartlett, parzen, qs). Default is Bartlett's kernel, which is produces a covariance estimator similar to the Newey-West covariance estimator. * ``bandwidth`` - Bandwidth to use when computing the kernel. If not provided, a naive default is used. When using a clustered covariance estimator, all cluster ids must be identical within a first difference. In most scenarios, this requires ids to be identical within an entity. """ y_fd = self.dependent.first_difference() time_ids = y_fd.time_ids entity_ids = y_fd.entity_ids index = y_fd.index y = cast(Float64Array, y_fd.values2d) x = cast(Float64Array, self.exog.first_difference().values2d) if np.all(self.weights.values2d == 1.0): w = root_w = np.ones_like(y) else: w = cast(Float64Array, 1.0 / self.weights.values3d) w = w[:, :-1] + w[:, 1:] w = cast(Float64Array, 1.0 / w) w_frame = panel_to_frame( w, self.weights.panel.items, self.weights.panel.major_axis[1:], self.weights.panel.minor_axis, True, ) w_frame = w_frame.reindex(self.weights.index).dropna(how="any") index = cast(MultiIndex, w_frame.index) w = np.require(w_frame, requirements="W") w /= w.mean() root_w = cast(Float64Array, np.sqrt(w)) wx = root_w * x wy = root_w * y params = _lstsq(wx, wy, rcond=None)[0] df_resid = y.shape[0] - x.shape[1] cov_config = self._setup_clusters(cov_config) extra_df = 0 if "extra_df" in cov_config: cov_config = cov_config.copy() _extra_df = cov_config.pop("extra_df") assert isinstance(_extra_df, (str, int)) extra_df = int(_extra_df) cov = setup_covariance_estimator( self._cov_estimators, cov_type, wy, wx, params, entity_ids, time_ids, debiased=debiased, extra_df=extra_df, **cov_config, ) weps = wy - wx @ params fitted = DataFrame( self.exog.values2d @ params, self.dependent.index, ["fitted_values"] ) idiosyncratic = DataFrame( self.dependent.values2d - fitted.values, self.dependent.index, ["idiosyncratic"], ) effects = DataFrame( np.full_like(np.asarray(fitted), np.nan), self.dependent.index, ["estimated_effects"], ) eps = y - x @ params residual_ss = float(np.squeeze(weps.T @ weps)) total_ss = float(np.squeeze(w.T @ (y**2))) r2 = 1 - residual_ss / total_ss res = self._postestimation( params, cov, debiased, df_resid, weps, wy, wx, root_w ) res.update(
(dependent: 'PanelDataLike', exog: 'PanelDataLike', *, weights: 'PanelDataLike | None' = None, check_rank: 'bool' = True)
[ 0.024063898250460625, -0.0722573846578598, 0.006705704145133495, 0.03976345807313919, 0.010745548643171787, -0.024458028376102448, -0.03477112948894501, -0.021469200029969215, 0.014758022502064705, 0.0446900948882103, -0.025749903172254562, -0.012119533494114876, 0.015349219553172588, 0.009311349131166935, -0.028070898726582527, 0.06673954427242279, -0.022126086056232452, 0.01418872270733118, 0.030851712450385094, -0.015294479206204414, -0.0371578112244606, -0.09091292321681976, -0.0505363754928112, 0.010696282610297203, 0.002934087533503771, -0.027698663994669914, -0.035537492483854294, -0.02128308266401291, 0.0008512138738296926, -0.03050137311220169, -0.05220048502087593, -0.040070001035928726, -0.07089982181787491, -0.04974811151623726, -0.0008881636313162744, -0.05263840779662132, 0.03606300428509712, -0.008501190692186356, -0.0170899648219347, 0.007827882654964924, 0.000720521027687937, -0.037004537880420685, 0.061834800988435745, -0.021830487996339798, -0.05447768792510033, 0.040683094412088394, -0.028070898726582527, 0.08530750125646591, -0.010964510031044483, 0.00016943877562880516, 0.029735008254647255, -0.042741335928440094, 0.017418408766388893, 0.019268635660409927, 0.007871675305068493, 0.046857818961143494, 0.020899901166558266, 0.04289460927248001, 0.02529008314013481, -0.06358649581670761, 0.040070001035928726, 0.007209315896034241, 0.0029587207827717066, 0.05128084495663643, -0.03733298182487488, -0.026231618598103523, -0.005246871151030064, 0.008336968719959259, 0.01005581859499216, -0.01805339753627777, 0.00003143298818031326, 0.0006863082526251674, 0.04843434318900108, 0.02789572812616825, 0.021874280646443367, -0.028793472796678543, -0.004885584581643343, -0.039500702172517776, 0.010324046947062016, -0.012546509504318237, -0.03463974967598915, 0.01657540537416935, -0.025662317872047424, 0.0053864591754972935, 0.035428013652563095, -0.029056226834654808, 0.000655858893878758, 0.03875623270869255, 0.046814024448394775, -0.009530310519039631, -0.018228566274046898, 0.04904743656516075, 0.025618527084589005, 0.007154575549066067, 0.059776563197374344, 0.03107067383825779, -0.017878228798508644, -0.03207789734005928, 0.010783866979181767, -0.022990984842181206, 0.015568180941045284, 0.046332310885190964, -0.0048910584300756454, 0.08294271677732468, -0.03365442156791687, -0.009656214155256748, -0.030851712450385094, 0.006623593159019947, -0.01653161272406578, -0.04659506306052208, -0.057630736380815506, 0.03996052220463753, -0.018786920234560966, -0.011309375055134296, -0.018754074349999428, -0.03577835112810135, -0.039018984884023666, 0.05071154609322548, -0.02890295349061489, 0.019268635660409927, -0.004338179714977741, 0.04506232962012291, -0.08022759109735489, 0.022049449384212494, 0.015436803922057152, -0.021359719336032867, 0.03148670122027397, 0.014812763780355453, 0.014670438133180141, -0.031771350651979446, 0.008194644004106522, -0.04852192848920822, -0.030391892418265343, -0.00619661808013916, 0.022465476766228676, 0.0032570562325417995, 0.007997578009963036, -0.02377924695611, -0.019980261102318764, 0.010980932042002678, 0.04878468066453934, 0.04348580539226532, 0.0020089740864932537, 0.03571266308426857, -0.03529663756489754, 0.03214358538389206, 0.012623145245015621, -0.0507553368806839, -0.026603855192661285, 0.04037654772400856, -0.026231618598103523, -0.025640422478318214, -0.024129586294293404, -0.06919191777706146, 0.022947192192077637, -0.06065240874886513, -0.019761299714446068, -0.0232099462300539, 0.005520573351532221, -0.003547180676832795, -0.08758470416069031, -0.0507553368806839, 0.05342667177319527, 0.025465253740549088, -0.009245660156011581, 0.03196841850876808, -0.02375735156238079, -0.03785848990082741, -0.051499806344509125, 0.02535577304661274, -0.0034267515875399113, 0.02951604500412941, -0.033917177468538284, -0.031158259138464928, -0.0692794993519783, 0.0726953074336052, 0.030786024406552315, -0.0455002561211586, -0.011024724692106247, -0.035449910908937454, -0.0031092569697648287, -0.024961641058325768, -0.048390548676252365, -0.008282228372991085, -0.04451492801308632, 0.02577180042862892, 0.026144035160541534, -0.015907572582364082, 0.04298219457268715, 0.02439234033226967, -0.04874088987708092, -0.0038482530508190393, 0.027063673362135887, 0.019378116354346275, 0.014550008811056614, 0.00048787417472340167, 0.03575645759701729, -0.020878003910183907, 0.030435685068368912, -0.020910847932100296, -0.02544335648417473, 0.004516086541116238, 0.05290116369724274, -0.042675647884607315, -0.02995396964251995, 0.015885675325989723, -0.009935390204191208, 0.008254858665168285, -0.05233186110854149, 0.006322520785033703, -0.028355548158288002, 0.01210858579725027, 0.0002660043246578425, 0.0013602999970316887, 0.05793728306889534, -0.038055554032325745, -0.0016422132030129433, -0.029888281598687172, 0.03621627390384674, -0.00464198924601078, 0.004984117113053799, -0.04136187583208084, -0.038055554032325745, 0.045763008296489716, 0.0026029080618172884, -0.04350770264863968, 0.05688626691699028, 0.01749504543840885, 0.04361718147993088, -0.0649440586566925, 0.017724955454468727, 0.020812315866351128, 0.02531198039650917, -0.08977432548999786, 0.035887833684682846, 0.0047815777361392975, -0.03928174078464508, 0.02279391884803772, -0.031355325132608414, 0.006109033245593309, -0.059163469821214676, -0.05688626691699028, 0.021852383390069008, 0.04493095353245735, -0.01660824939608574, 0.013082965277135372, 0.07926415652036667, 0.03205600380897522, -0.029669318348169327, 0.003183156717568636, 0.03842778876423836, -0.03880002349615097, -0.021447304636240005, 0.013378563337028027, 0.009026698768138885, -0.12060414254665375, 0.05644834414124489, 0.013126757927238941, 0.04070499166846275, -0.05443389341235161, -0.036457132548093796, -0.023910624906420708, -0.06800952553749084, 0.04177790507674217, -0.06735263764858246, 0.02691040001809597, -0.022377891466021538, 0.0028985063545405865, 0.01031309925019741, 0.03928174078464508, -0.0027876568492501974, 0.06967363506555557, -0.042084451764822006, -0.024020105600357056, -0.021491097286343575, 0.017692111432552338, -0.01957518234848976, -0.07457837462425232, 0.056711096316576004, 0.0484781339764595, 0.0024181590415537357, -0.05268219858407974, -0.06174721568822861, 0.0249178484082222, -0.01599515601992607, -0.022355996072292328, -0.059207260608673096, -0.09222669154405594, 0.032931849360466, 0.0070888870395720005, -0.04668264836072922, -0.008638042025268078, 0.06117791682481766, -0.029735008254647255, -0.005164760630577803, 0.03365442156791687, 0.0003193762677256018, 0.0026754389982670546, 0.006973932031542063, 0.027019880712032318, 0.004108270164579153, 0.033829592168331146, 0.031858935952186584, 0.0040891109965741634, -0.019060621038079262, -0.05233186110854149, 0.04201876372098923, -0.03306322544813156, 0.03619438037276268, 0.0013883544597774744, -0.026012657210230827, 0.04464630410075188, -0.013104861602187157, 0.019038725644350052, -0.011670662090182304, -0.026800919324159622, 0.002415421884506941, -0.024436132982373238, 0.08403752744197845, 0.09161360561847687, -0.007789564784616232, -0.05386459454894066, 0.010291202925145626, 0.02426096424460411, 0.039566390216350555, 0.008495716378092766, 0.0754542201757431, 0.00011119151895400137, 0.019498545676469803, 0.006919191684573889, -0.05338287726044655, -0.06437475979328156, -0.0036730836145579815, 0.03766142204403877, 0.007997578009963036, -0.04026706889271736, 0.02173195593059063, -0.03580024838447571, 0.08784745633602142, -0.00014206854393705726, 0.05211289972066879, -0.01502077654004097, -0.06003931537270546, 0.012612197548151016, -0.019038725644350052, -0.04398941993713379, 0.08955536037683487, 0.015929467976093292, 0.007849778980016708, 0.04926639795303345, 0.002203302690759301, 0.04804021120071411, 0.027326427400112152, 0.0733959823846817, 0.018502268940210342, 0.0653819814324379, -0.011780142784118652, -0.015425856225192547, 0.02480836771428585, -0.03888760879635811, -0.0004954009782522917, 0.0017626421758905053, -0.029581734910607338, 0.012327547185122967, -0.019531389698386192, -0.027808144688606262, -0.0022512006107717752, -0.01961897313594818, 0.044208381325006485, -0.054652854800224304, -0.04589438438415527, -0.03976345807313919, 0.011287478730082512, -0.010482794605195522, -0.0074228039011359215, 0.006815184839069843, -0.03890950605273247, -0.008107059635221958, 0.029603630304336548, -0.027173154056072235, 0.016323599964380264, -0.04394562542438507, -0.07527905702590942, 0.024939745664596558, -0.011594025418162346, 0.0019432856934145093, 0.031202051788568497, -0.05942622199654579, 0.041668422520160675, -0.06735263764858246, 0.09415356069803238, -0.05535353347659111, 0.051456015557050705, 0.010012026876211166, -0.021578682586550713, 0.016816264018416405, 0.016279807314276695, 0.04028896614909172, -0.03457406163215637, 0.010553956963121891, -0.020024053752422333, -0.039062779396772385, 0.03485871106386185, 0.03768331930041313, -0.04020138084888458, -0.07869485765695572, 0.022574957460165024, 0.04514991492033005, -0.02323184348642826, 0.07181946188211441, -0.032340653240680695, 0.017352718859910965, -0.010526587255299091, -0.014736127108335495, -0.01059227529913187, 0.005422040820121765, -0.0631047785282135, 0.031355325132608414, 0.0850447490811348, 0.013707006350159645, 0.03772711008787155, -0.024676991626620293, 0.05036120489239693, 0.033304084092378616, 0.019794143736362457, -0.008107059635221958, -0.06844744831323624, 0.014889399521052837, -0.014736127108335495, 0.009158075787127018, 0.010855029337108135, -0.016717730090022087, -0.07501629739999771, -0.0393255315721035, -0.006869925186038017, -0.0010120138758793473, -0.024589406326413155, 0.05005465820431709, -0.010033923201262951, 0.05106188356876373, 0.005145601462572813, 0.047821249812841415, 0.03047947771847248, -0.027260739356279373, -0.04153704643249512, 0.0067987628281116486, 0.000771840219385922, -0.02483026310801506, -0.0809282660484314, -0.010428054258227348, 0.08662127703428268, 0.04668264836072922, 0.02421717159450054, 0.014232514426112175, -0.06170342490077019, -0.006629067473113537, 0.023407012224197388, -0.038471583276987076, -0.02176479995250702, -0.014133981429040432, -0.018732178956270218, 0.004910217598080635, -0.042259618639945984, -0.013367615640163422, 0.0019282320281490684, 0.0015628396067768335, 0.04096774756908417, -0.02684471197426319, -0.00830959901213646, 0.013323822990059853, 0.015809038653969765, 0.00011067833111155778, -0.0046009342186152935, -0.039588287472724915, 0.0006295150960795581, 0.024961641058325768, -0.05364563316106796, -0.022355996072292328, 0.009026698768138885, 0.00005858937947778031, -0.028793472796678543, -0.04593817889690399, 0.019246738404035568, -0.005011487286537886, 0.003062727628275752, -0.02693229727447033, -0.0016600039089098573, -0.04346391186118126, 0.011265582405030727, -0.0057203760370612144, -0.04449303075671196, 0.026494372636079788, 0.005922915879637003, 0.039106570184230804, -0.043179258704185486, 0.03733298182487488, 0.038559164851903915, -0.02325373888015747, 0.07650524377822876, -0.059163469821214676, 0.034902505576610565, 0.021304979920387268, -0.026757126674056053, -0.04790883511304855, -0.007329745218157768, -0.039610184729099274, -0.014878451824188232, 0.008046844974160194, -0.03404855355620384, -0.0010003815405070782, 0.010362365283071995, -0.022925296798348427, 0.04948535934090614, -0.0072969007305800915, 0.014232514426112175, -0.006557904649525881, -0.009377037174999714, 0.076811783015728, 0.03617248311638832, 0.014090189710259438, 0.023910624906420708, -0.023516492918133736, 0.0289248488843441, 0.011440752074122429, 0.03939121961593628, 0.03146480396389961, -0.04206255450844765, -0.03558128699660301, 0.03663230314850807, 0.027107466012239456, -0.030764127150177956, -0.06603886932134628, 0.0016257910756394267, 0.08758470416069031, 0.004108270164579153, -0.03987293690443039, -0.024107690900564194, -0.04074878245592117, -0.04052982106804848, -0.009130705147981644, -0.0185789056122303, -0.015743350610136986, 0.03047947771847248, 0.005758694373071194, 0.005416566506028175, -0.009678109548985958, 0.03056706301867962, 0.01970655843615532, -0.058156244456768036, 0.031355325132608414, 0.013915020041167736, 0.004715888760983944, 0.053995970636606216, 0.031311530619859695, 0.027238843962550163, 0.0006623593508265913, -0.020494820550084114, -0.0088296327739954, 0.0069082435220479965, 0.026779023930430412, 0.001341140829026699, -0.04044223949313164, 0.07633007317781448, -0.05215669050812721, 0.04394562542438507, 0.019892675802111626, 0.06052103266119957, 0.03575645759701729, -0.040113795548677444, -0.009431777521967888, 0.011867727153003216, 0.059864144772291183, 0.0007191525655798614, 0.03376390412449837, -0.0352090522646904, 0.014944140799343586, 0.035887833684682846, -0.025180602446198463, -0.048872265964746475, -0.021359719336032867, -0.0030846239533275366, -0.04913501814007759, 0.04133998230099678, -0.04852192848920822, 0.011867727153003216, 0.06603886932134628, -0.007909993641078472, 0.04917881265282631, 0.00047555757919326425, 0.016728678718209267, -0.031223947182297707, 0.037530045956373215, -0.0361286923289299, -0.003500651102513075, 0.013882176019251347, 0.0537332184612751, -0.012688834220170975, -0.004811684601008892, 0.05106188356876373, 0.029187602922320366, -0.04545646160840988, -0.01011055987328291, 0.05022982880473137, 0.009831382893025875, 0.012787367217242718, -0.022969089448451996, -0.005649213679134846, -0.013904072344303131, 0.02955983765423298, -0.025552837178111076, 0.02647247724235058, 0.009404407814145088, 0.014637594111263752, -0.026713335886597633, -0.0018502268940210342, -0.0289248488843441, -0.029056226834654808, -0.019038725644350052, 0.046770233660936356, -0.009130705147981644, 0.04291650652885437, 0.026581957936286926, -0.010220040567219257, 0.010225513949990273, -0.0516749769449234, -0.00424238434061408, 0.05894450843334198, -0.09432873129844666, -0.0005829856963828206, -0.038055554032325745, 0.021512992680072784, 0.03358873352408409, 0.004157536663115025, -0.05833141505718231, 0.05071154609322548, 0.028267962858080864, 0.04554404690861702, -0.01922484301030636, 0.024151481688022614, 0.02017732709646225, 0.01527258288115263, 0.005216763820499182, 0.01185677945613861, 0.04151514917612076, -0.049879491329193115, 0.0021266660187393427, -0.022388840094208717, -0.013258134946227074, 0.0477774553000927, 0.023625973612070084, -0.009366089478135109, -0.0016353706596419215, -0.04442734271287918, -0.02529008314013481, 0.03667609393596649, -0.013652266003191471, -0.015414908528327942, 0.00607071490958333, 0.07427182793617249, -0.012513664551079273, 0.061878595501184464, 0.02384493686258793, 0.028246067464351654, -0.001809171517379582, 0.08053413778543472, -0.02325373888015747, 0.04646368697285652, 0.006897295359522104, 0.033895280212163925, 0.021107913926243782, -0.010389735922217369, -0.05544111877679825, -0.03466164693236351, 0.02014448307454586, 0.0025604842230677605, -0.06490026414394379, -0.00257964339107275, 0.0496167354285717, -0.012590301223099232, -0.0016750574577599764, 0.06415579468011856, 0.08911743760108948, -0.02896864153444767, -0.045850593596696854, 0.033347874879837036, -0.04449303075671196, 0.0036676095332950354, -0.037946075201034546, 0.019991209730505943, -0.0663016214966774, -0.02951604500412941, 0.023012882098555565, -0.009782116860151291, 0.003062727628275752, 0.01865554228425026, -0.09827003628015518, -0.022071346640586853, -0.008698255755007267, -0.019334323704242706, 0.011867727153003216, 0.021907124668359756, -0.004319021012634039, -0.024501821026206017, 0.061834800988435745, -0.00012607408280018717, 0.09590525180101395, -0.030172931030392647, -0.0027780772652477026, 0.02423906698822975, -0.09424114227294922, -0.030632751062512398, 0.04852192848920822, 0.05995173007249832, -0.003708664793521166, 0.010291202925145626, 0.015130258165299892, -0.031837038695812225, -0.00387014914304018, -0.01869933493435383, 0.04755849391222, 0.025005433708429337, 0.03731108456850052, 0.019454753026366234, 0.049879491329193115, -0.023625973612070084, 0.0027274424210190773, 0.059732768684625626, -0.015130258165299892, 0.028092794120311737, -0.024195274338126183, 0.028136586770415306, 0.0111177833750844, 0.019005881622433662, 0.02336321957409382, 0.032406341284513474, -0.022596854716539383, -0.0007752614910714328, -0.02380114421248436, -0.03864675015211105, 0.012798314914107323, -0.03199031203985214, -0.041208602488040924, -0.07168807834386826, -0.04957294464111328, -0.013072017580270767, 0.03923794627189636, 0.018786920234560966, 0.013750799000263214, 0.05951380729675293, -0.04795262590050697, 0.0444711335003376, -0.04488716274499893, 0.0010455424198880792, 0.03308512270450592, 0.02121739462018013, -0.005742272362112999, 0.013061068952083588, 0.015677662566304207, -0.018754074349999428, -0.041121020913124084, 0.00595028605312109, -0.03882192075252533, 0.052988745272159576, 0.0672212615609169, 0.03711402043700218, 0.026800919324159622, -0.0022347785998135805, 0.03148670122027397 ]
42,856
linearmodels.panel.model
__init__
null
def __init__( self, dependent: PanelDataLike, exog: PanelDataLike, *, weights: PanelDataLike | None = None, check_rank: bool = True, ): super().__init__(dependent, exog, weights=weights, check_rank=check_rank) if self._constant: raise ValueError( "Constants are not allowed in first difference regressions." ) if self.dependent.nobs < 2: raise ValueError("Panel must have at least 2 time periods")
(self, dependent: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, weights: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, check_rank: bool = True)
[ 0.02595851570367813, -0.001389520475640893, -0.012693999335169792, 0.045712660998106, -0.016045786440372467, -0.025156227871775627, -0.012426570057868958, -0.024550052359700203, -0.009582900442183018, 0.024389594793319702, 0.02973818965256214, 0.04425071179866791, 0.04938536509871483, 0.0015265782130882144, -0.033125635236501694, 0.012275026179850101, 0.039294347167015076, 0.030522651970386505, -0.023605134338140488, 0.0068372879177331924, -0.019183628261089325, -0.020681235939264297, -0.06614429503679276, 0.04831564426422119, -0.010304960422217846, 0.09335082024335861, -0.05223795026540756, 0.02217884175479412, -0.0011610909132286906, -0.04303836449980736, -0.020538605749607086, 0.006124141626060009, -0.07587873935699463, 0.022606730461120605, 0.0020670092198997736, -0.02066340669989586, -0.04093458503484726, 0.03883080184459686, -0.08393728733062744, 0.07773292064666748, 0.055482763797044754, -0.052558865398168564, 0.07823212444782257, 0.024353938177227974, -0.05387818440794945, -0.0030442422721534967, 0.012310683727264404, 0.021590497344732285, -0.032769061625003815, -0.02699257805943489, 0.03357135131955147, 0.02800881117582321, 0.04371585324406624, -0.0055536250583827496, -0.018274366855621338, 0.06924647837877274, 0.0672140121459961, 0.09220978617668152, 0.045070830732584, -0.034302324056625366, -0.03178848698735237, 0.015546583570539951, -0.013531946577131748, -0.009556157514452934, -0.012319598346948624, -0.022606730461120605, -0.043252307921648026, -0.027117379009723663, 0.007091346196830273, 0.014824523590505123, 0.017088761553168297, 0.01961151696741581, -0.03506895899772644, 0.03904474526643753, -0.0031779571436345577, -0.023943878710269928, 0.011918453499674797, -0.04321664944291115, 0.01978980377316475, -0.04303836449980736, 0.0062355706468224525, 0.011490565724670887, -0.03943697735667229, 0.06204370781779289, -0.002988527761772275, -0.08279625326395035, -0.019130142405629158, -0.025708915665745735, 0.04321664944291115, 0.005067794118076563, -0.09962650388479233, -0.0010920049389824271, 0.013121887110173702, -0.015724871307611465, 0.062008049339056015, 0.019665002822875977, -0.027473952621221542, -0.015751613304018974, -0.03850988671183586, -0.005281738005578518, 0.01127662230283022, -0.02200055494904518, -0.04942101985216141, 0.027937496080994606, -0.0047825356014072895, -0.022303642705082893, -0.012702913954854012, -0.025584114715456963, -0.06158016249537468, -0.06279250979423523, -0.05623156577348709, 0.08058550208806992, -0.05919112265110016, 0.01066153310239315, -0.031574539840221405, 0.03333957865834236, -0.02699257805943489, 0.017311619594693184, -0.02838321216404438, 0.019540201872587204, 0.013808290474116802, 0.06033215671777725, -0.0673566460609436, 0.08030024915933609, 0.0526658371090889, 0.0061508845537900925, 0.020253347232937813, -0.012613770551979542, 0.04011446610093117, -0.0499202236533165, 0.03273340314626694, -0.0292389877140522, -0.036209989339113235, -0.005945855285972357, 0.0020547520834952593, 0.017579050734639168, 0.06521720439195633, 0.02526319958269596, -0.03460541367530823, -0.01975414529442787, 0.039971835911273956, 0.03801068291068077, 0.005228252150118351, 0.026600347831845284, 0.004546306096017361, 0.03565730154514313, -0.042396534234285355, -0.007871349342167377, -0.008718210272490978, 0.08001498878002167, -0.009779015555977821, -0.007688605692237616, -0.018015852198004723, -0.06917516887187958, -0.00009889330249279737, -0.014557093381881714, 0.0008290322730317712, 0.0030130420345813036, 0.03665570542216301, 0.008557752706110477, -0.04888616129755974, -0.01470863725990057, 0.033981408923864365, 0.008718210272490978, 0.004002532456070185, 0.03815331310033798, -0.026404231786727905, -0.07994367182254791, -0.0037640740629285574, 0.03169934079051018, 0.050847314298152924, -0.03729753941297531, 0.05419909954071045, -0.012328512035310268, -0.0743098184466362, 0.02235712856054306, 0.03883080184459686, 0.0034453868865966797, 0.006378199905157089, 0.005063336808234453, 0.06617995351552963, 0.004414819646626711, -0.06806979328393936, -0.009279812686145306, 0.009386785328388214, -0.01945105940103531, -0.02822275459766388, 0.005228252150118351, 0.013710232451558113, 0.03736885264515877, 0.008009521290659904, 0.018844883888959885, -0.0013884062645956874, -0.02290981635451317, 0.005852254573255777, -0.0033072149381041527, 0.03300083428621292, -0.04146944358944893, 0.03096836805343628, 0.03317911922931671, -0.010091017000377178, 0.03783239796757698, 0.006797173526138067, -0.048244331032037735, -0.03317911922931671, 0.07003094255924225, -0.008575581014156342, 0.023676449432969093, -0.02321290411055088, -0.024122165516018867, 0.04674672335386276, 0.009618557058274746, -0.012961429543793201, 0.018666597083210945, 0.00757271982729435, -0.023533819243311882, -0.015947729349136353, -0.009663129225373268, 0.0484582744538784, -0.010340617969632149, 0.05337898060679436, -0.043608881533145905, -0.021982727572321892, 0.008361637592315674, 0.04250350594520569, -0.010313875041902065, 0.06835504621267319, -0.01873791217803955, -0.0293994452804327, 0.011793652549386024, -0.019397573545575142, 0.004746878519654274, 0.0052549950778484344, -0.07081540673971176, 0.0429670512676239, 0.017953451722860336, -0.035532500594854355, -0.02492445521056652, -0.02989864908158779, 0.011793652549386024, -0.02581588737666607, -0.01083090528845787, -0.005749740172177553, 0.017605792731046677, 0.02319507487118244, -0.04104155674576759, 0.016446931287646294, 0.05334332585334778, -0.06482497602701187, -0.002602983033284545, -0.0075950054451823235, -0.00850426685065031, -0.050669025629758835, 0.013095144182443619, -0.03455192595720291, 0.018167395144701004, 0.0306117944419384, -0.06104530394077301, 0.012390912510454655, -0.07359667122364044, 0.0072518037632107735, 0.00140846346039325, -0.07163552194833755, 0.013754804618656635, -0.037547141313552856, 0.02840104140341282, -0.01754339225590229, -0.02667166292667389, 0.0395796075463295, 0.01769493706524372, -0.025922859087586403, 0.056481167674064636, 0.006128598935902119, -0.014004405587911606, -0.008660267107188702, -0.00825466588139534, 0.011205307208001614, -0.04817301407456398, 0.04489254578948021, 0.01445012167096138, 0.02561977133154869, -0.050312455743551254, -0.013006000779569149, 0.014396635815501213, -0.044286370277404785, -0.04114852845668793, -0.024139994755387306, -0.04225390404462814, -0.011900625191628933, -0.005910197738558054, -0.04300270602107048, 0.05829969048500061, 0.07227735221385956, 0.059084150940179825, -0.0036281305365264416, -0.013656746596097946, 0.047745127230882645, -0.0052639092318713665, 0.02840104140341282, 0.03833160176873207, -0.004191961605101824, -0.026012001559138298, -0.03865251690149307, 0.009306555613875389, -0.0722060352563858, -0.07120763510465622, 0.0667148157954216, -0.026012001559138298, 0.054591331630945206, 0.015787269920110703, 0.04663975164294243, 0.07701977342367172, -0.01790888048708439, 0.0679984763264656, 0.03180631250143051, -0.028686299920082092, 0.005968140903860331, -0.04610489308834076, 0.029684703797101974, 0.09185320883989334, 0.01688373275101185, -0.02456788159906864, -0.01925494335591793, -0.03214505687355995, -0.04792341589927673, 0.02150135301053524, 0.049777593463659286, -0.026956921443343163, 0.03221637383103371, 0.044143740087747574, -0.07085105776786804, -0.020574264228343964, 0.05576802045106888, -0.01737402006983757, -0.003338414942845702, -0.012488970533013344, 0.014414465054869652, -0.010652619414031506, 0.08343809098005295, 0.0006184313679113984, 0.04125550016760826, -0.06717836111783981, -0.05658813938498497, 0.014521436765789986, 0.021376552060246468, -0.06318473815917969, 0.02734915167093277, -0.012506798841059208, 0.07120763510465622, 0.03300083428621292, -0.03975789248943329, 0.042574819177389145, -0.031396254897117615, 0.010287132114171982, 0.030166078358888626, 0.012988172471523285, -0.037226222455501556, 0.03426666930317879, 0.002223009942099452, -0.045320432633161545, 0.021893583238124847, 0.01875574141740799, -0.014155949465930462, 0.015591155737638474, -0.008999011479318142, -0.052523206919431686, 0.04492820054292679, -0.013023830018937588, -0.0038064171094447374, 0.005968140903860331, -0.031538885086774826, -0.012711828574538231, 0.002377896336838603, -0.013728061690926552, -0.014441207982599735, 0.03492632880806923, 0.023355532437562943, -0.017998022958636284, 0.03590690344572067, -0.05919112265110016, 0.020182034000754356, -0.03900909051299095, -0.037582796066999435, 0.027242179960012436, -0.05519750341773033, 0.005188137758523226, 0.020164204761385918, -0.0004783092881552875, 0.054270416498184204, -0.019308429211378098, 0.06774887442588806, -0.04817301407456398, 0.024050850421190262, 0.0046532778069376945, -0.04574831947684288, 0.011704509146511555, 0.022410614416003227, 0.009912730194628239, -0.05038376897573471, 0.015903156250715256, -0.022856330499053, -0.032412488013505936, -0.003131156787276268, 0.0323055163025856, 0.00184972258284688, -0.020930835977196693, 0.0077331773936748505, 0.06286382675170898, -0.012907943688333035, 0.051310859620571136, -0.028311898931860924, 0.02337336167693138, -0.015100867487490177, -0.001139362226240337, -0.00554471043869853, -0.015323725529015064, -0.009707700461149216, 0.000956618576310575, 0.04214693233370781, -0.02456788159906864, 0.02444308064877987, -0.010126673616468906, 0.045177802443504333, 0.018613111227750778, 0.025067083537578583, 0.04699632525444031, -0.008905411697924137, 0.013326916843652725, -0.001234634080901742, 0.020253347232937813, -0.04007880762219429, 0.035871244966983795, -0.09470579773187637, -0.035354215651750565, 0.06379091739654541, -0.02460353821516037, -0.04057801142334938, 0.030540479347109795, -0.003686073701828718, 0.035835590213537216, -0.013870690949261189, 0.015020638704299927, 0.07373930513858795, 0.003128928365185857, -0.06329171359539032, -0.018292196094989777, 0.038616858422756195, -0.005353052634745836, -0.07972972840070724, -0.05744391307234764, 0.042931392788887024, 0.04660409316420555, 0.02995213493704796, -0.01718682050704956, -0.04467859864234924, -0.06311342865228653, -0.044108081609010696, -0.037761084735393524, 0.02182227000594139, -0.03374963626265526, -0.023533819243311882, 0.0017171220388263464, -0.05965466797351837, -0.046711064875125885, -0.05487658828496933, 0.0074033476412296295, 0.05334332585334778, -0.03865251690149307, -0.004227619152516127, 0.013736976310610771, 0.010296045802533627, 0.01941540092229843, 0.04104155674576759, -0.03679833561182022, -0.037261880934238434, 0.02508491277694702, 0.008923240005970001, -0.017267048358917236, 0.04528477415442467, -0.026225946843624115, 0.0073186615481972694, 0.04043538123369217, 0.024657024070620537, -0.0104208467528224, -0.012899029068648815, -0.028258413076400757, -0.07135026156902313, -0.020520778372883797, -0.02581588737666607, 0.04852958768606186, -0.04589094966650009, -0.003661559196189046, 0.002591840224340558, 0.030504822731018066, -0.03250163048505783, 0.023605134338140488, 0.039116062223911285, 0.0035746446810662746, 0.08087076246738434, -0.008976725861430168, 0.012275026179850101, -0.015243496745824814, -0.002420239383354783, -0.021430039778351784, -0.02287415973842144, -0.05626722425222397, -0.04400110989809036, 0.0057363687083125114, -0.04621186479926109, 0.0031935572624206543, 0.016402360051870346, 0.039116062223911285, 0.021019980311393738, 0.06468234956264496, 0.056659452617168427, -0.052737150341272354, -0.039650920778512955, 0.06717836111783981, 0.008294779807329178, 0.021554838865995407, 0.028828930109739304, -0.008009521290659904, 0.047566842287778854, -0.0042387619614601135, 0.03850988671183586, -0.04097023978829384, -0.04499951750040054, -0.04735289886593819, 0.03524724394083023, -0.005027679726481438, 0.017088761553168297, -0.06846202164888382, 0.009034669026732445, 0.07324010133743286, -0.009689872153103352, -0.02408650703728199, -0.010251474566757679, 0.005388709716498852, -0.04061366617679596, 0.02925681695342064, -0.013273430988192558, 0.00012083089677616954, 0.059405066072940826, -0.03027305006980896, -0.02080603688955307, -0.013719147071242332, 0.004125104285776615, 0.08543489873409271, -0.04614054784178734, 0.005139108747243881, -0.044821228832006454, -0.058727577328681946, -0.007492490578442812, 0.02169746905565262, -0.006471800617873669, -0.01015341654419899, -0.002413553651422262, 0.05915546417236328, 0.04036406800150871, 0.02289198897778988, -0.015466354787349701, -0.0646110326051712, 0.05213097482919693, 0.013701318763196468, -0.016910476610064507, -0.03043350763618946, 0.06539549678564072, 0.0020335805602371693, -0.046176206320524216, 0.02428262308239937, -0.0025338970590382814, 0.026867777109146118, -0.013781547546386719, 0.029345959424972534, -0.006030541379004717, -0.009743358008563519, 0.03510461375117302, 0.027759209275245667, -0.06764190644025803, -0.0003604730300139636, -0.03392792493104935, -0.01805150881409645, -0.034302324056625366, -0.03383877873420715, 0.015448526479303837, 0.02444308064877987, -0.0056160250678658485, 0.017489906400442123, -0.003206928726285696, 0.0017226934432983398, -0.0019277229439467192, 0.03136059641838074, -0.02098432183265686, 0.004223161842674017, 0.00029751562396995723, 0.03437364101409912, -0.05747957155108452, -0.05366424098610878, 0.032929517328739166, 0.045712660998106, -0.059084150940179825, 0.0161527581512928, 0.011659937910735607, -0.013273430988192558, 0.007554891053587198, -0.052558865398168564, -0.01351411733776331, 0.017596878111362457, -0.02973818965256214, -0.03401706740260124, 0.028169268742203712, 0.02249975875020027, 0.006823916453868151, -0.029345959424972534, 0.01513652503490448, -0.04400110989809036, -0.06193673610687256, -0.025584114715456963, 0.04278876259922981, -0.03234117478132248, -0.012471141293644905, 0.03908040374517441, -0.02578023076057434, 0.05919112265110016, -0.03797502815723419, 0.010572390630841255, 0.05965466797351837, -0.11203524470329285, 0.0017995794769376516, -0.04467859864234924, 0.02182227000594139, 0.049955882132053375, -0.0210021510720253, -0.05334332585334778, 0.017436420544981956, 0.009155012667179108, 0.011980853974819183, 0.0036259018816053867, 0.06414748728275299, 0.013202115893363953, 0.007340947166085243, 0.002504925476387143, 0.03701227903366089, 0.034997642040252686, -0.026885606348514557, -0.012961429543793201, -0.047388553619384766, -0.012025425210595131, 0.022428443655371666, -0.025869373232126236, -0.005063336808234453, 0.015065209940075874, -0.03886646032333374, 0.017151162028312683, 0.02340901829302311, 0.006137513089925051, 0.011142906732857227, -0.03128928318619728, 0.09392133355140686, -0.013255602680146694, 0.02027117647230625, 0.018140653148293495, 0.07135026156902313, 0.011918453499674797, 0.05883454903960228, 0.009975130669772625, 0.030825737863779068, -0.04867221787571907, -0.01125879306346178, -0.025191884487867355, -0.04072063788771629, -0.030558308586478233, -0.0014006634010002017, 0.01650933176279068, 0.023444676771759987, -0.00416521867737174, -0.004893964622169733, 0.047388553619384766, 0.01305948756635189, 0.0015132067492231727, 0.0402214378118515, 0.033286090940237045, -0.021394381299614906, -0.091425321996212, 0.017124420031905174, -0.01975414529442787, -0.05708734318614006, 0.027634410187602043, 0.010706105269491673, -0.01486909482628107, -0.02027117647230625, 0.02510274201631546, 0.015074124559760094, -0.017151162028312683, 0.024692682549357414, -0.09228109568357468, -0.06036781519651413, -0.024870969355106354, -0.007086888886988163, 0.021037807688117027, -0.003969103563576937, -0.008147693239152431, -0.004047103691846132, 0.08151259273290634, -0.013318002223968506, 0.025370171293616295, -0.041897330433130264, -0.011544051580131054, 0.06803413480520248, -0.10390537977218628, -0.02442525140941143, 0.05758654326200485, 0.030380021780729294, -0.050811655819416046, -0.017587965354323387, -0.00815660785883665, 0.030897052958607674, 0.010349531657993793, -0.05833534896373749, 0.03883080184459686, -0.010697190649807453, -0.00893661193549633, 0.04114852845668793, 0.019023170694708824, 0.014075720682740211, 0.041362471878528595, 0.041184183210134506, -0.032430317252874374, 0.04186167195439339, -0.057372599840164185, 0.02098432183265686, 0.013496289029717445, -0.03489067032933235, -0.0022475244477391243, 0.05491224676370621, -0.020021574571728706, -0.037226222455501556, 0.024888796731829643, 0.020092889666557312, 0.027545265853405, 0.023961707949638367, -0.043074022978544235, -0.005312938243150711, -0.04114852845668793, 0.00546448165550828, 0.0326264314353466, -0.029025044292211533, 0.01737402006983757, 0.035889074206352234, -0.04025709629058838, 0.004929622169584036, -0.0560532808303833, 0.031574539840221405, -0.010269302874803543, 0.030576137825846672, 0.009877072647213936, -0.004662192426621914, 0.007956035435199738, -0.024514395743608475, -0.037547141313552856, 0.011971939355134964, 0.014040063135325909, 0.07209906727075577, 0.034730214625597, 0.023836906999349594, 0.022749358788132668, 0.03797502815723419, 0.015707042068243027 ]
42,868
linearmodels.panel.model
_setup_clusters
null
def _setup_clusters( self, cov_config: Mapping[str, bool | float | str | IntArray | DataFrame | PanelData], ) -> dict[str, bool | float | str | IntArray | DataFrame | PanelData]: cov_config_upd = dict(cov_config).copy() cluster_types = ("clusters", "cluster_entity") common = set(cov_config.keys()).intersection(cluster_types) if not common: return cov_config_upd clusters = cov_config.get("clusters", None) clusters_frame: DataFrame | None = None if clusters is not None: cluster_data = cast(Union[IntArray, DataFrame, PanelData], clusters) clusters_panel = self.reformat_clusters(cluster_data) fd = clusters_panel.first_difference() fd_array = fd.values2d if np.any(fd_array.flat[np.isfinite(fd_array.flat)] != 0): raise ValueError( "clusters must be identical for values used " "to compute the first difference" ) clusters_frame = clusters_panel.dataframe.copy() cluster_entity = cov_config_upd.pop("cluster_entity", False) if cluster_entity: group_ids = self.dependent.entity_ids.squeeze() name = "cov.cluster.entity" group_ids_s = Series(group_ids, index=self.dependent.index, name=name) if clusters_frame is not None: clusters_frame[name] = group_ids_s else: clusters_frame = DataFrame(group_ids_s) assert clusters_frame is not None cluster_data = PanelData(clusters_frame) values = cluster_data.values3d[:, 1:] cluster_frame = panel_to_frame( values, cluster_data.panel.items, cluster_data.panel.major_axis[1:], cluster_data.panel.minor_axis, True, ) cluster_frame = PanelData(cluster_frame).dataframe cluster_frame = cluster_frame.loc[self.dependent.first_difference().index] cluster_frame = cluster_frame.astype(np.int64) cov_config_upd["clusters"] = ( cluster_frame.values if cluster_frame is not None else None ) return cov_config_upd
(self, cov_config: collections.abc.Mapping[str, bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData]) -> dict[str, bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData]
[ 0.0007914070738479495, -0.0670481026172638, -0.017058953642845154, 0.022355753928422928, -0.05574570968747139, 0.04080355912446976, -0.017671965062618256, 0.047508370131254196, 0.00031847847276367247, -0.0009099385351873934, -0.03973079100251198, 0.0030411104671657085, -0.016455519944429398, -0.019980333745479584, 0.025114303454756737, -0.02042093686759472, -0.025957193225622177, -0.004252765327692032, 0.07746929675340652, -0.03469260409474373, -0.014338715933263302, -0.060075100511312485, 0.0005911607295274734, -0.01565094292163849, 0.010478660464286804, -0.001172144548036158, -0.02494189329445362, -0.017461242154240608, 0.06612858921289444, -0.006101377308368683, -0.06501750648021698, -0.0243671964854002, -0.04095681384205818, 0.05467293784022331, 0.02657020464539528, -0.06356160342693329, 0.035956937819719315, 0.01947268471121788, -0.004951981361955404, 0.04141657054424286, -0.013208475895226002, -0.06195244565606117, 0.03407959267497063, -0.009041915647685528, 0.009410680271685123, 0.10061046481132507, -0.027623817324638367, 0.011158719658851624, -0.031014537438750267, -0.03448188304901123, -0.011848357506096363, -0.0711476132273674, -0.0034649502485990524, 0.053906675428152084, -0.010861792601644993, -0.043025724589824677, 0.03216393291950226, 0.007916465401649475, -0.042412713170051575, 0.01610112376511097, 0.00840016920119524, -0.007169357966631651, -0.004451515153050423, -0.004626319278031588, -0.05294884368777275, -0.053063783794641495, -0.01873515546321869, 0.028179360553622246, 0.02132129669189453, -0.021455392241477966, 0.012796609662473202, 0.008567789569497108, 0.0353630855679512, 0.005679931957274675, 0.04172307625412941, -0.04570765048265457, 0.0013792752288281918, 0.04758499562740326, 0.04632066190242767, 0.012403898872435093, -0.049692220985889435, -0.02942453883588314, -0.03193405270576477, -0.023447679355740547, 0.05076499283313751, 0.03388802707195282, -0.008797668851912022, 0.03157007694244385, 0.028696587309241295, -0.015248654410243034, 0.012461368925869465, 0.012250646017491817, 0.026225386187434196, -0.007954778149724007, 0.05467293784022331, 0.06352328509092331, 0.005588938482105732, -0.021397922188043594, 0.010057215578854084, -0.006747912615537643, 0.04907920956611633, -0.010737274773418903, 0.050496798008680344, 0.006599449086934328, -0.022528162226080894, -0.06685653328895569, -0.021761897951364517, 0.004561665467917919, -0.03953922539949417, 0.019769612699747086, -0.06632015109062195, 0.005224962718784809, 0.02459707483649254, 0.014501546509563923, 0.015756303444504738, -0.044405002146959305, -0.015612629242241383, -0.0003945062344428152, -0.04222114756703377, 0.01823708415031433, -0.02021021395921707, 0.03869633376598358, 0.0043389699421823025, 0.011273659765720367, 0.008007459342479706, 0.009357999078929424, 0.00908980704843998, 0.05291053280234337, 0.00942983664572239, 0.00630252156406641, 0.053102098405361176, -0.05796787515282631, -0.04287247359752655, -0.024252256378531456, 0.03672320395708084, 0.00486338185146451, -0.02124466933310032, 0.014626064337790012, -0.013151006773114204, -0.005694299470633268, 0.05973028019070625, 0.030420681461691856, 0.003455371828749776, 0.016196906566619873, -0.06965339928865433, 0.04532451555132866, -0.01965467259287834, -0.09631938487291336, -0.08597482740879059, -0.001981510780751705, -0.0010955181205645204, -0.008064928464591503, -0.031033692881464958, -0.038255732506513596, -0.045784275978803635, -0.03469260409474373, -0.013783174566924572, -0.03340911120176315, 0.03147429600358009, 0.003589468076825142, -0.0555158294737339, -0.011934562586247921, 0.07233532518148422, 0.032642848789691925, -0.04314066469669342, 0.00033314526081085205, -0.015775460749864578, -0.10091697424650192, -0.054136551916599274, -0.01805509626865387, -0.04229777306318283, 0.03973079100251198, 0.018045518547296524, 0.027221528813242912, -0.006795804016292095, 0.028198515996336937, 0.011838778853416443, -0.11003551632165909, -0.01273913960903883, -0.020919008180499077, -0.06325509399175644, -0.006676075514405966, -0.000784821982961148, 0.017240941524505615, -0.022183343768119812, 0.03193405270576477, 0.019769612699747086, 0.011254502460360527, 0.04892595857381821, 0.001064987271092832, -0.010459504090249538, 0.013237210921943188, -0.012432633899152279, 0.07283339649438858, 0.02741309627890587, -0.03386887162923813, -0.01875431276857853, -0.019530154764652252, -0.0752471312880516, -0.011311972513794899, -0.029079720377922058, -0.0025765628088265657, 0.031455136835575104, -0.007456706836819649, 0.02944369614124298, 0.013543716631829739, 0.0037666666321456432, 0.005445263814181089, -0.027336468920111656, 0.043025724589824677, -0.04061199352145195, -0.009856071323156357, 0.026378639042377472, -0.01570841297507286, 0.031148632988333702, -0.05739317461848259, -0.0038935791235417128, 0.02969273179769516, -0.029903452843427658, -0.004777177236974239, 0.0549028180539608, -0.00861568097025156, 0.0744425505399704, 0.048312947154045105, -0.04907920956611633, -0.039615850895643234, 0.02490358054637909, -0.026704302057623863, 0.04517126455903053, -0.018102988600730896, -0.015037931501865387, 0.0000037368465655163163, -0.019127866253256798, -0.05394498631358147, 0.0493474043905735, -0.029577791690826416, 0.03563127666711807, 0.040228862315416336, 0.01774859055876732, 0.055630769580602646, -0.01992286555469036, -0.011695104651153088, 0.03519067540764809, 0.024501292034983635, -0.005617673043161631, 0.001209260430186987, 0.05153125524520874, 0.02216418646275997, -0.0070304726250469685, 0.0526423379778862, 0.018409492447972298, -0.04815969243645668, -0.01175257470458746, 0.021781055256724358, 0.02915634587407112, -0.05578402057290077, -0.001648664940148592, 0.009903962723910809, 0.053906675428152084, -0.0316658616065979, -0.06344666332006454, -0.047201864421367645, 0.019999491050839424, 0.05360016971826553, -0.04501800984144211, -0.01286365743726492, -0.008764144964516163, 0.02438635192811489, -0.00707357469946146, 0.01719304919242859, -0.022604789584875107, 0.08176036924123764, 0.02404153347015381, 0.0034865012858062983, 0.011273659765720367, 0.01760491542518139, -0.023888280615210533, -0.07164568454027176, 0.03302597999572754, 0.06103292852640152, 0.04881101846694946, -0.04643560200929642, -0.04593752697110176, -0.031742487102746964, 0.013476668857038021, -0.035995252430438995, -0.08459554612636566, -0.03323670104146004, 0.020267684012651443, -0.016187326982617378, -0.09409721940755844, -0.015076245181262493, -0.013323416002094746, -0.014233354479074478, -0.04877270385622978, -0.005248908419162035, -0.0036780673544853926, 0.028677431866526604, 0.008730621077120304, 0.018534010276198387, -0.017422927543520927, -0.057239923626184464, 0.0331026054918766, 0.02153201960027218, 0.0520293265581131, -0.04478813335299492, 0.07379122823476791, -0.04176139086484909, 0.027930323034524918, 0.03999898210167885, -0.020095273852348328, 0.034328628331422806, -0.001315818983130157, -0.010612756945192814, -0.008663572371006012, -0.011034201830625534, 0.0287923701107502, -0.031780801713466644, 0.0526423379778862, 0.03883042931556702, -0.033428266644477844, -0.07103267312049866, -0.061186183243989944, 0.04739343002438545, 0.06927026808261871, 0.026167916133999825, 0.095399871468544, -0.013151006773114204, 0.0036205975338816643, 0.03258537873625755, -0.0756685733795166, -0.0437919907271862, 0.005881076212972403, 0.0470869243144989, -0.010440347716212273, -0.04003729671239853, 0.003553549526259303, -0.005584149155765772, 0.035094890743494034, 0.012767874635756016, 0.022892137989401817, -0.04643560200929642, -0.05091824382543564, -0.012988175265491009, -0.015219919383525848, 0.0069442675448954105, 0.05681847780942917, 0.024022378027439117, -0.04451993852853775, 0.07313989847898483, -0.01696317084133625, 0.022758042439818382, 0.01907997392117977, 0.07509387284517288, 0.06884882599115372, 0.05291053280234337, 0.01610112376511097, -0.1233685091137886, -0.001728883245959878, -0.04337054491043091, 0.06739292293787003, -0.06122449412941933, 0.055592454969882965, 0.014501546509563923, -0.047163549810647964, 0.02911803312599659, -0.03771934658288956, 0.007121466100215912, 0.07700953632593155, -0.0361868180334568, 0.01525823213160038, -0.01204950176179409, 0.0372212752699852, -0.02074659802019596, 0.058657512068748474, -0.027930323034524918, -0.08084085583686829, -0.008917397819459438, -0.033753931522369385, -0.004446725826710463, 0.003057872410863638, -0.003481712192296982, -0.027796227484941483, 0.019750455394387245, -0.0509948693215847, -0.02490358054637909, 0.04114837944507599, -0.03505657985806465, 0.040228862315416336, -0.00045257469173520803, 0.051416315138339996, 0.02132129669189453, 0.049117524176836014, -0.01175257470458746, -0.02383081056177616, 0.013744860887527466, -0.009693239815533161, -0.004262343514710665, 0.018955456092953682, 0.00036756726331077516, 0.006043907720595598, -0.020612502470612526, 0.041608136147260666, 0.03953922539949417, -0.012854078784584999, -0.02467370219528675, 0.017001483589410782, 0.006345624104142189, 0.011379021219909191, 0.0258039403706789, 0.020555032417178154, 0.024175630882382393, 0.012796609662473202, -0.013677813112735748, -0.031531766057014465, -0.03302597999572754, -0.06624352186918259, -0.008050561882555485, 0.05582233518362045, -0.002078491263091564, 0.029462851583957672, -0.04474981874227524, 0.04674210399389267, 0.015507268719375134, 0.06195244565606117, -0.0018917142879217863, -0.003084212774410844, 0.010229624807834625, -0.0037451153621077538, -0.02770044468343258, 0.011149141937494278, 0.035688746720552444, -0.0069586350582540035, -0.007346556521952152, 0.043830301612615585, 0.010172154754400253, -0.010469082742929459, 0.03647416830062866, -0.01415672805160284, 0.04237440228462219, -0.010890527628362179, -0.016790760681033134, -0.009286162443459034, 0.000492683844640851, -0.0353630855679512, 0.023888280615210533, -0.049692220985889435, -0.04923246428370476, 0.010315829887986183, -0.013467090204358101, 0.02888815477490425, -0.027068275958299637, -0.06440449506044388, -0.013744860887527466, -0.0005654190317727625, 0.026972493156790733, 0.004956770222634077, 0.0221067164093256, -0.0030746343545615673, 0.03302597999572754, -0.03388802707195282, -0.04233608767390251, -0.05632040649652481, 0.006388726178556681, 0.03649332374334335, 0.016915278509259224, 0.04701029881834984, 0.0035846789833158255, -0.006273786537349224, -0.01871599815785885, 0.006843695417046547, -0.024577919393777847, -0.000837502651847899, 0.026934180408716202, -0.01231769472360611, -0.011206611059606075, -0.007332189008593559, -0.004561665467917919, -0.06382979452610016, 0.037144649773836136, -0.018840515986084938, 0.02494189329445362, 0.013141428120434284, -0.04429006204009056, 0.005732612684369087, -0.08482542634010315, 0.03381140157580376, -0.018677685409784317, 0.01286365743726492, 0.025439966470003128, -0.04819800704717636, 0.0009751907200552523, 0.007557278964668512, 0.015545581467449665, 0.03779597207903862, 0.03390718251466751, 0.05900232866406441, 0.027221528813242912, 0.05823606625199318, -0.03591862693428993, 0.02356261946260929, 0.045822590589523315, -0.034041278064250946, -0.015727568417787552, -0.011177876964211464, -0.025248399004340172, 0.005914600566029549, 0.009765077382326126, -0.01150353904813528, 0.01943437196314335, 0.0020940559916198254, 0.013744860887527466, 0.06689485162496567, -0.013495825231075287, 0.017058953642845154, 0.015919135883450508, -0.04107175022363663, 0.019099131226539612, -0.006757490802556276, 0.029807670041918755, 0.02572731487452984, -0.010651069693267345, 0.031493451446294785, -0.010526551865041256, 0.01118745468556881, 0.020325154066085815, 0.06302521377801895, -0.02517177350819111, -0.017528289929032326, 0.0034146641846746206, -0.11800465732812881, -0.08988276869058609, -0.010842636227607727, 0.10873286426067352, 0.006120534148067236, -0.019386479631066322, -0.021781055256724358, 0.04823632165789604, 0.04927077889442444, 0.0018785441061481833, -0.02404153347015381, -0.03563127666711807, 0.00994227547198534, -0.00566077558323741, 0.02494189329445362, -0.021991778165102005, 0.05068836733698845, -0.005579359829425812, -0.027087433263659477, 0.023332739248871803, 0.021953463554382324, 0.014894257299602032, 0.052795592695474625, 0.020076118409633636, 0.025382496416568756, -0.01008595060557127, -0.015928713604807854, -0.0768945962190628, 0.01717389188706875, 0.03591862693428993, 0.004362915642559528, -0.010708539746701717, 0.056665223091840744, -0.044136807322502136, 0.06275702267885208, -0.023428522050380707, 0.001261941040866077, 0.029232973232865334, -0.04375367611646652, -0.020631659775972366, 0.03915609046816826, -0.0049040899612009525, -0.030075863003730774, 0.024482136592268944, -0.051952701061964035, 0.008088874630630016, -0.003261411329731345, -0.0056416187435388565, 0.007365712895989418, -0.06130112335085869, -0.0974687859416008, 0.037930067628622055, 0.06501750648021698, 0.0015253443270921707, 0.0029884297400712967, 0.05578402057290077, -0.040228862315416336, 0.01092884037643671, 0.021072261035442352, 0.02293045073747635, -0.044673193246126175, 0.0095112519338727, -0.03367730230093002, 0.020899850875139236, 0.012777452357113361, 0.0001279601128771901, -0.0010805519996210933, -0.0064557744190096855, 0.04348548501729965, -0.03130188584327698, -0.037968382239341736, -0.024846110492944717, 0.013553295284509659, 0.023849967867136, 0.005076499190181494, -0.022892137989401817, -0.015210340730845928, -0.022336596623063087, -0.00043940453906543553, 0.0008434890769422054, 0.033160075545310974, 0.03588031232357025, 0.010287094861268997, -0.050535112619400024, 0.04229777306318283, -0.07306327670812607, -0.022202501073479652, -0.039021994918584824, 0.011944140307605267, -0.02938622608780861, 0.055630769580602646, -0.02664683200418949, 0.0009033534443005919, 0.005598516669124365, -0.06593701988458633, -0.009286162443459034, 0.005560203455388546, -0.05658859759569168, -0.007997880689799786, -0.008984445594251156, 0.01597660407423973, 0.01148438174277544, 0.015449798665940762, -0.05061173811554909, 0.04455825313925743, -0.03191489726305008, 0.0458609014749527, -0.016235219314694405, 0.04448162764310837, 0.015536002814769745, 0.060649797320365906, -0.03588031232357025, 0.0384472981095314, 0.015660520642995834, -0.06808255612850189, -0.0621057003736496, 0.054136551916599274, -0.01567010022699833, 0.035152360796928406, 0.033504895865917206, 0.012442212551832199, 0.008055350743234158, -0.04057367891073227, -0.010603178292512894, 0.021991778165102005, -0.005042975302785635, -0.02768128737807274, 0.030382368713617325, 0.04344717040657997, -0.044711507856845856, 0.0038768171798437834, 0.0824500098824501, -0.027528034523129463, -0.01821792684495449, 0.05999847501516342, 0.019510997459292412, 0.0654006376862526, 0.0019575650803744793, 0.04068861901760101, 0.025056833401322365, 0.03082296997308731, -0.024577919393777847, -0.05509438365697861, 0.005708666983991861, 0.040458742529153824, -0.07969146221876144, -0.02994176745414734, 0.05946208909153938, -0.046090781688690186, -0.019999491050839424, 0.006369569804519415, 0.03551633656024933, -0.04563102126121521, 0.020804068073630333, 0.03164670616388321, -0.02099563367664814, 0.01904166117310524, -0.09164518117904663, 0.003084212774410844, 0.0008189446525648236, 0.044098496437072754, 0.047738250344991684, -0.005057342816144228, -0.002231743885204196, -0.033217545598745346, -0.022355753928422928, -0.05900232866406441, -0.05379173532128334, -0.0431789793074131, 0.06693316251039505, 0.031014537438750267, -0.010804322548210621, -0.08214350044727325, 0.008596524596214294, 0.007360924035310745, 0.027604661881923676, 0.008381012827157974, -0.005306378472596407, -0.010995889082551003, -0.013869378715753555, -0.007748845033347607, 0.07601339370012283, 0.06409798562526703, -0.038255732506513596, -0.039347656071186066, 0.07091773301362991, -0.008213392458856106, -0.0015456982655450702, -0.02827514335513115, -0.01678118295967579, 0.009913540445268154, 0.03193405270576477, -0.010152998380362988, 0.047201864421367645, 0.0014139965642243624, -0.08658783882856369, 0.05291053280234337, 0.022796355187892914, 0.03325586020946503, 0.004520957823842764, 0.011857936158776283, 0.018677685409784317, -0.0078015257604420185, 0.03946259617805481, -0.020037803798913956, -0.021493706852197647, -0.0017516317311674356, -0.008002669550478458, -0.06329341232776642, 0.016168171539902687, -0.013831065967679024, -0.02019105665385723, -0.06137774884700775, -0.01119703333824873, -0.001965946052223444, 0.01006679330021143, 0.028945622965693474, 0.017240941524505615, 0.06153099983930588, -0.02383081056177616, -0.005617673043161631, 0.011637634597718716, -0.01373528316617012, 0.00982733629643917, -0.01428124587982893, -0.057852935045957565, 0.02461623214185238, 0.019692985340952873, 0.04141657054424286, -0.039385970681905746, -0.00018602855561766773, -0.015622207894921303, 0.014932570047676563, 0.01342877745628357, 0.035956937819719315, 0.019539732486009598, 0.050535112619400024, 0.016666242852807045 ]
42,870
linearmodels.panel.model
fit
Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator. See Notes. debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional covariance-specific options. See Notes. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import FirstDifferenceOLS >>> mod = FirstDifferenceOLS(y, x) >>> robust = mod.fit(cov_type="robust") >>> clustered = mod.fit(cov_type="clustered", cluster_entity=True) Notes ----- Three covariance estimators are supported: * "unadjusted", "homoskedastic" - Assume residual are homoskedastic * "robust", "heteroskedastic" - Control for heteroskedasticity using White's estimator * "clustered` - White's. Configuration options are: * ``clusters`` - Input containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables * ``cluster_entity`` - Boolean flag indicating to use entity clusters * "kernel" - Driscoll-Kraay HAC estimator. Configurations options are: * ``kernel`` - One of the supported kernels (bartlett, parzen, qs). Default is Bartlett's kernel, which is produces a covariance estimator similar to the Newey-West covariance estimator. * ``bandwidth`` - Bandwidth to use when computing the kernel. If not provided, a naive default is used. When using a clustered covariance estimator, all cluster ids must be identical within a first difference. In most scenarios, this requires ids to be identical within an entity.
def fit( self, *, cov_type: str = "unadjusted", debiased: bool = True, **cov_config: bool | float | str | IntArray | DataFrame | PanelData, ) -> PanelResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator. See Notes. debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional covariance-specific options. See Notes. Returns ------- PanelResults Estimation results Examples -------- >>> from linearmodels import FirstDifferenceOLS >>> mod = FirstDifferenceOLS(y, x) >>> robust = mod.fit(cov_type="robust") >>> clustered = mod.fit(cov_type="clustered", cluster_entity=True) Notes ----- Three covariance estimators are supported: * "unadjusted", "homoskedastic" - Assume residual are homoskedastic * "robust", "heteroskedastic" - Control for heteroskedasticity using White's estimator * "clustered` - White's. Configuration options are: * ``clusters`` - Input containing 1 or 2 variables. Clusters should be integer values, although other types will be coerced to integer values by treating as categorical variables * ``cluster_entity`` - Boolean flag indicating to use entity clusters * "kernel" - Driscoll-Kraay HAC estimator. Configurations options are: * ``kernel`` - One of the supported kernels (bartlett, parzen, qs). Default is Bartlett's kernel, which is produces a covariance estimator similar to the Newey-West covariance estimator. * ``bandwidth`` - Bandwidth to use when computing the kernel. If not provided, a naive default is used. When using a clustered covariance estimator, all cluster ids must be identical within a first difference. In most scenarios, this requires ids to be identical within an entity. """ y_fd = self.dependent.first_difference() time_ids = y_fd.time_ids entity_ids = y_fd.entity_ids index = y_fd.index y = cast(Float64Array, y_fd.values2d) x = cast(Float64Array, self.exog.first_difference().values2d) if np.all(self.weights.values2d == 1.0): w = root_w = np.ones_like(y) else: w = cast(Float64Array, 1.0 / self.weights.values3d) w = w[:, :-1] + w[:, 1:] w = cast(Float64Array, 1.0 / w) w_frame = panel_to_frame( w, self.weights.panel.items, self.weights.panel.major_axis[1:], self.weights.panel.minor_axis, True, ) w_frame = w_frame.reindex(self.weights.index).dropna(how="any") index = cast(MultiIndex, w_frame.index) w = np.require(w_frame, requirements="W") w /= w.mean() root_w = cast(Float64Array, np.sqrt(w)) wx = root_w * x wy = root_w * y params = _lstsq(wx, wy, rcond=None)[0] df_resid = y.shape[0] - x.shape[1] cov_config = self._setup_clusters(cov_config) extra_df = 0 if "extra_df" in cov_config: cov_config = cov_config.copy() _extra_df = cov_config.pop("extra_df") assert isinstance(_extra_df, (str, int)) extra_df = int(_extra_df) cov = setup_covariance_estimator( self._cov_estimators, cov_type, wy, wx, params, entity_ids, time_ids, debiased=debiased, extra_df=extra_df, **cov_config, ) weps = wy - wx @ params fitted = DataFrame( self.exog.values2d @ params, self.dependent.index, ["fitted_values"] ) idiosyncratic = DataFrame( self.dependent.values2d - fitted.values, self.dependent.index, ["idiosyncratic"], ) effects = DataFrame( np.full_like(np.asarray(fitted), np.nan), self.dependent.index, ["estimated_effects"], ) eps = y - x @ params residual_ss = float(np.squeeze(weps.T @ weps)) total_ss = float(np.squeeze(w.T @ (y**2))) r2 = 1 - residual_ss / total_ss res = self._postestimation( params, cov, debiased, df_resid, weps, wy, wx, root_w ) res.update( dict( df_resid=df_resid, df_model=x.shape[1], nobs=y.shape[0], residual_ss=residual_ss, total_ss=total_ss, r2=r2, resids=eps, wresids=weps, index=index, fitted=fitted, effects=effects, idiosyncratic=idiosyncratic, ) ) return PanelResults(res)
(self, *, cov_type: str = 'unadjusted', debiased: bool = True, **cov_config: bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData) -> linearmodels.panel.results.PanelResults
[ 0.03337555006146431, -0.05029255151748657, 0.03507183492183685, 0.0038510248996317387, 0.014120425097644329, -0.0486421138048172, -0.05162207409739494, -0.06280837953090668, 0.012871134094893932, 0.04763351008296013, -0.011123272590339184, -0.024664897471666336, -0.008469962514936924, 0.025856882333755493, -0.026773791760206223, 0.08490592986345291, -0.045937225222587585, 0.01282528880983591, 0.015438484027981758, -0.0005694875144399703, -0.04488277807831764, -0.07926692813634872, -0.05065931752324104, 0.011426999233663082, 0.0014577447436749935, -0.043576180934906006, -0.0030716508626937866, -0.01821213960647583, 0.006406913511455059, -0.03442999720573425, -0.03791425749659538, -0.0069054835475981236, -0.06652186810970306, -0.04855042323470116, 0.016790926456451416, -0.015037335455417633, 0.03241279348731041, 0.02213193289935589, 0.03635551035404205, 0.01122069451957941, -0.026475796476006508, -0.025306735187768936, 0.07326116412878036, -0.006212070118635893, -0.047908585518598557, 0.040940061211586, -0.06569664925336838, 0.09251628816127777, -0.005022951401770115, -0.009392604231834412, 0.017100384458899498, -0.06601756811141968, 0.030876968055963516, -0.019037358462810516, 0.05208052694797516, 0.0012328150914981961, -0.0008180562872439623, 0.036126282066106796, 0.07752479612827301, -0.05817798525094986, 0.046739522367715836, -0.007444168906658888, -0.00015374372014775872, 0.022750847041606903, -0.01864767074584961, -0.009386872872710228, -0.012916979379951954, 0.011409807950258255, 0.025467194616794586, -0.0016461412888020277, 0.02780531719326973, -0.0023954291827976704, -0.001673361985012889, 0.016515854746103287, 0.02411475218832493, -0.023438530042767525, -0.0025816767010837793, -0.01981673203408718, -0.03053312562406063, -0.008802343159914017, -0.01518633309751749, 0.03979392349720001, -0.0682181566953659, -0.0136848920956254, 0.009484294801950455, -0.012332448735833168, -0.030189285054802895, -0.011266539804637432, 0.051392845809459686, 0.021192098036408424, 0.003793718060478568, 0.040046073496341705, 0.03963346406817436, -0.014108963310718536, 0.04187989607453346, 0.014716416597366333, -0.010939890518784523, -0.03541567549109459, 0.035117678344249725, -0.010309514589607716, -0.016321010887622833, 0.04822950437664986, 0.020343955606222153, 0.08247611671686172, -0.030831122770905495, -0.03635551035404205, -0.022040240466594696, 0.0004992865142412484, -0.0020802412182092667, -0.05382265895605087, -0.028745150193572044, -0.002851019147783518, -0.01634393259882927, -0.02281961590051651, -0.0004509338177740574, -0.027232248336076736, -0.06546742469072342, 0.033627700060606, -0.05084269866347313, 0.04538707807660103, -0.011977146379649639, 0.06899753212928772, -0.08463085442781448, 0.0035960092209279537, 0.01703161559998989, -0.01170207280665636, 0.018028756603598595, 0.018028756603598595, 0.01773076131939888, -0.03472799435257912, -0.010722124017775059, -0.037685029208660126, -0.028309617191553116, -0.001507172011770308, 0.013467125594615936, 0.05428111180663109, -0.011295193806290627, -0.02165055461227894, -0.024183519184589386, -0.013146206736564636, 0.04708336293697357, 0.0841265544295311, 0.006349606439471245, 0.021409865468740463, -0.00202150153927505, 0.04804611951112747, 0.012561677023768425, -0.07119811326265335, -0.01416627038270235, 0.05781121924519539, -0.047587666660547256, -0.029020223766565323, -0.045937225222587585, -0.0637252926826477, -0.02812623605132103, -0.09774268418550491, -0.024825356900691986, 0.01688261888921261, 0.013192052952945232, 0.01918635703623295, -0.07151903212070465, -0.028355462476611137, 0.061891473829746246, 0.029982980340719223, -0.0034871259704232216, 0.005320947617292404, -0.03569074720144272, -0.026177801191806793, -0.01570209488272667, -0.0019369738874956965, -0.002863913308829069, -0.013478587381541729, -0.04174235835671425, -0.027874086052179337, -0.06193731725215912, 0.051667917519807816, 0.022567464038729668, -0.028951454907655716, -0.030510203912854195, -0.03605751320719719, 0.027117634192109108, -0.007111788727343082, -0.05414357781410217, -0.014223577454686165, -0.03397154062986374, 0.015725018456578255, 0.017535917460918427, 0.000633599644061178, 0.014452804811298847, -0.00024104722251649946, -0.0438283309340477, -0.0041891359724104404, 0.01943850703537464, -0.02131817303597927, 0.008229273371398449, -0.005819517653435469, 0.049788251519203186, -0.022899845615029335, 0.03449876606464386, -0.0018581767799332738, -0.0071977488696575165, -0.02309468761086464, 0.05208052694797516, -0.04080252721905708, -0.04380540922284126, 0.0149685675278306, -0.011484306305646896, -0.02796577662229538, -0.02448151633143425, -0.0059656500816345215, 0.014189193025231361, 0.026131954044103622, -0.009627562016248703, -0.031060349196195602, 0.04687706008553505, -0.015209256671369076, -0.008790881372988224, -0.02372506447136402, 0.018991513177752495, -0.012194911949336529, -0.00242981337942183, -0.027415629476308823, -0.02255600318312645, 0.03649304434657097, 0.029226528480648994, -0.05840720981359482, 0.023610450327396393, 0.0016031611012294888, 0.038922857493162155, -0.08912371844053268, 0.005352466367185116, 0.034040309488773346, 0.02351875975728035, -0.06542158126831055, 0.008859649300575256, 0.016366856172680855, -0.06450466811656952, 0.03053312562406063, -0.03316924348473549, 0.008687729015946388, -0.020538799464702606, -0.04162774607539177, 0.012401217594742775, 0.0127221355214715, -0.03037266619503498, 0.005352466367185116, 0.06367944926023483, 0.06606341898441315, -0.010441320948302746, -0.0180975254625082, 0.05661923438310623, -0.02549011819064617, -0.03614920377731323, 0.007369669619947672, 0.006183416582643986, -0.041375596076250076, 0.06005765125155449, -0.019427046179771423, 0.04018361121416092, -0.05785706639289856, -0.020928487181663513, -0.007959931157529354, -0.0352322943508625, 0.047541819512844086, -0.07702049612998962, 0.006647602654993534, -0.00742124579846859, -0.03186264634132385, 0.009736445732414722, 0.055198024958372116, -0.11222986876964569, 0.09746760874986649, -0.013398357667028904, -0.034200768917798996, -0.013730737380683422, 0.06001180410385132, -0.006916944868862629, -0.06377113610506058, 0.06510066241025925, 0.0714273452758789, 0.009169107303023338, -0.04355325922369957, -0.02244138903915882, 0.007833856157958508, -0.0068424460478127, -0.030441435053944588, -0.05221806466579437, -0.026750870048999786, 0.02549011819064617, 0.012068836949765682, -0.01676800474524498, 0.019896961748600006, 0.06037857010960579, -0.026613332331180573, 0.008641883730888367, -0.019644811749458313, 0.031060349196195602, -0.005776537582278252, 0.022464312613010406, 0.03000590205192566, -0.020596107468008995, 0.06743878126144409, 0.01805168017745018, -0.004074521828442812, 0.0025831093080341816, -0.028997300192713737, 0.06042441353201866, -0.06775970011949539, 0.033398471772670746, 0.004266500007361174, -0.013994349166750908, 0.058315519243478775, -0.027507320046424866, 0.029960056766867638, -0.019427046179771423, -0.054189421236515045, 0.012802365235984325, -0.025994418188929558, 0.03080819919705391, 0.09884297102689743, -0.012366833165287971, -0.04600599408149719, 0.026338260620832443, -0.01810898631811142, 0.02512335404753685, 0.032114796340465546, 0.049788251519203186, 0.03504891321063042, -0.00020576766110025346, -0.01837259903550148, -0.03009759448468685, -0.058361366391181946, 0.005289428401738405, 0.022968612611293793, 0.00013091049913782626, -0.030601894482970238, 0.04048160836100578, -0.02480243518948555, 0.08751912415027618, 0.02260184846818447, 0.016894079744815826, -0.016997231170535088, -0.041008830070495605, -0.009100338444113731, -0.027301015332341194, -0.051026079803705215, 0.07573682069778442, 0.019404122605919838, 0.034521687775850296, 0.07307778298854828, -0.02624656818807125, 0.05528971552848816, 0.05116361752152443, 0.04568507522344589, -0.0023982946295291185, 0.043255262076854706, -0.009180568158626556, 0.0036217973101884127, 0.026429951190948486, -0.04891718551516533, -0.03981684893369675, 0.018349675461649895, -0.04444724693894386, 0.03910624235868454, -0.0037077576853334904, 0.0004376815923023969, -0.004022945649921894, -0.034957218915224075, 0.04951317608356476, -0.03702026978135109, -0.032000184059143066, -0.028149157762527466, -0.04520369693636894, 0.014636186882853508, 0.026544565334916115, 0.0032894171308726072, -0.051988836377859116, -0.014326729811728, 0.07257348299026489, 0.002497148932889104, 0.01927804760634899, -0.05790290981531143, -0.042934343218803406, 0.0064183748327195644, -0.00990836601704359, -0.00003487663343548775, 0.024412747472524643, -0.04314064979553223, 0.021134791895747185, -0.0544186495244503, 0.07193164527416229, -0.038005948066711426, 0.025742268189787865, 0.028561769053339958, -0.009421257302165031, -0.0007965661934576929, 0.016470007598400116, 0.026659179478883743, -0.059599194675683975, 0.0021117599681019783, -0.02351875975728035, -0.012492908164858818, 0.04055037721991539, 0.04270511493086815, -0.042017433792352676, -0.06312929838895798, 0.0004946303670294583, 0.04600599408149719, -0.008126121014356613, 0.03679104149341583, -0.022899845615029335, 0.02500873990356922, -0.020275188609957695, 0.013352512381970882, -0.036561813205480576, 0.03894578292965889, -0.03032682090997696, 0.028905609622597694, 0.09746760874986649, 0.005713499616831541, 0.07601189613342285, -0.033627700060606, 0.0595533512532711, 0.039289623498916626, 0.01800583302974701, 0.017719298601150513, -0.05020086094737053, -0.007661934942007065, -0.012928441166877747, -0.023770909756422043, 0.011295193806290627, -0.012916979379951954, -0.05125530809164047, -0.009220683015882969, -0.0028123371303081512, -0.0032034567557275295, -0.007621820084750652, 0.03406323119997978, -0.012641905806958675, 0.05969088524580002, -0.007776549085974693, 0.03238987177610397, -0.0029040281660854816, -0.019472891464829445, -0.05781121924519539, 0.016619006171822548, 0.03663058206439018, -0.040252380073070526, -0.09063662588596344, -0.008011506870388985, 0.09526702016592026, 0.04210912436246872, 0.03328385949134827, 0.016298087313771248, -0.05886566638946533, -0.02416059747338295, 0.0133639732375741, -0.04474524036049843, -0.018361136317253113, -0.0024756588973104954, 0.004438420757651329, -0.018223600462079048, -0.030762353911995888, -0.030028825625777245, -0.013639046810567379, 0.02025226503610611, 0.02030957117676735, -0.02372506447136402, 0.03798302635550499, 0.015667712315917015, 0.008469962514936924, 0.018028756603598595, -0.008000046014785767, -0.0174556877464056, 0.007186287548393011, 0.041490208357572556, -0.027919931337237358, 0.021822474896907806, 0.03711196035146713, -0.015083180740475655, -0.001224219100549817, -0.03518644720315933, -0.003704892238602042, -0.006464220583438873, 0.03585120663046837, -0.0463956817984581, -0.016401240602135658, -0.011593190021812916, 0.03048728033900261, 0.03145003691315651, -0.013639046810567379, 0.03305463120341301, 0.0201491117477417, 0.024894125759601593, -0.06445882469415665, 0.02436690218746662, 0.01977088674902916, -0.04589138180017471, 0.05308913066983223, -0.06005765125155449, 0.06963936984539032, -0.0009362517739646137, -0.02077948860824108, -0.03906039521098137, -0.021352557465434074, -0.04144436493515968, -0.014200654812157154, 0.0054699452593922615, -0.03711196035146713, -0.031312499195337296, -0.02500873990356922, -0.0044355555437505245, 0.0292952973395586, -0.024710742756724358, 0.019220739603042603, -0.0055874246172606945, 0.015404099598526955, 0.0796336978673935, 0.03502598777413368, -0.0014283749042078853, 0.03149588406085968, 0.010143324732780457, 0.05116361752152443, 0.02287692204117775, 0.06675110012292862, 0.056710924953222275, -0.03791425749659538, -0.029501602053642273, 0.04772520065307617, 0.04669367894530296, -0.031243732199072838, -0.08183427900075912, -0.01643562503159046, 0.08453916758298874, 0.020470030605793, -0.03750164806842804, -0.041375596076250076, -0.03986269235610962, -0.029386987909674644, 0.004656187258660793, -0.034315381199121475, -0.025833958759903908, 0.016619006171822548, -0.01057885680347681, 0.024871202185750008, -0.007765087299048901, 0.03718072921037674, 0.018235061317682266, -0.03718072921037674, -0.0003622871881816536, 0.001453446689993143, -0.0270488653331995, 0.0518512986600399, 0.052630674093961716, 0.03791425749659538, -0.0021189232356846333, -0.022636232897639275, -0.0003209187416359782, -0.01981673203408718, 0.018395520746707916, -0.007134711369872093, -0.03225233405828476, 0.04905472323298454, -0.07073965668678284, 0.047541819512844086, 0.04495154693722725, 0.07106057554483414, 0.024619052186608315, -0.0280116219073534, -0.034636300057172775, -0.00274643418379128, 0.04632691293954849, -0.025031661614775658, 0.031839724630117416, -0.027278093621134758, 0.03910624235868454, 0.03332970291376114, -0.028584690764546394, -0.07926692813634872, 0.006561642047017813, -0.00025680664111860096, -0.05749030038714409, 0.01853305660188198, -0.034475840628147125, 0.006378259975463152, 0.01084819994866848, -0.006074533332139254, 0.021776629611849785, 0.008005776442587376, 0.022407004609704018, -0.03541567549109459, 0.052997440099716187, -0.05285990238189697, 0.009415526874363422, 0.0214327871799469, 0.057719528675079346, -0.027117634192109108, -0.013788044452667236, 0.0560232438147068, 0.01398288831114769, -0.031633418053388596, -0.0299371350556612, 0.05061347037553787, 0.010888314805924892, -0.006177685689181089, -0.0030687854159623384, -0.0032034567557275295, 0.024091828614473343, 0.042819730937480927, -0.046624910086393356, 0.03117496334016323, -0.010189170017838478, 0.008183428086340427, -0.015770863741636276, -0.016470007598400116, -0.020492954179644585, -0.017421303316950798, 0.00478226225823164, 0.05978257581591606, 0.019805271178483963, 0.0483211949467659, 0.01793706603348255, 0.019690657034516335, 0.01580524817109108, -0.05620662495493889, 0.011363961733877659, 0.04655614122748375, -0.11305508762598038, 0.010533011518418789, -0.04268219321966171, 0.014028733596205711, 0.07165656983852386, 0.024183519184589386, -0.02549011819064617, 0.03569074720144272, 0.028790995478630066, 0.046303991228342056, -0.017111845314502716, 0.020126190036535263, -0.009386872872710228, 0.01250436995178461, 0.04279680550098419, 0.04080252721905708, 0.041856974363327026, -0.036882732063531876, 0.026773791760206223, -0.013169130310416222, -0.005931266117841005, 0.006785138975828886, -0.006762216333299875, -0.00002780280919978395, -0.0240001380443573, -0.06331268697977066, -0.032435715198516846, 0.04887134209275246, 0.0010171978501603007, 0.012206373736262321, 0.02860761433839798, 0.06161639839410782, -0.004616072401404381, 0.057765375822782516, -0.0038825436495244503, 0.03702026978135109, -0.014200654812157154, 0.059920113533735275, 0.006326683796942234, 0.012057376094162464, -0.015587481670081615, 0.013719276525080204, -0.019965730607509613, 0.009484294801950455, -0.04492862522602081, -0.03931254521012306, 0.004131828900426626, 0.004787993151694536, -0.06395452469587326, -0.028401309624314308, 0.024619052186608315, -0.024550283327698708, -0.021283790469169617, 0.06519234925508499, 0.08110075443983078, 0.0028567498084157705, -0.028859764337539673, 0.09004063159227371, -0.04375956207513809, -0.010464243590831757, -0.04055037721991539, 0.000567338487599045, -0.04311772435903549, -0.046258144080638885, -0.0023696410935372114, -0.019942807033658028, -0.03172510862350464, 0.05918658524751663, -0.1152556762099266, -0.006710640154778957, -0.025444271042943, -0.01462472602725029, -0.007547321263700724, 0.009965673089027405, 0.002037260914221406, -0.006057341117411852, 0.07266516983509064, 0.014074578881263733, 0.062166545540094376, 0.005664789117872715, 0.008533000014722347, 0.04570799693465233, -0.0937541201710701, -0.030670663341879845, 0.0149685675278306, 0.03855609521269798, -0.008418386802077293, 0.026475796476006508, 0.02764485776424408, -0.014716416597366333, 0.011186310090124607, -0.017971450462937355, 0.03294001519680023, 0.03461337834596634, 0.027759471908211708, -0.011965684592723846, 0.008452770300209522, 0.005868228618055582, -0.026452872902154922, 0.03825809806585312, 0.0021375480573624372, 0.0518512986600399, -0.027942853048443794, 0.05047593265771866, -0.027576088905334473, 0.009060223586857319, 0.006183416582643986, 0.00018266579718329012, -0.019965730607509613, -0.005085988901555538, 0.004097444470971823, -0.04155897721648216, 0.015300947241485119, -0.04740428179502487, 0.01073931623250246, -0.05886566638946533, -0.05969088524580002, -0.012527292594313622, 0.0243210569024086, 0.02565057761967182, -0.0013710680650547147, 0.06267084926366806, -0.04836703836917877, 0.03342139348387718, -0.03851024806499481, 0.023862600326538086, 0.03085404448211193, 0.033031709492206573, 0.0012385457521304488, 0.006544450297951698, -0.009203490801155567, -0.017971450462937355, -0.023931369185447693, 0.013214975595474243, -0.03112911805510521, 0.0524931363761425, 0.04119221493601799, 0.021879781037569046, 0.02030957117676735, 0.0093696815893054, 0.017593223601579666 ]
42,873
linearmodels.iv.model
IV2SLS
Estimation of IV models using two-stage least squares Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation Notes ----- The 2SLS estimator is defined .. math:: \hat{\beta}_{2SLS} & =(X'Z(Z'Z)^{-1}Z'X)^{-1}X'Z(Z'Z)^{-1}Z'Y\\ & =(\hat{X}'\hat{X})^{-1}\hat{X}'Y\\ \hat{X} & =Z(Z'Z)^{-1}Z'X The 2SLS estimator is a special case of a k-class estimator with :math:`\kappa=1`, .. todo:: * VCV: bootstrap See Also -------- IVLIML, IVGMM, IVGMMCUE
class IV2SLS(_IVLSModelBase): r""" Estimation of IV models using two-stage least squares Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation Notes ----- The 2SLS estimator is defined .. math:: \hat{\beta}_{2SLS} & =(X'Z(Z'Z)^{-1}Z'X)^{-1}X'Z(Z'Z)^{-1}Z'Y\\ & =(\hat{X}'\hat{X})^{-1}\hat{X}'Y\\ \hat{X} & =Z(Z'Z)^{-1}Z'X The 2SLS estimator is a special case of a k-class estimator with :math:`\kappa=1`, .. todo:: * VCV: bootstrap See Also -------- IVLIML, IVGMM, IVGMMCUE """ def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, ): self._method = "IV-2SLS" super().__init__( dependent, exog, endog, instruments, weights=weights, fuller=0, kappa=1 ) @staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None ) -> IV2SLS: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation Returns ------- IV2SLS Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IV2SLS >>> data = wage.load() >>> formula = 'np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]' >>> mod = IV2SLS.from_formula(formula, data) """ parser = IVFormulaParser(formula, data) dep, exog, endog, instr = parser.data mod = IV2SLS(dep, exog, endog, instr, weights=weights) mod.formula = formula return mod
(dependent: 'IVDataLike', exog: 'IVDataLike | None', endog: 'IVDataLike | None', instruments: 'IVDataLike | None', *, weights: 'IVDataLike | None' = None)
[ 0.054584015160799026, -0.08563109487295151, -0.005061602685600519, 0.011932995170354843, 0.011003904975950718, -0.05768097937107086, -0.02663390338420868, -0.044905997812747955, 0.007210122421383858, 0.05535825714468956, -0.012097520753741264, -0.017507532611489296, 0.010190951637923717, 0.03896369785070419, -0.04928046092391014, 0.07049467414617538, 0.03702809289097786, -0.04974500834941864, -0.0077956425957381725, -0.0031405165791511536, -0.03319559618830681, 0.020246410742402077, 0.006319744978100061, 0.0791274681687355, 0.016317136585712433, 0.04103479161858559, -0.008579562418162823, -0.011497484520077705, 0.03515055775642395, -0.07475300133228302, -0.05872620642185211, -0.0023493384942412376, -0.05187417194247246, -0.016046151518821716, 0.03598286584019661, -0.05733257159590721, 0.01575581170618534, -0.0036268369294703007, -0.04451887682080269, 0.060777947306632996, 0.05036440119147301, -0.005124509800225496, 0.08717957884073257, -0.029847003519535065, -0.05303553119301796, 0.009949001483619213, -0.027292007580399513, -0.01652037538588047, 0.05477757751941681, -0.028917914256453514, 0.020285123959183693, -0.026943599805235863, 0.00821179710328579, -0.049706295132637024, -0.033563364297151566, 0.055203408002853394, 0.020614175125956535, 0.03515055775642395, 0.0619393065571785, -0.023556293919682503, 0.016365526244044304, -0.04815781116485596, 0.004952725023031235, 0.04428660497069359, -0.035460252314805984, 0.03774426504969597, -0.04378334805369377, 0.047577131539583206, -0.012407218106091022, 0.03329237923026085, -0.02758234739303589, -0.03396983817219734, -0.02407890558242798, 0.05032568797469139, -0.018078535795211792, 0.042699411511421204, -0.03623449429869652, -0.023265952244400978, 0.012058809399604797, -0.050519246608018875, 0.03919596970081329, -0.0401444137096405, -0.01721719279885292, -0.04161547124385834, -0.016491340473294258, -0.033466581255197525, -0.017226869240403175, -0.034163400530815125, 0.02918889932334423, 0.008627952076494694, -0.08431488275527954, 0.03269234299659729, -0.0005129348719492555, 0.04103479161858559, 0.04552539065480232, -0.012184623628854752, -0.01325888279825449, -0.08021140098571777, 0.03139548748731613, -0.029827648773789406, 0.010481292381882668, -0.015968728810548782, -0.0005700956680811942, 0.039525020867586136, -0.03321495279669762, -0.0399121418595314, -0.06348779052495956, -0.005129348952323198, 0.021001296117901802, -0.09654789417982101, -0.03060188889503479, 0.07394004613161087, -0.0410735048353672, -0.0009405822493135929, -0.09786410629749298, 0.015591285191476345, -0.0051099928095936775, 0.04931917414069176, -0.007113342639058828, 0.007021401077508926, -0.0317826084792614, -0.020285123959183693, -0.08059852570295334, 0.05957787111401558, 0.041770320385694504, -0.09112820774316788, -0.011371670290827751, -0.02535640448331833, -0.004855944775044918, -0.05590022727847099, 0.004079284146428108, -0.039757292717695236, -0.016597798094153404, 0.01680103689432144, 0.023556293919682503, -0.04331880435347557, 0.03923467919230461, 0.0012460446450859308, 0.01746882125735283, 0.06387491524219513, 0.010984549298882484, 0.025085419416427612, -0.03998956456780434, 0.016626833006739616, -0.011023261584341526, 0.0410735048353672, 0.051099929958581924, 0.018988268449902534, -0.00254047941416502, 0.003367949975654483, -0.013500833883881569, 0.01505899429321289, 0.03468601405620575, -0.004466404672712088, 0.013162102550268173, -0.03261491656303406, 0.0071762497536838055, -0.01431378722190857, 0.019249575212597847, -0.042118728160858154, -0.04258327558636665, -0.030176056548953056, -0.054467879235744476, 0.0016513116424903274, 0.026808107271790504, 0.032634273171424866, -0.048738494515419006, -0.005380977410823107, -0.01372342836111784, 0.03774426504969597, -0.02907276339828968, -0.050403110682964325, -0.0696042999625206, -0.011197465471923351, -0.026653258129954338, 0.037531349807977676, 0.02884048968553543, 0.02498864009976387, 0.03762812912464142, 0.010103849694132805, 0.030098631978034973, -0.0005840078229084611, -0.07057210057973862, -0.028104960918426514, -0.038247521966695786, 0.029285678640007973, 0.00767466751858592, 0.010510326363146305, -0.030524466186761856, -0.02884048968553543, 0.03607964888215065, -0.046183496713638306, 0.0378216914832592, 0.0016718774568289518, -0.01565903052687645, 0.04792553931474686, 0.020749667659401894, 0.022917544469237328, -0.029266323894262314, 0.025646744295954704, 0.032285865396261215, 0.03607964888215065, 0.002056578639894724, -0.033563364297151566, -0.038712069392204285, 0.02827916480600834, -0.03623449429869652, -0.04111221432685852, 0.0021485197357833385, -0.007723057642579079, 0.009808669798076153, 0.03482150658965111, -0.012823372147977352, 0.04688031226396561, 0.044093046337366104, 0.028646929189562798, 0.0023989384062588215, 0.01115875318646431, -0.01243625208735466, -0.016597798094153404, 0.06499756127595901, -0.051680609583854675, -0.10514197498559952, -0.003876045811921358, -0.018059179186820984, -0.02498864009976387, 0.053771063685417175, 0.017497854307293892, -0.02287883125245571, 0.02220137044787407, -0.004248649347573519, -0.028917914256453514, 0.048854630440473557, -0.021659402176737785, -0.038944341242313385, 0.030388973653316498, -0.057526133954524994, 0.04378334805369377, -0.024136973544955254, -0.010810344479978085, -0.020052850246429443, -0.012900796718895435, -0.022820763289928436, 0.031589046120643616, -0.00645523751154542, -0.016559086740016937, 0.03095029853284359, 0.029924428090453148, -0.04010570049285889, -0.022356219589710236, 0.04208001866936684, -0.038712069392204285, -0.024717655032873154, 0.05439045652747154, -0.022278795018792152, -0.03958309069275856, 0.007534336298704147, 0.01642359420657158, 0.027233939617872238, -0.0703011155128479, -0.035808663815259933, -0.0063294232822954655, -0.0689074769616127, 0.04815781116485596, -0.015194486826658249, 0.045254405587911606, 0.013239527121186256, -0.006251998711377382, 0.07746284455060959, 0.03156968951225281, 0.031008366495370865, 0.018920522183179855, -0.049474023282527924, 0.04285426065325737, 0.007698862347751856, 0.04765455424785614, -0.03727972134947777, -0.024388602003455162, 0.006581051275134087, -0.00762143824249506, 0.031221281737089157, 0.00552130863070488, -0.010229663923382759, -0.005211612209677696, 0.033911772072315216, -0.0033776278141885996, -0.04591251164674759, -0.08919260650873184, 0.04544796794652939, -0.005264841020107269, 0.011526518501341343, 0.042118728160858154, 0.04715129733085632, 0.044325318187475204, 0.04908690229058266, 0.04912561550736427, -0.02196909859776497, 0.03244071453809738, 0.054119471460580826, -0.028453370556235313, -0.02746621146798134, 0.016084864735603333, 0.025724168866872787, -0.011778146959841251, -0.043396227061748505, -0.05864878371357918, 0.012745948508381844, -0.039060477167367935, -0.011526518501341343, -0.017430108040571213, 0.009116691537201405, 0.07784996926784515, -0.009145725518465042, -0.017604311928153038, 0.021001296117901802, -0.031105145812034607, -0.030621245503425598, 0.0008837239001877606, 0.05160318687558174, 0.03656354919075966, 0.023846633732318878, 0.016733290627598763, 0.018552757799625397, -0.02299496904015541, 0.0378216914832592, 0.016994597390294075, 0.05493242293596268, -0.024717655032873154, 0.00879247859120369, -0.016597798094153404, -0.0014347659889608622, -0.013229848816990852, 0.03420211002230644, -0.014526703394949436, -0.01436217688024044, -0.03083416260778904, 0.02862757444381714, 0.02218201383948326, 0.050170838832855225, 0.011603942140936852, 0.08748926967382431, -0.050170838832855225, -0.04192516952753067, -0.0205367524176836, -0.00770854065194726, -0.08175988495349884, 0.04142191261053085, -0.04122835025191307, -0.018320485949516296, 0.06151347607374191, -0.049009475857019424, -0.04835137352347374, 0.036505479365587234, 0.030059920623898506, -0.013084678910672665, -0.007481107022613287, -0.034995708614587784, 0.009939323179423809, 0.04471243917942047, -0.05326780676841736, -0.025433829054236412, 0.016907496377825737, -0.055280834436416626, 0.002620323095470667, 0.024698298424482346, -0.04215744137763977, 0.03306010738015175, -0.03797653689980507, 0.005695512983947992, 0.007664989214390516, -0.025085419416427612, -0.04579637572169304, 0.006416525226086378, -0.0017626088811084628, 0.012794338166713715, -0.006072955671697855, -0.03950566425919533, -0.01663651131093502, -0.01063614059239626, -0.04401561990380287, 0.04827394708991051, -0.01682039350271225, 0.01733332872390747, 0.024233754724264145, 0.07022368907928467, 0.026420986279845238, 0.038615286350250244, 0.04626091942191124, 0.06023597717285156, -0.011981384828686714, -0.00004154742418904789, 0.02183360606431961, 0.04347365349531174, -0.029363103210926056, -0.012523354031145573, -0.02104000933468342, 0.013229848816990852, -0.0034018228761851788, -0.0026154841762036085, -0.037202298641204834, -0.040725093334913254, 0.023536937311291695, 0.028414657339453697, 0.011797502636909485, -0.03956373408436775, -0.03125999495387077, 0.027640417218208313, 0.04835137352347374, -0.04215744137763977, -0.011361991986632347, -0.031821317970752716, 0.01837855391204357, -0.040337976068258286, -0.07452072948217392, -0.0012363666901364923, -0.00872473232448101, 0.0413057766854763, 0.03306010738015175, -0.001234552008099854, 0.03664097189903259, 0.035460252314805984, 0.0205367524176836, 0.05593893676996231, 0.021349705755710602, -0.039641156792640686, 0.044325318187475204, -0.05702287703752518, -0.02591772936284542, 0.002054159063845873, -0.0027340396773070097, -0.04006699100136757, 0.04974500834941864, -0.038576576858758926, -0.006034243386238813, -0.033466581255197525, -0.06139734014868736, -0.02978893555700779, -0.000786338874604553, 0.012087843380868435, 0.022123945876955986, 0.015194486826658249, 0.011468449607491493, 0.00767466751858592, 0.030447041615843773, -0.04029926285147667, -0.04118964076042175, -0.01904633641242981, 0.04273812100291252, -0.00942154973745346, -0.03431824967265129, 0.04707387462258339, 0.01907537132501602, 0.03209230303764343, 0.031143859028816223, -0.04250584915280342, -0.02932439185678959, 0.03664097189903259, -0.033002037554979324, 0.01033612247556448, -0.002013027435168624, -0.03584737330675125, 0.005695512983947992, 0.0187947079539299, 0.04149933531880379, -0.023865990340709686, 0.012571743689477444, 0.07003013044595718, -0.0647265762090683, 0.009653821587562561, 0.026072576642036438, -0.0031235800124704838, 0.014391210861504078, 0.0735529288649559, -0.027853332459926605, 0.017372040078043938, 0.04126706346869469, -0.02160133421421051, -0.05710029974579811, -0.016413915902376175, -0.04486728459596634, -0.008845707401633263, -0.003713939106091857, -0.002218685345724225, 0.02616935782134533, 0.008240831084549427, -0.011284567415714264, 0.004313976038247347, -0.009257023222744465, 0.001047645346261561, -0.05020955204963684, -0.04471243917942047, 0.06762998551130295, 0.022240083664655685, 0.02862757444381714, 0.0025864499621093273, 0.024911215528845787, 0.0012533031404018402, -0.013752462342381477, 0.037066806107759476, -0.018252739682793617, 0.010132883675396442, -0.026672614738345146, -0.017904331907629967, -0.057293858379125595, 0.037202298641204834, -0.011478127911686897, -0.027504924684762955, -0.018252739682793617, -0.020052850246429443, -0.028221096843481064, 0.004212356638163328, -0.03495699539780617, 0.038015250116586685, 0.0020299640018492937, 0.020846448838710785, -0.003931694198399782, -0.0336407870054245, 0.077037014067173, 0.0207690242677927, 0.02196909859776497, 0.04262198507785797, -0.08114049583673477, -0.00256709405221045, -0.03373756632208824, 0.04103479161858559, -0.005705190822482109, -0.05965529754757881, -0.048428796231746674, 0.04823523759841919, 0.02148519828915596, -0.014991248026490211, -0.039757292717695236, -0.018988268449902534, 0.052145153284072876, -0.05195159465074539, 0.0331762433052063, 0.027872689068317413, -0.02746621146798134, -0.00686171418055892, -0.019704442471265793, -0.036273207515478134, 0.02719522826373577, -0.011758790351450443, 0.031240638345479965, 0.0044905999675393105, 0.004396239295601845, -0.05907461419701576, 0.03623449429869652, -0.07200444489717484, -0.020304478704929352, -0.046764176338911057, 0.015852591022849083, 0.004386560991406441, -0.014846078120172024, 0.009373159147799015, -0.004984178580343723, -0.0403766855597496, 0.04765455424785614, -0.020227055996656418, 0.02334337681531906, -0.039641156792640686, 0.0031405165791511536, 0.04800296574831009, -0.062055446207523346, 0.04053153470158577, 0.04358978942036629, 0.0788951963186264, -0.017013953998684883, -0.008381162770092487, 0.008927970193326473, -0.01628810167312622, -0.010578072629868984, 0.06131991371512413, 0.006435881368815899, -0.04657061770558357, 0.03633127734065056, 0.0037042610347270966, -0.018107568845152855, -0.0018218866316601634, -0.0626361221075058, -0.006431042216718197, 0.004517214372754097, -0.005642283707857132, -0.02498864009976387, 0.03273105248808861, -0.03073738142848015, -0.032072946429252625, 0.07579822838306427, -0.034995708614587784, 0.09863834828138351, 0.015697743743658066, 0.01863018237054348, -0.031956810504198074, -0.002642098581418395, -0.0013210492907091975, 0.013897632248699665, -0.03153098002076149, 0.010829701088368893, 0.038383014500141144, 0.009276378899812698, -0.048777204006910324, 0.04029926285147667, 0.009087657555937767, 0.020498039200901985, 0.008085982874035835, 0.010897447355091572, 0.016839750111103058, -0.024330534040927887, -0.004720452707260847, 0.01781722903251648, 0.032169729471206665, 0.02264655940234661, 0.031008366495370865, 0.002290060743689537, 0.008105339482426643, 0.05350007861852646, -0.021098077297210693, 0.03261491656303406, 0.060777947306632996, -0.01623971201479435, -0.020517395809292793, -0.00015862873988226056, -0.016646189615130424, -0.009353803470730782, -0.048854630440473557, 0.020149631425738335, 0.03584737330675125, -0.033834345638751984, 0.00577777624130249, -0.050867658108472824, 0.018184993416070938, 0.0015629996778443456, 0.07130762934684753, -0.007611760403960943, 0.05384848639369011, 0.03261491656303406, 0.030040564015507698, 0.007306902669370174, -0.004202678799629211, 0.08888290822505951, 0.005937463603913784, -0.021349705755710602, -0.006489110179245472, 0.060197263956069946, 0.003571188310161233, 0.0035881248768419027, -0.011120041832327843, 0.007718218490481377, 0.010597428306937218, 0.03244071453809738, -0.004006699193269014, 0.015368690714240074, -0.054584015160799026, -0.03784104436635971, -0.06302324682474136, -0.028104960918426514, 0.010936158709228039, -0.032518137246370316, 0.06279097497463226, -0.007882745005190372, -0.0018485012697055936, 0.023865990340709686, 0.040802519768476486, 0.0357312373816967, 0.015165452845394611, 0.025608032941818237, 0.08764412254095078, 0.01354922354221344, 0.028317878022789955, 0.01424604095518589, 0.013084678910672665, -0.03466665744781494, -0.02396276965737343, 0.009469939395785332, -0.04262198507785797, -0.017439786344766617, -0.00552130863070488, -0.011197465471923351, 0.0006027590134181082, 0.03360207378864288, 0.03284718841314316, 0.025666100904345512, 0.02183360606431961, -0.07692088186740875, -0.009494134224951267, -0.06708801537752151, -0.014352499507367611, 0.018039824441075325, 0.02465958707034588, -0.11598135530948639, -0.05129348859190941, 0.017410753294825554, -0.00471077486872673, -0.037415213882923126, 0.047112587839365005, -0.09910289198160172, -0.005564859602600336, -0.03865399956703186, 0.016975240781903267, -0.02078838087618351, 0.028782421723008156, -0.005153543781489134, 0.0030921264551579952, 0.024814436212182045, 0.007287546526640654, 0.05311295762658119, -0.025182200595736504, -0.06329423189163208, 0.02967279963195324, -0.05977143347263336, 0.02417568676173687, 0.012629811652004719, 0.023149816319346428, -0.0371248722076416, 0.10049653053283691, 0.035789307206869125, -0.039525020867586136, -0.0066633145324885845, -0.04808038845658302, 0.039873428642749786, 0.04138319939374924, -0.04343494027853012, 0.05795196443796158, -0.04575766250491142, -0.05059667304158211, 0.0004418619500938803, 0.01837855391204357, 0.06894619017839432, 0.06755255907773972, 0.03373756632208824, 0.016142932698130608, 0.01663651131093502, -0.04064767062664032, -0.02407890558242798, 0.008860224857926369, -0.04784811660647392, -0.07351421564817429, -0.02558867633342743, 0.00031211605528369546, 0.016413915902376175, 0.02897598221898079, -0.011429738253355026, -0.0018122086767107248, -0.013162102550268173, -0.043396227061748505, 0.07231414318084717, 0.013578257523477077, 0.02078838087618351, 0.05675189197063446, -0.030388973653316498, 0.029963139444589615, -0.013036288321018219, -0.0017299455357715487, -0.015378369018435478, 0.03565381467342377, -0.013926666229963303, 0.052029017359018326, -0.012252368964254856, -0.03640870004892349, -0.04149933531880379, 0.022259438410401344, -0.032653629779815674, 0.11056166887283325, 0.02208523452281952, 0.004176064394414425, 0.02429182268679142, -0.0002436138311168179, 0.04053153470158577 ]
42,874
linearmodels.iv.model
__init__
null
def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, ): self._method = "IV-2SLS" super().__init__( dependent, exog, endog, instruments, weights=weights, fuller=0, kappa=1 )
(self, dependent: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], endog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], instruments: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None)
[ 0.03630475699901581, -0.07190524786710739, 0.030600227415561676, 0.009868484921753407, -0.01829323172569275, -0.05841861292719841, -0.03505469113588333, -0.03778370842337608, 0.02130395546555519, 0.0298959631472826, -0.015203277580440044, 0.04260791093111038, -0.007157072424888611, 0.034068722277879715, -0.03320600092411041, 0.044016435742378235, 0.019015099853277206, 0.01964893750846386, -0.00028720725094899535, 0.007165875751525164, -0.04014299064874649, 0.011365043930709362, -0.042960040271282196, 0.063982293009758, 0.009912501089274883, 0.07768020778894424, -0.026832420378923416, -0.02964947186410427, 0.023487171158194542, -0.0641583576798439, -0.04155151546001434, -0.015537802129983902, -0.0490519180893898, 0.04176279529929161, 0.07123620063066483, -0.033769410103559494, 0.0021116884890943766, 0.033258818089962006, -0.09120205789804459, 0.09507550299167633, 0.04556581377983093, -0.05546071007847786, 0.06109481304883957, -0.01710478775203228, -0.04415728896856308, 0.04693912714719772, -0.013609882444143295, -0.005559275858104229, 0.04341781139373779, -0.029473405331373215, 0.0025661583058536053, -0.025159794837236404, 0.025987304747104645, -0.03355813026428223, -0.03965000435709953, 0.09930107742547989, 0.03683295473456383, 0.0501435250043869, 0.05553113669157028, 0.002159006195142865, 0.01103932224214077, -0.04584752023220062, 0.03669210150837898, 0.015396949835121632, -0.019437657669186592, 0.07120098918676376, -0.07190524786710739, 0.03445606678724289, -0.0038624422159045935, 0.05028437823057175, 0.046692635864019394, -0.022994186729192734, -0.07158832997083664, 0.0602496974170208, 0.010854452848434448, 0.04303046688437462, -0.05031958967447281, -0.013160914182662964, -0.0010151290334761143, -0.07408846914768219, 0.02855786494910717, -0.03817105293273926, -0.05873553454875946, -0.01806434616446495, -0.013891587033867836, -0.03718508407473564, -0.02688523940742016, -0.056939661502838135, -0.00666849035769701, -0.005176332779228687, -0.11331591755151749, 0.02206103876233101, -0.012993652373552322, 0.041621942073106766, 0.07577870041131973, -0.01118897832930088, -0.02563517354428768, -0.09676573425531387, 0.016215655952692032, -0.027343010529875755, 0.028434617444872856, -0.03873446583747864, 0.03174465522170067, -0.005664915312081575, -0.013521849177777767, -0.07158832997083664, -0.041375450789928436, -0.0015471777878701687, -0.0054140216670930386, -0.07669424265623093, -0.05035480484366417, 0.07838447391986847, -0.044298142194747925, -0.01196366734802723, -0.09141333401203156, 0.02797684632241726, 0.031075604259967804, 0.031146030873060226, 0.008442352525889874, 0.04447420686483383, -0.010440698824822903, 0.0050090705044567585, -0.06859521567821503, 0.05954543501138687, 0.0226596612483263, -0.039755646139383316, -0.03179747238755226, 0.002035760087892413, -0.006294350605458021, -0.05894681066274643, 0.01780024729669094, -0.041657157242298126, -0.041305024176836014, 0.03144534304738045, 0.00863602478057146, -0.04098810628056526, 0.062327273190021515, 0.018416477367281914, 0.016286080703139305, 0.04546017572283745, 0.018416477367281914, -0.0017078376840800047, -0.0037105856463313103, -0.0012511671520769596, 0.0053744069300591946, 0.07500401139259338, -0.000003284038712081383, -0.0027818388771265745, 0.013275356963276863, 0.022430775687098503, -0.020036282017827034, 0.05296057462692261, -0.008411540649831295, -0.03466734662652016, 0.006659687031060457, -0.028205731883645058, 0.014939178712666035, -0.013090488500893116, 0.022254711017012596, -0.037220299243927, -0.037290725857019424, -0.043488238006830215, -0.007143867667764425, -0.01604839228093624, 0.008468762040138245, 0.02695566602051258, -0.042960040271282196, 0.0007416769512929022, 0.003582937875762582, 0.022413169965147972, -0.03473777323961258, -0.10486476123332977, -0.06764446198940277, -0.0059114075265824795, 0.0018784013809636235, 0.05296057462692261, 0.02042362652719021, 0.0231174323707819, 0.03288908302783966, 0.018962280824780464, 0.024825269356369972, -0.024209039285779, -0.07366590946912766, -0.024966122582554817, 0.0007042629877105355, 0.0047669801861047745, 0.02959665283560753, 0.022008217871189117, 0.0011433269828557968, -0.01780024729669094, 0.07465187460184097, -0.021480020135641098, -0.001842087833210826, 0.003930667880922556, 0.02804727293550968, 0.0071394662372767925, 0.048594146966934204, -0.0024165024515241385, -0.03146294876933098, 0.03292429447174072, 0.04274876415729523, 0.022254711017012596, -0.008776877075433731, -0.03369898349046707, -0.008037401363253593, 0.04767860472202301, -0.009542763233184814, -0.006122686434537172, -0.0027598305605351925, -0.021391987800598145, 0.0527845099568367, 0.018486903980374336, 0.010801633819937706, -0.011725978925824165, 0.01804673857986927, -0.005660513881593943, -0.011954864487051964, 0.00458211125805974, -0.007980179972946644, 0.009894895367324352, 0.08577923476696014, -0.029825536534190178, -0.05088299885392189, -0.006047858390957117, 0.00026203534798696637, 0.003345249220728874, 0.06887692213058472, -0.018786214292049408, -0.045636240392923355, -0.004300405737012625, -0.019050313159823418, -0.007003014907240868, 0.013134504668414593, -0.00431801239028573, -0.031867899000644684, 0.04338259994983673, -0.04450942203402519, 0.011831617914140224, -0.07718722522258759, -0.008385131135582924, -0.00229105562902987, 0.02045883983373642, -0.01644454151391983, -0.008490771055221558, -0.019842609763145447, -0.044544633477926254, 0.025247827172279358, 0.05866510793566704, -0.03528357669711113, -0.006285547278821468, 0.03965000435709953, -0.07591954618692398, -0.0462348647415638, 0.014120472595095634, -0.009208238683640957, 0.0018002722645178437, 0.012879209592938423, -0.017148803919553757, 0.03609347715973854, -0.08422985672950745, -0.024385105818510056, -0.005673718638718128, -0.08451155573129654, 0.0694403275847435, -0.03260737657546997, 0.04736168682575226, -0.001771661569364369, -0.03125166893005371, 0.042678337544202805, -0.004855012986809015, 0.037889350205659866, 0.023821694776415825, -0.003391466336324811, 0.014771915972232819, -0.0035521264653652906, 0.023275891318917274, -0.018698181957006454, -0.033258818089962006, -0.017412902787327766, 0.02209625206887722, 0.06968682259321213, -0.0186101496219635, 0.003107560332864523, -0.009243451990187168, 0.012456651777029037, -0.017624180763959885, -0.022536415606737137, -0.06091874837875366, 0.012218962423503399, -0.027114124968647957, 0.011611536145210266, 0.09099077433347702, 0.03880488872528076, 0.08521582186222076, 0.05841861292719841, 0.02204343117773533, 0.026022518053650856, 0.03038894757628441, 0.06137651950120926, -0.011215387843549252, 0.0030855522491037846, -0.0431361086666584, 0.009146615862846375, -0.030300915241241455, -0.046727847307920456, -0.0516929030418396, 0.073172926902771, -0.009639599360525608, -0.004652537405490875, -0.013116898015141487, 0.02341674454510212, 0.06736275553703308, -0.03229045867919922, 0.006439604796469212, -0.0030129251535981894, -0.037255510687828064, -0.012315798550844193, -0.01915595307946205, 0.019772183150053024, 0.0862722173333168, 0.004084725398570299, 0.0007103152456693351, 0.0003061893512494862, -0.04042469710111618, -0.008728459477424622, 0.010440698824822903, 0.03392786905169487, -0.015969162806868553, 0.013521849177777767, -0.003778811078518629, -0.022835727781057358, -0.010299846529960632, 0.049967460334300995, -0.021990612149238586, -0.04373473301529884, -0.019877823069691658, 0.023205464705824852, -0.00524235749617219, 0.03410393372178078, 0.0040869261138141155, 0.0376780703663826, -0.061799075454473495, -0.03236088529229164, 0.011954864487051964, 0.017421705648303032, -0.07074321806430817, 0.00544483307749033, -0.08141279965639114, 0.030776292085647583, 0.04098810628056526, -0.043488238006830215, -0.003008523490279913, 0.010968895629048347, 0.04183322191238403, 0.04433335363864899, 0.0042255776934325695, -0.03306514769792557, 0.01266793068498373, 0.01092487946152687, -0.04746732488274574, -0.007086646277457476, 0.023064613342285156, -0.04098810628056526, 0.0365864634513855, 0.03817105293273926, -0.03415675461292267, 0.040283843874931335, -0.0019268195610493422, 0.0010591455502435565, 0.03227285295724869, -0.023311104625463486, -0.07267993688583374, -0.030512193217873573, 0.02801205962896347, 0.020106708630919456, -0.010317453183233738, -0.06229206174612045, -0.018469296395778656, 0.010766420513391495, -0.027149338275194168, 0.003312236862257123, -0.01225417573004961, 0.012720749713480473, 0.015969162806868553, -0.010880863294005394, 0.009666009806096554, 0.03248412907123566, 0.03306514769792557, 0.06285547465085983, 0.019191166386008263, 0.006734514608979225, -0.007205490488559008, 0.028610683977603912, -0.01908552646636963, -0.0032660195138305426, -0.0028302569407969713, 0.006025850307196379, -0.034368034452199936, -0.03185029327869415, -0.015678655356168747, -0.03824147954583168, -0.019701756536960602, 0.010669584386050701, 0.04303046688437462, -0.00039752342854626477, -0.058841172605752945, 0.03496665880084038, 0.04070639982819557, 0.0030173268169164658, -0.008882516995072365, -0.04355866461992264, 0.01778263971209526, -0.042643122375011444, -0.028909996151924133, -0.016611803323030472, -0.025758419185876846, 0.038664039224386215, 0.014120472595095634, 0.012386225163936615, 0.02644507586956024, 0.04549538716673851, 0.024121006950736046, 0.07017980515956879, 0.04010777547955513, 0.006642080377787352, 0.015036014840006828, -0.026233796030282974, -0.03014245629310608, 0.012720749713480473, -0.022554021328687668, -0.05753828585147858, 0.08810330182313919, -0.0315333753824234, -0.017791444435715675, 0.02559996023774147, -0.01829323172569275, -0.02931494638323784, -0.02454356476664543, 0.04475591331720352, 0.016321294009685516, -0.014472604729235172, -0.010986502282321453, 0.020406020805239677, -0.011646749451756477, -0.047291260212659836, -0.03926265984773636, -0.030318520963191986, 0.04493197798728943, 0.010511125437915325, -0.07194046676158905, 0.060214485973119736, -0.02128634788095951, 0.019508084282279015, 0.020106708630919456, -0.03577655926346779, -0.02047644555568695, 0.012034093961119652, -0.004476471804082394, 0.03683295473456383, -0.018205197528004646, -0.045636240392923355, -0.0038976555224508047, -0.015159260481595993, -0.015150457620620728, -0.02096942998468876, 0.0247548446059227, 0.0490519180893898, -0.05486208572983742, 0.011875635012984276, 0.0038140241522341967, 0.009261058643460274, 0.02750146947801113, 0.06077789515256882, -0.047819457948207855, 0.03908659517765045, 0.03236088529229164, -0.013601078651845455, -0.050742149353027344, 0.020265167579054832, -0.04398122429847717, 0.008442352525889874, -0.0006321860710158944, 0.0061534978449344635, 0.013803554698824883, -0.004771381616592407, -0.03824147954583168, -0.032220032066106796, -0.009375501424074173, -0.005141119938343763, -0.02019474096596241, -0.02422664687037468, 0.06532039493322372, 0.0030943555757403374, 0.021796939894557, 0.026867633685469627, 0.05056608095765114, 0.015493785962462425, -0.0005458038067445159, 0.049967460334300995, 0.017967509105801582, 0.0047273654490709305, -0.021937791258096695, -0.02500133588910103, -0.05517900362610817, -0.005273168906569481, -0.030600227415561676, -0.058805957436561584, -0.008376328274607658, -0.027343010529875755, 0.0156522449105978, 0.020106708630919456, -0.028417011722922325, 0.031339701265096664, 0.004141946788877249, 0.029191700741648674, -0.014683883637189865, -0.06222163513302803, 0.07039108872413635, 0.0008071514312177896, 0.018099559471011162, 0.0271669439971447, -0.019472870975732803, 0.00188390351831913, -0.008209065534174442, 0.04683348909020424, -0.04391079768538475, -0.037607643753290176, -0.05200982093811035, 0.037537217140197754, 0.02987835742533207, -0.04655178263783455, -0.04391079768538475, -0.016752656549215317, 0.059087663888931274, -0.03824147954583168, 0.047291260212659836, 0.012527077458798885, -0.013645095750689507, -0.003759003710001707, -0.03908659517765045, -0.02207864448428154, 0.00930507481098175, 0.0084291473031044, -0.021409595385193825, 0.007936163805425167, -0.00930507481098175, -0.07176439464092255, 0.06598944216966629, -0.0158811304718256, -0.012755963020026684, -0.06908819824457169, -0.022747693583369255, -0.009533960372209549, 0.014454998075962067, 0.011505896225571632, -0.0028280559927225113, -0.006448408123105764, 0.019015099853277206, 0.006981006823480129, 0.04961532726883888, -0.019825002178549767, -0.009366697631776333, 0.04736168682575226, -0.030054422095417976, 0.03584698587656021, 0.029772717505693436, 0.06722190231084824, -0.0226596612483263, -0.023311104625463486, -0.003536720760166645, -0.010616764426231384, -0.02017713524401188, 0.038382332772016525, 0.029843144118785858, -0.051305558532476425, 0.02801205962896347, 0.01132983062416315, 0.00340467132627964, -0.023575203493237495, -0.07655338943004608, -0.04419250413775444, 0.02260684221982956, 0.003219802398234606, -0.03255455568432808, 0.029420586302876472, 0.015599424950778484, -0.03929787501692772, 0.049404047429561615, -0.01801152527332306, 0.05334792286157608, -0.009498747065663338, -0.03415675461292267, -0.05310142785310745, 0.003919663839042187, -0.027924027293920517, 0.025723205879330635, -0.029279733076691628, -0.022413169965147972, 0.04014299064874649, 0.005110308062285185, -0.06165822595357895, 0.035424429923295975, 0.008481967262923717, 0.01480712927877903, 0.0156522449105978, 0.0050090705044567585, -0.012896816246211529, 0.03283626213669777, -0.024138614535331726, 0.013284160755574703, 0.06363016366958618, 0.04341781139373779, 0.021603267639875412, -0.00904097594320774, 0.005075095221400261, 0.011532306671142578, -0.03044176660478115, 0.01806434616446495, 0.05186896771192551, -0.02479005791246891, -0.0495096892118454, 0.025723205879330635, -0.008614016696810722, 0.02123352885246277, -0.04634050279855728, 0.023575203493237495, 0.008002188056707382, -0.07172918319702148, -0.0013039868790656328, -0.041621942073106766, 0.010035747662186623, -0.026761993765830994, 0.028628289699554443, -0.00396588072180748, 0.01510644145309925, 0.021427201107144356, 0.031920719891786575, 0.013680308125913143, 0.003501507453620434, 0.08007469773292542, 0.008010991849005222, 0.0392274484038353, 0.03229045867919922, 0.03771328181028366, 0.0016253069043159485, -0.012623913586139679, -0.06053140386939049, 0.0006140292971394956, -0.020828578621149063, 0.004586512688547373, -0.003525716485455632, 0.009472337551414967, -0.04662220925092697, -0.0006244832184165716, -0.04570666700601578, -0.020582085475325584, 0.004551299382001162, -0.018240410834550858, 0.07282079011201859, -0.01237742230296135, -0.013697914779186249, 0.041657157242298126, 0.05296057462692261, 0.01989542879164219, 0.05468602105975151, -0.004467668477445841, 0.049650538712739944, -0.06535560637712479, 0.005427226424217224, -0.00826188549399376, 0.02723737061023712, -0.012685537338256836, -0.0014635465340688825, 0.03102278523147106, -0.016189245507121086, -0.019860215485095978, -0.010828043334186077, 0.011144962161779404, 0.03965000435709953, 0.019772183150053024, 0.06327802687883377, 0.0064748176373541355, 0.04288961738348007, -0.0946529433131218, -0.008191458880901337, -0.025652779266238213, -0.05366484075784683, 0.032202426344156265, -0.007606040220707655, -0.07768020778894424, -0.05789041891694069, -0.03119884990155697, -0.012738356366753578, -0.03428000211715698, 0.0591580905020237, -0.08380729705095291, -0.04278397560119629, -0.08648349344730377, 0.014314144849777222, -0.012351011857390404, 0.021656086668372154, 0.02986074984073639, 0.008618418127298355, 0.05665795877575874, -0.0016154032200574875, 0.037537217140197754, -0.016902310773730278, -0.05338313430547714, 0.046410929411649704, -0.05683402344584465, 0.03736115247011185, 0.020335594192147255, -0.0037766103632748127, -0.032466523349285126, 0.04412207752466202, 0.07003895193338394, -0.02454356476664543, 0.02396254800260067, -0.07697594165802002, 0.03391026332974434, 0.019560905173420906, -0.06081311032176018, 0.05384090542793274, -0.02123352885246277, -0.007623646873980761, 0.015203277580440044, 0.019032707437872887, 0.05486208572983742, 0.056164972484111786, 0.010572748258709908, 0.004516086541116238, 0.004833004903048277, -0.022782906889915466, -0.03707944601774216, 0.005431628320366144, -0.04933362081646919, -0.0501435250043869, 0.013160914182662964, 0.031621407717466354, 0.021691299974918365, -0.009551567025482655, -0.0000896147103048861, -0.005682521965354681, 0.0068929740227758884, -0.005889399442821741, 0.0475025400519371, 0.001438237028196454, -0.0043686311691999435, 0.05289015173912048, -0.011391453444957733, 0.019314412027597427, 0.0302128829061985, 0.01989542879164219, 0.000880878942552954, 0.046692635864019394, -0.012861602939665318, 0.06708104908466339, -0.015370539389550686, -0.02723737061023712, -0.05877074599266052, -0.0059906370006501675, -0.0398612841963768, 0.08972310274839401, 0.002640986116603017, 0.0277127493172884, 0.05443952977657318, 0.05672838166356087, 0.016699835658073425 ]
42,875
linearmodels.iv.model
_drop_missing
null
def _drop_missing(self) -> BoolArray: data = (self.dependent, self.exog, self.endog, self.instruments, self.weights) missing = cast( BoolArray, npany(column_stack([dh.isnull for dh in data]), axis=1) ) if npany(missing): if npall(missing): raise ValueError( "All observations contain missing data. " "Model cannot be estimated." ) self.dependent.drop(missing) self.exog.drop(missing) self.endog.drop(missing) self.instruments.drop(missing) self.weights.drop(missing) missing_warning(missing, stacklevel=4) return missing
(self) -> numpy.ndarray
[ -0.030107904225587845, 0.04233802482485771, 0.00429660826921463, 0.019387075677514076, 0.014012055471539497, -0.030322127044200897, -0.03939734399318695, -0.028822574764490128, -0.0010315511608496308, 0.014966316521167755, -0.022162223234772682, 0.030322127044200897, 0.05304911732673645, -0.041403237730264664, -0.027400920167565346, 0.010574768297374249, 0.020876891911029816, 0.06968051940202713, 0.047907792031764984, -0.044324446469545364, -0.026816679164767265, 0.0015421537682414055, -0.04973841458559036, 0.058229390531778336, -0.025433974340558052, -0.008559135720133781, -0.0006657917401753366, -0.015073426999151707, -0.007200774736702442, 0.05137429013848305, 0.0012597704771906137, -0.0051900106482207775, 0.002291930140927434, -0.007595137692987919, 0.005087768658995628, -0.008340045809745789, 0.030322127044200897, -0.006168615072965622, 0.0008228066144511104, 0.03114006482064724, 0.02903679572045803, -0.04529818147420883, 0.002862782683223486, -0.009708143770694733, -0.015793992206454277, -0.04155903682112694, 0.04596032202243805, 0.037216175347566605, -0.044674988836050034, 0.057684097439050674, 0.06496763974428177, 0.07334176450967789, 0.016504818573594093, 0.06192958354949951, -0.008057662285864353, 0.08311807364225388, 0.0015969263622537255, 0.011421918869018555, 0.043428607285022736, -0.042221177369356155, -0.011957473121583462, 0.054100751876831055, 0.08335176855325699, -0.0439739003777504, 0.04409074783325195, 0.034528665244579315, -0.01214248314499855, -0.022415393963456154, -0.040780048817396164, -0.02282436192035675, -0.007171562872827053, -0.015910839661955833, 0.008369257673621178, 0.07953472435474396, 0.017098797485232353, -0.05694405734539032, 0.01931891404092312, -0.0068064117804169655, -0.007716854568570852, -0.064188651740551, -0.014401549473404884, -0.014401549473404884, -0.03797568753361702, 0.05032265558838844, 0.014313913881778717, 0.01866651140153408, -0.025375550612807274, 0.044012848287820816, 0.06765515357255936, -0.014459974132478237, 0.011490080505609512, 0.04190957918763161, 0.010185274295508862, -0.004116467200219631, 0.03530765324831009, 0.06080005317926407, -0.042221177369356155, -0.013778358697891235, -0.03585294634103775, -0.038404133170843124, 0.021811677142977715, -0.01243460364639759, 0.0005906315054744482, 0.06551293283700943, -0.02434339001774788, 0.009542608633637428, 0.026602456346154213, -0.034820783883333206, -0.025589771568775177, 0.019494187086820602, -0.06228012964129448, 0.017322756350040436, -0.0344897136092186, 0.001814799732528627, -0.019786307588219643, -0.0656687319278717, 0.01069161668419838, 0.02257119119167328, -0.08553293347358704, -0.016387971118092537, -0.011567979119718075, 0.024713410064578056, -0.0498163141310215, -0.024168116971850395, 0.08062531054019928, -0.04572662338614464, 0.024226542562246323, 0.020214751362800598, -0.001634658663533628, -0.01247355341911316, -0.00829622708261013, -0.03293173760175705, -0.012308018282055855, -0.015015003271400928, -0.08366336673498154, -0.00741499662399292, 0.044597089290618896, -0.051724836230278015, 0.0366903580725193, -0.0008313267608173192, -0.009031398221850395, -0.006889179348945618, 0.04116954281926155, 0.048725731670856476, 0.04120849072933197, 0.02580399438738823, 0.015453184023499489, -0.003916851710528135, 0.006154009141027927, -0.03526870533823967, -0.03108164109289646, -0.011149272322654724, -0.05098479613661766, -0.05297121778130531, -0.0008404555264860392, 0.017575927078723907, 0.017868047580122948, -0.0012549017556011677, -0.07225118577480316, -0.022960685193538666, -0.03939734399318695, 0.005019607022404671, 0.015229225158691406, 0.014128903858363628, -0.024713410064578056, 0.006197827402502298, -0.00429660826921463, -0.028686251491308212, -0.015083164907991886, 0.0692131295800209, 0.0005370760336518288, 0.005029344465583563, -0.03947524353861809, -0.011295333504676819, -0.03228907287120819, 0.017293544486165047, -0.04039055481553078, -0.02194800041615963, -0.026212962344288826, 0.04159798473119736, 0.009255357086658478, -0.041987478733062744, -0.0623190775513649, -0.02703090012073517, 0.04946576803922653, -0.012970157898962498, -0.02015632763504982, -0.06465604156255722, -0.0013778358697891235, 0.02313595823943615, -0.010117112658917904, 0.022590667009353638, -0.011597190983593464, 0.07505553960800171, 0.048180438578128815, 0.035443976521492004, 0.018734673038125038, 0.06430549919605255, 0.008841519244015217, -0.06858993321657181, 0.01780962385237217, -0.05811254307627678, -0.028588877990841866, 0.030146853998303413, -0.07505553960800171, -0.01128559559583664, -0.10103480517864227, -0.02523922733962536, 0.06360440701246262, -0.011275858618319035, 0.0379367396235466, -0.009980790317058563, 0.02434339001774788, -0.01810174435377121, 0.04206537827849388, -0.0025536215398460627, 0.016212698072195053, 0.0014715578872710466, 0.05047845467925072, -0.0026680356822907925, -0.02993263304233551, -0.04989421367645264, 0.018812572583556175, 0.02520027756690979, 0.01658271811902523, 0.0242849662899971, 0.025219751521945, 0.01870546117424965, -0.03744987025856972, -0.03877415135502815, 0.01572583056986332, -0.022746464237570763, -0.032464344054460526, -0.036320339888334274, 0.07030370831489563, 0.03589189425110817, -0.011791937984526157, -0.03411969542503357, 0.05733355134725571, -0.003636902431026101, -0.06804464757442474, 0.01037028431892395, -0.007716854568570852, -0.006524028722196817, 0.03168535605072975, -0.018608087673783302, 0.002612045733258128, 0.03466498851776123, 0.018598349764943123, -0.030438974499702454, 0.03357440233230591, -0.004316083155572414, 0.008607822470366955, 0.006908654235303402, 0.05312701314687729, -0.032152749598026276, 0.024674460291862488, -0.007731460966169834, 0.039631038904190063, -0.04424654692411423, 0.03051687404513359, -0.018491238355636597, -0.0633707121014595, 0.07049845904111862, -0.04954366758465767, 0.07256277650594711, 0.07193958759307861, -0.03312648460268974, 0.013758883811533451, -0.009099558927118778, 0.11941893398761749, 0.0700310617685318, -0.009693537838757038, -0.023291755467653275, 0.020837942138314247, 0.07112164795398712, 0.013749146834015846, -0.051140595227479935, 0.02761514112353325, -0.0006024988833814859, 0.018082270398736, -0.04868678003549576, 0.07645771652460098, 0.06434445083141327, 0.0010029476834461093, -0.0136517733335495, -0.01424575224518776, -0.09799674898386002, 0.0004406153748277575, 0.010652667842805386, 0.006353625096380711, 0.040156856179237366, 0.047635145485401154, -0.01468393299728632, 0.0143820745870471, -0.010350809432566166, -0.04471394047141075, -0.019961580634117126, -0.017361706122756004, 0.03744987025856972, 0.013398601673543453, 0.004340426530689001, 0.014002318494021893, -0.010974000208079815, 0.04241592437028885, -0.03174377977848053, 0.014323650859296322, 0.015346073545515537, 0.0062270392663776875, -0.004854071885347366, -0.006684694904834032, -0.03680720552802086, 0.07739250361919403, -0.009528002701699734, -0.00013137824134901166, -0.02434339001774788, 0.04572662338614464, 0.011567979119718075, 0.027400920167565346, 0.026310335844755173, 0.035482924431562424, -0.041052691638469696, -0.06017686054110527, 0.019757095724344254, -0.04658351093530655, 0.02790726348757744, -0.012483290396630764, -0.02461603656411171, -0.08257278054952621, 0.01006842590868473, 0.02494710683822632, -0.02138323336839676, 0.002285844413563609, 0.00047226177412085235, 0.036631934344768524, -0.0034397209528833628, -0.005589242558926344, -0.06847308576107025, 0.06029370799660683, 0.08187168836593628, -0.029426289722323418, 0.009007054381072521, -0.01715722121298313, 0.00009912324458127841, 0.030400026589632034, 0.0001214126605191268, -0.0024891116190701723, 0.013680985197424889, -0.019143642857670784, 0.023953896015882492, -0.018763884902000427, 0.09402391314506531, -0.002750803017988801, 0.024771833792328835, 0.05612612143158913, -0.0003703238326124847, -0.029212068766355515, 0.06317596882581711, -0.005516212433576584, 0.06411075592041016, 0.02611558884382248, -0.0046958401799201965, 0.023798098787665367, 0.06411075592041016, 0.049309972673654556, -0.07053741067647934, 0.04233802482485771, -0.013155167922377586, -0.11895154416561127, -0.016173748299479485, -0.06080005317926407, -0.04409074783325195, -0.07112164795398712, 0.02484973333775997, 0.0050244759768247604, -0.0036198620218783617, 0.048764679580926895, -0.0462719164788723, 0.00756592582911253, -0.0026023085229098797, -0.037527769804000854, -0.0439739003777504, -0.04498658701777458, -0.010204749181866646, -0.0016017950838431716, 0.004554648417979479, -0.036339811980724335, 0.010087900795042515, -0.028238331899046898, -0.03881310299038887, 0.09332282096147537, -0.05043950304389, -0.01066240482032299, 0.03861835598945618, -0.0027021162677556276, -0.0031792467925697565, -0.033710725605487823, -0.0011088413884863257, -0.016193224117159843, -0.027128273621201515, 0.009289437904953957, -0.073575459420681, -0.025881892070174217, 0.022103797644376755, 0.03168535605072975, -0.003911982756108046, -0.041636936366558075, -0.008695458993315697, -0.00038736421265639365, 0.020643195137381554, 0.032717514783144, 0.025979265570640564, 0.011061636731028557, -0.0033253070432692766, 0.008875600062310696, 0.02346702851355076, 0.029465239495038986, -0.007356572430580854, 0.050595302134752274, 0.03281489014625549, 0.07225118577480316, -0.01745907962322235, -0.00859321653842926, -0.007385784760117531, -0.0168845746666193, -0.008529923856258392, -0.036281388252973557, -0.0019584258552640676, -0.0028506109956651926, 0.07205643504858017, -0.0189683698117733, -0.012308018282055855, -0.03197747841477394, -0.03817043453454971, -0.03265909105539322, 0.006538634654134512, -0.04097479581832886, -0.039280492812395096, -0.024538137018680573, 0.051724836230278015, -0.031568508595228195, 0.04264961928129196, 0.0134959751740098, -0.02076004259288311, -0.0172448568046093, 0.014226277358829975, 0.017332494258880615, -0.010847414843738079, -0.03713827580213547, 0.03737197443842888, 0.000148114311741665, -0.0278293639421463, 0.025063954293727875, -0.07396495342254639, -0.02313595823943615, 0.03883257508277893, 0.00903626624494791, -0.0798463225364685, -0.07871678471565247, 0.005394495092332363, 0.01987394317984581, 0.009868810884654522, -0.08163799345493317, -0.0021592588163912296, 0.025745568796992302, 0.025959791615605354, -0.03413917124271393, -0.04592137038707733, -0.022941211238503456, 0.036573510617017746, 0.001973031787201762, -0.012551452033221722, -0.024791309610009193, -0.007838571444153786, -0.02547292411327362, -0.012872784398496151, 0.015073426999151707, 0.05223117768764496, 0.041364289820194244, -0.009055741131305695, -0.03470393642783165, 0.024207066744565964, -0.020935315638780594, 0.007264067884534597, -0.02669982984662056, 0.0006688346620649099, -0.04483078792691231, -0.028978371992707253, 0.028978371992707253, -0.052581723779439926, -0.011120060458779335, -0.06734355539083481, 0.007585400249809027, -0.042532771825790405, 0.034197594970464706, 0.03820938616991043, 0.04366230592131615, 0.02249329350888729, 0.07583452761173248, -0.012308018282055855, 0.040857944637537, 0.04471394047141075, -0.004712880589067936, -0.0016955171013250947, -0.02019527740776539, -0.07264067977666855, 0.0177706740796566, 0.0030331865418702364, -0.044908687472343445, -0.040780048817396164, -0.033944424241781235, 0.0005760254571214318, -0.01810174435377121, 0.006275726016610861, 0.03737197443842888, -0.035424500703811646, -0.026446659117937088, -0.03176325559616089, 0.006509422790259123, 0.052309077233076096, 0.005160798784345388, -0.0073663098737597466, -0.025122378021478653, 0.03312648460268974, -0.050244756042957306, 0.04004000872373581, -0.028588877990841866, -0.007395522203296423, -0.035443976521492004, -0.03139323741197586, 0.011344020254909992, -0.01573556661605835, 0.04039055481553078, 0.04989421367645264, -0.05098479613661766, -0.027731990441679955, 0.016670353710651398, -0.005944655742496252, -0.032172225415706635, -0.0065532405860722065, 0.04615506902337074, -0.034820783883333206, 0.041091643273830414, -0.018004370853304863, 0.028939422219991684, 0.028608351945877075, -0.01868598721921444, 0.022649090737104416, 0.021207962185144424, 0.0873246118426323, -0.024479713290929794, -0.008646772243082523, 0.058579932898283005, -0.04837518557906151, 0.10874679684638977, -0.025648195296525955, 0.05456814542412758, 0.05452919378876686, 0.03550240024924278, -0.006558109540492296, -0.022746464237570763, -0.0888046845793724, 0.04206537827849388, -0.04393495246767998, -0.06434445083141327, 0.0017977593233808875, -0.022473817691206932, -0.014148378744721413, -0.0002670165558811277, 0.049037326127290726, -0.04276646673679352, 0.03028317727148533, -0.039241544902324677, 0.002672904171049595, 0.018569137901067734, -0.017390917986631393, -0.020643195137381554, 0.03108164109289646, -0.048492033034563065, -0.05047845467925072, 0.030438974499702454, 0.0009694755426608026, -0.026914052665233612, -0.030672671273350716, -0.0026388235855847597, -0.01662166602909565, -0.05269857123494148, 0.009849335998296738, 0.06781094521284103, -0.004243053030222654, 0.07443235069513321, -0.012853310443460941, 0.008705195970833302, -0.004364769905805588, 0.0015299820806831121, 0.0562819167971611, -0.010204749181866646, -0.03595031797885895, 0.01692352443933487, 0.007731460966169834, 0.04782989248633385, 0.004379375837743282, 0.0005933701177127659, -0.020370548591017723, -0.004939273931086063, 0.044363394379615784, -0.06578557938337326, 0.03579452261328697, -0.018549663946032524, -0.01872493512928486, 0.0021702132653445005, 0.029582088813185692, -0.021714303642511368, -0.041948530822992325, -0.0344897136092186, -0.0000239249875448877, 0.02582346834242344, -0.018160169944167137, 0.0016407445073127747, 0.03536607697606087, -0.021110588684678078, -0.08888258785009384, -0.018870996311306953, 0.004372072871774435, 0.026193488389253616, -0.03922206908464432, 0.02136375941336155, 0.02549239806830883, -0.00992236565798521, 0.008310833014547825, 0.002502500545233488, -0.03764461725950241, -0.004912496078759432, 0.01246381551027298, -0.014927366748452187, -0.008043056353926659, 0.0414811372756958, -0.014012055471539497, 0.021110588684678078, 0.030146853998303413, -0.0746270939707756, 0.013690723106265068, -0.0030770045705139637, 0.03797568753361702, -0.011412180960178375, -0.0598263144493103, -0.04646666347980499, 0.0118795745074749, 0.010467657819390297, -0.016534030437469482, -4.944751026414451e-7, -0.008934023790061474, -0.0225127674639225, -0.054412346333265305, -0.017653826624155045, 0.03299016132950783, -0.04650561138987541, 0.04619401693344116, 0.02753724344074726, -0.047323551028966904, -0.008383863605558872, 0.00749289570376277, -0.0510626956820488, 0.005993342492729425, 0.08093690127134323, -0.0036247307434678078, -0.019786307588219643, -0.04070214927196503, 0.020701618865132332, 0.0037707912269979715, 0.008135560899972916, 0.03992316126823425, 0.020662669092416763, 0.040468450635671616, -0.026174012571573257, -0.02728407271206379, -0.009055741131305695, 0.029134169220924377, 0.011567979119718075, -0.008417944423854351, 0.035151854157447815, -0.002750803017988801, 0.016816414892673492, -0.03487921133637428, 0.017390917986631393, -0.01775120012462139, -0.007673036772757769, -0.007307885680347681, 0.013272016309201717, -0.017984896898269653, -0.033710725605487823, -0.033632829785346985, 0.07976841926574707, 0.08381915837526321, 0.045220281928777695, -0.05406180024147034, 0.0216753538697958, 0.02640770934522152, 0.015618719160556793, -0.04662246257066727, 0.009854204021394253, 0.017410391941666603, -0.05604822188615799, 0.014664458110928535, -0.004583860281854868, 0.0569051094353199, 0.0018805268919095397, 0.0437791533768177, -0.06204643473029137, -0.017945947125554085, -0.046077169477939606, 0.016981948167085648, -0.02342807874083519, -0.03521027788519859, -0.027673566713929176, 0.007726592011749744, 0.01717669703066349, -0.008826913312077522, 0.005506474990397692, -0.0199031550437212, 0.003826780943199992, 0.08428655564785004, -0.057684097439050674, 0.04070214927196503, -0.022921735420823097, 0.1060982346534729, -0.05156903713941574, -0.10189169645309448, -0.030925843864679337, -0.011061636731028557, 0.017303282395005226, 0.017868047580122948, 0.009883416816592216, 0.008914549835026264, -0.0006040203734301031, -0.03524922952055931, 0.021714303642511368, 0.012804623693227768, 0.0018184512155130506, -0.012278806418180466, -0.038092538714408875, 0.003559003584086895, 0.06703195720911026, 0.021831152960658073, 0.02817990817129612, -0.00000568170935366652, -0.00030520526343025267, -0.00918232649564743, -0.020545821636915207, -0.02257119119167328, 0.04744039848446846, 0.00011365320096956566, 0.0035127513110637665, -0.01718643307685852, 0.013087006285786629, 0.04276646673679352, 0.03861835598945618, -0.009674062952399254, 0.01747855357825756, -0.03526870533823967, -0.04319491237401962, -0.001673608087003231, -0.014109428972005844, 0.04557082802057266, -0.02336965501308441, 0.032756466418504715, -0.030731095001101494, 0.014742356725037098 ]
42,876
linearmodels.iv.model
_estimate_kappa
null
def _estimate_kappa(self) -> float: y, x, z = self._wy, self._wx, self._wz is_exog = self._regressor_is_exog e = c_[y, x[:, ~is_exog]] x1 = x[:, is_exog] ez = e - z @ (pinv(z) @ e) if x1.shape[1] == 0: # No exogenous regressors ex1 = e else: ex1 = e - x1 @ (pinv(x1) @ e) vpmzv_sqinv = inv_sqrth(ez.T @ ez) q = vpmzv_sqinv @ (ex1.T @ ex1) @ vpmzv_sqinv return min(eigvalsh(q))
(self) -> float
[ 0.037751320749521255, -0.04168374836444855, 0.029961366206407547, 0.053443584591150284, 0.03906213119626045, -0.04524166136980057, -0.015888886526226997, -0.05561578646302223, -0.009213119745254517, 0.05767562985420227, 0.004449730738997459, -0.019793227314949036, 0.02254592813551426, -0.002009518211707473, -0.05018528550863266, -0.0023313688579946756, 0.01343579962849617, -0.018959926441311836, 0.004901492036879063, 0.017312051728367805, -0.052245132625103, -0.06531577557325363, 0.005636482033878565, 0.04647756740450859, -0.028332216665148735, -0.019268903881311417, 0.03460537642240524, -0.01650683954358101, 0.06546558439731598, -0.056364819407463074, -0.05258219689130783, -0.0017590598436072469, -0.01412865612655878, -0.02164708636701107, 0.07310573011636734, -0.04951115697622299, 0.052020419389009476, -0.019662145525217056, 0.010121324099600315, -0.0542675219476223, -0.03627197816967964, 0.02419380284845829, 0.015392651781439781, -0.04078491032123566, -0.007775910664349794, 0.018866296857595444, -0.024399787187576294, 0.04333162307739258, 0.0677126869559288, 0.0009450704092159867, -0.012068812735378742, -0.03589745983481407, 0.0261225663125515, -0.013557517901062965, 0.015505006536841393, 0.055465977638959885, 0.04924899339675903, -0.046552471816539764, 0.013407710939645767, -0.08022155612707138, 0.015308384783565998, -0.024025270715355873, 0.03462410345673561, 0.017255874350667, 0.02001793682575226, 0.009634451940655708, -0.012349700555205345, 0.02915615402162075, -0.0015753124607726932, 0.020542262122035027, 0.03868761286139488, -0.0542675219476223, -0.02469940111041069, -0.020280098542571068, 0.0007133379695005715, 0.05198296904563904, -0.04812544211745262, -0.06636442244052887, -0.02166581153869629, -0.020729519426822662, -0.011188697069883347, -0.015776531770825386, -0.0468895360827446, -0.058911535888910294, -0.018061086535453796, -0.008876054547727108, 0.009138216264545918, -0.03780749812722206, 0.04370614141225815, 0.02307025156915188, -0.005388364195823669, 0.023987818509340286, 0.04033548757433891, 0.019268903881311417, 0.03250808268785477, 0.044642433524131775, -0.008946276269853115, -0.06741306930780411, 0.029062524437904358, -0.03535441309213638, 0.04835015535354614, 0.10426554828882217, 0.06475400179624557, 0.02421252802014351, -0.0006829084595665336, -0.036609042435884476, 0.018650950863957405, -0.008501537144184113, 0.03057931922376156, -0.04291965439915657, -0.021291295066475868, 0.017986182123422623, -0.056477174162864685, -0.025691870599985123, -0.04505440220236778, -0.015121126547455788, -0.027283567935228348, 0.02777044102549553, 0.029362138360738754, 0.06070921570062637, 0.006970698945224285, 0.0061514428816735744, -0.02621619403362274, 0.01756484992802143, 0.01914718560874462, -0.019137822091579437, 0.0479007326066494, 0.0007069009589031339, -0.00304061034694314, 0.021853070706129074, 0.017461858689785004, 0.010243041440844536, -0.008557715453207493, -0.017705295234918594, -0.025542063638567924, 0.06711345911026001, 0.04520421102643013, -0.03211483731865883, 0.07314318418502808, 0.003574297297745943, 0.045653630048036575, 0.01249014399945736, -0.023500945419073105, 0.00023348798276856542, 0.02660943754017353, -0.0010808329097926617, 0.06381770968437195, 0.045653630048036575, 0.06213238090276718, -0.0342121347784996, 0.01686263084411621, 0.027564456686377525, 0.028369668871164322, -0.034436844289302826, -0.005093432031571865, -0.051121581345796585, 0.06153315305709839, 0.019643420353531837, 0.005070024635642767, -0.05052235350012779, -0.02584167756140232, -0.015954427421092987, 0.017237147316336632, -0.001385713112540543, 0.002738656010478735, 0.007504385896027088, -0.030654221773147583, 0.056215010583400726, 0.0059220511466264725, -0.012302885763347149, -0.04460498318076134, -0.011488310992717743, -0.12021997570991516, -0.010093235410749912, 0.003667926648631692, 0.05314397066831589, -0.025186272338032722, 0.009292704984545708, 0.04393085092306137, -0.0375453345477581, 0.012256070971488953, -0.016094870865345, -0.06767523288726807, 0.0033168168738484383, -0.009531459771096706, 0.02660943754017353, 0.06198257580399513, 0.012714854441583157, -0.016076145693659782, -0.007340534590184689, -0.02574804797768593, -0.03477390855550766, 0.03071039915084839, 0.004054147284477949, -0.003719422733411193, 0.04265749454498291, 0.08516518026590347, 0.013885220512747765, -0.006568093318492174, 0.000655990035738796, -0.037358079105615616, -0.034848812967538834, -0.03297622874379158, 0.03604726865887642, 0.004599537700414658, -0.004901492036879063, 0.016413209959864616, -0.03439939394593239, 0.008974364958703518, 0.04849996045231819, -0.03853780776262283, -0.007377986330538988, -0.08471576124429703, -0.019325081259012222, 0.0037428298965096474, -0.007040920667350292, 0.06250689923763275, -0.011563214473426342, 0.049211543053388596, 0.024661948904395103, -0.04849996045231819, -0.024025270715355873, 0.017377592623233795, 0.020991681143641472, 0.04954860731959343, -0.04737640917301178, -0.01820152997970581, 0.045129306614398956, -0.05213277414441109, -0.0686115249991417, -0.0011656844289973378, -0.007523111533373594, 0.03308858349919319, -0.053031615912914276, -0.030111173167824745, -0.010832905769348145, -0.07707561552524567, -0.029362138360738754, -0.024549594148993492, -0.004131391644477844, 0.011432133615016937, -0.025373531505465508, -0.004028399009257555, 0.05778798460960388, -0.08142001181840897, -0.018192166462540627, 0.04067255184054375, 0.006535322871059179, 0.03042951226234436, 0.0033168168738484383, 0.060559410601854324, -0.0442679189145565, -0.009962153621017933, 0.002303279936313629, -0.03353800252079964, 0.004210976418107748, 0.10374122858047485, 0.10898447036743164, 0.043481431901454926, -0.008950958028435707, -0.010046420618891716, 0.02164708636701107, 0.009273978881537914, -0.014081841334700584, -0.050896868109703064, 0.056364819407463074, 0.012771031819283962, 0.02763935923576355, 0.028706733137369156, 0.036852478981018066, 0.05707640200853348, 0.07381731271743774, -0.04168374836444855, -0.026684341952204704, -0.026515807956457138, 0.03192758187651634, -0.0039394511841237545, 0.021703263744711876, -0.036234527826309204, 0.027789166197180748, -0.02140364982187748, -0.053668294101953506, -0.01778019778430462, 0.04359378665685654, -0.0853898897767067, 0.025242449715733528, -0.0010422107297927141, -0.07149530947208405, 0.09130726009607315, -0.03376271203160286, -0.0034947122912853956, 0.014081841334700584, -0.012124990113079548, -0.03473645821213722, 0.07962232828140259, -0.016394484788179398, -0.015280296094715595, -0.03988606855273247, 0.013070645742118359, 0.07029685378074646, 0.029493218287825584, 0.027920247986912727, -0.01905355602502823, -0.04748876392841339, 0.021927975118160248, 0.06707600504159927, 0.05029764398932457, 0.019774502143263817, 0.025130094960331917, -0.0059220511466264725, -0.08846092969179153, -0.0017555487575009465, -0.013707324862480164, 0.005449223332107067, -0.056364819407463074, -0.06707600504159927, 0.03005499392747879, 0.027283567935228348, 0.03400614857673645, 0.04625285789370537, 0.03286387398838997, 0.03327584266662598, 0.01043966319411993, -0.02599148452281952, 0.011488310992717743, -0.06677639484405518, -0.0018503484316170216, -0.023894188925623894, 0.027957698330283165, -0.06160805746912956, -0.014933868311345577, -0.04621540755033493, -0.012143716216087341, -0.006610226351767778, -0.04243278503417969, 0.0029657070990651846, 0.039661359041929245, 0.01196582056581974, -0.00914289802312851, 0.028482023626565933, 0.001801192993298173, -0.00028688591555692255, -0.0030382697004824877, 0.027040133252739906, -0.03996097296476364, -0.04471733793616295, 0.0006472123204730451, -0.04928644746541977, -0.029586847871541977, 0.012424604035913944, -0.032152291387319565, -0.018875660374760628, 0.0455787256360054, -0.010636284947395325, 0.0321335643529892, 0.03016735054552555, -0.025448434054851532, -0.021066585555672646, 0.010926535353064537, 0.01960596814751625, -0.008946276269853115, 0.012256070971488953, -0.09849798679351807, 0.004967032466083765, -0.018323248252272606, -0.05842466279864311, -0.01635703258216381, -0.012518232688307762, 0.02267700806260109, -0.021590908989310265, 0.000473998166853562, -0.030335882678627968, -0.05359339341521263, -0.0006325827562250197, 0.0035181196872144938, 0.06250689923763275, 0.0244559645652771, 0.016300855204463005, -0.0023278575390577316, -0.024025270715355873, 0.04509185627102852, -0.021497279405593872, -0.04535401612520218, -0.003756874240934849, -0.004164161626249552, -0.0018491779919713736, -0.0000828765332698822, -0.024418512359261513, 0.0227893628180027, -0.03612217307090759, 0.019961759448051453, -0.049848221242427826, 0.040185682475566864, -0.01751803606748581, 0.0159169752150774, 0.01986812986433506, 0.026590712368488312, -0.006446375045925379, -0.053818102926015854, 0.05868682637810707, -0.040560197085142136, -0.012330974452197552, 0.01854795776307583, -0.009376971051096916, 0.004559745080769062, -0.078423872590065, -0.03488626331090927, 0.017265236005187035, 0.03468028083443642, 0.03857525810599327, -0.04726405441761017, -0.008749655447900295, 0.01120742317289114, -0.00030283216619864106, -0.07396712154150009, 0.021927975118160248, 0.0062778424471616745, -0.017265236005187035, -0.033800166100263596, 0.014578077010810375, 0.018473055213689804, -0.037770047783851624, 0.024118898436427116, -0.002991455141454935, 0.024999015033245087, -0.010645647533237934, -0.04999803006649017, -0.07752503454685211, 0.01763039082288742, 0.010093235410749912, -0.03913703188300133, -0.03338819742202759, -0.008131701499223709, 0.01802363432943821, -0.03835054859519005, 0.03853780776262283, 0.009339519776403904, 0.025635693222284317, -0.005655207671225071, -0.019268903881311417, 0.021197665482759476, 0.03492371737957001, -0.02876291051506996, 0.0051636542193591595, -0.021740715950727463, -0.008693477138876915, 0.05554088205099106, -0.032938774675130844, -0.015795256942510605, -0.0024928792845457792, 0.038912322372198105, -0.00256310123950243, 0.017855100333690643, -0.030485689640045166, 0.009793621487915516, 0.03958645462989807, -0.03462410345673561, -0.04423046484589577, 0.006708536762744188, 0.023838011547923088, 0.04497950151562691, 0.030860206112265587, 0.01095462404191494, -0.025130094960331917, -0.014166108332574368, 0.038125839084386826, -0.009915339760482311, 0.0238005593419075, 0.04389340057969093, -0.02228376641869545, 0.01445635873824358, 4.6174588419489737e-7, -0.01736822910606861, -0.003239572746679187, -0.016413209959864616, 0.00856239628046751, -0.027283567935228348, 0.047301504760980606, 0.08142001181840897, -0.02127256989479065, -0.07460380345582962, -0.012574410997331142, 0.039549004286527634, 0.016469387337565422, 0.05018528550863266, -0.001521475613117218, -0.013295356184244156, -0.06393006443977356, 0.01877266727387905, -0.05314397066831589, 0.01470915786921978, 0.06127099320292473, 0.05842466279864311, 0.0747910588979721, -0.03833182156085968, 0.008557715453207493, 0.041833557188510895, -0.016328943893313408, 0.01903483085334301, -0.0008373967721126974, 0.02893144264817238, 0.019531065598130226, -0.07722541689872742, 0.0009292704635299742, -0.012817846611142159, -0.04026058316230774, -0.018238980323076248, -0.006647678092122078, -0.002372331451624632, 0.005678615067154169, -0.008215968497097492, 0.0068115293979644775, 0.02101040817797184, -0.014990045689046383, 0.005631800275295973, -0.0014641276793554425, -0.013257903978228569, 0.009170986711978912, 0.024530867114663124, 0.008688796311616898, 0.01736822910606861, -0.05643972381949425, -0.013604332692921162, 0.0011545659508556128, 0.011872190982103348, 0.06505361199378967, 0.017031162977218628, 0.004182887729257345, 0.021197665482759476, 0.05722620710730553, -0.05501655861735344, -0.030729126185178757, 0.0012066471390426159, 0.07022195309400558, -0.037882402539253235, -0.03690865635871887, -0.002710567321628332, -0.06407987326383591, -0.037133365869522095, 0.02876291051506996, -0.021085310727357864, -0.053668294101953506, -0.001886629732325673, -0.07310573011636734, 0.07209453731775284, 0.0022857245057821274, -0.023594575002789497, 0.032657887786626816, -0.09467791765928268, -0.020298825576901436, 0.019287629052996635, -0.006596182007342577, 0.059660568833351135, 0.03846290335059166, 0.02586040273308754, 0.07389222085475922, -0.02164708636701107, 0.007448208052664995, -0.024680674076080322, 0.01070182491093874, -0.017312051728367805, -0.06891114264726639, 0.07707561552524567, -0.030485689640045166, -0.05733856186270714, -0.004482501186430454, -0.0014243351761251688, 0.061570607125759125, -0.015027496963739395, 0.00032272838870994747, -0.06243199482560158, 0.03571020066738129, 0.05423007160425186, -0.014231648296117783, -0.0646791011095047, 0.008089568465948105, 0.04924899339675903, -0.02189052291214466, -0.03071039915084839, -0.020167743787169456, 0.038799967616796494, -0.030017543584108353, 0.04625285789370537, 0.030766576528549194, 0.005702022463083267, 0.0024039314594119787, -0.026571985334157944, 0.04291965439915657, -0.05179570987820625, 0.016787728294730186, -0.04370614141225815, -0.007977213710546494, -0.05134629085659981, -0.055578332394361496, -0.010664373636245728, 0.009831072762608528, -0.0016104234382510185, -0.000938048237003386, 0.09917212277650833, -0.025261176750063896, -0.013192364014685154, -0.03348182514309883, 0.030766576528549194, -0.0342121347784996, 0.02762063406407833, 0.04494204744696617, -0.007939761504530907, 0.010055783204734325, 0.02357584983110428, -0.04003587365150452, 0.05067215859889984, -0.04026058316230774, -0.004079895094037056, 0.020692067220807076, -0.039174485951662064, 0.05688914284110069, -0.002384035149589181, -0.013922671787440777, 0.013342170976102352, 0.04265749454498291, -0.029511945322155952, 0.015430103056132793, 0.03428703919053078, 0.011956457048654556, 0.05958566442131996, -0.011169971898198128, 0.06767523288726807, -0.03288259729743004, 0.02893144264817238, 0.002591189928352833, 0.013098734430968761, 0.033800166100263596, 0.013585606589913368, -0.02750827930867672, 0.02213395945727825, 0.04202081635594368, 0.009180349297821522, 0.021197665482759476, -0.08965938538312912, 0.028182409703731537, -0.03106619045138359, 0.05097177252173424, 0.010308582335710526, 0.053443584591150284, 0.033182211220264435, 0.03535441309213638, -0.010748639702796936, 0.019643420353531837, -0.0030265660025179386, -0.01936253160238266, -0.018276432529091835, -0.01815471425652504, -0.0395115502178669, 0.02013029158115387, -0.035597845911979675, -0.03514842689037323, 0.0011580770369619131, -0.01222798228263855, -0.013473251834511757, -0.030354607850313187, -0.04269494488835335, -0.03615962341427803, -0.07149530947208405, -0.04625285789370537, 0.05996018275618553, -0.01572035439312458, -0.025673145428299904, -0.035073522478342056, -0.04333162307739258, -0.00999960582703352, 0.04063510149717331, -0.021104035899043083, 0.007921036332845688, -0.03056059218943119, -0.016338307410478592, 0.01712479256093502, 0.009283341467380524, 0.02711503580212593, -0.030335882678627968, -0.023519672453403473, 0.06651423126459122, 0.04700189083814621, 0.005079387687146664, 0.030485689640045166, 0.035728927701711655, -0.09422849118709564, -0.016628557816147804, 0.02853820100426674, 0.013220452703535557, 0.008595166727900505, -0.06100882962346077, -0.052919261157512665, 0.002322005806490779, 0.018875660374760628, 0.05321887508034706, -0.05254474654793739, -0.0008730929112061858, 0.06452929228544235, 0.01062692143023014, -0.03630942851305008, 0.016974985599517822, 0.03166541829705238, -0.005762881599366665, -0.0014512536581605673, 0.004438027273863554, 0.047451313585042953, 0.01062692143023014, 0.004622945096343756, -0.03436193987727165, -0.05273200199007988, 0.004007332492619753, -0.02087932638823986, -0.001083173556253314, -0.04187100753188133, 0.022190136834979057, 0.07595206052064896, -0.01921272650361061, -0.011497673578560352, 0.0239503663033247, 0.0395115502178669, -0.0425451397895813, -0.06115863844752312, -0.0043467385694384575, -0.013557517901062965, -0.04864976555109024, 0.005547534208744764, -0.016778364777565002, -0.04149649292230606, -0.03565402328968048, 0.0445675328373909, -0.02726484276354313, -0.046028148382902145, -0.004688485525548458, 0.006745988503098488, 0.020092841237783432, -0.0019018445163965225, -0.029455767944455147, -0.005556896794587374, 0.029755381867289543, 0.050747063010931015, 0.02698395401239395, 0.02788279578089714, -0.04797563701868057, -0.06490381062030792, 0.05741346627473831, 0.038032207638025284, -0.022864267230033875, 0.017686568200588226, 0.055840495973825455, -0.00856239628046751, 0.03160924091935158, 0.01528965961188078, 0.0670011043548584, -0.013482614420354366, 0.03054186701774597, 0.034848812967538834, 0.0002668434171937406, -0.034511748701334, -0.006282523740082979, 0.04359378665685654, -0.0007338193827308714, -0.025261176750063896, -0.03541059046983719, 0.05981037765741348, -0.037751320749521255, -0.002792492974549532, -0.001364646595902741, 0.046290308237075806 ]
42,877
linearmodels.iv.model
_f_statistic
null
def _f_statistic( self, params: Float64Array, cov: Float64Array, debiased: bool ) -> WaldTestStatistic | InvalidTestStatistic: const_loc = find_constant(self._x) nobs, nvar = self._x.shape return f_statistic(params, cov, debiased, nobs - nvar, const_loc)
(self, params: numpy.ndarray, cov: numpy.ndarray, debiased: bool) -> linearmodels.shared.hypotheses.WaldTestStatistic | linearmodels.shared.hypotheses.InvalidTestStatistic
[ 0.04082212224602699, -0.04702024534344673, 0.07694222033023834, 0.03022475726902485, 0.04392118379473686, -0.02757096290588379, -0.011781777255237103, -0.03861359506845474, -0.061981234699487686, 0.07544612139463425, -0.01578027941286564, 0.03271825611591339, -0.018487505614757538, -0.0260392427444458, -0.013295686803758144, 0.08485016971826553, -0.04566663131117821, 0.017418863251805305, 0.006327250972390175, 0.042674433439970016, -0.0688205435872078, 0.01307305321097374, -0.029761677607893944, 0.007698674686253071, -0.002021514344960451, -0.029886353760957718, -0.004862321075052023, -0.06714633852243423, 0.06650514900684357, -0.02840806543827057, -0.04057277366518974, -0.042389463633298874, -0.021853728219866753, 0.014969892799854279, 0.02147970348596573, -0.0019614032935351133, -0.010793283581733704, 0.03576388210058212, -0.021497514098882675, 0.011532427743077278, -0.009404049254953861, -0.05054676532745361, 0.036832526326179504, 0.03622696176171303, -0.006839308422058821, 0.02254834584891796, 0.029690435156226158, 0.018149102106690407, -0.050689250230789185, -0.006345061585307121, 0.02707226201891899, -0.047732673585414886, -0.0051205758936703205, 0.010775472968816757, 0.04278130084276199, 0.011398847214877605, 0.027250370010733604, -0.032255176454782486, 0.043173134326934814, -0.007729843258857727, 0.055996838957071304, -0.023919768631458282, 0.016840016469359398, -0.029565760865807533, -0.04035904258489609, -0.014435571618378162, -0.0022129793651401997, 0.017222946509718895, 0.014987703412771225, 0.020767275243997574, 0.016857827082276344, 0.04588036239147186, 0.03221955522894859, 0.03243328258395195, 0.023901958018541336, 0.005819645710289478, -0.01804223842918873, -0.0560324601829052, -0.004902394954115152, -0.0353720486164093, 0.039041053503751755, -0.002052683150395751, -0.039539750665426254, -0.02299361303448677, -0.024596575647592545, -0.024845926091074944, -0.00951091293245554, -0.07637228071689606, 0.04146330803632736, 0.05022617056965828, -0.02840806543827057, 0.01039254292845726, 0.050297413021326065, -0.027873743325471878, 0.040074072778224945, 0.019484905526041985, -0.04064401611685753, 0.026003621518611908, 0.03478429466485977, 0.034428082406520844, 0.05229221284389496, 0.057029858231544495, 0.04000283032655716, 0.08363904058933258, 0.03811489790678024, 0.011318699456751347, 0.003542102873325348, -0.02869303710758686, 0.02377728372812271, 0.011505711823701859, -0.0634060874581337, -0.048730071634054184, -0.0027562056202441454, 0.015486402437090874, -0.025148706510663033, -0.02933422103524208, 0.026947587728500366, 0.04053715243935585, -0.012538732029497623, 0.03389376029372215, 0.04288816452026367, 0.027232559397816658, -0.04726959392428398, -0.040608394891023636, 0.05165102705359459, -0.03793678805232048, 0.009804789908230305, -0.0024868189357221127, 0.03002883866429329, 0.051579784601926804, 0.02354574389755726, -0.0048667737282812595, 0.02678729221224785, 0.027054451406002045, 0.023510122671723366, 0.05019054934382439, 0.06639828532934189, 0.0015317201614379883, 0.033840328454971313, -0.036244772374629974, 0.03704625368118286, 0.05140167847275734, -0.03458837792277336, 0.015174715779721737, 0.01896839402616024, 0.057172343134880066, 0.006883835420012474, 0.02310047671198845, -0.0015640020137652755, 0.0216221883893013, -0.012761365622282028, -0.010917958803474903, -0.020126089453697205, -0.054037660360336304, -0.0011966563761234283, -0.06679011881351471, 0.02142627164721489, -0.009537629783153534, -0.014195127412676811, -0.023456690832972527, -0.03531861677765846, -0.03517613187432289, -0.007435966748744249, 0.04445550590753555, 0.0050760493613779545, 0.023723851889371872, -0.08064684271812439, 0.035941991955041885, -0.025344625115394592, -0.010632987134158611, -0.001560662523843348, -0.00990274827927351, -0.034819915890693665, 0.02894238568842411, 0.02673385851085186, 0.0250596534460783, -0.024792492389678955, -0.041890762746334076, -0.015201431699097157, -0.08463644236326218, 0.05809849873185158, -0.03631601482629776, -0.04445550590753555, -0.06771627813577652, 0.004056386649608612, 0.02172905206680298, -0.012048938311636448, 0.004078649915754795, -0.014177316799759865, -0.007026320789009333, -0.05831222981214523, -0.03067002445459366, 0.031329020857810974, -0.02416911907494068, 0.014533530920743942, -0.020215144380927086, 0.007582905236631632, 0.01145227998495102, 0.05984394997358322, -0.05952335521578789, -0.011265267618000507, 0.015032229945063591, 0.01720513589680195, -0.0064252098090946674, -0.04994120076298714, 0.04352935031056404, -0.012494205497205257, -0.0055970121175050735, -0.03779430314898491, -0.012966188602149487, -0.013892345130443573, -0.014506814070045948, -0.04659279063344002, 0.02044668234884739, 0.00997399166226387, -0.042531948536634445, 0.0761585459113121, 0.014257464557886124, -0.02500622160732746, -0.007881234399974346, 0.07530363649129868, -0.08378152549266815, 0.031275589019060135, 0.013553941622376442, 0.07672849297523499, 0.023456690832972527, 0.03989596664905548, -0.0017209588550031185, -0.04481171816587448, -0.03693939000368118, -0.016991406679153442, 0.03266482055187225, 0.02279769442975521, -0.0486588291823864, -0.011194024235010147, -0.0025714195799082518, 0.00480443611741066, 0.008388839662075043, 0.015014419332146645, -0.02354574389755726, -0.04662841185927391, -0.027001019567251205, 0.040216557681560516, 0.038898568600416183, -0.0035287446808069944, -0.07302386313676834, -0.0015940575394779444, 0.027143506333231926, -0.00039934925734996796, 0.0280162300914526, -0.017614781856536865, -0.009377333335578442, -0.026698237285017967, 0.0073691769503057, 0.0042968313209712505, -0.004702024627476931, 0.026003621518611908, 0.0506180077791214, 0.05214972794055939, -0.021248163655400276, 0.011487901210784912, -0.03125777840614319, 0.003969559445977211, 0.058347851037979126, -0.09211693704128265, 0.027535341680049896, 0.003410748904570937, -0.00785006582736969, 0.0006038940045982599, 0.022726451978087425, 0.0023220698349177837, 0.03711749613285065, -0.02928078919649124, -0.08485016971826553, -0.019876740872859955, 0.021907160058617592, 0.05090297758579254, -0.05271966755390167, 0.0756598487496376, 0.033395059406757355, -0.020268576219677925, -0.0904071107506752, 0.002254166640341282, 0.052256591618061066, -0.04844510182738304, 0.06215934082865715, -0.006211481522768736, -0.005325398873537779, 0.03478429466485977, 0.014195127412676811, -0.0175702553242445, -0.021016625687479973, 0.020571356639266014, -0.0039027694147080183, 0.00006692927127005532, -0.010401448234915733, 0.018175818026065826, -0.01002742350101471, 0.061981234699487686, 0.000527085387147963, -0.03946850821375847, 0.005743950605392456, -0.023795094341039658, 0.008362122811377048, -0.013304592110216618, -0.02673385851085186, 0.026466699317097664, -0.06803686916828156, -0.016225546598434448, -0.017650403082370758, -0.001825596671551466, 0.035657018423080444, -0.011817398481070995, -0.014034830965101719, 0.05008368566632271, -0.04702024534344673, -0.07744091749191284, -0.009404049254953861, 0.029565760865807533, 0.05343209579586983, 0.037865545600652695, 0.023421069607138634, 0.08221418410539627, 0.0021183600183576345, -0.027927177026867867, 0.031222155317664146, 0.024756871163845062, -0.021301595494151115, -0.0033996172714978456, 0.004853415302932262, -0.03861359506845474, -0.07380753755569458, 0.04121395945549011, 0.02958357147872448, -0.041107092052698135, 0.05264842510223389, 0.031329020857810974, 0.001959176966920495, 0.028461497277021408, 0.019039636477828026, -0.004376979079097509, -0.011372131295502186, -0.013651900924742222, 0.0002899804385378957, -0.009181415662169456, -0.03070564568042755, 0.016804395243525505, -0.006438567768782377, 0.06860681623220444, 0.028924575075507164, 0.004635234363377094, -0.03207707032561302, 0.04217573627829552, 0.006086806301027536, 0.055213168263435364, 0.028283389285206795, -0.019039636477828026, 0.026377646252512932, 0.025433678179979324, 0.004466032609343529, -0.035407669842243195, 0.01086452603340149, -0.02078508585691452, -0.01159476488828659, 0.02108786813914776, -0.01969863288104534, 0.02564740739762783, 0.0013513867743313313, -0.0074226087890565395, -0.027998419478535652, -0.002214092528447509, -0.03503364697098732, -0.030260378494858742, -0.024151308462023735, 0.06604207307100296, -0.023403258994221687, 0.028586171567440033, 0.002426707651466131, 0.0014003661926835775, 0.0329141728579998, -0.04053715243935585, -0.008081604726612568, -0.041748277842998505, 0.0017743909265846014, -0.03337724879384041, 0.015441875904798508, -0.0688205435872078, 0.002840806497260928, 0.0053298515267670155, -0.023278582841157913, -0.008753958158195019, -0.016920164227485657, -0.020553546026349068, 0.01643037050962448, -0.013651900924742222, 0.03419654071331024, 0.0628717690706253, -0.0402878001332283, -0.021586567163467407, 0.009706830605864525, -0.041748277842998505, -0.04235384240746498, -0.05282653495669365, 0.038898568600416183, -0.02963700331747532, -0.03011789172887802, -0.028871143236756325, 0.01508566178381443, -0.026520131155848503, 0.0486588291823864, 0.014827406965196133, 0.0047599091194570065, -0.05763542279601097, 0.05286215618252754, -0.053289610892534256, 0.03725998103618622, -0.08634626865386963, 0.018060049042105675, 0.02653794176876545, 0.04132082313299179, 0.0697823166847229, -0.08086057752370834, 0.0057394979521632195, 0.02516651712357998, 0.006247102748602629, -0.00825525913387537, -0.05635305121541023, -0.002658246783539653, -0.01994798332452774, -0.008477892726659775, 0.02938765287399292, 0.02117692120373249, -0.07281013578176498, 0.003987370058894157, -0.007542830891907215, -0.038008030503988266, -0.04937125742435455, -0.0069684358313679695, 0.023011423647403717, 0.04883693531155586, 0.007186617236584425, 0.04588036239147186, 0.04242508485913277, 0.0349089689552784, -0.0727388933300972, -0.03360879048705101, 0.027891553938388824, -0.027642205357551575, -0.02986854314804077, -0.052256591618061066, 0.0437430776655674, -0.015103472396731377, -0.04025217890739441, 0.03243328258395195, -0.04726959392428398, -0.03578169271349907, -0.009715735912322998, -0.03572826087474823, -0.0006562129710800946, 0.026057053357362747, -0.011372131295502186, 0.030883751809597015, -0.07751215994358063, -0.05286215618252754, -0.03996720910072327, -0.01026786770671606, 0.036975011229515076, -0.03143588453531265, 0.05375269055366516, 0.0011126120807603002, 0.025576163083314896, 0.002089417539536953, -0.02737504430115223, -0.030153512954711914, 0.007404798176139593, 0.022174321115016937, -0.05264842510223389, 0.01088233757764101, 0.04399242624640465, 0.014551341533660889, 0.009225942194461823, 0.03163180127739906, 0.02377728372812271, 0.0035220657009631395, 0.0476614311337471, -0.05984394997358322, -0.0339115709066391, 0.010294584557414055, 0.013393646106123924, -0.006719086319208145, 0.018086764961481094, -0.012040033005177975, 0.04876569285988808, -0.026555752381682396, -0.05460760369896889, 0.007289028726518154, 0.06946172565221786, -0.001023002085275948, 0.01994798332452774, -0.03243328258395195, 0.034036245197057724, -0.012057843618094921, -0.06461721658706665, -0.013206633739173412, -0.06258679926395416, -0.03179209679365158, 0.023652607575058937, -0.013936871662735939, -0.006451925728470087, -0.012280477210879326, -0.005632633809000254, 0.026644805446267128, -0.026252970099449158, -0.010312395170331001, 0.024489711970090866, -0.06383354216814041, -0.0140081150457263, -0.001692016376182437, 0.00014596425171475857, -0.007654148153960705, -0.00476436223834753, 0.008005909621715546, -0.021408461034297943, -0.014622583985328674, 0.046699654310941696, -0.008989950641989708, -0.03544329106807709, 0.0001882646611193195, 0.05763542279601097, 0.003551008179783821, -0.03843548893928528, -0.05564062297344208, 0.028835522010922432, 0.018950583413243294, 0.005338756833225489, -0.04171265661716461, 0.04089336469769478, -0.0614112913608551, -0.10971390455961227, -0.019199933856725693, 0.024596575647592545, -0.01703593321144581, -0.011363225989043713, -0.011247456073760986, 0.04210449382662773, -0.0511167049407959, 0.017926469445228577, -0.01575356349349022, 0.03661879897117615, -0.0233320165425539, 0.016991406679153442, -0.03109748102724552, 0.023421069607138634, 0.030438484624028206, -0.0009294958435930312, 0.05763542279601097, -0.01838064193725586, 0.04431302100419998, -0.014996608719229698, 0.02005484700202942, -0.03567482903599739, -0.016252262517809868, 0.05916714295744896, 0.014034830965101719, -0.016216641291975975, 0.0026805102825164795, 0.08734367042779922, 0.03362660109996796, -0.03086594119668007, -0.005859720055013895, -0.018398452550172806, 0.07473369687795639, -0.02358136512339115, 0.028568360954523087, -0.010178814642131329, -0.01712498627603054, 0.03617352992296219, -0.04349372908473015, 0.00840665027499199, -0.020909760147333145, -0.09952618926763535, -0.0368681475520134, -0.04196200892329216, 0.0017532407073304057, -0.04117833822965622, 0.03939726576209068, -0.07156338542699814, 0.0016842242330312729, -0.0029677078127861023, 0.0233320165425539, -0.0839952602982521, -0.05877530574798584, -0.043315619230270386, -0.05460760369896889, 0.0032571316696703434, 0.0014081584522500634, -0.03758057579398155, -0.008900896646082401, 0.04352935031056404, 0.02782031148672104, -0.0069684358313679695, -0.04345810413360596, 0.03156055882573128, -0.04231822118163109, 0.01051721815019846, 0.012075654231011868, -0.016359128057956696, 0.020357629284262657, -0.013892345130443573, -0.01759697124361992, 0.008709431625902653, 0.018790287896990776, 0.016109777614474297, 0.0555337592959404, 0.020037036389112473, 0.013055242598056793, -0.024543143808841705, 0.009181415662169456, 0.05774228647351265, 0.042816922068595886, 0.007761012297123671, 0.03473086282610893, 0.009733547456562519, 0.038257382810115814, 0.023225151002407074, -0.03298541530966759, 0.056388672441244125, -0.0805756002664566, -0.02156875655055046, -0.048373859375715256, -0.02894238568842411, 0.04509669169783592, 0.005240797996520996, -0.006162501871585846, -0.015050040557980537, -0.01695578545331955, 0.04114271327853203, -0.0062159341759979725, -0.009715735912322998, -0.00006118949386291206, 0.006171407178044319, 0.08292661607265472, 0.04352935031056404, 0.003114646067842841, -0.010018518194556236, -0.007044131401926279, -0.031329020857810974, -0.019538337364792824, 0.07338008284568787, -0.013625185005366802, -0.0008938744431361556, 0.019627390429377556, -0.03489115834236145, 0.02623515948653221, 0.09952618926763535, -0.04338686168193817, -0.019395850598812103, 0.013358023948967457, 0.012983999215066433, 0.02835463359951973, -0.0028118640184402466, -0.02899581752717495, 0.029458897188305855, 0.0011443374678492546, -0.0031235513743013144, -0.026947587728500366, 0.014230748638510704, -0.010748757049441338, -0.04481171816587448, -0.08143051713705063, 0.04709148779511452, 0.05218534916639328, -0.007778822910040617, 0.004964732564985752, 0.0033417323138564825, -0.02555835247039795, -0.017650403082370758, 0.07380753755569458, -0.05296901986002922, -0.017303094267845154, 0.12609975039958954, 0.039432886987924576, 0.007600715849548578, -0.0009651172440499067, 0.08606129884719849, -0.023403258994221687, -0.062337446957826614, -0.044989824295043945, -0.0466640330851078, 0.01724075712263584, -0.07252516597509384, -0.09126202017068863, 0.03161399066448212, 0.011131687089800835, 0.025433678179979324, -0.047982022166252136, -0.00427456758916378, 0.08912473917007446, 0.048872556537389755, 0.012360624969005585, -0.04271005466580391, 0.021711241453886032, 0.01754353940486908, 0.03772306069731712, 0.020749464631080627, 0.008682715706527233, 0.03642287850379944, -0.029850732535123825, 0.013304592110216618, -0.07366505265235901, 0.002147302497178316, -0.03807927295565605, -0.018701234832406044, 0.013055242598056793, -0.004230041056871414, 0.05645991489291191, 0.0021183600183576345, -0.02167562022805214, 0.012841514311730862, -0.014604773372411728, 0.03435683995485306, 0.0004563991678878665, -0.01469382643699646, 0.051615405827760696, -0.02212088741362095, -0.02682291343808174, 0.035550154745578766, -0.0015873785596340895, 0.018505316227674484, -0.007627431768923998, 0.04399242624640465, -0.021978402510285378, -0.021497514098882675, -0.01307305321097374, -0.018487505614757538, 0.022281184792518616, -0.022103076800704002, -0.0017899752128869295, -0.01911088079214096, 0.056780509650707245, 0.027481907978653908, 0.09069208055734634, -0.021248163655400276, -0.0437430776655674, -0.03243328258395195, 0.06059199944138527, -0.002013722201809287, -0.019716443493962288, 0.02310047671198845, -0.0481601320207119, 0.045239176601171494, -0.05492819473147392, 0.002504629548639059, 0.046022847294807434, 0.08363904058933258, 0.008896443992853165, 0.022049644961953163, -0.04456236958503723, 0.0014181769220158458, -0.01936022937297821, 0.01026786770671606, 0.00650981068611145, 0.060805726796388626, 0.017089365050196648, -0.05475008860230446, 0.053040262311697006, -0.03843548893928528, 0.05784915015101433 ]
42,878
linearmodels.iv.model
_post_estimation
null
def _post_estimation( self, params: Float64Array, cov_estimator: CovarianceEstimator, cov_type: str ) -> dict[str, Any]: columns = self._columns index = self._index eps = self.resids(params) y = self.dependent.pandas fitted = DataFrameWrapper( asarray(y) - eps, index=y.index, columns=["fitted_values"] ) weps = self.wresids(params) cov = cov_estimator.cov debiased = cov_estimator.debiased residual_ss = squeeze(weps.T @ weps) w = self.weights.ndarray e = self._wy if self.has_constant: e = e - sqrt(self.weights.ndarray) * average(self._y, weights=w) total_ss = float(squeeze(e.T @ e)) r2 = 1 - residual_ss / total_ss fstat = self._f_statistic(params, cov, debiased) out = { "params": Series(params.squeeze(), columns, name="parameter"), "eps": SeriesWrapper(eps.squeeze(), index=index, name="residual"), "weps": SeriesWrapper( weps.squeeze(), index=index, name="weighted residual" ), "cov": DataFrame(cov, columns=columns, index=columns), "s2": float(squeeze(cov_estimator.s2)), "debiased": debiased, "residual_ss": float(residual_ss), "total_ss": float(total_ss), "r2": float(squeeze(r2)), "fstat": fstat, "vars": columns, "instruments": self._instr_columns, "cov_config": cov_estimator.config, "cov_type": cov_type, "method": self._method, "cov_estimator": cov_estimator, "fitted": fitted, "original_index": self._original_index, } return out
(self, params: numpy.ndarray, cov_estimator: ~CovarianceEstimator, cov_type: str) -> dict[str, typing.Any]
[ 0.04080865532159805, -0.023590704426169395, -0.005859285593032837, 0.013071822002530098, -0.0255294032394886, -0.04357273876667023, -0.034589461982250214, -0.020039621740579605, -0.03266995772719383, 0.05485942214727402, 0.018158506602048874, 0.028638998046517372, -0.022554172202944756, -0.021325688809156418, -0.031479865312576294, 0.08607055991888046, -0.005566561594605446, 0.01367646548897028, -0.01713157258927822, -0.035434041172266006, -0.047910816967487335, -0.08783650398254395, -0.04737335816025734, 0.005451391451060772, 0.01865757815539837, -0.04733496904373169, -0.011565010994672775, -0.08975600451231003, 0.046835895627737045, 0.007726003415882587, -0.048025988042354584, -0.07113681733608246, -0.025068720802664757, 0.022304635494947433, 0.04848666861653328, -0.009338386356830597, -0.01816810481250286, 0.021997515112161636, 0.017333120107650757, 0.035837139934301376, -0.04391825199127197, -0.04917769134044647, 0.005019502714276314, -0.030040236189961433, -0.00943916104733944, 0.0514427050948143, -0.026028472930192947, 0.017083585262298584, 0.013743648305535316, -0.04864022880792618, 0.025663767009973526, -0.058237750083208084, 0.037545498460531235, 0.027583271265029907, 0.035894725471735, 0.003385525196790695, 0.02719937078654766, 0.023513924330472946, 0.03297707810997963, -0.04503156244754791, 0.05651019513607025, -0.024972746148705482, -0.010528478771448135, 0.021709589287638664, -0.0068910191766917706, -0.004273295868188143, -0.009074455127120018, -0.007130957208573818, 0.009703092277050018, 0.007764393463730812, 0.057009268552064896, -0.03130710870027542, -0.014463461935520172, 0.030097821727395058, -0.0020898599177598953, -0.00664148386567831, -0.009237612597644329, -0.04430215060710907, -0.0019950843416154385, 0.015672748908400536, -0.01820649579167366, 0.034474290907382965, -0.04449409991502762, -0.024262530729174614, 0.0018643182702362537, -0.016200613230466843, -0.044916391372680664, -0.036182649433612823, -0.025702157989144325, 0.01650773361325264, -0.00031731798662804067, 0.029445189982652664, 0.02627800963819027, 0.013484515249729156, 0.030155407264828682, 0.01008699368685484, -0.023629093542695045, -0.0413077250123024, -0.0006382350693456829, -0.03852444514632225, 0.008992875926196575, 0.04553063213825226, 0.011968106962740421, 0.03704642504453659, 0.019847670570015907, -0.03349534422159195, 0.019626928493380547, -0.026969030499458313, 0.006214394234120846, -0.02316841296851635, -0.029809895902872086, -0.00335433310829103, -0.07605074346065521, -0.047910816967487335, -0.0016987610142678022, -0.026930639520287514, -0.016411758959293365, 0.04407181218266487, -0.03497336059808731, 0.032401226460933685, -0.0018595193978399038, 0.032593175768852234, -0.05555044487118721, 0.016411758959293365, -0.055051375180482864, -0.03712320700287819, 0.030366552993655205, 0.04142289608716965, 0.017189158126711845, -0.04956159368157387, -0.022035906091332436, -0.05697087571024895, -0.026949835941195488, 0.016229405999183655, 0.014434670098125935, 0.040923822671175, -0.00451323390007019, 0.001848722225986421, -0.008282659575343132, -0.02479999139904976, 0.05777706950902939, 0.06257583200931549, -0.04933125153183937, -0.01761144958436489, 0.01395479403436184, 0.02002042531967163, 0.006766251288354397, 0.0020910596940666437, -0.06614610552787781, 0.001027534483000636, -0.01902228407561779, -0.007989935576915741, -0.048870570957660675, -0.03174859657883644, 0.030999988317489624, -0.09912318736314774, 0.029848286882042885, 0.026182033121585846, -0.04222908616065979, -0.012160057201981544, -0.05973496288061142, -0.017697826027870178, 0.04441732168197632, -0.02612444944679737, 0.00132325803861022, 0.07532133162021637, -0.03493497148156166, 0.010634051635861397, -0.03176778927445412, -0.0168052576482296, -0.01302383467555046, -0.013244577683508396, -0.07086808234453201, -0.039061903953552246, -0.039177075028419495, 0.060118865221738815, 0.03981051221489906, -0.04188357666134834, -0.0383324921131134, -0.011277086101472378, 0.05627985671162605, -0.05942784249782562, -0.061193786561489105, -0.018532810732722282, -0.014751387760043144, -0.007505260407924652, -0.0072653223760426044, -0.022343026474118233, 0.0005926468293182552, 0.014444267377257347, -0.013129406608641148, 0.03201732411980629, 0.0052594407461583614, -0.010442101396620274, 0.0563950277864933, -0.0463368259370327, 0.044762831181287766, 0.014856960624456406, 0.024857576936483383, 0.0028792559169232845, -0.0016459745820611715, -0.016162224113941193, 0.0116225965321064, -0.02205510064959526, -0.0463368259370327, 0.0128990663215518, -0.01614302769303322, -0.027775222435593605, -0.0338408537209034, 0.032881103456020355, -0.026431569829583168, -0.000135340029373765, 0.02276531606912613, -0.040578313171863556, 0.03378326818346977, -0.021402468904852867, 0.0004981712554581463, 0.008109903894364834, 0.03174859657883644, -0.026930639520287514, 0.04629843682050705, -0.03489658236503601, 0.010058200918138027, 0.018513616174459457, 0.03837088495492935, -0.029118875041604042, -0.010931574739515781, -0.004957119002938271, 0.012553555890917778, -0.04756530746817589, -0.030923208221793175, 0.017016403377056122, -0.012956651858985424, -0.07770151644945145, 0.025260671973228455, 0.003671051235869527, -0.04011763259768486, 0.013570892624557018, 0.006214394234120846, 0.001749148010276258, -0.01369566097855568, 0.004237304907292128, -0.018590396270155907, 0.02109534852206707, -0.0676817074418068, -0.033879246562719345, 0.08138696849346161, 0.04411020129919052, -0.008042722009122372, -0.011593803763389587, 0.09582163393497467, -0.030136212706565857, -0.04334240034222603, 0.04303527995944023, 0.04030958190560341, -0.006439935881644487, 0.06921730935573578, 0.058314528316259384, 0.05781545862555504, -0.03819812834262848, 0.031191939488053322, 0.010451698675751686, 0.01445386465638876, 0.016008662059903145, -0.06464889645576477, 0.00030202194466255605, -0.003231964772567153, -0.025471817702054977, -0.007620430551469326, 0.030558502301573753, -0.04560741409659386, 0.07071452587842941, -0.041384506970644, -0.04959998279809952, -0.016498137265443802, 0.056011125445365906, 0.02169039472937584, -0.0672210305929184, 0.02572135254740715, 0.05067490413784981, 0.028811754658818245, -0.05781545862555504, 0.010470894165337086, -0.0035270885564386845, 0.013666868209838867, 0.017601851373910904, -0.0034623052924871445, 0.032478008419275284, 0.05758512020111084, 0.013791635632514954, -0.022822901606559753, 0.004856344778090715, 0.043687909841537476, -0.014693803153932095, 0.018743956461548805, -0.01343652792274952, -0.00034671041066758335, -0.02604766935110092, 0.0665300041437149, 0.028523828834295273, -0.027525687590241432, 0.04042475298047066, 0.05313187092542648, 0.009295198135077953, 0.005609750282019377, 0.033073052763938904, 0.04299688711762428, -0.06257583200931549, -0.0044244565069675446, -0.013071822002530098, -0.010019810870289803, 0.05839131027460098, -0.0256445724517107, 0.02739132195711136, 0.008690553717315197, -0.05731638893485069, -0.0206154715269804, -0.027045810595154762, 0.054091621190309525, 0.07985136657953262, 0.005436995066702366, -0.009655104950070381, 0.04917769134044647, -0.05247923731803894, 0.05981174483895302, 0.010499686934053898, -0.014799375087022781, 0.011181110516190529, 0.010106188245117664, -0.0031215932685881853, -0.0056049516424536705, -0.03992568328976631, 0.021421663463115692, 0.04330400750041008, 0.03372568264603615, 0.021786369383335114, 0.008215476758778095, -0.012236837297677994, 0.026969030499458313, 0.035913918167352676, -0.005504177417606115, -0.046874284744262695, 0.0015931882662698627, 0.0014804174425080419, -0.031287916004657745, -0.01812971569597721, 0.0281207337975502, 0.0049283262342214584, 0.04199874773621559, 0.04852506145834923, -0.055972736328840256, 0.006372753065079451, 0.04929286241531372, 0.12707115709781647, 0.01990525610744953, 0.035510823130607605, 0.014338694512844086, -0.03984890133142471, 0.01282228622585535, -0.04553063213825226, 0.008594579063355923, 0.05224889889359474, 0.0038773980922997, 0.006583898328244686, 0.06952442973852158, -0.005624146666377783, -0.00918002799153328, -0.005556963849812746, 0.020673057064414024, -0.043803080916404724, -0.017477083951234818, -0.034147974103689194, -0.009443959221243858, 0.030443333089351654, 0.04844827950000763, -0.0022518180776387453, -0.0512891449034214, 0.0013040630146861076, 0.03629782050848007, -0.001746748574078083, -0.04080865532159805, -0.024934357032179832, -0.04184518754482269, 0.00018040338181890547, 0.03683527931571007, -0.002384983701631427, 0.026105253025889397, -0.021632809191942215, 0.010058200918138027, -0.048025988042354584, -0.00892089493572712, -0.005336220841854811, -0.03631701320409775, -0.0016975613543763757, 0.012447983026504517, 0.02042352221906185, -0.007399687543511391, 0.0041245343163609505, -0.0671442449092865, 0.009458355605602264, -0.07685694098472595, -0.06883341073989868, -0.03220927715301514, 0.04000246152281761, -0.026373984292149544, -0.08990956842899323, -0.029886675998568535, 0.019051076844334602, 0.02572135254740715, -0.002663311781361699, 0.0016591711901128292, -0.010039005428552628, -0.0041509270668029785, -0.008258665911853313, -0.0033303394448012114, 0.0672210305929184, -0.01413714699447155, 0.018292872235178947, 0.07213495671749115, 0.01768822968006134, 0.06649161875247955, -0.018456030637025833, 0.03220927715301514, 0.0824618861079216, 0.027007421478629112, 0.0024533660616725683, -0.06418821215629578, 0.010883587412536144, -0.012054485268890858, 0.004350075963884592, 0.03528048098087311, -0.0028936523012816906, -0.07129037380218506, -0.000007582415491924621, -0.005614548921585083, 0.04434053972363472, -0.00793714914470911, 0.03301546722650528, 0.03873559087514877, 0.0720965713262558, -0.0206154715269804, 0.05977335199713707, -0.02575974352657795, -0.027410516515374184, -0.030001847073435783, -0.020404327660799026, 0.04322722926735878, -0.017198756337165833, -0.08975600451231003, -0.04729657620191574, 0.0723269060254097, -0.008733742870390415, 0.04027119278907776, -0.02217026986181736, -0.019492562860250473, -0.008892102167010307, 0.03505014255642891, -0.03545323759317398, 0.0009909438667818904, 0.004556422587484121, 0.03159503638744354, -0.005408202297985554, -0.03272754326462746, -0.018791943788528442, -0.0018727160058915615, 0.03783342242240906, 0.001348451478406787, -0.03205571696162224, -0.003865401027724147, 0.025491012260317802, 0.03328419849276543, 0.005451391451060772, -0.03297707810997963, -0.0414612852036953, 0.0004888736875727773, 0.045722585171461105, -0.03556840866804123, 0.010989160276949406, -0.01812971569597721, 0.009837457910180092, -0.010442101396620274, -0.013993184082210064, -0.03268915414810181, 0.021306494250893593, 0.02276531606912613, -0.05313187092542648, -0.03481980040669441, 0.004966716282069683, 0.016219807788729668, 0.012342410162091255, -0.0020814621821045876, -0.00335433310829103, 0.06998511403799057, 0.07121359556913376, -0.022381415590643883, 0.07259564101696014, 0.07251886278390884, 0.0002787779667414725, 0.039177075028419495, -0.0718662291765213, 0.047949209809303284, -0.028370268642902374, -0.05017583444714546, -0.02109534852206707, -0.05532010272145271, -0.06741297990083694, -0.02456965111196041, 0.04464766010642052, -0.050099052488803864, 0.01473219320178032, -0.022938072681427002, -0.016191015020012856, -0.02265014685690403, -0.017438692972064018, -0.018379250541329384, -0.018638383597135544, 0.004803558811545372, -0.010518881492316723, -0.010403711348772049, 0.006295972969383001, 0.045760974287986755, 0.01212166715413332, 0.034032806754112244, -0.003999766428023577, 0.05543527379631996, 0.042612988501787186, -0.02723776176571846, 0.00982786063104868, 0.062268707901239395, 0.003968574572354555, -0.04533868283033371, -0.03977212309837341, 0.03349534422159195, 0.045722585171461105, 0.045876145362854004, -0.016239004209637642, 0.07420802116394043, -0.06176963821053505, -0.04741174727678299, -0.03090401366353035, -0.01710277982056141, -0.010394114069640636, -0.04011763259768486, -0.04034797474741936, 0.06606932729482651, -0.02612444944679737, 0.02683466486632824, -0.023302778601646423, 0.019559744745492935, -0.027372125536203384, -0.017035597935318947, 0.01136346347630024, 0.06422660499811172, 0.04936964064836502, -0.009064857847988605, 0.04522351175546646, 0.000058634846936911345, -0.03159503638744354, 0.007039780728518963, 0.0037238376680761576, 0.00014831167936790735, -0.018743956461548805, 0.048717010766267776, -0.009693494997918606, -0.020711448043584824, 0.045837752521038055, 0.06614610552787781, 0.10127303004264832, -0.06553186476230621, -0.052978310734033585, 0.019636524841189384, 0.024991940706968307, 0.026028472930192947, -0.0191662460565567, -0.02224704995751381, 0.008028325624763966, 0.038466859608888626, -0.02639317885041237, -0.018177703022956848, -0.010029408149421215, 0.01361888088285923, -0.002778481924906373, -0.018935905769467354, -0.04840989038348198, -0.04299688711762428, 0.015452006831765175, -0.05981174483895302, 0.026143644005060196, 0.011373060755431652, 0.02994426153600216, -0.06867985427379608, 0.04288171976804733, -0.06802722066640854, -0.030040236189961433, 0.04326561838388443, 0.025414232164621353, -0.025107111781835556, 0.020596276968717575, -0.023437142372131348, -0.02220866084098816, -0.05363094061613083, -0.05439874157309532, 0.035357262939214706, -0.020039621740579605, -0.005307428538799286, -0.04837150126695633, -0.005024301819503307, 0.0722501277923584, 0.03911948949098587, 0.0024209744296967983, 0.025337452068924904, 0.0024233737494796515, 0.03564518690109253, -0.025702157989144325, 0.012236837297677994, 0.0027664850931614637, -0.0515962652862072, 0.00229020812548697, 0.03272754326462746, 0.03629782050848007, 0.013484515249729156, -0.006483124569058418, 0.009184826165437698, 0.020154790952801704, -0.06069471314549446, -0.00830665323883295, 0.04929286241531372, -0.11716651916503906, -0.013638075441122055, -0.082308329641819, -0.005465787369757891, 0.05029100179672241, 0.08392070978879929, -0.07850771397352219, 0.04303527995944023, 0.036988839507102966, 0.06311328709125519, -0.005844889674335718, 0.0028624602127820253, -0.036547355353832245, 0.0778166875243187, 0.042651377618312836, 0.008575383573770523, 0.00807151384651661, -0.009386374615132809, -0.0129182618111372, 0.013628478161990643, -0.016344577074050903, 0.031115159392356873, 0.00209585833363235, -0.0011481032706797123, 0.013148602098226547, -0.0721733495593071, -0.0019842872861772776, 0.05432196334004402, 0.006593496073037386, -0.009496745653450489, 0.018446432426571846, 0.014981728047132492, 0.02819751389324665, 0.026777079328894615, 0.00657909968867898, -0.006852629128843546, -0.06438016146421432, 0.04503156244754791, -0.010039005428552628, -0.022861292585730553, 0.024742405861616135, 0.0045468248426914215, -0.04879378899931908, 0.03888915106654167, -0.0011193107347935438, -0.017160365357995033, -0.010528478771448135, 0.02117212861776352, -0.005350617226213217, -0.03741113096475601, 0.007510059047490358, -0.03783342242240906, 0.019809281453490257, 0.07635786384344101, 0.07724083960056305, -0.0009519539889879525, 0.018753552809357643, 0.08760616183280945, -0.04349596053361893, 0.00806671567261219, -0.030923208221793175, -0.010864391922950745, -0.022304635494947433, -0.028504634276032448, -0.07094486802816391, -0.0103269312530756, -0.026585130020976067, 0.050751686096191406, -0.08906498551368713, -0.019310209900140762, -0.0255294032394886, -0.015452006831765175, 0.024857576936483383, -0.0034095188602805138, -0.01658451370894909, 0.013762843795120716, 0.018091324716806412, 0.008628170005977154, 0.052939917892217636, 0.01595107838511467, -0.015058508142828941, 0.06176963821053505, -0.07639625668525696, -0.0387931764125824, -0.009016869589686394, 0.010451698675751686, -0.015260056592524052, -0.014693803153932095, 0.09543773531913757, -0.018312066793441772, 0.02890772931277752, -0.0071501522324979305, 0.013666868209838867, 0.02934921532869339, 0.01238080020993948, 0.03677769750356674, 0.011565010994672775, -0.03769905865192413, -0.014242718927562237, 0.02990587241947651, -0.0204619113355875, 0.07770151644945145, -0.004995509050786495, 0.017237145453691483, -0.03167181462049484, -0.006046437658369541, -0.015375226736068726, -0.04956159368157387, -0.025663767009973526, 0.03146066889166832, -0.023225998505949974, -0.021997515112161636, 0.03437831625342369, -0.04606809467077255, 0.05581917613744736, -0.03030896745622158, -0.021632809191942215, -0.007860369049012661, 0.03925385698676109, 0.03075045347213745, -0.04948481172323227, 0.07363217324018478, -0.051980167627334595, 0.06549347192049026, -0.019070271402597427, 0.022343026474118233, 0.011593803763389587, 0.013580490835011005, 0.007658820599317551, 0.05658697709441185, -0.01128668338060379, -0.020692253485322, 0.012697518803179264, 0.015663152560591698, 0.007802783511579037, 0.038140542805194855, 0.023629093542695045, 0.014338694512844086, 0.017525071278214455, 0.00399736687541008, 0.0008757736650295556 ]
42,879
linearmodels.iv.model
_validate_inputs
null
def _validate_inputs(self) -> None: x, z = self._x, self._z if x.shape[1] == 0: raise ValueError("Model must contain at least one regressor.") if self.instruments.shape[1] < self.endog.shape[1]: raise ValueError( "The number of instruments ({}) must be at least " "as large as the number of endogenous regressors" " ({}).".format(self.instruments.shape[1], self.endog.shape[1]) ) if matrix_rank(x) < x.shape[1]: raise ValueError("regressors [exog endog] do not have full " "column rank") if matrix_rank(z) < z.shape[1]: raise ValueError( "instruments [exog instruments] do not have " "full column rank" ) self._has_constant, self._const_loc = has_constant(x)
(self) -> NoneType
[ -0.011642565950751305, -0.004553936421871185, 0.013108527287840843, 0.009902329184114933, -0.02122332900762558, -0.0234932042658329, -0.04566231369972229, -0.008838324807584286, -0.009192992933094501, 0.001491969800554216, 0.03942015767097473, 0.017317254096269608, 0.024041756987571716, -0.008947090245783329, 0.008417452685534954, 0.012682925909757614, -0.01230461336672306, -0.021034173667430878, 0.02877066284418106, -0.01877375692129135, -0.07710008323192596, -0.05599024519324303, -0.04361942782998085, 0.014120512641966343, 0.019208814948797226, 0.07672176510095596, 0.02650078758597374, -0.006998780649155378, 0.07172804325819016, 0.015170330181717873, -0.04978591948747635, 0.0016113746678456664, -0.00022004189668223262, 0.01741183176636696, 0.015624305233359337, -0.04388424754142761, 0.029981262981891632, 0.013950272463262081, 0.009150432422757149, 0.04369508847594261, 0.008072242140769958, -0.025063201785087585, 0.057730481028556824, 0.03397246077656746, -0.012219492346048355, -0.02443898469209671, -0.023739106953144073, 0.039722807705402374, -0.036828719079494476, -0.05326639488339424, -0.0016740326536819339, -0.026046814396977425, 0.0443003885447979, -0.0010421326151117682, 0.018300864845514297, 0.027011509984731674, 0.07706224918365479, 0.07725140452384949, 0.05133700370788574, -0.08421235531568527, -0.03527763858437538, 0.029054397717118263, -0.0010208525927737355, -0.035674866288900375, 0.009864497929811478, -0.006932576186954975, -0.03595859929919243, -0.02114766649901867, -0.005807096604257822, 0.06087047606706619, -0.02336079441010952, -0.02650078758597374, -0.030567647889256477, 0.02858150750398636, 0.034729085862636566, -0.038814857602119446, -0.0032984118442982435, 0.010280641727149487, 0.00934904720634222, -0.05962204560637474, 0.007826339453458786, 0.012474853545427322, -0.054666150361299515, -0.007074443157762289, 0.003442643443122506, -0.04127389192581177, -0.06041650101542473, 0.016239061951637268, 0.0008222385076805949, -0.0013039958430454135, -0.03590185195207596, -0.005778722930699587, 0.008251940831542015, -0.015709424391388893, 0.058941081166267395, 0.09435112774372101, -0.02971644513309002, -0.057995300740003586, -0.009505100548267365, -0.03423727676272392, -0.0014080316759645939, 0.0025157779455184937, -0.012645094655454159, 0.019937066361308098, -0.02001272886991501, -0.007263599429279566, 0.004856586456298828, -0.05523362010717392, -0.04483002796769142, -0.005934776738286018, -0.017402373254299164, -0.009419980458915234, -0.018953455612063408, 0.012777503579854965, -0.05425000935792923, -0.03609101101756096, -0.02114766649901867, 0.03522089123725891, -0.050542544573545456, 0.012909913435578346, 0.045321833342313766, 0.04778086394071579, -0.02428765967488289, 0.019076406955718994, 0.09518341720104218, 0.002965023973956704, 0.007490586955100298, 0.02971644513309002, 0.007575707044452429, -0.06938250362873077, -0.04925628378987312, -0.010980519466102123, -0.02224477380514145, 0.022982481867074966, -0.038814857602119446, 0.046267613768577576, 0.033537399023771286, -0.05232061445713043, 0.013439550064504147, -0.04815917834639549, 0.06261071562767029, 0.09775593876838684, 0.0005387997371144593, 0.01273021474480629, -0.020958511158823967, 0.011226422153413296, -0.00016654616047162563, 0.012559973634779453, 0.0017414195463061333, -0.0013950272696092725, -0.012370817363262177, 0.009415251202881336, -0.00608610175549984, -0.07641911506652832, -0.04070642217993736, -0.01588912308216095, 0.013590875081717968, -0.04138738289475441, 0.05129916965961456, 0.0021433765068650246, -0.08005091547966003, 0.011481783352792263, 0.019000744447112083, 0.0008033228805288672, 0.00023053416225593537, 0.05769265070557594, -0.006573179271072149, -0.005036284681409597, 0.029470540583133698, 0.02865717001259327, -0.00266473856754601, -0.02128007635474205, -0.0427493080496788, -0.001009621424600482, -0.026992594823241234, 0.00442389165982604, 0.004388424567878246, -0.014687981456518173, -0.024874044582247734, 0.029243553057312965, 0.07611647248268127, -0.04691074788570404, -0.055687595158815384, -0.00860660895705223, 0.009769919328391552, 0.010450881905853748, -0.050504714250564575, -0.020693691447377205, -0.0143002113327384, -0.03098379075527191, 0.009065312333405018, -0.0062705292366445065, -0.027049342170357704, 0.032515957951545715, 0.0011331640416756272, -0.013723284937441349, 0.045397497713565826, 0.01602153293788433, 0.05610373988747597, -0.043959908187389374, -0.03217547386884689, -0.028940903022885323, -0.004426255822181702, -0.032383546233177185, -0.07331695407629013, -0.001460049650631845, -0.055952414870262146, -0.021507063880562782, 0.004622505512088537, -0.016456592828035355, 0.01058329176157713, 0.004605954512953758, -0.03694221377372742, 0.011443952098488808, 0.05224495381116867, 0.054628320038318634, 0.015652678906917572, -0.031324271112680435, -0.018244119361042976, -0.01437587384134531, 0.08353139460086823, -0.01281533483415842, 0.0360153466463089, -0.030435238033533096, 0.038777027279138565, 0.0038918894715607166, 0.0005987976910546422, 0.054703984409570694, 0.004218183923512697, 0.010640038177371025, 0.009930701926350594, -0.03575052693486214, -0.031362105160951614, -0.0027616810984909534, 0.004189810715615749, 0.0037216488271951675, 0.003622341901063919, -0.007263599429279566, 0.05402301996946335, -0.005348392762243748, -0.028468012809753418, -0.026122476905584335, -0.06862588226795197, -0.07187937200069427, 0.0508451946079731, -0.009334860369563103, 0.03414269909262657, 0.030189335346221924, -0.04187919199466705, -0.021752966567873955, -0.015217619016766548, 0.0533420592546463, -0.0038540582172572613, -0.017761770635843277, -0.024892959743738174, 0.0057929097674787045, 0.008006037212908268, -0.006771793123334646, 0.06957166641950607, -0.04819700866937637, 0.004700532648712397, 0.0729764774441719, 0.03834196925163269, 0.07399792224168777, -0.022887904196977615, 0.028392350301146507, 0.037774499505758286, 0.0039557297714054585, 0.03930666670203209, 0.0035277637653052807, 0.049445439130067825, 0.07800803333520889, -0.05330422520637512, -0.012985575944185257, 0.031116200610995293, 0.04369508847594261, 0.018953455612063408, -0.04880230873823166, 0.015662135556340218, 0.06506974250078201, 0.022774411365389824, -0.04017678275704384, 0.05750349536538124, -0.013761116191744804, 0.022017786279320717, -0.028165362775325775, -0.003636528505012393, -0.08292609453201294, -0.007206852547824383, -0.012399191036820412, 0.00877212081104517, 0.016466049477458, 0.04554882273077965, 0.0038422360084950924, 0.002740400843322277, -0.05602807551622391, 0.02769247256219387, -0.05523362010717392, 0.04259798303246498, 0.005197067745029926, -0.025063201785087585, 0.021507063880562782, 0.028165362775325775, -0.04119822755455971, -0.010999434627592564, -0.04002545773983002, 0.0552714504301548, -0.019426345825195312, 0.011037265881896019, 0.0011225240305066109, 0.027919460088014603, 0.046078458428382874, -0.0027120274025946856, 0.007878357544541359, 0.03527763858437538, 0.0010190792381763458, 0.0706687718629837, 0.006459685508161783, -0.028884157538414, 0.05459048971533775, 0.030586563050746918, 0.02865717001259327, 0.03688546642661095, -0.07675959914922714, -0.037887994199991226, 0.022755494341254234, 0.01061166450381279, -0.020712608471512794, -0.027049342170357704, -0.010885940864682198, -0.04354376345872879, -0.08542295545339584, 0.02871391549706459, 0.0018915623659268022, 0.04327894747257233, -0.015652678906917572, -0.004003018606454134, 0.005991523619741201, 0.045284003019332886, 0.03603426367044449, 0.017345625907182693, 0.0027545876801013947, 0.008478928357362747, -0.0007518960046581924, -0.0040195700712502, -0.056860364973545074, 0.027314160019159317, -0.034521013498306274, -0.02029646374285221, 0.0533420592546463, -0.07921863347291946, 0.06385914236307144, 0.010923772118985653, -0.028884157538414, 0.011860095895826817, -0.0042347353883087635, -0.033386074006557465, 0.015993159264326096, 0.022944651544094086, 0.017790144309401512, 0.049407608807086945, -0.010375219397246838, -0.02644404210150242, 0.007656098809093237, -0.04793218895792961, -0.02969752810895443, 0.03164583817124367, -0.004414433613419533, 0.030246082693338394, -0.012049252167344093, -0.007646640762686729, 0.019596586003899574, -0.05095868930220604, -0.004719448275864124, -0.0007696294342167675, 0.05288808420300484, 0.04974808916449547, 0.02122332900762558, -0.004650878719985485, -0.02139357104897499, -0.022074531763792038, 0.010309014469385147, 0.01168039720505476, -0.002012149430811405, -0.002324257278814912, -0.0337076410651207, -0.01752532459795475, 0.019076406955718994, -0.01481093280017376, 0.00320619810372591, 0.032610535621643066, -0.020618028938770294, -0.018650805577635765, -0.001935304724611342, -0.003262944985181093, 0.04596496373414993, 0.05644422024488449, 0.043165452778339386, -0.07585164904594421, -0.011623650789260864, -0.09200559556484222, -0.007490586955100298, -0.053644709289073944, 0.045321833342313766, 0.016257978975772858, -0.0027593164704740047, -0.011614193208515644, 0.013562502339482307, 0.03075680322945118, 0.02216911129653454, 0.007452755700796843, -0.005523362196981907, 0.04464087262749672, 0.013004491105675697, -0.02655753493309021, -0.022017786279320717, 0.007920917123556137, 0.005367308389395475, -0.004426255822181702, -0.0013808405492454767, 0.01795092597603798, 0.02663319744169712, 0.043165452778339386, 0.036847636103630066, -0.012777503579854965, 0.026235969737172127, -0.06397263705730438, 0.001989687094464898, -0.008128989487886429, 0.013146358542144299, -0.10123641788959503, 0.04558665305376053, -0.0595085509121418, -0.02990560047328472, -0.025725247338414192, -0.05023989453911781, -0.008639710955321789, 0.05455265939235687, -0.004733634646981955, 0.02778705023229122, -0.00666302815079689, -0.025101032108068466, 0.051601819694042206, 0.05417434498667717, -0.04573797807097435, -0.011500699445605278, 0.06575071066617966, 0.03279969096183777, -0.060227345675230026, -0.01331659872084856, 0.016267435625195503, -0.02120441384613514, -0.012011420913040638, -0.03575052693486214, 0.03616667166352272, -0.020731523633003235, -0.03614775463938713, 0.008412723429501057, -0.017591530457139015, -0.02663319744169712, -0.0297542754560709, -0.020599113777279854, -0.04683508351445198, 0.0002806310076266527, -0.045208338648080826, 0.010885940864682198, 0.03402920812368393, -0.013515212573111057, 0.017383458092808723, 0.08360705524682999, -0.0046721589751541615, -0.012957202270627022, 0.03102162294089794, -0.03202414885163307, -0.05496880039572716, 0.023833686485886574, 0.08292609453201294, 0.036526069045066833, 0.05852494016289711, -0.031551260501146317, 0.04433822259306908, 0.014092139899730682, -0.028884157538414, 0.048348333686590195, 0.015482437796890736, 0.01274912990629673, -0.03923100233078003, -0.05126133933663368, -0.016797073185443878, 0.006393480580300093, -0.04327894747257233, -0.026160307228565216, 0.05209362879395485, 0.04017678275704384, 0.007859441451728344, -0.018745383247733116, -0.005915861111134291, -0.017629360780119896, 0.04566231369972229, 0.02324730157852173, 0.04566231369972229, 0.015747256577014923, 0.00034905236680060625, -0.02782488241791725, -0.017894180491566658, -0.035523541271686554, -0.02037212625145912, -0.003934449516236782, 0.0053152902983129025, -0.03633691370487213, -0.07520852237939835, 0.00017157061665784568, 0.05190446972846985, 0.04483002796769142, 0.03395354375243187, -0.03287535533308983, 0.030227165669202805, 0.04146304726600647, -0.024211997166275978, 0.06628034263849258, 0.0358261913061142, -0.0213746540248394, -0.011784433387219906, -0.05704952031373978, 0.0267656072974205, 0.04649460315704346, -0.01493388507515192, -0.042900633066892624, 0.021847544237971306, -0.03172149881720543, -0.03730161115527153, -0.014404247514903545, 0.02557392232120037, 0.035504624247550964, -0.08580126613378525, -0.03896618261933327, 0.11319109052419662, 0.0035821462515741587, -0.04921845346689224, 0.027333075180649757, -0.03508848324418068, 0.02020188607275486, 0.023625614121556282, -0.016153942793607712, 0.02884632535278797, -0.016797073185443878, 0.0321565605700016, 0.03518306091427803, -0.07604080438613892, -0.0067528774961829185, -0.03960931673645973, -0.019558753818273544, 0.024174166843295097, 0.021677304059267044, 0.03499390184879303, -0.0013229114701971412, 0.026084644719958305, 0.08133718371391296, 0.02216911129653454, 0.0749058723449707, -0.024003926664590836, -0.057995300740003586, 0.0464189387857914, -0.04229533299803734, -0.10078243911266327, 0.005135591607540846, -0.009873955510556698, -0.033386074006557465, -0.05947072058916092, 0.06204324588179588, -0.04361942782998085, 0.015463522635400295, -0.02782488241791725, -0.019955983385443687, 0.0039439075626432896, -0.02538476698100567, -0.003917898517102003, 0.04498135298490524, -0.06896636635065079, -0.022585254162549973, 0.05243410915136337, 0.003813862567767501, -0.03720702975988388, -0.0760786384344101, 0.09087065607309341, 0.005234898999333382, -0.039684977382421494, 0.013420634903013706, -0.04127389192581177, 0.019653333351016045, 0.03321583569049835, 0.07494369894266129, -0.030340660363435745, -0.03911750763654709, 0.027843797579407692, 0.06045433133840561, -0.022623086348176003, -0.033423908054828644, -0.016778158023953438, -0.012635636143386364, -0.029357047751545906, -0.025725247338414192, 0.021942123770713806, -0.057011689990758896, 0.0024011018685996532, -0.047175563871860504, -0.036563899368047714, 0.033499568700790405, -0.015406775288283825, -0.05935722589492798, 0.04498135298490524, 0.006308360490947962, -0.033442821353673935, -0.041841357946395874, -0.04709990322589874, -0.046381108462810516, -0.04713773354887962, 0.051450494676828384, 0.04252232238650322, 0.03376438841223717, 0.04437605291604996, -0.011935758404433727, -0.010498170740902424, -0.004579945467412472, -0.01374220009893179, -0.0025796182453632355, 0.01109401322901249, -0.05194230377674103, -0.007041340693831444, -0.03094596043229103, 0.042068347334861755, -0.03610992431640625, 0.014763643965125084, -0.03378330171108246, 0.04358159750699997, 0.006540076807141304, 0.026954762637615204, 0.006530619226396084, -0.023985009640455246, 0.013723284937441349, -0.008720102719962597, 0.006691401824355125, -0.011935758404433727, 0.030038010329008102, -0.001208826550282538, 0.027446569874882698, -0.022093448787927628, -0.004336406476795673, 0.08254778385162354, -0.020693691447377205, 0.004605954512953758, 0.037774499505758286, -0.03068114072084427, -0.034407518804073334, 0.016513340175151825, 0.0005127907497808337, -0.018092794343829155, -0.0633673369884491, 0.005608482286334038, -0.01160473469644785, 0.014196175150573254, 0.011264253407716751, 0.06949599832296371, -0.017478035762906075, 0.004471180494874716, 0.03162692114710808, -0.023909347131848335, -0.016768699511885643, -0.004244192969053984, 0.022963566705584526, -0.053606875240802765, -0.06881503760814667, 0.05534711480140686, 0.034615591168403625, 0.04672158882021904, 0.006686673033982515, -0.02640620991587639, 0.0038777028676122427, -0.041992682963609695, -0.035618118941783905, 0.04331677779555321, 0.03614775463938713, 0.0033055052626878023, -0.023587781935930252, 0.013723284937441349, -0.08905475586652756, -0.0554606094956398, 0.0342751108109951, 0.041122566908597946, 0.05330422520637512, 0.013997561298310757, 0.0075047737918794155, 0.06964732706546783, -0.03410486876964569, -0.0005707198288291693, -0.038663532584905624, -0.045057013630867004, 0.03098379075527191, -0.007741218898445368, 0.019728995859622955, -0.0019979628268629313, 0.0063840229995548725, -0.05742783099412918, 0.07657044380903244, 0.005178152117878199, 0.04441388323903084, -0.05935722589492798, 0.019861403852701187, 0.000773176085203886, -0.07815935462713242, 0.035599201917648315, 0.01225732360035181, 0.019974898546934128, -0.06775576621294022, 0.00772230327129364, -0.033423908054828644, 0.09465377777814865, 0.04157654196023941, 0.00821410957723856, -0.03745293617248535, -0.011595277115702629, 0.01488659530878067, -0.013458466157317162, -0.03189174085855484, -0.014347500167787075, 0.009363234043121338, -0.010517086833715439, -0.0737709328532219, 0.0614379458129406, -0.008024953305721283, 0.013430092483758926, 0.021866461262106895, -0.025800909847021103, 0.07134973257780075, -0.007249412592500448, -0.04562448337674141, -0.029546203091740608, 0.0026623739395290613, -0.012607263401150703, -0.003407176584005356, 0.057011689990758896, -0.006261071190237999, 0.043089788407087326, -0.028486929833889008, 0.015236535109579563, 0.09117330610752106, -0.0032180205453187227, -0.02143140137195587, -0.021639473736286163, -0.027276329696178436, 0.03919317200779915, -0.0111696757376194, 0.06230806186795235, -0.03321583569049835, 0.06457793712615967, 0.007622996345162392, -0.01808333583176136, -0.0286004226654768, -0.004764372482895851, -0.0143002113327384, 0.012503227218985558, -0.022698748856782913, 0.0007909095147624612, 0.009528744965791702, -0.006625196896493435, 0.04543532803654671, 0.007050798740237951, 0.03213764354586601 ]
42,880
linearmodels.iv.model
estimate_parameters
Parameter estimation without error checking Parameters ---------- x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) kappa : scalar Parameter value for k-class estimator Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed as a static method to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking.
@staticmethod def estimate_parameters( x: Float64Array, y: Float64Array, z: Float64Array, kappa: Numeric ) -> Float64Array: """ Parameter estimation without error checking Parameters ---------- x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) kappa : scalar Parameter value for k-class estimator Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed as a static method to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking. """ pinvz = pinv(z) p1 = (x.T @ x) * (1 - kappa) + kappa * ((x.T @ z) @ (pinvz @ x)) p2 = (x.T @ y) * (1 - kappa) + kappa * ((x.T @ z) @ (pinvz @ y)) return inv(p1) @ p2
(x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, kappa: Union[int, float]) -> numpy.ndarray
[ 0.030035385861992836, -0.05179300159215927, 0.030016399919986725, 0.025725631043314934, 0.028915228322148323, -0.04655294865369797, -0.05057791993021965, -0.06717142462730408, 0.007959757000207901, 0.07484164834022522, -0.013650721870362759, -0.004504358395934105, -0.03609182685613632, 0.03191497176885605, -0.06895607709884644, 0.016574520617723465, 0.009815609082579613, 0.01601444184780121, 0.022517045959830284, -0.011590773239731789, -0.02640911564230919, -0.05270431563258171, -0.028212757781147957, 0.09227052330970764, -0.006583293434232473, -0.0324275828897953, 0.02703564427793026, -0.04309755191206932, 0.026067372411489487, -0.009568795561790466, -0.053843460977077484, -0.006383943371474743, -0.025156058371067047, 0.02538388781249523, 0.0347818098962307, -0.0687282532453537, 0.04655294865369797, 0.015255014412105083, -0.03745879605412483, -0.04890717566013336, 0.010052930563688278, -0.04754020646214485, 0.018264248967170715, -0.06888014078140259, -0.010214309208095074, 0.02764318697154522, -0.0023316817823797464, 0.023903002962470055, -0.020238760858774185, 0.004369085188955069, 0.02413083054125309, -0.04089520871639252, 0.045148007571697235, -0.013641228899359703, -0.03447803854942322, 0.06622213870286942, 0.05638754367828369, -0.006251043174415827, 0.022023417055606842, -0.05877974256873131, 0.0039110551588237286, -0.044540464878082275, 0.0007416291045956314, 0.034136299043893814, 0.01880533993244171, 0.0249092448502779, -0.05304605886340141, 0.011780629865825176, 0.027149558067321777, 0.035845011472702026, 0.026978686451911926, -0.03404136747121811, -0.034895725548267365, -0.010650980286300182, 0.04173057898879051, 0.05771654471755028, -0.0525144599378109, -0.059349313378334045, -0.01590052805840969, -0.0186629481613636, -0.03142134100198746, -0.02215631864964962, -0.012217300944030285, -0.04169260710477829, 0.010280759073793888, -0.00362864276394248, -0.001928235637024045, -0.048489492386579514, 0.031402356922626495, 0.005690964870154858, -0.05023617669939995, 0.02308661676943302, 0.022365160286426544, 0.0396801233291626, 0.008923280984163284, 0.0233903881162405, 0.001961460569873452, -0.054906658828258514, 0.01161925122141838, -0.024396631866693497, 0.05304605886340141, 0.029237985610961914, 0.039034608751535416, 0.036281682550907135, 0.011353451758623123, -0.06310848146677017, -0.0052068294025957584, 0.03480079770088196, 0.018216783180832863, -0.009720681235194206, -0.034591954201459885, 0.015539799816906452, -0.04883123189210892, -0.05847597122192383, -0.01711561344563961, -0.0068585858680307865, -0.03083278425037861, 0.06394385546445847, -0.0026247736532241106, 0.024472573772072792, 0.029674656689167023, 0.048033833503723145, -0.0363006666302681, 0.03449702635407448, -0.014533556997776031, -0.036870237439870834, 0.03144032880663872, 0.02747231535613537, 0.010309237986803055, -0.01177113689482212, 0.0010175150819122791, 0.007238300051540136, -0.02582055889070034, 0.0008596964762546122, 0.026807814836502075, 0.04845152050256729, 0.015947991982102394, 0.025004172697663307, 0.03776256740093231, -0.02471938729286194, 0.06375399976968765, 0.030453070998191833, -0.025269974023103714, 0.012568537145853043, 0.014362686313688755, -0.01880533993244171, 0.08361304551362991, -0.0053397295996546745, 0.0198400616645813, 0.02078934758901596, 0.0032797805033624172, 0.031687140464782715, 0.022498060017824173, -0.041464779525995255, 0.005567558109760284, -0.06626010686159134, 0.07351265102624893, -0.0332629568874836, 0.013403907418251038, -0.06326036900281906, -0.07525933533906937, -0.006939275190234184, -0.019023677334189415, -0.009758652187883854, 0.011220552027225494, 0.023940974846482277, -0.013223543763160706, 0.05574202910065651, 0.0003850538341794163, -0.04078129306435585, -0.0007968063000589609, -0.05574202910065651, -0.0883214995265007, -0.030339157208800316, 0.004570808261632919, 0.05194488912820816, -0.043629150837659836, -0.027757100760936737, 0.04150275141000748, -0.006455139722675085, 0.022498060017824173, -0.029883500188589096, -0.052780259400606155, -0.06808273494243622, 0.011040187440812588, 0.0357121117413044, 0.03926243633031845, -0.014789864420890808, -0.0558939166367054, -0.008652735501527786, -0.019783103838562965, -0.021776603534817696, 0.020067891106009483, 0.050501976162195206, 0.0011219364823773503, -0.0017170197097584605, 0.031250469386577606, 0.05297011882066727, 0.026371143758296967, 0.020105861127376556, 0.018549034371972084, -0.004338233731687069, 0.033073097467422485, 0.012559044174849987, -0.0003102976188529283, -0.020238760858774185, 0.009573541581630707, -0.050198204815387726, -0.006436153780668974, 0.011049680411815643, 0.021586745977401733, -0.01696372777223587, 0.02657998725771904, -0.01891925558447838, 0.022498060017824173, 0.06899405270814896, 0.06705751270055771, 0.010442137718200684, 0.026485059410333633, -0.008676467463374138, 0.03952823951840401, -0.03295918554067612, -0.014685442671179771, 0.053084030747413635, 0.0589316301047802, -0.030623942613601685, 0.008866324089467525, 0.01220780797302723, -0.060868170112371445, -0.09667520970106125, 0.003061444964259863, -0.019897019490599632, -0.025288959965109825, -0.05008428916335106, 0.0024005051236599684, -0.06656388193368912, -0.016242271289229393, -0.02428271621465683, -0.011970487423241138, -0.0002917568781413138, -0.002748180879279971, 0.0005313031142577529, -0.013982972130179405, 0.04997037723660469, -0.04541380703449249, -0.007888560183346272, 0.023257488384842873, 0.040705353021621704, 0.042376093566417694, 0.00824928842484951, 0.024092860519886017, -0.035370368510484695, -0.029522771015763283, 0.030187271535396576, -0.0004882885841652751, 0.012397665530443192, 0.09340967237949371, 0.07875270396471024, 0.06607025116682053, -0.013783621601760387, -0.04719846323132515, -0.01650807075202465, -0.027757100760936737, 0.02445358783006668, -0.01833069883286953, 0.020694417878985405, 0.021510804072022438, 0.028915228322148323, 0.020542532205581665, -0.006127636414021254, 0.029408857226371765, 0.1312291920185089, -0.0491350032389164, -0.05175503343343735, 0.01601444184780121, 0.06253891438245773, 0.018216783180832863, -0.031516268849372864, 0.02629520185291767, 0.013299486599862576, 0.024643445387482643, -0.09880160540342331, -0.029067113995552063, 0.020979203283786774, -0.009288756176829338, 0.0241498164832592, -0.031098585575819016, -0.007546817883849144, 0.07415816187858582, -0.02553577348589897, 0.028820300474762917, 0.01291027944535017, 0.05107154697179794, -0.04385697841644287, 0.06842447817325592, 0.01328999362885952, -0.0381612665951252, 0.011277508921921253, 0.04632512107491493, 0.012540058232843876, 0.014647471718490124, 0.022403132170438766, 0.047426290810108185, -0.029750600457191467, 0.013812100514769554, 0.01601444184780121, 0.046780776232481, 0.005605529528111219, -0.001429860945791006, 0.020219776779413223, -0.0004684129380621016, 0.008610017597675323, -0.021282974630594254, -0.0396801233291626, -0.030453070998191833, -0.08968847244977951, 0.0027149557135999203, 0.00908465962857008, 0.04321146383881569, 0.03819923847913742, 0.045603662729263306, 0.021738631650805473, -0.0018321205861866474, 0.006118143443018198, -0.009255531243979931, -0.033832527697086334, -0.0048508476465940475, -0.0027291951701045036, -0.06724736839532852, -0.036889225244522095, -0.0029380377382040024, -0.003358096582815051, -0.03876880928874016, 0.05270431563258171, -0.020428618416190147, 0.03284526988863945, 0.012634987011551857, 0.004561315756291151, 0.032142799347639084, 0.05300808697938919, -0.0324275828897953, -0.027567243203520775, -0.06291862577199936, 0.00955930259078741, -0.034743841737508774, -0.025782587006688118, 0.010442137718200684, -0.017960477620363235, 0.015511320903897285, 0.07708196341991425, -0.04397089406847954, 0.003436412662267685, 0.09758652746677399, 0.06648793816566467, 0.027776086702942848, 0.023903002962470055, 0.00801196787506342, -0.015406900085508823, 0.04043955355882645, -0.007731928490102291, -0.0016719286795705557, 0.04473032057285309, -0.02489025890827179, -0.0010525200050324202, 0.03622472658753395, -0.018292726948857307, -0.022213274613022804, -0.0037259445525705814, -0.00048532208893448114, -0.02063746191561222, -0.02001093327999115, -0.08171447366476059, -0.042983636260032654, 0.011714180000126362, 0.04917297512292862, -0.0025203523691743612, -0.07115842401981354, -0.011220552027225494, 0.026959700509905815, 0.037515752017498016, 0.01412536483258009, -0.052932146936655045, 0.06865230947732925, 0.0055817971006035805, -0.014476600103080273, 0.0163371991366148, -0.007029457483440638, -0.020656447857618332, 0.027111586183309555, -0.01443862821906805, 0.01298622228205204, -0.027871014550328255, 0.014039929024875164, 0.02246008813381195, -0.038578953593969345, 0.01474239956587553, 0.0058286115527153015, 0.009065673686563969, -0.04123695194721222, -0.0005689778481610119, -0.06109599769115448, -0.023713145405054092, -0.005486868787556887, 0.007879067212343216, 0.0074091712012887, -0.0509956032037735, 0.01802692748606205, 0.01450507901608944, 0.001854666043072939, 0.02473837323486805, -0.04062940925359726, 0.007062682416290045, 0.07491759210824966, -0.00862900260835886, 0.004789144266396761, 0.04233812168240547, 0.0034506518859416246, 0.00931248813867569, 0.03366165608167648, 0.030282199382781982, 0.07267727702856064, -0.07844893634319305, 0.04321146383881569, 0.0357121117413044, 0.022023417055606842, 0.0038635910023003817, -0.039034608751535416, -0.09310589730739594, 0.0005339729250408709, -0.032161783427000046, -0.023599231615662575, -0.032788313925266266, -0.06094411388039589, -0.007247793022543192, 0.008348964154720306, 0.015957485884428024, 0.026314187794923782, 0.014913271181285381, -0.014524064026772976, 0.013375429436564445, -0.0015983590856194496, 0.03341484069824219, -0.005681472364813089, -0.0029973681084811687, -0.09189081192016602, -0.013195064850151539, 0.05824814364314079, -0.0158720500767231, -0.043135520070791245, -0.029997413977980614, 0.013963986188173294, -0.003585925092920661, 0.04112303629517555, 0.002217767760157585, 0.028972186148166656, 0.008681213483214378, -0.019460348412394524, -0.03622472658753395, -0.009293502196669579, 0.042717836797237396, 0.024491559714078903, -0.003597791073843837, -0.01725800521671772, -0.03755372390151024, 0.0026508790906518698, 0.03941432386636734, 0.0034625178668648005, 0.0006935715209692717, 0.0022569256834685802, -0.04249000921845436, 0.017761126160621643, -0.0031421342864632607, -0.012691943906247616, 0.014106378890573978, -0.02901015803217888, 0.06576648354530334, 0.01154330838471651, 0.08027156442403793, -0.007618014235049486, -0.020580504089593887, -0.05057791993021965, -0.012369186617434025, 0.00021121597092133015, 0.04074332118034363, 0.011733165942132473, -0.017352934926748276, 0.013005208224058151, 0.02259298972785473, 0.014486093074083328, -0.04776803404092789, -0.010584530420601368, 0.06158962845802307, 0.06903202086687088, 0.10738314688205719, -0.04135086387395859, 0.03592095524072647, 0.06580445170402527, -0.0019317955011501908, 0.02992147020995617, -0.011410408653318882, 0.006626010872423649, 0.024187788367271423, -0.057071030139923096, -0.06060237064957619, 0.014846821315586567, -0.040401581674814224, -0.053387802094221115, 0.026466073468327522, -0.007774646393954754, 0.02948479913175106, -0.028649428859353065, -0.01024278812110424, 0.010945258662104607, -0.007380692753940821, -0.01816931925714016, 0.029864514246582985, -0.00550110824406147, -0.009046688675880432, -0.0059425258077681065, 0.007442396599799395, 0.03144032880663872, 0.009326727129518986, 0.034440070390701294, -0.03660443797707558, 0.03975606709718704, 0.07169002294540405, 0.015103128738701344, -0.013631735928356647, 0.030889742076396942, 0.06531082838773727, -0.07503150403499603, -0.04317349195480347, -0.00370221259072423, 0.040705353021621704, 0.000870375894010067, -0.019061647355556488, -0.014922764152288437, -0.05559014528989792, 0.016080891713500023, -0.0013361190212890506, -0.007352214306592941, -0.004326367750763893, -0.0025203523691743612, -0.04321146383881569, 0.011021201498806477, 0.01190403662621975, -0.044084805995225906, 0.05771654471755028, -0.04571757838129997, -0.009630498476326466, 0.01758076250553131, -0.00011094771616626531, 0.047274406999349594, 0.030813800171017647, 0.005178350955247879, 0.05661537125706673, -0.04233812168240547, -0.019783103838562965, 0.0005707577802240849, 0.030756842344999313, -0.013005208224058151, -0.03343382477760315, 0.08718235790729523, -0.020713403820991516, -0.026523029431700706, 0.02261197380721569, -0.012036937288939953, 0.0190806332975626, -0.03193395584821701, -0.016887784004211426, -0.007921785116195679, -0.009872566908597946, 0.01504617091268301, 0.01698271371424198, -0.05448897182941437, 0.020580504089593887, 0.05498260259628296, -0.032598454505205154, -0.04776803404092789, -0.04059143736958504, 0.02044760435819626, 0.005823865067213774, 0.018890775740146637, -0.08163852989673615, -0.005876075476408005, -0.012350200675427914, -0.08179041743278503, -0.011030694469809532, -0.0011160034919157624, 0.02671288698911667, -0.060792226344347, 0.062235139310359955, -0.04993240535259247, -0.023732131347060204, -0.004822369199246168, 0.013223543763160706, -0.024244746193289757, 0.01924201287329197, 0.05703305825591087, -0.033376868814229965, -0.02090326137840748, -0.01770417019724846, 0.005159365478903055, -0.023618217557668686, 0.02644708752632141, -0.03083278425037861, -0.06565257161855698, 0.007470875047147274, 0.027092600241303444, -0.03147830069065094, 0.02549780160188675, -0.02523200213909149, 0.004601660184562206, 0.02768115885555744, -0.006697207223623991, 0.059045542031526566, -0.03481978178024292, 0.043287407606840134, 0.04385697841644287, 0.004663363564759493, -0.0415407232940197, 0.021036161109805107, 0.016109371557831764, 0.014685442671179771, -0.01786554791033268, -0.011438887566328049, 0.002044523134827614, -0.12576131522655487, 0.007803124841302633, -0.030472056940197945, 0.042414065450429916, 0.014400657266378403, 0.06819665431976318, -0.015834078192710876, -0.012397665530443192, -0.025137074291706085, 0.02825072966516018, -0.001318319933488965, -0.07134827971458435, -0.013403907418251038, -0.019593248143792152, 0.021567760035395622, -0.03502862527966499, 0.028801314532756805, 0.049590662121772766, -0.02293473109602928, -0.0028264967259019613, 0.014780371449887753, 0.05578000098466873, 0.018112363293766975, -0.0445784367620945, -0.034003399312496185, -0.0516790896654129, 0.044996120035648346, -0.005401432979851961, -0.02629520185291767, -0.04662889242172241, 0.0648551657795906, 0.008633749559521675, -0.02244110405445099, -0.022687917575240135, -0.028896242380142212, -0.06470328569412231, -0.02536490187048912, 0.005183097440749407, 0.018283233046531677, -0.023903002962470055, -0.041464779525995255, -0.023713145405054092, 0.004874579608440399, 0.04791991785168648, 0.03818025439977646, 0.037971410900354385, -0.047274406999349594, 0.03166815638542175, -0.06618417054414749, -0.040363609790802, -0.0030282200314104557, -0.04716049134731293, -0.026845786720514297, 0.0660322830080986, 0.008125881664454937, 0.029731614515185356, 0.01739090494811535, 0.04089520871639252, -0.06967753916978836, 0.002900066552683711, -0.005353968590497971, 0.004492492415010929, 0.011220552027225494, -0.04689469188451767, -0.015292985364794731, 0.034155283123254776, 0.022118346765637398, 0.005145126022398472, -0.05931134149432182, -0.0186154842376709, 0.019479332491755486, 0.006758911069482565, -0.04689469188451767, -0.02857348695397377, -0.004499611910432577, -0.04564163461327553, 0.05494463071227074, -0.02766217291355133, 0.08042344450950623, 0.017504820600152016, -0.02350430190563202, -0.02733941562473774, -0.06200731173157692, -0.00849135685712099, -0.012549551203846931, 0.0388447530567646, -0.06998130679130554, 0.0019151830347254872, 0.1004723533987999, 0.009696949273347855, -0.03347179666161537, -0.019298968836665154, 0.0690699964761734, 0.00022530692513100803, 0.009715934284031391, -0.003047205740585923, 0.0009581848280504346, -0.06269079446792603, -0.0019448481034487486, -0.007447142619639635, -0.0354652963578701, 0.010081409476697445, 0.014685442671179771, 0.024624459445476532, 0.016745392233133316, 0.022365160286426544, 0.005173604469746351, -0.0178560558706522, -0.01970716193318367, -0.017988955602049828, -0.06865230947732925, 0.02644708752632141, 0.07225959002971649, -0.0031801057048141956, 0.03609182685613632, -0.02612433023750782, -0.04184449464082718, 0.010726923123002052, 0.03914852440357208, -0.025896500796079636, -0.021624717861413956, 0.06599430739879608, -0.03256048262119293, 0.042414065450429916, -0.007442396599799395, 0.00016686654998920858, -0.026940714567899704, 0.07617064565420151, 0.005524840205907822, 0.044654376804828644, -0.06607025116682053, -0.036281682550907135, -0.04886920377612114, -0.05638754367828369, -0.011419901624321938, 0.011011708527803421, 0.0351235531270504, 0.015387914143502712, -0.010489601641893387, 0.025440845638513565, 0.010764895007014275 ]
42,881
linearmodels.iv.model
fit
Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator to use. Supported covariance estimators are: * "unadjusted", "homoskedastic" - Classic homoskedastic inference * "robust", "heteroskedastic" - Heteroskedasticity robust inference * "kernel" - Heteroskedasticity and autocorrelation robust inference * "cluster" - One-way cluster dependent inference. Heteroskedasticity robust debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional parameters to pass to covariance estimator. The list of optional parameters differ according to ``cov_type``. See the documentation of the alternative covariance estimators for the complete list of available commands. Returns ------- IVResults Results container Notes ----- Additional covariance parameters depend on specific covariance used. The see the docstring of specific covariance estimator for a list of supported options. Defaults are used if no covariance configuration is provided. See also -------- linearmodels.iv.covariance.HomoskedasticCovariance linearmodels.iv.covariance.HeteroskedasticCovariance linearmodels.iv.covariance.KernelCovariance linearmodels.iv.covariance.ClusteredCovariance
def fit( self, *, cov_type: str = "robust", debiased: bool = False, **cov_config: Any ) -> OLSResults | IVResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator to use. Supported covariance estimators are: * "unadjusted", "homoskedastic" - Classic homoskedastic inference * "robust", "heteroskedastic" - Heteroskedasticity robust inference * "kernel" - Heteroskedasticity and autocorrelation robust inference * "cluster" - One-way cluster dependent inference. Heteroskedasticity robust debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional parameters to pass to covariance estimator. The list of optional parameters differ according to ``cov_type``. See the documentation of the alternative covariance estimators for the complete list of available commands. Returns ------- IVResults Results container Notes ----- Additional covariance parameters depend on specific covariance used. The see the docstring of specific covariance estimator for a list of supported options. Defaults are used if no covariance configuration is provided. See also -------- linearmodels.iv.covariance.HomoskedasticCovariance linearmodels.iv.covariance.HeteroskedasticCovariance linearmodels.iv.covariance.KernelCovariance linearmodels.iv.covariance.ClusteredCovariance """ wy, wx, wz = self._wy, self._wx, self._wz kappa = self._kappa try: liml_kappa: float = self._estimate_kappa() except Exception as exc: liml_kappa = nan if kappa is None: raise ValueError( "Unable to estimate kappa. This is most likely occurs if the " f"instrument matrix is rank deficient. The error raised when " f"computing kappa was:\n\n{exc}" ) if kappa is not None: est_kappa = kappa else: est_kappa = liml_kappa if self._fuller != 0: nobs, ninstr = wz.shape est_kappa -= self._fuller / (nobs - ninstr) params = self.estimate_parameters(wx, wy, wz, est_kappa) cov_estimator = COVARIANCE_ESTIMATORS[cov_type] cov_config["debiased"] = debiased cov_config["kappa"] = est_kappa cov_config_copy = {k: v for k, v in cov_config.items()} if "center" in cov_config_copy: del cov_config_copy["center"] cov_estimator_inst = cov_estimator(wx, wy, wz, params, **cov_config_copy) results = {"kappa": est_kappa, "liml_kappa": liml_kappa} pe = self._post_estimation(params, cov_estimator_inst, cov_type) results.update(pe) if self.endog.shape[1] == 0 and self.instruments.shape[1] == 0: return OLSResults(results, self) else: return IVResults(results, self)
(self, *, cov_type: str = 'robust', debiased: bool = False, **cov_config: Any) -> linearmodels.iv.results.OLSResults | linearmodels.iv.results.IVResults
[ 0.040741365402936935, -0.0796755701303482, 0.0232520941644907, -0.04252844303846359, 0.014176147058606148, -0.03716721013188362, -0.03017953224480152, -0.07822984457015991, 0.023372571915388107, 0.062407176941633224, -0.044616714119911194, -0.02435646951198578, -0.034255675971508026, 0.04497814550995827, -0.02598291076719761, 0.08521752059459686, -0.014798613265156746, -0.012860937975347042, 0.04445607587695122, 0.0021447446197271347, -0.01651541329920292, -0.03421551734209061, -0.06891294568777084, 0.0041690124198794365, -0.0014018021756783128, -0.009402239695191383, 0.03515925630927086, -0.04337178170681, 0.0606803372502327, -0.016967201605439186, -0.05658411234617233, 0.035841960459947586, -0.03668529912829399, -0.004884345456957817, 0.046664826571941376, -0.033271778374910355, 0.04313082993030548, 0.015561634674668312, 0.058672383427619934, 0.03124374710023403, -0.05292963981628418, -0.016917003318667412, 0.054897431284189224, -0.03997834399342537, -0.038673173636198044, 0.018985195085406303, -0.062407176941633224, 0.068832628428936, 0.039155080914497375, -0.030018895864486694, -0.0030847175512462854, -0.06879246979951859, 0.027830226346850395, -0.03347257524728775, 0.001685425522737205, -0.028332214802503586, -0.007057954557240009, -0.008679375983774662, 0.04365289583802223, -0.00406108470633626, 0.01843300834298134, -0.05116264149546623, 0.008689416572451591, 0.020661834627389908, -0.006786881014704704, 0.008729575201869011, -0.007123212795704603, 0.029436590149998665, 0.023653686046600342, 0.019346626475453377, 0.03136422485113144, -0.0264848992228508, -0.049957867711782455, 0.04682546108961105, 0.052769001573324203, -0.005727685522288084, -0.05927477031946182, -0.028874361887574196, -0.007986633107066154, -0.008237626403570175, 0.007494684308767319, 0.0032980625983327627, -0.058069996535778046, -0.07822984457015991, -0.013121971860527992, 0.025581320747733116, -0.039657071232795715, -0.09533760696649551, 0.08569943159818649, 0.05124295875430107, 0.00676178140565753, 0.021866606548428535, 0.03873341158032417, 0.00812216941267252, 0.012047717347741127, 0.04827118664979935, 0.0009801320265978575, -0.08923342823982239, 0.04529941827058792, -0.02475805953145027, -0.006018838845193386, 0.05545965954661369, 0.06481672078371048, 0.018463127315044403, -0.03126382827758789, -0.06204574555158615, -0.043010350316762924, 0.036444343626499176, 0.06453560292720795, -0.025440763682127, -0.04389385133981705, -0.018945036455988884, -0.02371392399072647, -0.014818692579865456, -0.04987755045294762, 0.005190558265894651, -0.01703748106956482, 0.02696680836379528, -0.07067994028329849, 0.0571463406085968, -0.039215318858623505, 0.04228748753666878, -0.03893420845270157, -0.031042952090501785, 0.01941690407693386, -0.01516004465520382, 0.0035515667404979467, 0.02644474059343338, 0.00874965451657772, 0.004914464894682169, -0.00047281014849431813, -0.04220717027783394, -0.012218393385410309, -0.002924081403762102, 0.025280127301812172, 0.05794952064752579, -0.0025726896710693836, 0.0005741490167565644, -0.045058462768793106, 0.03513917699456215, 0.04698609933257103, 0.05626283958554268, -0.0014570208732038736, -0.006922417785972357, 0.01589294709265232, 0.04698609933257103, 0.0465041883289814, -0.09702428430318832, -0.004826616961508989, 0.02222803793847561, -0.006571026053279638, -0.013613920658826828, -0.040199216455221176, -0.029516907408833504, -0.04090199992060661, -0.10208432376384735, 0.010200400836765766, -0.009251642972230911, -0.011816802434623241, -0.02214772067964077, -0.06208590418100357, -0.001867396174930036, 0.0540139339864254, 0.03234812244772911, 0.007549902889877558, -0.0016691108467057347, -0.06220638006925583, 0.04803023487329483, -0.003689613426104188, -0.021766209974884987, -0.028814123943448067, -0.033191461116075516, -0.05196582153439522, -0.014949209056794643, -0.003897938644513488, 0.0465041883289814, -0.014095829799771309, -0.018995234742760658, 0.006445528939366341, -0.06529863178730011, 0.017589667811989784, -0.018985195085406303, -0.09630142152309418, -0.02021004632115364, -0.033693451434373856, 0.055379342287778854, 0.017971178516745567, 0.010089963674545288, -0.011636086739599705, -0.04533957690000534, -0.03142446279525757, -0.01080278679728508, 0.018031416460871696, 0.014718295074999332, -0.0006149355904199183, -0.016043543815612793, 0.05465647950768471, 0.027910545468330383, -0.03471750393509865, 0.019366705790162086, 0.020491158589720726, 0.008719535544514656, 0.014818692579865456, -0.017800502479076385, -0.01941690407693386, 0.02158549427986145, -0.04120319336652756, -0.04208669438958168, 0.007931414060294628, 0.005928480997681618, -0.0005948560428805649, 0.02327217347919941, 0.024978933855891228, -0.030641362071037292, 0.0258624330163002, 0.008297865279018879, 0.02025020495057106, 0.021304380148649216, -0.005918441340327263, 0.0142865851521492, 0.05445568263530731, -0.04863261803984642, 0.0072637698613107204, 0.03660498186945915, 0.03652466461062431, -0.022529231384396553, 0.003938097506761551, -0.02033052407205105, -0.014969289302825928, -0.06911373883485794, -0.01833260990679264, -0.010762627236545086, -0.013905073516070843, -0.029055079445242882, -0.061804790049791336, 0.014648016542196274, -0.0329505056142807, 0.043050508946180344, -0.08088034391403198, -0.015812629833817482, 0.019567500799894333, -0.010441355407238007, -0.01968797855079174, 0.05345170572400093, -0.06557974219322205, -0.031565017998218536, 0.027247920632362366, 0.042367804795503616, 0.003057108260691166, -0.010064863599836826, 0.05566045269370079, -0.04554037004709244, -0.03556084632873535, 0.045058462768793106, 0.01693708263337612, -0.01978837512433529, 0.03989802300930023, -0.00172558450140059, 0.05453599989414215, -0.0290952380746603, -0.02367376536130905, -0.0047488086856901646, 0.014075749553740025, 0.06891294568777084, -0.046704985201358795, 0.014417101629078388, 0.032107166945934296, -0.017991257831454277, 0.03793023154139519, 0.02704712562263012, -0.026846330612897873, 0.09349028766155243, -0.00886511243879795, -0.023332413285970688, 0.011535689234733582, 0.10079923272132874, -0.038572777062654495, -0.011435291729867458, 0.007896275259554386, 0.05722665786743164, 0.02104334719479084, -0.01516004465520382, -0.022268198430538177, -0.00264045805670321, -0.038050707429647446, -0.02435646951198578, -0.04911452904343605, 0.01843300834298134, 0.04393400996923447, 0.007951493375003338, 0.03554076701402664, 0.017549509182572365, 0.03017953224480152, -0.04148430749773979, 0.055339183658361435, -0.010943342931568623, 0.015631914138793945, 0.02058151736855507, 0.05224693566560745, -0.015983305871486664, -0.02475805953145027, 0.031645338982343674, 0.036022674292325974, -0.05096184462308884, 0.05827079340815544, 0.007334047928452492, 0.026705773547291756, -0.07136264443397522, 0.015220282599329948, 0.015601794235408306, -0.016103781759738922, 0.03339225798845291, -0.0033281820360571146, -0.018192052841186523, -0.039195239543914795, -0.04276939854025841, 0.024557264521718025, -0.04321114718914032, 0.040841761976480484, 0.05076104775071144, -0.011465410701930523, -0.019487183541059494, -0.0035616063978523016, -0.04481750726699829, 0.023472970351576805, 0.00768543966114521, 0.021264221519231796, 0.04060080647468567, -0.02760935202240944, -0.029356271028518677, -0.01734871231019497, -0.004949603695422411, -0.016344737261533737, 0.018422968685626984, -0.068832628428936, -0.037588879466056824, 0.02058151736855507, 0.006801940500736237, 0.06100161001086235, 0.06622228771448135, 0.0398377850651741, -0.03875349089503288, -0.02270994707942009, -0.016364816576242447, -0.04140399023890495, -0.024657661095261574, 0.06879246979951859, -0.0027032066136598587, 0.036022674292325974, 0.08353084325790405, -0.05441552400588989, 0.03676561638712883, 0.06766801327466965, 0.06911373883485794, 0.014668095856904984, 0.009015708230435848, -0.0021849037148058414, -0.03415527939796448, 0.041323669254779816, -0.07730618864297867, -0.041966214776039124, 0.008594038896262646, -0.03385408595204353, 0.03668529912829399, 0.009326941333711147, -0.0012160665355622768, -0.025119490921497345, -0.04112287610769272, 0.04750816524028778, -0.01274046115577221, -0.016063623130321503, -0.04164494201540947, -0.041765421628952026, -0.0047287289053201675, 0.06782864779233932, -0.009763671085238457, -0.034757666289806366, -0.0009393454529345036, 0.0222079586237669, 0.03746839985251427, -0.015521476045250893, -0.041926056146621704, 0.016615809872746468, 0.017087679356336594, 0.00810209009796381, -0.0024647621903568506, 0.0062397136352956295, 0.013463323935866356, 0.011415212415158749, -0.005843142978847027, 0.012298711575567722, -0.013121971860527992, 0.010245579294860363, -0.015672072768211365, 0.0066162049770355225, 0.025541160255670547, -0.022910742089152336, -0.005918441340327263, -0.033834006637334824, -0.02811134047806263, -0.04276939854025841, 0.0007109408034011722, 0.04610259830951691, 0.04200637340545654, -0.03154493868350983, -0.03823142498731613, -0.006149355787783861, -0.01781054213643074, -0.011053781025111675, -0.02532028593122959, -0.001142023247666657, 0.01537087932229042, 0.004211681429296732, 0.00999960582703352, -0.03951651230454445, 0.072567418217659, 0.015280521474778652, 0.018262332305312157, 0.06176463142037392, 0.04935548081994057, 0.07541871070861816, -0.041323669254779816, 0.06710578501224518, 0.03929563984274864, 0.038010548800230026, 0.04590180516242981, -0.02329225279390812, -0.025701796635985374, -0.010330917313694954, -0.08995629101991653, 0.03188629075884819, 0.034235596656799316, -0.008528780192136765, -0.017318593338131905, -0.05774872377514839, 0.03943619504570961, -0.024597423151135445, -0.005326095037162304, -0.005132829770445824, 0.042930033057928085, 0.005037451628595591, -0.0030972673557698727, -0.04280955716967583, 0.017589667811989784, -0.032167404890060425, 0.026866409927606583, 0.02052127942442894, -0.009668293409049511, -0.05116264149546623, -0.0080820107832551, 0.07325012236833572, 0.0049094450660049915, -0.0031349165365099907, 0.011405172757804394, 0.011445331387221813, -0.006244733463972807, -0.013121971860527992, 0.008709495887160301, -0.0006839589332230389, 0.011334894225001335, 0.03843221813440323, -0.0011401408119127154, -0.004663470666855574, -0.03521949425339699, 0.007790857460349798, 0.07417377829551697, 0.01885467767715454, -0.014146028086543083, 0.012278632260859013, -0.032649315893650055, -0.0006820764974690974, -0.02493877522647381, 0.04794991388916969, 0.010762627236545086, -0.0046559409238398075, 0.03686601668596268, -0.0029742801561951637, 0.020963028073310852, 0.00426940992474556, -0.004088694229722023, 0.0021585493814200163, -0.0142865851521492, -0.0036394146736711264, 0.014447221532464027, 0.03349265456199646, -0.02548092231154442, -0.026725852862000465, 0.003958177287131548, 0.0032453539315611124, 0.0023442849051207304, -0.03768927603960037, 0.048873573541641235, 0.027810147032141685, 0.062407176941633224, -0.013955272734165192, 0.027950704097747803, 0.04248828440904617, -0.04481750726699829, 0.005983699578791857, -0.020842550322413445, 0.09244614839553833, -0.013443244621157646, -0.024396628141403198, -0.05397377535700798, 0.0016000875039026141, -0.036464422941207886, -0.026886489242315292, -0.028733806684613228, -0.027890466153621674, -0.02811134047806263, -0.04437575861811638, 0.029416510835289955, 0.04718689247965813, -0.061885107308626175, 0.01190716028213501, 0.006581065710633993, 0.016133900731801987, 0.027267999947071075, 0.0022777714766561985, -0.023452889174222946, 0.017549509182572365, -0.040199216455221176, 0.03136422485113144, 0.021424857899546623, 0.0264848992228508, 0.06907358020544052, 0.018985195085406303, -0.022448914125561714, 0.042367804795503616, 0.031645338982343674, -0.06578053534030914, -0.06501751393079758, -0.054295048117637634, 0.09027756005525589, 0.02975786291062832, -0.030480725690722466, -0.00768543966114521, -0.0465041883289814, 0.013362926431000233, -0.010180321522057056, -0.037508558481931686, -0.013633999973535538, -0.03132406622171402, -0.016505373641848564, 0.07196503132581711, -0.00371973286382854, 0.0014821202494204044, 0.01402555126696825, -0.05497775226831436, -0.016917003318667412, -0.02100318670272827, 0.0012468132190406322, 0.034858062863349915, 0.04762864112854004, 0.016846725717186928, 0.062326859682798386, -0.013433204963803291, -0.05072088912129402, 0.004088694229722023, 0.028994839638471603, -0.002964240498840809, -0.002081996062770486, 0.02588251233100891, -0.08586006611585617, 0.06039922311902046, 0.05292963981628418, 0.04337178170681, 0.015250402502715588, 0.015551595017313957, -0.04445607587695122, 0.027308160439133644, -0.0506807304918766, -0.04586164280772209, -0.002262711990624666, -0.06064017862081528, 0.05509822815656662, -0.010411235503852367, -0.002566414885222912, -0.06393322348594666, -0.009673313237726688, -0.017127837985754013, -0.014708255417644978, 0.025782115757465363, -0.03439623489975929, 0.02025020495057106, -0.03881372883915901, -0.06325051933526993, 0.003393440507352352, 0.0018347669392824173, 0.058551907539367676, -0.043974168598651886, 0.01761978678405285, -0.07630220800638199, -0.015250402502715588, 0.0011614753166213632, 0.032107166945934296, -0.007504723966121674, -0.033171381801366806, 0.03676561638712883, -0.03027993068099022, -0.03437615558505058, -0.07325012236833572, 0.032187484204769135, 0.02275010570883751, -0.03174573555588722, 0.03421551734209061, -0.05019882321357727, 0.07678411900997162, 0.06782864779233932, 0.003943117335438728, 0.02548092231154442, 0.005044981837272644, 0.012850898317992687, 0.010160241276025772, -0.016856765374541283, 0.01718807779252529, -0.027227841317653656, 0.017418991774320602, 0.07035867124795914, 0.03995826467871666, 0.03240836039185524, -0.03032008931040764, 0.02963738515973091, -0.0007027835235930979, -0.057427454739809036, 0.017609747126698494, 0.020782312378287315, -0.12497498840093613, 0.022910742089152336, -0.038693252950906754, 0.04975707456469536, 0.054254885762929916, 0.04803023487329483, -0.005918441340327263, 0.02706720493733883, 0.02003937028348446, 0.05686522647738457, 0.017167996615171432, 0.009281761944293976, 0.004904424771666527, 0.0002509941114112735, 0.029436590149998665, 0.07067994028329849, 0.05626283958554268, 0.014688175171613693, -0.017840661108493805, -0.0021974535193294287, 0.03728768602013588, 0.03439623489975929, 0.01430666446685791, 0.0018397868843749166, -0.019306467846035957, -0.05132327601313591, -0.024055276066064835, -0.011244536377489567, -0.014447221532464027, 0.04337178170681, 0.03421551734209061, 0.02536044456064701, -0.009015708230435848, -0.02164573222398758, -0.005155418999493122, -0.016344737261533737, -0.0264848992228508, 0.05389345437288284, 0.014075749553740025, -0.0009795045480132103, -0.004470204934477806, 0.0025526101235300303, -0.025561239570379257, 0.03614315390586853, 0.007810936775058508, -0.011435291729867458, 0.018573563545942307, 0.026886489242315292, -0.03124374710023403, -0.03417535871267319, -0.0037774613592773676, -0.04979723319411278, -0.036484505981206894, 0.05124295875430107, 0.046182915568351746, 0.023914719000458717, 0.0065961251966655254, 0.05935508757829666, -0.07168392091989517, 0.010320877656340599, -0.05517854541540146, -0.014838771894574165, -0.054295048117637634, -0.029938578605651855, -0.018804479390382767, 0.016404975205659866, -0.04529941827058792, 0.05405409261584282, -0.08602070063352585, -0.05076104775071144, -0.01300149504095316, -0.03606283292174339, -0.017931019887328148, 0.051644548773765564, 0.01274046115577221, -0.02477813884615898, 0.05606204643845558, -0.0232520941644907, 0.06774833053350449, 0.001104374066926539, -0.002924081403762102, 0.0037950309924781322, -0.05827079340815544, 0.021505175158381462, 0.010762627236545086, 0.003448659088462591, -0.048793256282806396, 0.021384699270129204, 0.049998026341199875, -0.0023367551621049643, -0.009136185981333256, -0.01014518178999424, 0.021806368604302406, 0.03738808259367943, -0.023452889174222946, -0.01601342484354973, -0.01910567097365856, -0.013593841344118118, -0.06393322348594666, -0.005145379342138767, 0.03393440321087837, 0.055981725454330444, 0.029336191713809967, 0.025782115757465363, -0.020922869443893433, 0.004153952468186617, -0.005366254132241011, -0.03078191727399826, -0.033271778374910355, -0.039697229862213135, -0.01749930903315544, -0.00008431833703070879, 0.006018838845193386, -0.013182210735976696, 0.03797039017081261, -0.0431709885597229, -0.03293042629957199, -0.04746800661087036, 0.01827237196266651, 0.02967754378914833, 0.00904080830514431, 0.07578014582395554, -0.032187484204769135, -0.00039562946767546237, -0.005652387626469135, 0.04554037004709244, 0.0005995621904730797, 0.040801603347063065, -0.0042794495820999146, 0.006395330186933279, -0.026043148711323738, 0.008674356155097485, -0.012047717347741127, 0.01568211242556572, -0.04851214215159416, 0.045701008290052414, 0.01993897184729576, 0.00827778596431017, 0.03126382827758789, -0.007524803280830383, 0.005080120638012886 ]
42,882
linearmodels.iv.model
from_formula
Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation Returns ------- IV2SLS Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IV2SLS >>> data = wage.load() >>> formula = 'np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]' >>> mod = IV2SLS.from_formula(formula, data)
@staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None ) -> IV2SLS: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation Returns ------- IV2SLS Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IV2SLS >>> data = wage.load() >>> formula = 'np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]' >>> mod = IV2SLS.from_formula(formula, data) """ parser = IVFormulaParser(formula, data) dep, exog, endog, instr = parser.data mod = IV2SLS(dep, exog, endog, instr, weights=weights) mod.formula = formula return mod
(formula: str, data: pandas.core.frame.DataFrame, *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None) -> linearmodels.iv.model.IV2SLS
[ 0.07115133106708527, -0.05663898214697838, 0.05044061318039894, -0.042423564940690994, -0.021490151062607765, -0.03756136819720268, 0.006379308644682169, -0.044724754989147186, 0.008926392532885075, 0.07037189602851868, 0.007859308272600174, -0.006513854023069143, -0.013417426496744156, 0.021397361531853676, -0.050143685191869736, 0.050737541168928146, 0.0212860144674778, -0.007613414898514748, -0.027521498501300812, 0.013371030800044537, -0.046098046004772186, 0.010262567549943924, 0.0037672717589884996, 0.07078017294406891, 0.028690651059150696, 0.0033357986249029636, -0.03594682365655899, 0.010513100773096085, 0.028375165536999702, -0.06413640826940536, -0.004917867016047239, -0.01757441647350788, -0.01360300648957491, 0.009715107269585133, 0.02917315810918808, -0.040604881942272186, 0.005896801128983498, -0.01862294226884842, -0.024997610598802567, 0.05147986114025116, 0.05578531697392464, 0.004903948400169611, 0.07853741198778152, 0.031010400503873825, -0.06502719223499298, -0.014818554744124413, -0.04865904897451401, -0.03318168595433235, 0.04914155602455139, -0.0240325964987278, 0.028338048607110977, 0.012480247765779495, 0.003231409937143326, -0.05474606901407242, -0.04520726203918457, 0.03370130807161331, 0.0013419745955616236, 0.08135822415351868, 0.08714831620454788, -0.013658680021762848, 0.034109584987163544, -0.022176796570420265, -0.014530905522406101, -0.011385326273739338, -0.016256798058748245, 0.03245792165398598, -0.007840750738978386, 0.0276142880320549, 0.005196237005293369, -0.012786454521119595, -0.058717478066682816, -0.011765765026211739, 0.006012788508087397, 0.03815522417426109, -0.011134793050587177, 0.004437678959220648, -0.0228077694773674, -0.02100764401257038, 0.01200701855123043, 0.010002756491303444, -0.022176796570420265, -0.046617668122053146, -0.025795605033636093, -0.031121747568249702, -0.0110234459862113, -0.014475231990218163, -0.003182695247232914, -0.005892161745578051, 0.025962626561522484, -0.010837865993380547, -0.08447596430778503, -0.004913227632641792, -0.040122371166944504, 0.04453917220234871, 0.009798618033528328, -0.007910342887043953, 0.01896626502275467, -0.05741841718554497, 0.021081876009702682, 0.015161877498030663, -0.009640875272452831, 0.039936792105436325, -0.03611384704709053, 0.011088398285210133, -0.03756136819720268, -0.03277340903878212, -0.031622812151908875, -0.007771158125251532, 0.051442746073007584, -0.10607746243476868, -0.05574819818139076, 0.07259885221719742, 0.007627333514392376, -0.0014231657842174172, -0.0508117750287056, 0.01029040478169918, 0.00994708202779293, 0.05133139714598656, -0.009362505748867989, -0.023123254999518394, -0.004671973641961813, -0.01621968299150467, -0.08336248993873596, 0.03815522417426109, 0.05500587821006775, -0.05396663397550583, -0.006467459257692099, -0.06836763024330139, 0.029804131016135216, -0.04142143204808235, 0.0276142880320549, -0.04695171117782593, -0.0021631657145917416, 0.044130899012088776, 0.01631247252225876, -0.02531309798359871, 0.02419961802661419, -0.012480247765779495, 0.015440247021615505, 0.05329854413866997, 0.010921376757323742, 0.01757441647350788, -0.03336726501584053, 0.012684385292232037, -0.03904600813984871, 0.05912575498223305, 0.026834852993488312, 0.05300161615014076, -0.033422939479351044, -0.015031971037387848, -0.0022884320933371782, 0.016405262053012848, 0.007232976146042347, -0.019949838519096375, 0.03878619894385338, -0.03214243799448013, -0.00013795254926662892, 0.0017780873458832502, 0.030861936509609222, -0.040604881942272186, 0.012981313280761242, 0.019782816991209984, -0.06799647212028503, 0.010652286000549793, 0.008518117479979992, 0.007093791384249926, -0.037709832191467285, -0.027298802509903908, -0.014029840007424355, 0.033942561596632004, -0.049104440957307816, -0.030954726040363312, -0.04951271414756775, 0.021675731986761093, -0.01218331977725029, 0.01111623551696539, 0.012341062538325787, 0.016785701736807823, 0.011570906266570091, 0.01055949553847313, -0.0005961753777228296, 0.015662942081689835, -0.03396112099289894, -0.0020831343717873096, -0.028004005551338196, 0.027428707107901573, -0.023141812533140182, 0.035390086472034454, -0.038897544145584106, -0.03125165402889252, 0.026463693007826805, -0.0566018670797348, 0.03481478616595268, -0.03637365996837616, -0.01166369579732418, -0.00918620452284813, 0.019690025597810745, 0.017787832766771317, -0.09590768814086914, 0.01637742482125759, 0.06409929692745209, 0.025368770584464073, 0.011645138263702393, 0.0031363002490252256, -0.0440937839448452, 0.046283625066280365, -0.05860612913966179, 0.009125891141593456, 0.002605077810585499, -0.036150962114334106, 0.026723504066467285, 0.03156713768839836, -0.02169428952038288, 0.06602932512760162, 0.007924261502921581, 0.020692158490419388, 0.001527554471977055, 0.005530280992388725, 0.025090401992201805, -0.007279371377080679, 0.05214795097708702, -0.06265176832675934, -0.0933838039636612, 0.004667334258556366, -0.01286996528506279, -0.018511593341827393, 0.014948460273444653, 0.0016261438140645623, -0.016934165731072426, 0.01629391498863697, -0.030509334057569504, -0.05199948698282242, 0.05912575498223305, -0.03989967703819275, -0.0012433852534741163, 0.02126745507121086, -0.05663898214697838, 0.04398243501782417, -0.000917460594791919, 0.021638615056872368, -0.02032099850475788, -0.00041784471250139177, -0.003994607366621494, 0.04476187005639076, -0.01535673625767231, -0.00794281903654337, 0.052296414971351624, -0.006769026629626751, -0.05834631621837616, -0.052444878965616226, 0.020265324041247368, 0.006880374625325203, -0.007172662764787674, 0.07668161392211914, 0.002465892815962434, -0.002214200096204877, 0.022288145497441292, 0.0241068284958601, 0.025498677045106888, -0.07348963618278503, -0.012322505004703999, -0.061130017042160034, -0.011682254262268543, -0.03720876947045326, -0.010930655524134636, 0.0009899527067318559, -0.04041929915547371, 0.019801374524831772, 0.06428487598896027, 0.023216044530272484, 0.029488645493984222, 0.015282504260540009, 0.019504446536302567, 0.03320024162530899, 0.027484381571412086, 0.008768649771809578, 0.022455167025327682, -0.04004814103245735, 0.01732388325035572, 0.0027836982626467943, 0.028338048607110977, 0.03687472268939018, 0.006982443388551474, -0.0007446393137797713, 0.03904600813984871, -0.001898714224807918, 0.007567020133137703, -0.039676979184150696, 0.052556224167346954, 0.01631247252225876, 0.005168399773538113, 0.03492613509297371, 0.013853538781404495, 0.05062619596719742, 0.02943297103047371, 0.06899860501289368, 0.03327447548508644, -0.007177302148193121, 0.03670770302414894, -0.0508117750287056, -0.038303688168525696, -0.0019729461055248976, 0.07441753894090652, 0.00029460806399583817, -0.06988938897848129, -0.04758268594741821, -0.008003132417798042, -0.04914155602455139, -0.004444638267159462, -0.06142694503068924, 0.02032099850475788, 0.10526091605424881, -0.013315357267856598, -0.015477363020181656, 0.013306078501045704, -0.01905905455350876, -0.03713453561067581, -0.015282504260540009, 0.08217477798461914, 0.003797428449615836, 0.0130833825096488, 0.029637109488248825, 0.054263561964035034, -0.048844628036022186, 0.00044220208656042814, 0.013992724008858204, 0.022084007039666176, -0.042868953198194504, 0.0283009335398674, 0.010327520780265331, -0.024310965090990067, 0.012229714542627335, 0.051962368190288544, -0.02496049553155899, -0.05277892202138901, -0.04828788712620735, 0.029321622103452682, 0.016962002962827682, -0.006615923251956701, 0.009557364508509636, 0.08996912837028503, -0.06554681807756424, 0.025350213050842285, -0.03730155900120735, 0.015820685774087906, -0.05574819818139076, 0.00018905951583292335, -0.029748456552624702, -0.016071218997240067, 0.0537068210542202, -0.03848927095532417, -0.048250772058963776, 0.024607893079519272, 0.004370406270027161, -0.006959246005862951, -0.04153278097510338, -0.011069840751588345, -0.000953416689299047, -0.0009864730527624488, -0.07475157827138901, -0.013881376013159752, 0.030268080532550812, -0.04528149217367172, -0.0134638212621212, 0.019523004069924355, -0.032810524106025696, 0.031511466950178146, -0.006077741272747517, 0.03464776650071144, 0.021582940593361855, -0.00806808564811945, -0.037375789135694504, 0.017054792493581772, 0.014697927050292492, 0.02136024460196495, 0.006597365252673626, -0.002670030575245619, -0.05437490716576576, -0.05474606901407242, -0.045095913112163544, -0.004221942741423845, -0.022677863016724586, 0.014002002775669098, 0.02169428952038288, 0.06213214620947838, 0.014503068290650845, -0.012229714542627335, 0.059162870049476624, 0.0386006161570549, 0.006142694503068924, -0.009622317738831043, 0.01939309947192669, 0.06254042685031891, -0.013315357267856598, -0.01956012099981308, -0.008481001481413841, 0.004648776259273291, -0.0022826327476650476, 0.006012788508087397, -0.02017253451049328, -0.024682125076651573, -0.01665579527616501, 0.01243385300040245, 0.01725892908871174, -0.06124136596918106, 0.008615546859800816, -0.007297929376363754, 0.0060452651232481, -0.028245259076356888, -0.06528700888156891, 0.020525135099887848, 0.009733665734529495, -0.027057548984885216, -0.053669705986976624, 0.009172285906970501, 0.031864065676927567, 0.08328825235366821, -0.007919621653854847, -0.031437233090400696, 0.027762752026319504, 0.026890525594353676, -0.03893466293811798, 0.04453917220234871, 0.0221211239695549, -0.006314355880022049, 0.051591210067272186, -0.020617926493287086, -0.029451528564095497, -0.01595059223473072, 0.032810524106025696, -0.050403498113155365, 0.03583547845482826, -0.004370406270027161, -0.0036721620708703995, -0.020636484026908875, -0.061909452080726624, -0.01887347549200058, 0.014085513539612293, 0.006880374625325203, 0.02744726650416851, 0.03383121266961098, -0.0003439027350395918, 0.03114030510187149, 0.03724588453769684, -0.10229163616895676, -0.0468403659760952, -0.007028838619589806, 0.01775999553501606, -0.04253491014242172, -0.07163383811712265, 0.04361127316951752, 0.026111090555787086, 0.053669705986976624, 0.02557290904223919, -0.020896295085549355, -0.005901440512388945, 0.023735668510198593, -0.04617227613925934, 0.050477731972932816, 0.02985980361700058, 0.009677991271018982, 0.01948588900268078, 0.04171836003661156, 0.01956012099981308, -0.02162005752325058, -0.001843040343374014, 0.06335697323083878, -0.05704725906252861, 0.023364508524537086, 0.012665827758610249, 0.013092661276459694, -0.009343947283923626, 0.05604512616991997, -0.027150338515639305, 0.0262409970164299, 0.02249228209257126, -0.004430720116943121, -0.04260914400219917, -0.007451032754033804, -0.0469888299703598, -0.02993403561413288, -0.016061939299106598, -0.03407246991991997, 0.056156475096940994, -0.02291911654174328, -0.01724965125322342, -0.007409277372062206, -0.037691276520490646, -0.019021939486265182, -0.04312876611948013, -0.029822688549757004, 0.08499559015035629, 0.031195979565382004, -0.0022153600584715605, 0.03938005119562149, 0.007627333514392376, 0.02874632552266121, -0.006467459257692099, 0.03878619894385338, -0.034610651433467865, -0.004507271572947502, -0.03952851518988609, -0.031864065676927567, -0.05122004821896553, 0.012665827758610249, 0.01081002876162529, -0.01732388325035572, -0.009724386036396027, -0.023865574970841408, -0.07337828725576401, -0.025869837030768394, -0.03223522752523422, -0.012303946539759636, 0.06517565995454788, 0.018474478274583817, 0.001715454156510532, -0.05003233999013901, 0.0590515211224556, -0.023049023002386093, 0.01449378952383995, 0.005474606994539499, -0.06127848103642464, -0.011218304745852947, -0.06851609796285629, 0.023550087586045265, -0.011858555488288403, -0.025610024109482765, -0.05463472008705139, 0.01878996379673481, -0.018502315506339073, -0.0019810653757303953, -0.0427204892039299, 0.01577429100871086, 0.059496913105249405, -0.042423564940690994, 0.0483621209859848, 0.03605817258358002, -0.03206820413470268, -0.056676097214221954, -0.0036512843798846006, -0.033924005925655365, 0.05251910910010338, -0.03904600813984871, -0.006240123882889748, 0.06142694503068924, 0.016099056228995323, -0.06265176832675934, 0.03327447548508644, -0.05585954710841179, -0.02076639048755169, -0.029989710077643394, 0.010856423527002335, -0.025201749056577682, -0.005154481623321772, 0.01843736134469509, -0.02564714103937149, -0.013723633252084255, 0.03312601149082184, -0.04186682403087616, -0.01629391498863697, -0.03949140012264252, -0.06536123901605606, 0.0363922156393528, -0.02169428952038288, 0.011181188747286797, 0.0329589881002903, 0.06150117516517639, -0.002760500879958272, -0.03923158720135689, -0.022844884544610977, -0.01321328803896904, -0.010819307528436184, 0.1319844126701355, 0.01981993205845356, -0.018669337034225464, 0.017695043236017227, 0.005173039622604847, -0.05960826203227043, 0.014261814765632153, -0.04947559908032417, -0.0004622099222615361, -0.014595858752727509, -0.07824048399925232, 0.007223697379231453, 0.051851022988557816, 0.018251782283186913, -0.026575040072202682, 0.08477289229631424, -0.020914854481816292, 0.062429074198007584, 0.004217302892357111, -0.000009029802640725393, -0.007919621653854847, 0.03730155900120735, -0.009956360794603825, 0.008030969649553299, 0.003753353375941515, -0.006124136503785849, 0.038637734949588776, 0.02247372455894947, -0.06985227018594742, 0.04023372009396553, -0.010179056786000729, 0.02720601297914982, 0.014605137519538403, 0.022455167025327682, 0.0296742245554924, -0.017388835549354553, 0.03596538305282593, -0.03114030510187149, 0.03826657310128212, 0.02856074459850788, 0.027076106518507004, 0.034870460629463196, 0.0026630715001374483, 0.034109584987163544, -0.01922607608139515, -0.010225452482700348, 0.031437233090400696, 0.022937674075365067, -0.0248677060008049, -0.020302440971136093, -0.000235309504205361, -0.008689778856933117, -0.048696164041757584, 0.03789541497826576, 0.028022563084959984, -0.010949213989078999, -0.05827208608388901, -0.046877481043338776, 0.014354604296386242, 0.0044608768075704575, 0.06610355526208878, 0.03750569745898247, 0.030082499608397484, 0.07538255304098129, 0.05396663397550583, 0.011784323491156101, 0.008545953780412674, 0.07564236223697662, -0.015152597799897194, -0.024348082020878792, 0.026463693007826805, 0.03346005454659462, 0.0289875790476799, -0.00047641838318668306, -0.002329027745872736, -0.030063942074775696, -0.030435102060437202, 0.03576124459505081, 0.002697867574170232, 0.006147333886474371, -0.042089518159627914, 0.014540184289216995, 0.005521001759916544, 0.002676989883184433, -0.00828150287270546, -0.10414743423461914, 0.05411509796977043, -0.031437233090400696, -0.02247372455894947, 0.02436663955450058, 0.0041778674349188805, 0.026278112083673477, 0.019003380089998245, -0.005980311892926693, 0.04212663695216179, 0.05207371711730957, 0.03062068298459053, 0.00007144101255107671, 0.020822063088417053, -0.000048932197387330234, -0.057789579033851624, 0.026575040072202682, -0.0011314573930576444, 0.008485640399158001, 0.023234602063894272, -0.03474055603146553, 0.011598743498325348, 0.01853015273809433, 0.03277340903878212, 0.010494543239474297, 0.05960826203227043, -0.09984198212623596, -0.02993403561413288, -0.015152597799897194, 0.007200499996542931, -0.003764952067285776, 0.05697302520275116, -0.07300712913274765, -0.0495869480073452, 0.01989416405558586, -0.0386006161570549, -0.015542316250503063, 0.057344187051057816, -0.08930104225873947, -0.035649895668029785, -0.01724965125322342, 0.010299683548510075, 0.011580185033380985, 0.03945428505539894, -0.0013941689394414425, 0.03706030547618866, 0.030769145116209984, 0.018493035808205605, -0.05574819818139076, 0.01021617278456688, -0.05500587821006775, 0.00320821232162416, -0.007567020133137703, 0.028709208592772484, -0.01629391498863697, 0.019244635477662086, -0.019411657005548477, 0.1127583384513855, 0.04966117814183235, -0.09820888191461563, 0.003952851518988609, -0.06803359091281891, -0.00974294450134039, 0.06974092125892639, -0.07523408532142639, 0.06836763024330139, -0.03533441200852394, -0.010308963246643543, -0.022269586101174355, -0.006550970021635294, 0.046469204127788544, 0.060350582003593445, 0.0035608140751719475, 0.0037115977611392736, 0.016535168513655663, -0.040976040065288544, -0.03312601149082184, 0.017314603552222252, -0.016433099284768105, -0.06254042685031891, -0.008425327017903328, -0.02497905306518078, 0.03294043242931366, 0.025275981053709984, 0.019671468064188957, 0.0011604542378336191, 0.030936168506741524, -0.03305177763104439, 0.043017417192459106, 0.002925202948972583, 0.0018952346872538328, 0.0469888299703598, -0.02943297103047371, 0.006356111261993647, -0.009900687262415886, 0.00875009223818779, 0.0028347328770905733, 0.04361127316951752, -0.029637109488248825, 0.06576951593160629, 0.03217955306172371, -0.02136024460196495, -0.01913328655064106, 0.03405391052365303, 0.02702043205499649, 0.08128399401903152, 0.024756357073783875, -0.0386006161570549, -0.03613240644335747, 0.005646268371492624, 0.008174793794751167 ]
42,883
linearmodels.iv.model
predict
Predict values for additional data Parameters ---------- params : array_like Model parameters (nvar by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) data : DataFrame Values to use when making predictions from a model constructed from a formula eval_env : int Depth of use when evaluating formulas. Returns ------- DataFrame Fitted values from supplied data and parameters Notes ----- The number of parameters must satisfy nvar = nexog + nendog. When using `exog` and `endog`, regressor matrix is constructed as `[exog, endog]` and so parameters must be aligned to this structure. The the the same structure used in model estimation. If `data` is not none, then `exog` and `endog` must be none. Predictions from models constructed using formulas can be computed using either `exog` and `endog`, which will treat these are arrays of values corresponding to the formula-processed data, or using `data` which will be processed using the formula used to construct the values corresponding to the original model specification.
def predict( self, params: ArrayLike, *, exog: IVDataLike | None = None, endog: IVDataLike | None = None, data: DataFrame | None = None, eval_env: int = 4, ) -> DataFrame: """ Predict values for additional data Parameters ---------- params : array_like Model parameters (nvar by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) data : DataFrame Values to use when making predictions from a model constructed from a formula eval_env : int Depth of use when evaluating formulas. Returns ------- DataFrame Fitted values from supplied data and parameters Notes ----- The number of parameters must satisfy nvar = nexog + nendog. When using `exog` and `endog`, regressor matrix is constructed as `[exog, endog]` and so parameters must be aligned to this structure. The the the same structure used in model estimation. If `data` is not none, then `exog` and `endog` must be none. Predictions from models constructed using formulas can be computed using either `exog` and `endog`, which will treat these are arrays of values corresponding to the formula-processed data, or using `data` which will be processed using the formula used to construct the values corresponding to the original model specification. """ if data is not None and not self.formula: raise ValueError( "Unable to use data when the model was not " "created using a formula." ) if data is not None and (exog is not None or endog is not None): raise ValueError( "Predictions can only be constructed using one " "of exog/endog or data, but not both." ) if exog is not None or endog is not None: exog = IVData(exog).pandas endog = IVData(endog).pandas elif data is not None: parser = IVFormulaParser(self.formula, data, eval_env=eval_env) exog = parser.exog endog = parser.endog else: raise ValueError("exog and endog or data must be provided.") assert exog is not None assert endog is not None if exog.shape[0] != endog.shape[0]: raise ValueError("exog and endog must have the same number of rows.") if (exog.index != endog.index).any(): warnings.warn( "The indices of exog and endog do not match. Predictions created " "using the index of exog.", IndexWarning, stacklevel=2, ) exog_endog = concat([exog, endog], axis=1) x = asarray(exog_endog) params = atleast_2d(asarray(params)) if params.shape[0] == 1: params = params.T pred = DataFrame(x @ params, index=exog_endog.index, columns=["predictions"]) return pred
(self, params: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, exog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, endog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, data: Optional[pandas.core.frame.DataFrame] = None, eval_env: int = 4) -> pandas.core.frame.DataFrame
[ 0.06748814135789871, -0.048336099833250046, -0.01186552457511425, -0.021527044475078583, 0.002519880188629031, -0.021679045632481575, -0.032775066792964935, -0.07489815354347229, 0.008127267472445965, 0.0013703778386116028, 0.04381409287452698, -0.004628884606063366, 0.0009054706315509975, 0.04054608568549156, -0.00032982882112264633, 0.025175053626298904, 0.012293025851249695, -0.02308504842221737, 0.010374021716415882, -0.004503009375184774, -0.018477538600564003, -0.06311812996864319, -0.07018614560365677, -0.00004987510328646749, 0.016796035692095757, -0.0038261329755187035, -0.011742024682462215, -0.005225011147558689, 0.028880059719085693, 0.01690053567290306, -0.004275009036064148, -0.10609622299671173, -0.03353507071733475, -0.0047547598369419575, 0.052972111850976944, -0.05278211086988449, -0.01970304176211357, 0.004780884832143784, -0.0075050159357488155, 0.03256606683135033, -0.018905039876699448, -0.062472131103277206, 0.02901306003332138, 0.010782522149384022, -0.06026812642812729, -0.00918651930987835, -0.03307906910777092, -0.020824043080210686, 0.04522009566426277, -0.030571063980460167, -0.007044264581054449, -0.02390204928815365, 0.0132050272077322, -0.023427048698067665, -0.037278078496456146, 0.0528201088309288, 0.004429384134709835, 0.04294009134173393, 0.02580205351114273, -0.06319413334131241, 0.03648007661104202, -0.04164808616042137, 0.01200802531093359, 0.03990008309483528, -0.0029070060700178146, 0.08854018896818161, -0.03019106388092041, -0.027702057734131813, -0.01505753118544817, -0.01861053891479969, -0.04138208553195, -0.019066540524363518, -0.010915522463619709, 0.01767953671514988, -0.027208056300878525, 0.030210062861442566, 0.001863191369920969, -0.01844903826713562, -0.012226525694131851, -0.01653953455388546, -0.048944100737571716, 0.015029031783342361, -0.043624091893434525, -0.030533064156770706, -0.024776052683591843, -0.003415257204324007, -0.062396131455898285, 0.004593259654939175, -0.012236025184392929, -0.025346053764224052, -0.016891036182641983, 0.015390031971037388, 0.022648047655820847, 0.03974808380007744, 0.08968018740415573, -0.03015306405723095, -0.017090536653995514, 0.005343761295080185, 0.013984029181301594, -0.02101404406130314, 0.008782768622040749, 0.06095212697982788, -0.023294048383831978, 0.013955528847873211, -0.021869046613574028, -0.047728098928928375, -0.04799409955739975, 0.026030054315924644, -0.0011120961280539632, -0.0795721635222435, -0.09910421073436737, 0.041268087923526764, -0.026429055258631706, -0.04271208867430687, -0.007120264694094658, 0.03433307260274887, -0.033782072365283966, 0.07166814804077148, -0.0528201088309288, 0.01739453710615635, 0.01966504193842411, 0.0546061135828495, -0.06342213600873947, -0.00008245720528066158, 0.033136069774627686, -0.027398057281970978, 0.04385209083557129, 0.03133106604218483, -0.022705048322677612, -0.1352042853832245, -0.00881601870059967, -0.02137504518032074, -0.004210883751511574, 0.024814052507281303, -0.02844305895268917, 0.027360057458281517, 0.042370088398456573, 0.01604553312063217, -0.027854058891534805, -0.027892058715224266, 0.04457409307360649, 0.016435034573078156, -0.02044404298067093, 0.017157036811113358, -0.026239054277539253, -0.0026291306130588055, 0.03328806906938553, 0.016026534140110016, 0.022952048107981682, 0.029203061014413834, 0.02112804353237152, 0.00048182913451455534, -0.012017524801194668, -0.06277613341808319, 0.033136069774627686, -0.03714507818222046, 0.0070585147477686405, 0.000019204142517992295, 0.01938953995704651, -0.007120264694094658, -0.0510341078042984, -0.050616104155778885, 0.010640022344887257, 0.010193521156907082, 0.021641045808792114, 0.06277613341808319, -0.022819047793745995, 0.019684040918946266, 0.027892058715224266, -0.0069302646443247795, 0.011913024820387363, -0.02340804971754551, 0.007514515891671181, -0.03615707531571388, -0.041268087923526764, 0.05844412371516228, 0.03543507307767868, -0.009908520616590977, -0.016929036006331444, 0.054188113659620285, 0.02109004370868206, -0.017584536224603653, -0.07269415259361267, -0.05453011393547058, -0.020064042881131172, -0.00234650494530797, -0.022097045555710793, 0.015466032549738884, -0.02173604629933834, 0.015209531411528587, -0.0009844395099207759, -0.05035010725259781, 0.015437532216310501, 0.011533023789525032, 0.001598378294147551, -0.028310058638453484, 0.05042610689997673, 0.06266213208436966, 0.0033155069686472416, 0.019855041056871414, 0.017727037891745567, -0.0042156339623034, 0.03505507484078407, -0.024814052507281303, -0.04347209259867668, 0.013404527679085732, -0.04088808596134186, -0.042560089379549026, -0.0014143154257908463, -0.04700609669089317, 0.004446009173989296, -0.0233700480312109, -0.02226804569363594, 0.023465048521757126, 0.04529609531164169, 0.08550018072128296, 0.002781130839139223, -0.00977552030235529, 0.01143802423030138, -0.018601039424538612, 0.0041206334717571735, -0.08306817710399628, -0.0024165676441043615, 0.0528201088309288, 0.06878014653921127, -0.06729814410209656, 0.028253059834241867, 0.013984029181301594, 0.044878095388412476, -0.03332607075572014, -0.013499528169631958, -0.008578518405556679, 0.007956266403198242, -0.07843216508626938, 0.06327012926340103, 0.06140812858939171, -0.02511805295944214, 0.016767535358667374, 0.0005640636663883924, 0.0546061135828495, 0.02048204280436039, 0.013889028690755367, -0.04761410132050514, 0.011780024506151676, -0.002546005416661501, -0.02084304392337799, 0.05859612300992012, 0.031711068004369736, -0.02815805934369564, -0.08094017207622528, 0.029469061642885208, 0.03990008309483528, 0.004643134772777557, 0.04172408580780029, 0.011590024456381798, 0.06042012572288513, 0.07782416045665741, 0.011694524437189102, 0.06881814450025558, -0.03940608352422714, 0.012388026341795921, -0.007120264694094658, -0.02490905299782753, 0.00048093849909491837, -0.008763768710196018, 0.017385035753250122, -0.009172269143164158, -0.0337250716984272, 0.041192084550857544, 0.013214527629315853, -0.03762007877230644, 0.09462019801139832, -0.020710043609142303, -0.017337536439299583, 0.02661905623972416, 0.0888441875576973, 0.015485032461583614, -0.0974322035908699, -0.016473034396767616, -0.0006537201115861535, 0.006669013760983944, -0.06418213248252869, 0.0035838824696838856, -0.031312067061662674, 0.009984521195292473, -0.015209531411528587, 0.002378567587584257, 0.009305269457399845, 0.10495621711015701, -0.021033044904470444, 0.014478030614554882, 0.07197215408086777, 0.02052004262804985, 0.0403180830180645, -0.003987633157521486, 0.0034888822119683027, 0.03437107056379318, 0.004821259994059801, 0.021679045632481575, -0.013452027924358845, 0.020406043156981468, 0.013034027069807053, 0.06456213444471359, -0.014316529966890812, -0.0410400852560997, -0.020748043432831764, 0.08390417695045471, -0.011704024858772755, 0.003056631423532963, -0.06513213366270065, 0.008977518416941166, 0.07797615975141525, -0.02333204820752144, -0.013528028503060341, -0.05320011079311371, -0.06927414238452911, 0.030020063742995262, -0.018316037952899933, 0.06429613381624222, -0.0006056262645870447, 0.0317680649459362, 0.02933606132864952, 0.0685141459107399, -0.08512017875909805, 0.04731009900569916, 0.018506038933992386, 0.028424059972167015, 0.008151017129421234, 0.04392809048295021, -0.013680028729140759, 0.024776052683591843, -0.04096408560872078, 0.04917210340499878, 0.04563809558749199, 0.004001883324235678, -0.037810079753398895, 0.005533761810511351, -0.0037976328749209642, 0.026201054453849792, 0.06159812957048416, -0.007695015985518694, -0.05027410387992859, -0.020900044590234756, -0.006987264845520258, 0.005576511844992638, -0.038627080619335175, 0.03471307083964348, 0.011048522777855396, 0.008203267119824886, 0.06733614206314087, -0.0667281374335289, 0.03986208513379097, 0.04628409817814827, -0.013015027157962322, -0.0031326315365731716, -0.005795012228190899, -0.028880059719085693, 0.03617607429623604, 0.020330041646957397, -0.03803807869553566, -0.024681052193045616, 0.011856025084853172, -0.027322057634592056, 0.020330041646957397, -0.007652265951037407, -0.027778057381510735, -0.0010895335581153631, 0.05236411094665527, 0.020976044237613678, 0.015133531764149666, 0.011799024417996407, -0.03636607527732849, 0.009927520528435707, 0.03847508132457733, 0.024776052683591843, 0.01503853127360344, -0.027170056477189064, -0.06790614128112793, 0.02031104266643524, -0.0172235369682312, -0.02673305571079254, -0.027892058715224266, -0.012825027108192444, -0.012511526234447956, 0.03467507287859917, 0.0063982633873820305, 0.07505016028881073, 0.022648047655820847, 0.035093072801828384, -0.026220055297017097, -0.006545513868331909, -0.0371260792016983, -0.011381023563444614, 0.017907537519931793, -0.03682207688689232, -0.002340567298233509, -0.011219523847103119, 0.006474263500422239, -0.08512017875909805, -0.011751524172723293, -0.09013618528842926, 0.030856065452098846, 0.05149010941386223, 0.002318004844710231, -0.0008686580695211887, -0.03247106820344925, -0.01143802423030138, -0.02169804461300373, -0.020653042942285538, -0.022819047793745995, -0.045372094959020615, -0.0005227979854680598, 0.000554860511329025, 0.010459521785378456, -0.026220055297017097, 0.07022414356470108, 0.02380705066025257, 0.0064790137112140656, 0.036271076649427414, 0.01503853127360344, 0.031065065413713455, -0.007072764914482832, -0.002876131096854806, 0.042484089732170105, -0.033459071069955826, 0.05327611044049263, -0.04681609943509102, -0.025631053373217583, -0.019855041056871414, -0.014516030438244343, -0.027778057381510735, -0.025365052744746208, -0.05206010863184929, 0.027968058362603188, -0.01072552241384983, -0.019152039662003517, -0.014126529917120934, -0.00528201088309288, -0.008873018436133862, 0.03368707001209259, -0.04278808832168579, -0.00902501866221428, 0.04028008505702019, 0.017366036772727966, -0.056506119668483734, -0.019399041309952736, 0.027398057281970978, 0.01259702630341053, -0.05156610906124115, -0.0681721419095993, 0.08869218826293945, 0.03250906988978386, 0.04278808832168579, 0.03467507287859917, -0.003569632535800338, -0.047462098300457, -0.014962531626224518, -0.03328806906938553, 0.02198304608464241, 0.0456760972738266, -0.02433905005455017, 0.01520003192126751, -0.014278530143201351, -0.016976535320281982, -0.024453051388263702, 0.07273215055465698, 0.04864010214805603, -0.07125014811754227, -0.040128085762262344, 0.005600261501967907, 0.0010194708593189716, -0.045486096292734146, 0.03233806788921356, -0.022819047793745995, -0.023142049089074135, 0.062472131103277206, 0.03083706460893154, -0.023826049640774727, 0.05449211224913597, -0.0335540696978569, -0.0008490642649121583, -0.007139265071600676, -0.00885876826941967, 0.05145210772752762, -0.00039543831371702254, 0.03019106388092041, 0.0068922643549740314, -0.009495269507169724, -0.01841103844344616, 0.01637803390622139, 0.024795051664114, 0.009561769664287567, 0.030020063742995262, 0.05871012434363365, 0.0026101304683834314, 0.01991204172372818, 0.06513213366270065, 0.010697022080421448, 0.0190950408577919, -0.07022414356470108, 0.032281067222356796, -0.028291059657931328, -0.00954752042889595, -0.05111010745167732, -0.015143031254410744, -0.05920412391424179, -0.03686007857322693, 0.024529051035642624, -0.050008103251457214, -0.00592326233163476, -0.044764094054698944, -0.012768026441335678, 0.02544105239212513, 0.013404527679085732, 0.005714261904358864, 0.01127652358263731, 0.03184406831860542, 0.01702403649687767, -0.020425042137503624, 0.014677531085908413, 0.0467400960624218, 0.0032110067550092936, 0.019123539328575134, -0.03589107468724251, 0.006792514119297266, 0.033421069383621216, 0.000244773953454569, 0.014288029633462429, 0.024168049916625023, 0.01731853559613228, -0.05498611554503441, -0.040812086313962936, 0.023275049403309822, 0.051186107099056244, -0.02933606132864952, -0.0264100544154644, 0.051832109689712524, -0.01448753010481596, 0.014117029495537281, 0.007695015985518694, -0.02084304392337799, 0.002752630738541484, -0.033744070678949356, -0.01966504193842411, 0.040128085762262344, -0.01673903502523899, 0.022781047970056534, 0.03971008211374283, 0.004020883236080408, -0.013518528081476688, -0.053618110716342926, -0.016245033591985703, 0.07535415887832642, 0.06764014065265656, -0.0018988164374604821, 0.018515538424253464, 0.03072306513786316, 0.05738012120127678, -0.02215404622256756, -0.013765528798103333, -0.012350025586783886, -0.02454805187880993, 0.047728098928928375, -0.04202808812260628, 0.01145702414214611, 0.05487211421132088, -0.008255517110228539, 0.008151017129421234, -0.06140812858939171, -0.021204045042395592, -0.058292120695114136, 0.03725907951593399, 0.020615043118596077, -0.00601351261138916, 0.014145529828965664, 0.017727037891745567, -0.010839522816240788, -0.02580205351114273, -0.006279513239860535, -0.03026706352829933, -0.01856303960084915, -0.004856884945183992, -0.04085008427500725, -0.025650054216384888, 0.03817107900977135, 0.014905530959367752, -0.03391507267951965, 0.09363219887018204, -0.0063982633873820305, -0.020102042704820633, -0.02454805187880993, 0.0685141459107399, -0.011162523180246353, 0.0040351334027945995, 0.044878095388412476, 0.022971048951148987, -0.04503009468317032, -0.015190531499683857, 0.00861651822924614, -0.02527005225419998, -0.04453609138727188, 0.00005288096872391179, 0.021432043984532356, -0.03382007032632828, -0.011191023513674736, -0.048906102776527405, -0.04693009704351425, 0.06266213208436966, 0.02901306003332138, -0.05232610926032066, 0.06042012572288513, 0.02226804569363594, -0.04058408364653587, -0.02251504734158516, -0.01259702630341053, 0.017138035967946053, -0.040774084627628326, 0.07790016382932663, 0.0018180663464590907, 0.03526407480239868, 0.06775414198637009, -0.020045042037963867, 0.009832520969212055, 0.01759403757750988, -0.036024075001478195, 0.009395519271492958, 0.04430809244513512, -0.054074112325906754, -0.005951762665063143, -0.0431680902838707, 0.02304704859852791, 0.03233806788921356, 0.03254706785082817, -0.0017111910274252295, 0.06304213404655457, 0.0017646286869421601, 0.06376413255929947, 0.006882764399051666, -0.016929036006331444, -0.022135047242045403, -0.02965906262397766, 0.007666516117751598, 0.009215019643306732, 0.017499037086963654, 0.021603045985102654, 0.016967035830020905, -0.0018869414925575256, -0.017660537734627724, 0.05339011177420616, -0.01881003938615322, 0.0585201233625412, -0.02137504518032074, -0.005063510499894619, -0.01600753329694271, 0.017157036811113358, 0.012958027422428131, 0.0040778834372758865, -0.0013098152121528983, 0.017727037891745567, 0.016283033415675163, -0.012872527353465557, -0.005700011737644672, 0.027170056477189064, -0.023465048521757126, 0.01893354021012783, 0.04917210340499878, -0.002010441618040204, -0.016511034220457077, 0.013499528169631958, 0.014972031116485596, -0.03784807771444321, -0.0032537567894905806, -0.02869006060063839, 0.04111608490347862, 0.039254080504179, -0.055822115391492844, -0.007205765228718519, -0.007267515175044537, -0.011172023601830006, 0.009006018750369549, 0.05491011589765549, 0.034314073622226715, 0.07326415181159973, -0.04430809244513512, 0.02661905623972416, -0.08534818142652512, 0.013233527541160583, -0.003308381885290146, 0.028633059933781624, -0.031958065927028656, -0.030134063214063644, -0.04563809558749199, 0.013224028050899506, -0.06862814724445343, 0.0321100689470768, -0.0938601940870285, -0.055936116725206375, -0.02215404622256756, -0.04693009704351425, 0.029602061957120895, -0.02730305679142475, 0.027721058577299118, 0.0007938453927636147, 0.014278530143201351, 0.02751205675303936, 0.037734080106019974, -0.04199008643627167, 0.003277506912127137, -0.03214806690812111, -0.09963621199131012, -0.004697759635746479, -0.008664018474519253, 0.03807608038187027, -0.03963408246636391, 0.07812816649675369, 0.015171531587839127, -0.003146881703287363, 0.05551811680197716, -0.078508161008358, 0.021641045808792114, 0.035454075783491135, 0.0033915070816874504, 0.056468117982149124, -0.016473034396767616, -0.019760040566325188, -0.02994406223297119, -0.030913064256310463, -0.016967035830020905, 0.054796114563941956, 0.013528028503060341, -0.015029031783342361, 0.041344087570905685, 0.010355021804571152, -0.026714056730270386, -0.06140812858939171, -0.06984414905309677, -0.04753809794783592, -0.06224413216114044, -0.00902501866221428, -0.000729126506485045, -0.009747019968926907, 0.01576053351163864, -0.007828016765415668, -0.04913410171866417, 0.02323704957962036, 0.049438104033470154, -0.0007481265929527581, -0.07812816649675369, 0.044118091464042664, -0.023351049050688744, 0.03146406635642052, 0.010488022118806839, 0.0367460772395134, -0.003294131951406598, 0.07117415219545364, 0.0513761080801487, 0.04157208651304245, 0.014212029986083508, -0.014126529917120934, -0.016729535534977913, -0.01889554038643837, 0.0005780168576166034, -0.002605380490422249, -0.005890012253075838, -0.0367460772395134, 0.004177633672952652, 0.050008103251457214, -0.002842881018295884 ]
42,884
linearmodels.iv.model
resids
Compute model residuals Parameters ---------- params : ndarray Model parameters (nvar by 1) Returns ------- ndarray Model residuals
def resids(self, params: Float64Array) -> Float64Array: """ Compute model residuals Parameters ---------- params : ndarray Model parameters (nvar by 1) Returns ------- ndarray Model residuals """ return self._y - self._x @ params
(self, params: numpy.ndarray) -> numpy.ndarray
[ 0.03856879472732544, 0.003090107813477516, 0.03143232688307762, 0.005122141446918249, 0.005941152572631836, 0.018469812348484993, -0.06286465376615524, -0.0450146347284317, 0.08195426315069199, 0.06413965672254562, 0.017982833087444305, -0.028634408488869667, 0.05305422842502594, 0.024632319808006287, -0.016017206013202667, 0.0230562761425972, -0.0309187863022089, -0.013113035820424557, -0.08110425621271133, -0.017965124920010567, -0.02302085980772972, 0.04058754816651344, 0.006020840257406235, 0.042783383280038834, -0.016548456624150276, -0.05833131819963455, 0.048450056463479996, -0.05588756501674652, -0.0260135717689991, -0.02146252430975437, -0.04979589208960533, 0.019213562831282616, -0.012776576913893223, -0.00505130784586072, -0.042252130806446075, 0.004170317202806473, 0.014095849357545376, 0.03945421054959297, -0.007490633521229029, 0.0037408897187560797, 0.005790631752461195, 0.008048446848988533, 0.03251253813505173, -0.024951070547103882, -0.01969168893992901, -0.0358240008354187, -0.005392193794250488, -0.04554588720202446, -0.027341697365045547, 0.03431878983974457, 0.014529704116284847, -0.03355732932686806, -0.006423705257475376, -0.012953660450875759, 0.04887505620718002, 0.05574589595198631, -0.013573452830314636, 0.08060842752456665, 0.028050031512975693, -0.05992506816983223, 0.06792924553155899, -0.047033388167619705, -0.0031321649439632893, 0.06084590405225754, 0.022312525659799576, -0.023587526753544807, -0.006556517910212278, 0.00008162444282788783, 0.0059190173633396626, 0.006671622395515442, -0.024366695433855057, -0.010571886785328388, 0.026881281286478043, -0.01105886697769165, 0.06017298623919487, 0.03885212913155556, -0.010138032026588917, -0.013334390707314014, -0.021533358842134476, -0.012510951608419418, 0.026226071640849113, 0.04760005325078964, 0.004675005562603474, -0.003466410329565406, -0.03338024765253067, -0.06555632501840591, -0.05925215035676956, -0.009438552893698215, -0.0026053416077047586, -0.02560628019273281, 0.008570843376219273, 0.07529591768980026, -0.014715641736984253, 0.009978657588362694, 0.043172966688871384, 0.018009396269917488, -0.007716414984315634, 0.013697411864995956, 0.026172947138547897, -0.04915839061141014, -0.0003112796403001994, 0.04660838842391968, -0.01436147466301918, 0.04515630006790161, 0.01696460321545601, 0.00866823922842741, 0.000782487855758518, -0.05386881157755852, 0.041862547397613525, 0.02626148797571659, -0.0055382875725626945, 0.08698343485593796, -0.051566727459430695, 0.023977110162377357, -0.08004175871610641, -0.017239082604646683, 0.002468101680278778, 0.024030236527323723, -0.024561487138271332, 0.05386881157755852, 0.018593771383166313, 0.049087557941675186, -0.05043338984251022, 0.0391000434756279, 0.014379182830452919, -0.019195854663848877, 0.021798983216285706, 0.038250043988227844, -0.032423995435237885, -0.06977090984582901, -0.02408336102962494, -0.02560628019273281, -0.03175107762217522, 0.005135422572493553, 0.013582306914031506, -0.016769811511039734, 0.0750834196805954, -0.004413807298988104, 0.0716480016708374, -0.042889632284641266, 0.03338024765253067, 0.14605849981307983, 0.0006529955426231027, 0.04009171202778816, 0.027607323601841927, -0.022029191255569458, 0.04915839061141014, 0.052345894277095795, 0.022595860064029694, 0.06367924064397812, 0.00062643300043419, -0.0008848643046803772, 0.055852148681879044, 0.022578150033950806, 0.0042057340033352375, -0.03453128784894943, 0.03173337131738663, -0.03662087395787239, 0.007317977026104927, -0.00820782221853733, -0.03415941447019577, -0.058968815952539444, 0.03120211884379387, -0.04140213131904602, 0.012838556431233883, 0.0012429050402715802, -0.0743042528629303, 0.011475013568997383, -0.018062520772218704, 0.002554429927840829, -0.0034332070499658585, -0.058437567204236984, -0.07784592360258102, -0.08344176411628723, 0.017752625048160553, 0.004072921350598335, -0.0018870463827624917, -0.020028147846460342, -0.0520271435379982, 0.05769381672143936, 0.07076258212327957, -0.03934796154499054, 0.018611479550600052, -0.04837922379374504, 0.012254180386662483, 0.031237535178661346, 0.002897529397159815, -0.009305739775300026, 0.0021017601247876883, -0.028315657749772072, -0.011271366849541664, 0.008854176849126816, -0.008956000208854675, 0.04721046984195709, -0.02550002932548523, -0.027129197493195534, 0.020400023087859154, 0.010633866302669048, 0.03129066154360771, -0.06743340939283371, -0.012537514790892601, 0.012227618135511875, -0.012245326302945614, 0.019319813698530197, -0.06031465157866478, 0.0029617222025990486, -0.02031148225069046, -0.031131286174058914, -0.010625012218952179, -0.03853337839245796, 0.010235428810119629, 0.03534587472677231, 0.030582327395677567, -0.023888569325208664, 0.02898857556283474, 0.04168546572327614, -0.003546097781509161, -0.014653662219643593, 0.038108378648757935, -0.04175629839301109, 0.03237086907029152, -0.07193133234977722, -0.014396891929209232, -0.02872294932603836, -0.028120866045355797, -0.029608367010951042, -0.017345331609249115, 0.04490838572382927, -0.006034121382981539, -0.019638564437627792, 0.04281879961490631, 0.006158079952001572, 0.006587507668882608, -0.08917926996946335, 0.005263808183372021, 0.03509795665740967, -0.048733390867710114, 0.05007922276854515, 0.007853655144572258, 0.015663038939237595, -0.06608757376670837, 0.010855221189558506, 0.011262512765824795, -0.014618245884776115, 0.041720882058143616, 0.006866414099931717, 0.01930210553109646, 0.068850077688694, -0.02913024090230465, -0.034991707652807236, 0.024951070547103882, -0.013538036495447159, 0.029980242252349854, 0.006020840257406235, 0.06849591434001923, -0.014706787653267384, 0.018328145146369934, 0.04048129543662071, 0.04041046276688576, 0.011997409164905548, 0.00828750990331173, 0.05471881106495857, -0.03444274887442589, -0.0033380247186869383, -0.05199172720313072, 0.01875314675271511, -0.062050070613622665, 0.06693757325410843, -0.0571625642478466, 0.02314481884241104, 0.07345425337553024, 0.010111469775438309, -0.06247507035732269, -0.03778962790966034, 0.02654482237994671, 0.018930230289697647, 0.04979589208960533, -0.024136485531926155, 0.026597946882247925, 0.0672917440533638, -0.034088581800460815, -0.03807295858860016, 0.05383339524269104, 0.008725791238248348, 0.031219827011227608, -0.021781275048851967, 0.020240647718310356, 0.008956000208854675, -0.03366358205676079, 0.002773570828139782, 0.009022406302392483, -0.016300540417432785, 0.020417731255292892, -0.0029174513183534145, 0.03793129324913025, -0.00818568654358387, -0.017690645530819893, -0.009952094405889511, 0.02781982347369194, 0.044200051575899124, -0.03221149370074272, 0.04724588617682457, 0.012280743569135666, -0.024419819936156273, -0.019496897235512733, -0.02252502553164959, 0.025128154084086418, -0.0328667052090168, 0.011696367524564266, 0.015813559293746948, 0.003067972371354699, 0.021816691383719444, 0.0018726583803072572, -0.049370888620615005, -0.016521893441677094, -0.03438962250947952, 0.05149589106440544, 0.03295524790883064, 0.059216734021902084, 0.0398792140185833, 0.04915839061141014, 0.017053144052624702, 0.0445542186498642, 0.005002609919756651, 0.01527345459908247, 0.022879192605614662, 0.01546824723482132, -0.00699037266895175, 0.005697662942111492, -0.013635432347655296, 0.034106288105249405, -0.036939624696969986, 0.0031188838183879852, -0.019125021994113922, 0.018983354791998863, -0.03221149370074272, 0.0677521601319313, 0.0030347690917551517, 0.033698998391628265, -0.002817841712385416, 0.0595000684261322, -0.05939381942152977, -0.015707310289144516, 0.012147930450737476, -0.03116670250892639, 0.03376983106136322, 0.006042975466698408, -0.002496877918019891, 0.017371894791722298, -0.03665629029273987, -0.032282330095767975, 0.04016254469752312, 0.027908366173505783, 0.043527133762836456, 0.017672937363386154, 0.05291255936026573, -0.027483364567160606, 0.05489589646458626, 0.021639607846736908, 0.0038604210130870342, -0.07480008900165558, -0.0056755272671580315, -0.04572296887636185, -0.030316701158881187, -0.0313083678483963, 0.0014675798593088984, -0.015556789003312588, -0.019975023344159126, 0.02057710662484169, -0.024897946044802666, -0.09590844064950943, -0.0070390705950558186, -0.09732510894536972, -0.008495582267642021, 0.0033889361657202244, 0.022082317620515823, -0.039914630353450775, -0.037966709583997726, 0.05723340064287186, 0.004621880128979683, -0.05461256206035614, -0.05100005865097046, 0.038108378648757935, -0.03428337350487709, 0.02418961189687252, 0.051708392798900604, 0.0014067073352634907, -0.03768337517976761, -0.016769811511039734, 0.0034066445659846067, 0.04062296450138092, -0.05574589595198631, -0.0015461606672033668, -0.009438552893698215, -0.029679201543331146, 0.014458870515227318, 0.061518821865320206, 0.05900423601269722, -0.06661882996559143, -0.018151061609387398, -0.053125061094760895, -0.03299066424369812, -0.01567189209163189, 0.014175537042319775, -0.030068784952163696, -0.040197961032390594, 0.02691669762134552, 0.01306876540184021, -0.008274228312075138, -0.028262533247470856, -0.04505005106329918, 0.017115123569965363, 0.04731672257184982, -0.015822414308786392, 0.009952094405889511, 0.04568755254149437, -0.021019816398620605, 0.0015716163907200098, 0.07416258752346039, 0.006640632636845112, 0.05220422521233559, -0.006764591205865145, 0.03793129324913025, 0.054293811321258545, 0.0008765634847804904, 0.05355006083846092, -0.001364649971947074, 0.006786726415157318, -0.023357318714261055, 0.009872406721115112, -0.03778962790966034, -0.016026059165596962, -0.021816691383719444, -0.07692509144544601, -0.009420843794941902, -0.020523982122540474, 0.004524484276771545, 0.03093649446964264, -0.05022089183330536, 0.013874495401978493, 0.05464797839522362, 0.05567506328225136, 0.039418794214725494, -0.030954202637076378, -0.01746043749153614, -0.04862713813781738, -0.01067813765257597, 0.008181259036064148, -0.1088709607720375, -0.03160941228270531, 0.06035006791353226, 0.0016424497589468956, 0.06367924064397812, -0.04437713325023651, 0.0019457053858786821, -0.016672415658831596, -0.017690645530819893, -0.03451358154416084, -0.05797715112566948, -0.07012508064508438, 0.022985443472862244, 0.007716414984315634, -0.021976066753268242, -0.013945328071713448, 0.0024415391962975264, -0.08726676553487778, -0.04933547228574753, -0.042393799871206284, 0.013431786559522152, 0.02199377492070198, 0.0021139346063137054, -0.008013029582798481, -0.017451582476496696, -0.02936045080423355, -0.0024083361495286226, 0.04136671498417854, -0.04515630006790161, 0.0029019564390182495, -0.01571616344153881, 0.0012473321985453367, -0.08868343383073807, -0.057410482317209244, -0.014662517234683037, 0.025694821029901505, 0.030600035563111305, -0.051956310868263245, -0.033079203218221664, -0.037081293761730194, -0.018576063215732574, -0.032671913504600525, 0.001999937230721116, 0.03778962790966034, -0.008229956962168217, 0.08634593337774277, -0.022719817236065865, -0.0015151710249483585, 0.021905234083533287, -0.009907823987305164, -0.01836356334388256, 0.022843776270747185, 0.03116670250892639, -0.0489104725420475, -0.006720320321619511, 0.005879173520952463, 0.015255746431648731, 0.005126568488776684, -0.030723992735147476, -0.017717208713293076, 0.00950938556343317, 0.033964622765779495, -0.058189649134874344, -0.04869797080755234, 0.0038980513345450163, 0.03917087987065315, -0.024738570675253868, -0.0002344973327126354, -0.018593771383166313, 0.027890656143426895, 0.024101069197058678, 0.037966709583997726, -0.020276064053177834, 0.019125021994113922, 0.008557561784982681, -0.020382314920425415, 0.033840663731098175, 0.029962534084916115, -0.11255429685115814, -0.08386676013469696, 0.025854196399450302, 0.06226257234811783, -0.03778962790966034, -0.07093966752290726, -0.011306784115731716, 0.004334119614213705, -0.015565643087029457, -0.010341678746044636, 0.046147968620061874, -0.12091264128684998, -0.020116690546274185, -0.011475013568997383, -0.009686469100415707, 0.042393799871206284, 0.06537923961877823, 0.028811492025852203, 0.033079203218221664, -0.0023684923071414232, 0.002817841712385416, 0.06173131987452507, -0.020878149196505547, -0.02224169299006462, -0.03495629131793976, -0.04685630276799202, -0.023498985916376114, -0.018823979422450066, 0.007840373553335667, -0.009279177524149418, 0.002198049332946539, -0.012519805692136288, -0.04175629839301109, 0.022737525403499603, 0.03885212913155556, -0.022613568231463432, 0.08840010315179825, -0.03665629029273987, -0.06796465814113617, 0.056631315499544144, 0.050787556916475296, -0.028120866045355797, -0.038356292992830276, 0.0011455090716481209, -0.03180420398712158, 0.01677866466343403, -0.004891932476311922, 0.037081293761730194, 0.005768496077507734, -0.041083380579948425, 0.06895633041858673, -0.06633549183607101, -0.04713963717222214, 0.007902353070676327, 0.0437750518321991, -0.030901076272130013, -0.04157921299338341, -0.04643130302429199, 0.024738570675253868, 0.07465841621160507, -0.022879192605614662, 0.050645891577005386, 0.003112243255600333, 0.02395940199494362, 0.0033291704021394253, 0.04002087935805321, -0.02627919614315033, 0.015786997973918915, 0.006999226752668619, 0.004856516141444445, -0.04862713813781738, 0.030476076528429985, -0.021834399551153183, 0.03515108302235603, 0.030334409326314926, -0.03828546032309532, 0.06899174302816391, 0.008278654888272285, -0.024278152734041214, -0.03531045839190483, -0.03338024765253067, 0.03169795125722885, -0.010058345273137093, 0.017504706978797913, -0.00036744834505952895, -0.062191739678382874, 0.02939586713910103, -0.03081253543496132, 0.010394803248345852, 0.03327399492263794, -0.020346898585557938, 0.05510839819908142, 0.005560423247516155, 0.0077208420261740685, 0.014724495820701122, -0.014529704116284847, 0.008278654888272285, -0.009199489839375019, -0.013626578263938427, 0.09052510559558868, -0.02149794064462185, -0.016539601609110832, 0.02627919614315033, -0.05089380964636803, -0.010598449967801571, 0.00912865623831749, 0.056206315755844116, 0.0003718754160217941, 0.07076258212327957, -0.004763547331094742, 0.036018792539834976, -0.038497962057590485, -0.008309644646942616, -0.005578131414949894, 0.021657316014170647, 0.05787089839577675, -0.06661882996559143, 0.009668760932981968, -0.026721905916929245, 0.0066450596787035465, -0.025960447266697884, -0.015769289806485176, 0.0528063103556633, 0.024278152734041214, 0.011882305145263672, 0.006290892604738474, -0.009323447942733765, 0.014715641736984253, 0.0774209201335907, 0.00022218450612854213, -0.029537534341216087, -0.015432829968631268, -0.01862918771803379, -0.016858352348208427, 0.012537514790892601, -0.004577609244734049, -0.000604297558311373, -0.03169795125722885, -0.004652869887650013, -0.027642739936709404, -0.03385837376117706, -0.021922942250967026, -0.01741616614162922, -0.010350532829761505, -0.006636205594986677, -0.011413034051656723, 0.003081253496930003, 0.025021903216838837, 0.0036811239551752806, -0.017823457717895508, -0.04292504861950874, -0.025429196655750275, 0.03157399594783783, 0.04466046765446663, -0.01799168810248375, 0.015813559293746948, 0.014184391126036644, -0.013352098874747753, 0.0540458969771862, -0.06020840257406235, -0.043527133762836456, 0.04409379884600639, -0.011165116913616657, 0.0012473321985453367, -0.043916717171669006, -0.000056203269195975736, 0.055179230868816376, -0.023463567718863487, 0.020771898329257965, -0.006622924469411373, -0.009084385819733143, 0.01903647929430008, 0.031237535178661346, 0.022843776270747185, -0.024490652605891228, -0.008198968134820461, -0.03502712398767471, 0.018983354791998863, -0.01848752051591873, 0.06796465814113617, 0.019868772476911545, -0.017965124920010567, -0.0602792352437973, -0.04012712836265564, 0.010058345273137093, -0.03817921131849289, 0.06474173814058304, -0.03378753736615181, 0.014051578938961029, 0.037081293761730194, 0.04306671768426895, -0.028970867395401, 0.016592727974057198, 0.03444274887442589, -0.0001074952378985472, 0.03554066643118858, 0.05266464501619339, 0.0278021153062582, -0.047422971576452255, 0.009801574051380157, 0.05121256038546562, -0.007937769405543804, 0.06435215473175049, 0.005936725530773401, -0.0027049509808421135, -0.026615655049681664, -0.03407087177038193, -0.031768787652254105, 0.003326956881210208, -0.004887505434453487, 0.006211204919964075, -0.020152106881141663, -0.03821462765336037, -0.011864596977829933, -0.016610436141490936, 0.009775010868906975, -0.03874587640166283, -0.05567506328225136, -0.020736481994390488, 0.03485003858804703, 0.041720882058143616, -0.007092195563018322, 0.011085429228842258, -0.09512927383184433, 0.05613547936081886, 0.019319813698530197, -0.0017188170459121466, -0.020346898585557938, 0.014724495820701122, -0.004227869212627411, 0.03593024984002113, -0.008044019341468811, -0.01770835369825363, 0.006025267299264669, -0.02174585871398449, -0.03361045569181442, -0.0030325555708259344, 0.03740004450082779, -0.0442354679107666, -0.004303129855543375, 0.02185210771858692, 0.033451080322265625 ]
42,885
linearmodels.iv.model
wresids
Compute weighted model residuals Parameters ---------- params : ndarray Model parameters (nvar by 1) Returns ------- ndarray Weighted model residuals Notes ----- Uses weighted versions of data instead of raw data. Identical to resids if all weights are unity.
def wresids(self, params: Float64Array) -> Float64Array: """ Compute weighted model residuals Parameters ---------- params : ndarray Model parameters (nvar by 1) Returns ------- ndarray Weighted model residuals Notes ----- Uses weighted versions of data instead of raw data. Identical to resids if all weights are unity. """ return self._wy - self._wx @ params
(self, params: numpy.ndarray) -> numpy.ndarray
[ 0.03696799278259277, 0.012440819293260574, 0.01610649563372135, -0.014437920413911343, 0.009682917036116123, -0.006791010033339262, -0.058719974011182785, -0.016132431104779243, 0.07116943597793579, 0.07995323091745377, 0.006510032340884209, -0.012596437707543373, 0.058201245963573456, 0.0181900504976511, -0.02915249578654766, 0.029740387573838234, -0.047757528722286224, -0.002915681805461645, -0.06888704001903534, -0.015449440106749535, -0.019175633788108826, 0.02419000118970871, 0.03676050156354904, 0.09302516281604767, -0.029584769159555435, -0.05664506554603577, -0.003959621302783489, -0.04589011147618294, -0.02704300358891487, -0.02524474821984768, -0.05142320692539215, 0.01279528345912695, 0.03306024521589279, -0.02616116590797901, -0.00970885343849659, 0.010046026669442654, 0.01998830772936344, 0.014411984011530876, -0.010737663134932518, -0.024449365213513374, 0.03603428229689598, 0.011723245494067669, 0.05612633749842644, -0.037901703268289566, -0.019331252202391624, 0.0007175733335316181, 0.017697259783744812, -0.030829716473817825, 0.0031469480600208044, 0.03245506435632706, 0.046892981976270676, 0.014584893360733986, -0.0045734490267932415, -0.004033107776194811, 0.05111197009682655, 0.024968093261122704, -0.047757528722286224, 0.033630844205617905, 0.049037057906389236, -0.07967657595872879, 0.05284105986356735, -0.051630694419145584, 0.03214382752776146, 0.02685280330479145, 0.006695909891277552, -0.029048750177025795, -0.007015792187303305, 0.0031296571251004934, 0.002710352186113596, 0.01674625836312771, 0.003345793578773737, -0.018224632367491722, 0.0032182729337364435, 0.003393343649804592, -0.011688663624227047, 0.03759046643972397, 0.00785872433334589, -0.042985234409570694, -0.019867271184921265, -0.004958172328770161, 0.06684670597314835, 0.052184004336595535, 0.0028530023992061615, -0.0014826966216787696, 0.00008105119923129678, -0.05515804514288902, -0.08285810053348541, 0.00820454303175211, 0.003494927892461419, -0.06560175865888596, -0.015146848745644093, 0.08590130507946014, 0.021060343831777573, -0.007521551568061113, 0.06791874766349792, -0.0020457322243601084, -0.03449539095163345, -0.008835661225020885, 0.011766472831368446, -0.017593514174222946, -0.022028636187314987, 0.011325554922223091, -0.016331275925040245, 0.042639415711164474, 0.009043152444064617, -0.012855801731348038, -0.0038277781568467617, -0.06670837849378586, -0.00351221882738173, 0.005485545378178358, 0.006060468498617411, 0.02311796322464943, -0.03534264490008354, 0.00521321315318346, -0.04222443327307701, 0.0055114817805588245, -0.01713530533015728, 0.03473746404051781, 0.019849980250000954, 0.07711751759052277, 0.01697104051709175, 0.018864396959543228, -0.028910422697663307, 0.0038277781568467617, 0.018950851634144783, -0.02296234667301178, 0.0082866745069623, 0.00507920840755105, 0.0014102909481152892, -0.010046026669442654, -0.03318127989768982, -0.007214637473225594, -0.05374018847942352, -0.0014708091039210558, 0.01888168789446354, 0.001234139665029943, 0.060137830674648285, 0.009544589556753635, 0.08555548638105392, -0.030432024970650673, 0.03776337578892708, 0.12152060866355896, 0.017705904319882393, 0.07400514930486679, 0.003892618929967284, -0.01676354929804802, 0.021648235619068146, 0.05073156952857971, 0.02932540513575077, 0.03793628513813019, -0.01324484683573246, -0.014852902851998806, 0.02474331110715866, 0.03942330554127693, -0.010564753785729408, -0.033285025507211685, 0.021665526553988457, -0.010997027158737183, 0.008226156234741211, -0.009181479923427105, -0.011420655064284801, -0.05277189612388611, 0.01924479752779007, -0.03387291729450226, -0.009432198479771614, 0.0324377715587616, -0.042985234409570694, 0.013063292019069195, 0.01607191376388073, 0.010262162424623966, 0.02474331110715866, -0.038212940096855164, -0.051838185638189316, -0.05311771482229233, 0.007837111130356789, 0.013115164823830128, -0.009328452870249748, -0.04699672758579254, -0.05581510066986084, 0.057820845395326614, 0.06781499832868576, -0.03907748684287071, -0.002386147389188409, -0.01659063994884491, 0.0020478935912251472, 0.007577747106552124, 0.00928522553294897, 0.010167062282562256, 0.01235436461865902, -0.008511456660926342, 0.003481959691271186, -0.019832689315080643, -0.01924479752779007, 0.030656807124614716, -0.009959571994841099, 0.00486307218670845, 0.05954993888735771, -0.017014268785715103, -0.008658429607748985, -0.059584520757198334, 0.005403413437306881, -0.021579071879386902, -0.010616626590490341, 0.02704300358891487, -0.03411499038338661, -0.01465405710041523, -0.0072665102779865265, -0.046547163277864456, -0.015605057589709759, -0.03963079676032066, 0.04208610579371452, 0.044264763593673706, 0.03349251672625542, -0.009579171426594257, 0.03409770131111145, 0.020368706434965134, -0.05384393408894539, -0.008541716262698174, 0.02809775061905384, -0.05173444002866745, -0.020783688873052597, -0.01678948663175106, -0.015172785148024559, -0.008736238814890385, -0.027803804725408554, -0.03672591969370842, -0.0019409061642363667, 0.04129072278738022, 0.0033371481113135815, 0.019901853054761887, 0.03848959505558014, 0.01218145526945591, 0.03421873599290848, -0.06805707514286041, -0.003871005494147539, 0.0032658230047672987, -0.08500217646360397, 0.032558806240558624, 0.04135988652706146, 0.00045712877181358635, -0.042812325060367584, -0.014377402141690254, 0.018760651350021362, -0.0028054523281753063, 0.03318127989768982, -0.007071987725794315, 0.028460858389735222, 0.05664506554603577, -0.0035965119022876024, -0.019711652770638466, 0.03356168046593666, -0.007491292431950569, 0.003652707440778613, 0.010391844436526299, 0.04627050831913948, 0.021855726838111877, 0.007711751852184534, 0.0241727102547884, -0.028547313064336777, -0.026714475825428963, 0.014221783727407455, 0.06764209270477295, -0.015293821692466736, 0.014005647972226143, -0.03721006587147713, 0.0071152145974338055, -0.03421873599290848, 0.05612633749842644, -0.07310602068901062, 0.04357312619686127, 0.03126198798418045, 0.010063317604362965, -0.009665626101195812, -0.029066041111946106, -0.017178531736135483, -0.0360688641667366, 0.07365933060646057, 0.014982584863901138, 0.0040158168412745, 0.05892746523022652, -0.06439139693975449, -0.010815472342073917, 0.055884264409542084, 0.012821219861507416, 0.027994005009531975, -0.0194522887468338, 0.02700842171907425, 0.023360036313533783, -0.03108908049762249, -0.002396954223513603, 0.006691587157547474, -0.007798206061124802, 0.001602652482688427, -0.021492617204785347, 0.005303990561515093, -0.024259164929389954, -0.010097899474203587, -0.03020724281668663, 0.06612049043178558, 0.0631464496254921, -0.029550187289714813, 0.04364228993654251, 0.022166963666677475, 0.0071022468619048595, -0.007020114921033382, -0.0011379588395357132, 0.02982684224843979, -0.05896204710006714, -0.005757877137511969, 0.007205992005765438, -0.02208050899207592, -0.007880338467657566, 0.003274468472227454, -0.023913346230983734, 0.010893281549215317, -0.07116943597793579, 0.047584619373083115, 0.040702831000089645, 0.02631678432226181, 0.08707708865404129, 0.05277189612388611, 0.007154119201004505, 0.047757528722286224, -0.01573473960161209, -0.022288000211119652, -0.011446591466665268, 0.02208050899207592, -0.016841359436511993, 0.02946373261511326, -0.03873166814446449, -0.006069113966077566, -0.02119867131114006, 0.028875840827822685, -0.03866250440478325, -0.00472906744107604, 0.0018187889363616705, 0.07504260540008545, 0.012241973541676998, 0.013616601936519146, -0.02524474821984768, 0.06660463660955429, -0.02967122383415699, -0.0010001718765124679, 0.03741755709052086, -0.03236860781908035, 0.018968142569065094, 0.026040129363536835, 0.01218145526945591, 0.01412668451666832, -0.0241727102547884, 0.005416381638497114, 0.04447225481271744, 0.0079538244754076, 0.05035116896033287, 0.028305241838097572, 0.021423453465104103, -0.027094876393675804, 0.06169401481747627, 0.008433647453784943, 0.01798255927860737, -0.09924989938735962, 0.014887484721839428, -0.022720273584127426, 0.020247671753168106, -0.023705855011940002, -0.005109467543661594, 0.03440893813967705, -0.026455111801624298, -0.03176342695951462, -0.026731766760349274, -0.06636255979537964, -0.029238950461149216, -0.10831034183502197, -0.007806851528584957, 0.014948002994060516, 0.03497953712940216, -0.038973741233348846, -0.041913196444511414, 0.04561345651745796, -0.01750705949962139, -0.05208025872707367, -0.025815347209572792, 0.038074612617492676, -0.010971090756356716, 0.057820845395326614, 0.024432074278593063, -0.007798206061124802, -0.04146363213658333, -0.055365536361932755, -0.0011660566087812185, 0.01640908606350422, -0.020230380818247795, -0.014360111206769943, 0.02915249578654766, -0.03325044363737106, 0.03485850244760513, 0.04049534350633621, 0.02616116590797901, -0.0689907819032669, 0.004361635539680719, -0.024241873994469643, -0.07746333628892899, -0.06072572246193886, 0.024483947083353996, -0.05965368449687958, -0.013659829273819923, -0.005403413437306881, 0.03918123245239258, -0.015648284927010536, -0.039665378630161285, -0.07158441841602325, 0.03589595481753349, -0.007672847248613834, -0.009449489414691925, 0.019210215657949448, 0.02809775061905384, 0.01263966504484415, -0.005913495551794767, 0.058028336614370346, 0.029930587857961655, 0.06812623888254166, -0.020092053338885307, 0.09862742573022842, 0.065048448741436, 0.017368732020258904, 0.017386022955179214, 0.0229969285428524, -0.023360036313533783, -0.0005187276983633637, 0.03866250440478325, -0.043538544327020645, -0.03176342695951462, -0.02439749240875244, -0.0778091549873352, 0.019901853054761887, -0.025313911959528923, 0.008606556802988052, 0.04879498481750488, -0.05813208222389221, 0.007819820195436478, 0.04523305594921112, 0.021838435903191566, 0.005974013824015856, -0.026887385174632072, -0.01799985021352768, -0.0599995031952858, -0.02242632769048214, 0.004966817796230316, -0.1069270670413971, -0.014818320982158184, 0.049555785953998566, 0.007971115410327911, 0.057647936046123505, -0.033129408955574036, -0.015406212769448757, 0.00623337784782052, -0.0098817627876997, -0.03783253952860832, -0.029792260378599167, -0.09731331467628479, 0.05699088051915169, -0.010192998684942722, 0.00031745052547194064, -0.018501287326216698, -0.010002799332141876, -0.06124445050954819, -0.06459888815879822, -0.08783788979053497, 0.0377979576587677, 0.0374867208302021, 0.058201245963573456, 0.022754855453968048, 0.003940169233828783, -0.04578636586666107, 0.03817835822701454, 0.0392158143222332, -0.09018945693969727, -0.011705954559147358, 0.013478274457156658, -0.02083556167781353, -0.0738668218255043, -0.009432198479771614, 0.00675642816349864, 0.01519007608294487, -0.010374553501605988, -0.0892903283238411, -0.05017825961112976, -0.03159051761031151, 0.02016121707856655, -0.01694510504603386, 0.027682768180966377, 0.06044906750321388, 0.017178531736135483, 0.057993754744529724, -0.0494520403444767, 0.03146947920322418, 0.019677070900797844, -0.001953874249011278, -0.006384673528373241, 0.04665090888738632, 0.04118697717785835, -0.0508698970079422, 0.00013420727918855846, 0.00623337784782052, -0.013616601936519146, -0.020195798948407173, -0.02310067228972912, -0.016478249803185463, 0.035048700869083405, 0.007037405855953693, -0.0406336672604084, -0.0412561409175396, -0.013383174315094948, 0.03357897326350212, -0.012138227932155132, -0.01511226687580347, -0.03165968134999275, 0.0593770295381546, 0.020731816068291664, 0.008550361730158329, -0.0039380076341331005, 0.004746358375996351, 0.003084268420934677, 0.005822718143463135, 0.03219569846987724, -0.008606556802988052, -0.11349762231111526, -0.08306559175252914, 0.03335418924689293, 0.09247185289859772, -0.02033412456512451, -0.026420529931783676, -0.021458035334944725, -0.021492617204785347, 0.009207416325807571, -0.03731381148099899, 0.031037207692861557, -0.09461592882871628, -0.030604934319853783, -0.01085005421191454, -0.005524449981749058, -0.0007051454740576446, 0.07725584506988525, -0.024483947083353996, 0.05294480547308922, 0.028996877372264862, -0.01662522181868553, 0.04454141855239868, -0.03568846359848976, -0.04384978115558624, -0.05982659384608269, -0.059964921325445175, -0.030656807124614716, 0.023360036313533783, 0.040875740349292755, -0.027336949482560158, 0.019365834072232246, -0.009241998195648193, -0.05602259188890457, 0.04644341766834259, 0.02351565472781658, -0.06802248954772949, 0.06584383547306061, -0.013253492303192616, -0.059964921325445175, 0.029014168307185173, 0.044437672942876816, -0.031504061073064804, -0.0631464496254921, 0.011169936507940292, -0.03886999562382698, 0.04571720212697983, 0.0318152979016304, 0.027423404157161713, -0.010547462850809097, -0.05128487944602966, 0.03886999562382698, -0.04716963693499565, -0.017239050939679146, -0.03191904351115227, 0.04592469334602356, -0.0010617707157507539, -0.01782694086432457, -0.03582679107785225, 0.053428951650857925, 0.028149623423814774, -0.0014600022695958614, 0.041947778314352036, -0.02206321805715561, 0.03655301034450531, 0.017541641369462013, 0.011161291040480137, -0.0034754755906760693, 0.01553589478135109, 0.03641468286514282, -0.00018911946972366422, -0.06321561336517334, 0.02806316874921322, 0.018432123586535454, 0.05190734937787056, 0.03389021009206772, -0.03299108147621155, 0.06452972441911697, 0.0181900504976511, -0.012873091734945774, -0.014420629478991032, -0.006371705327183008, 0.02986142411828041, -0.003970428369939327, -0.007919242605566978, 0.007971115410327911, -0.04398810863494873, 0.027319658547639847, -0.03485850244760513, 0.019175633788108826, 0.025867220014333725, -0.04308898001909256, 0.01473186630755663, 0.020939307287335396, -0.032040081918239594, 0.00945813488215208, -0.03001704253256321, 0.009164188988506794, -0.02296234667301178, 0.0042751808650791645, 0.06134819611907005, -0.0014200170990079641, 0.025711603462696075, 0.02439749240875244, -0.039665378630161285, -0.0033004048746079206, -0.006384673528373241, 0.08880618214607239, -0.008502811193466187, 0.027648186311125755, 0.07414347678422928, 0.012864446267485619, -0.05986117571592331, -0.011204518377780914, -0.0009320888202637434, 0.06484096497297287, 0.08223562687635422, -0.01695374958217144, -0.022875891998410225, -0.02351565472781658, 0.009665626101195812, 0.007703106384724379, -0.03404582664370537, -0.0197635255753994, 0.015942230820655823, -0.03596511855721474, -0.04257025197148323, -0.009812599048018456, -0.009778017178177834, 0.0733826756477356, 0.020524324849247932, -0.017014268785715103, -0.03658759221434593, -0.014463856816291809, -0.029550187289714813, -0.01492206659168005, -0.005373154301196337, 0.020939307287335396, -0.04167112335562706, -0.004214662592858076, -0.006224732380360365, -0.029221659526228905, -0.03651842847466469, 0.011593563482165337, -0.06885245442390442, -0.0005792459123767912, -0.0025136680342257023, -0.004919267725199461, 0.0075518107041716576, -0.024414783343672752, 0.018968142569065094, -0.05111197009682655, -0.022028636187314987, 0.028184205293655396, 0.009812599048018456, -0.005303990561515093, 0.010763599537312984, 0.007210314739495516, -0.02067994326353073, 0.081889808177948, -0.05356727913022041, -0.09060443937778473, 0.03689882904291153, 0.005403413437306881, 0.01412668451666832, -0.03759046643972397, -0.02541765756905079, 0.021630944684147835, -0.0000273716668743873, 0.033112116158008575, -0.0451984740793705, 0.020403288304805756, 0.028374405577778816, 0.05740586295723915, 0.01111806370317936, -0.022720273584127426, 0.0033695686142891645, -0.008446616120636463, -0.019711652770638466, 0.0060042729601264, 0.02648969367146492, 0.025849929079413414, -0.01324484683573246, -0.017213113605976105, -0.029100622981786728, -0.02948102355003357, -0.009259289130568504, 0.03696799278259277, -0.02277214638888836, -0.004331376403570175, 0.025192875415086746, 0.007893306203186512, -0.004469703417271376, 0.0176799688488245, 0.008243447169661522, -0.014118039049208164, 0.04340021684765816, 0.003069138852879405, -0.0010666338494047523, -0.052529823035001755, 0.012968191877007484, 0.0339420810341835, -0.010192998684942722, 0.04395352676510811, 0.01660793088376522, 0.0038515531923621893, -0.06380350887775421, -0.03219569846987724, -0.01959061622619629, 0.06238564848899841, 0.03918123245239258, 0.014766448177397251, -0.003345793578773737, -0.0494520403444767, 0.0032398866023868322, -0.039146650582551956, 0.041740287095308304, -0.058166664093732834, -0.04820709303021431, -0.024293746799230576, 0.015423503704369068, 0.07116943597793579, -0.007478324230760336, 0.042812325060367584, -0.0778091549873352, 0.08417221158742905, 0.0024639565963298082, -0.008066215552389622, -0.050247423350811005, 0.03017266094684601, 0.02877209521830082, 0.03091617114841938, -0.04751545563340187, -0.03176342695951462, -0.009596462361514568, -0.001528085325844586, -0.01235436461865902, -0.005001399666070938, 0.05581510066986084, -0.05706004425883293, 0.020437870174646378, 0.023567527532577515, 0.03321586176753044 ]
42,886
linearmodels.system.model
IV3SLS
Three-stage Least Squares (3SLS) Estimator Parameters ---------- equations : dict Dictionary-like structure containing dependent, exogenous, endogenous and instrumental variables. Each key is an equations label and must be a string. Each value must be either a tuple of the form (dependent, exog, endog, instrument[, weights]) or a dictionary with keys "dependent", and at least one of "exog" or "endog" and "instruments". When using a tuple, values must be provided for all 4 variables, although either empty arrays or `None` can be passed if a category of variable is not included in a model. The dictionary may contain optional keys for "exog", "endog", "instruments", and "weights". "exog" can be omitted if all variables in an equation are endogenous. Alternatively, "exog" can contain either an empty array or `None` to indicate that an equation contains no exogenous regressors. Similarly "endog" and "instruments" can either be omitted or may contain an empty array (or `None`) if all variables in an equation are exogenous. sigma : array_like Prespecified residual covariance to use in GLS estimation. If not provided, FGLS is implemented based on an estimate of sigma. Notes ----- Estimates a set of regressions which are seemingly unrelated in the sense that separate estimation would lead to consistent parameter estimates. Each equation is of the form .. math:: y_{i,k} = x_{i,k}\beta_i + \epsilon_{i,k} where k denotes the equation and i denoted the observation index. By stacking vertically arrays of dependent and placing the exogenous variables into a block diagonal array, the entire system can be compactly expressed as .. math:: Y = X\beta + \epsilon where .. math:: Y = \left[\begin{array}{x}Y_1 \\ Y_2 \\ \vdots \\ Y_K\end{array}\right] and .. math:: X = \left[\begin{array}{cccc} X_1 & 0 & \ldots & 0 \\ 0 & X_2 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & X_K \end{array}\right] The system instrumental variable (IV) estimator is .. math:: \hat{\beta}_{IV} & = (X'Z(Z'Z)^{-1}Z'X)^{-1}X'Z(Z'Z)^{-1}Z'Y \\ & = (\hat{X}'\hat{X})^{-1}\hat{X}'Y where :math:`\hat{X} = Z(Z'Z)^{-1}Z'X` and. When certain conditions are satisfied, a GLS estimator of the form .. math:: \hat{\beta}_{3SLS} = (\hat{X}'\Omega^{-1}\hat{X})^{-1}\hat{X}'\Omega^{-1}Y can improve accuracy of coefficient estimates where .. math:: \Omega = \Sigma \otimes I_N where :math:`\Sigma` is the covariance matrix of the residuals.
class IV3SLS(_LSSystemModelBase): r""" Three-stage Least Squares (3SLS) Estimator Parameters ---------- equations : dict Dictionary-like structure containing dependent, exogenous, endogenous and instrumental variables. Each key is an equations label and must be a string. Each value must be either a tuple of the form (dependent, exog, endog, instrument[, weights]) or a dictionary with keys "dependent", and at least one of "exog" or "endog" and "instruments". When using a tuple, values must be provided for all 4 variables, although either empty arrays or `None` can be passed if a category of variable is not included in a model. The dictionary may contain optional keys for "exog", "endog", "instruments", and "weights". "exog" can be omitted if all variables in an equation are endogenous. Alternatively, "exog" can contain either an empty array or `None` to indicate that an equation contains no exogenous regressors. Similarly "endog" and "instruments" can either be omitted or may contain an empty array (or `None`) if all variables in an equation are exogenous. sigma : array_like Prespecified residual covariance to use in GLS estimation. If not provided, FGLS is implemented based on an estimate of sigma. Notes ----- Estimates a set of regressions which are seemingly unrelated in the sense that separate estimation would lead to consistent parameter estimates. Each equation is of the form .. math:: y_{i,k} = x_{i,k}\beta_i + \epsilon_{i,k} where k denotes the equation and i denoted the observation index. By stacking vertically arrays of dependent and placing the exogenous variables into a block diagonal array, the entire system can be compactly expressed as .. math:: Y = X\beta + \epsilon where .. math:: Y = \left[\begin{array}{x}Y_1 \\ Y_2 \\ \vdots \\ Y_K\end{array}\right] and .. math:: X = \left[\begin{array}{cccc} X_1 & 0 & \ldots & 0 \\ 0 & X_2 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & X_K \end{array}\right] The system instrumental variable (IV) estimator is .. math:: \hat{\beta}_{IV} & = (X'Z(Z'Z)^{-1}Z'X)^{-1}X'Z(Z'Z)^{-1}Z'Y \\ & = (\hat{X}'\hat{X})^{-1}\hat{X}'Y where :math:`\hat{X} = Z(Z'Z)^{-1}Z'X` and. When certain conditions are satisfied, a GLS estimator of the form .. math:: \hat{\beta}_{3SLS} = (\hat{X}'\Omega^{-1}\hat{X})^{-1}\hat{X}'\Omega^{-1}Y can improve accuracy of coefficient estimates where .. math:: \Omega = \Sigma \otimes I_N where :math:`\Sigma` is the covariance matrix of the residuals. """ def __init__( self, equations: Mapping[ str, Mapping[str, ArrayLike | None] | Sequence[ArrayLike | None] ], *, sigma: ArrayLike | None = None, ) -> None: super().__init__(equations, sigma=sigma) @classmethod def multivariate_iv( cls, dependent: ArrayLike, exog: ArrayLike | None = None, endog: ArrayLike | None = None, instruments: ArrayLike | None = None, ) -> IV3SLS: """ Interface for specification of multivariate IV models Parameters ---------- dependent : array_like nobs by ndep array of dependent variables exog : array_like nobs by nexog array of exogenous regressors common to all models endog : array_like nobs by nendog array of endogenous regressors common to all models instruments : array_like nobs by ninstr array of instruments to use in all equations Returns ------- model : IV3SLS Model instance Notes ----- At least one of exog or endog must be provided. Utility function to simplify the construction of multivariate IV models which all use the same regressors and instruments. Constructs the dictionary of equations from the variables using the common exogenous, endogenous and instrumental variables. """ equations = {} dependent_ivd = IVData(dependent, var_name="dependent") if exog is None and endog is None: raise ValueError("At least one of exog or endog must be provided") exog_ivd = IVData(exog, var_name="exog") endog_ivd = IVData(endog, var_name="endog", nobs=dependent.shape[0]) instr_ivd = IVData(instruments, var_name="instruments", nobs=dependent.shape[0]) for col in dependent_ivd.pandas: equations[str(col)] = { # TODO: Bug in pandas-stubs # https://github.com/pandas-dev/pandas-stubs/issues/97 "dependent": dependent_ivd.pandas[[col]], "exog": exog_ivd.pandas, "endog": endog_ivd.pandas, "instruments": instr_ivd.pandas, } return cls(equations) @classmethod def from_formula( cls, formula: str | dict[str, str], data: DataFrame, *, sigma: ArrayLike | None = None, weights: Mapping[str, ArrayLike] | None = None, ) -> IV3SLS: """ Specify a 3SLS using the formula interface Parameters ---------- formula : {str, dict-like} Either a string or a dictionary of strings where each value in the dictionary represents a single equation. See Notes for a description of the accepted syntax data : DataFrame Frame containing named variables sigma : array_like Prespecified residual covariance to use in GLS estimation. If not provided, FGLS is implemented based on an estimate of sigma. weights : dict-like Dictionary like object (e.g. a DataFrame) containing variable weights. Each entry must have the same number of observations as data. If an equation label is not a key weights, the weights will be set to unity Returns ------- model : IV3SLS Model instance Notes ----- Models can be specified in one of two ways. The first uses curly braces to encapsulate equations. The second uses a dictionary where each key is an equation name. Examples -------- The simplest format uses standard formulas for each equation in a dictionary. Best practice is to use an Ordered Dictionary >>> import pandas as pd >>> import numpy as np >>> cols = ["y1", "x1_1", "x1_2", "z1", "y2", "x2_1", "x2_2", "z2"] >>> data = pd.DataFrame(np.random.randn(500, 8), columns=cols) >>> from linearmodels.system import IV3SLS >>> formula = {"eq1": "y1 ~ 1 + x1_1 + [x1_2 ~ z1]", ... "eq2": "y2 ~ 1 + x2_1 + [x2_2 ~ z2]"} >>> mod = IV3SLS.from_formula(formula, data) The second format uses curly braces {} to surround distinct equations >>> formula = "{y1 ~ 1 + x1_1 + [x1_2 ~ z1]} {y2 ~ 1 + x2_1 + [x2_2 ~ z2]}" >>> mod = IV3SLS.from_formula(formula, data) It is also possible to include equation labels when using curly braces >>> formula = "{eq1: y1 ~ x1_1 + [x1_2 ~ z1]} {eq2: y2 ~ 1 + [x2_2 ~ z2]}" >>> mod = IV3SLS.from_formula(formula, data) """ context = capture_context(1) parser = SystemFormulaParser(formula, data, weights, context=context) eqns = parser.data mod = cls(eqns, sigma=sigma) mod.formula = formula return mod
(equations: 'Mapping[str, Mapping[str, ArrayLike | None] | Sequence[ArrayLike | None]]', *, sigma: 'ArrayLike | None' = None) -> 'None'
[ 0.05146122723817825, -0.07536841183900833, 0.003353083971887827, 0.010910185985267162, -0.01171046867966652, -0.02224583737552166, -0.06580553948879242, -0.08193276077508926, 0.017049064859747887, 0.030349968001246452, 0.00020940946706105024, -0.022347139194607735, -0.04501844570040703, 0.02781742811203003, -0.061388786882162094, 0.05194747820496559, 0.005758997518569231, -0.038292016834020615, 0.022387661039829254, -0.05174487456679344, -0.04672031104564667, 0.00627563614398241, -0.00454337801784277, 0.06965500116348267, 0.058511823415756226, -0.00703539839014411, 0.0006527623627334833, -0.0023856533225625753, 0.04485636204481125, -0.0413513258099556, -0.05441923439502716, 0.005647565703839064, -0.04392438754439354, -0.015489019453525543, -0.009795867837965488, -0.07249144464731216, 0.03217339888215065, -0.019976681098341942, -0.010104837827384472, 0.047854889184236526, 0.04595042020082474, -0.003882385091856122, 0.09716852754354477, -0.01707945577800274, -0.058552343398332596, 0.01386819314211607, -0.020412279292941093, 0.011983983218669891, 0.0418173149228096, -0.0339968279004097, 0.02648024633526802, -0.029174869880080223, 0.023279115557670593, -0.04011544585227966, -0.059605877846479416, 0.012004243209958076, 0.0012858975678682327, 0.04659875109791756, 0.039021387696266174, -0.036509107798337936, 0.0339968279004097, 0.005900819785892963, -0.013250253163278103, 0.029377473518252373, -0.050083525478839874, 0.015114203095436096, -0.005039756186306477, 0.04106768220663071, -0.013858063146471977, 0.0024641621857881546, -0.05433819442987442, -0.03217339888215065, 0.008256083354353905, -0.00045680702896788716, 0.024899940937757492, 0.02615608088672161, -0.03697509691119194, -0.022792866453528404, -0.016826201230287552, 0.0011060872348025441, -0.004824490286409855, -0.028161853551864624, -0.037603165954351425, -0.03610390052199364, -0.008078805170953274, -0.011052007786929607, 0.00017680300516076386, 0.004262266214936972, 0.05129914730787277, -0.006012251600623131, -0.06868250668048859, 0.007192415650933981, -0.008534662425518036, 0.06479252129793167, 0.048503220081329346, -0.009917429648339748, 0.02741222083568573, -0.09862726926803589, 0.024474473670125008, -0.02753378264605999, 0.024454213678836823, 0.006513694766908884, -0.02607503905892372, 0.007678663823753595, -0.058998070657253265, -0.04461323842406273, -0.06503564864397049, -0.012277757748961449, 0.05178539454936981, -0.06422523409128189, -0.05445975810289383, 0.07415279746055603, -0.02720961719751358, 0.002732611494138837, -0.047935932874679565, 0.005910950247198343, -0.039953362196683884, 0.07488216459751129, -0.012115675024688244, -0.00684292521327734, -0.04274928942322731, 0.007384888827800751, -0.08031193166971207, 0.09036105126142502, 0.03537452965974808, -0.04323553666472435, -0.008149716071784496, -0.005546264350414276, 0.01768726482987404, -0.06552189588546753, 0.012034634128212929, -0.04380282387137413, -0.0001905736862681806, -0.0003415764367673546, 0.023562759160995483, 0.0017841749358922243, 0.004697863012552261, -0.030228406190872192, 0.00484475027769804, 0.07200519740581512, 0.023623540997505188, 0.038656704127788544, -0.060294732451438904, 0.014749517664313316, -0.048300616443157196, 0.04291136935353279, 0.06604866683483124, -0.03347006067633629, -0.07281561195850372, -0.03379422426223755, -0.0036417937371879816, 0.019520824775099754, 0.013331294991075993, -0.014911600388586521, -0.0045231180265545845, -0.011497735045850277, 0.010064316913485527, -0.04242512211203575, 0.0315655879676342, -0.01805195026099682, -0.0532846562564373, -0.0074102142825722694, -0.03338901698589325, 0.032355740666389465, 0.008823372423648834, -0.0088183069601655, -0.06276649236679077, -0.047247081995010376, -0.04412699118256569, 0.04360022023320198, -0.04139184579253197, -0.0027098185382783413, -0.0937647894024849, 0.004518052563071251, -0.0309577789157629, 0.02793898992240429, 0.01643112488090992, -0.011548385955393314, 0.017231406643986702, 0.0019563876558095217, 0.025143064558506012, -0.015316806733608246, -0.049394674599170685, 0.019723428413271904, -0.049394674599170685, -0.004857413005083799, -0.02297521010041237, 0.010206139646470547, -0.0011966255260631442, -0.010044056922197342, 0.006402262952178717, -0.049759361892938614, 0.032315220683813095, 0.004705460742115974, 0.0037684207782149315, 0.031585849821567535, 0.04108794033527374, -0.0014220216544345021, -0.032598864287137985, 0.002166588557884097, 0.020412279292941093, -0.002467961050570011, 0.019075097516179085, -0.01958160474896431, -0.07565205544233322, -0.01800129935145378, -0.03071465529501438, -0.06580553948879242, -0.012186585925519466, 0.00627563614398241, -0.02127334289252758, 0.03322693333029747, -0.01570175215601921, 0.0651572123169899, 0.04416751116514206, 0.02358301915228367, 0.04582885652780533, 0.021982453763484955, 0.014212618581950665, -0.01755557209253311, 0.05377090722322464, -0.061145663261413574, -0.07844798266887665, 0.011072268709540367, -0.0426277257502079, -0.024778379127383232, 0.029580077156424522, 0.061591390520334244, -0.004680135287344456, 0.007866071537137032, 0.026824671775102615, 0.002124801743775606, 0.048867907375097275, -0.038980867713689804, 0.00627563614398241, 0.0036063380539417267, -0.05539173260331154, 0.02648024633526802, 0.017251668497920036, -0.020614881068468094, 0.0012903294991701841, -0.012581662274897099, -0.012571532279253006, 0.030451269820332527, -0.004006479401141405, 0.00845868606120348, 0.05271736904978752, 0.033044591546058655, -0.06203711777925491, -0.05158279091119766, 0.05275788903236389, 0.011902941390872002, -0.010545499622821808, 0.0685204267501831, -0.03363214060664177, -0.038940347731113434, 0.06511668860912323, 0.04380282387137413, 0.0540950708091259, -0.06495460867881775, -0.02566983364522457, -0.030268928036093712, -0.01102161779999733, 0.04165523126721382, -0.010464458726346493, 0.03644832596182823, 0.0014258204028010368, 0.0009724956471472979, 0.05644526705145836, 0.029904240742325783, 0.06317169964313507, 0.06382002681493759, -0.029721898958086967, 0.024737859144806862, 0.024940460920333862, 0.020807355642318726, -0.01703893393278122, -0.02232687920331955, -0.004396490752696991, 0.015225634910166264, 0.036509107798337936, 0.006078097969293594, -0.013432595878839493, -0.0029757353477180004, 0.059119630604982376, -0.008717005141079426, -0.05133966729044914, -0.09117146581411362, 0.06296909600496292, 0.0004894135054200888, -0.003358148969709873, -0.001095957006327808, 0.01808234117925167, -0.001068099052645266, 0.04518052563071251, 0.02676389180123806, -0.03460463881492615, 0.037238478660583496, 0.06560293585062027, -0.012166325934231281, -0.017049064859747887, 0.04351918026804924, 0.09635811299085617, -0.0070505933836102486, -0.0532846562564373, -0.05117758363485336, 0.02054397016763687, -0.030248666182160378, -0.008671419695019722, -0.034908540546894073, 0.009370400570333004, 0.08136547356843948, -0.015245895832777023, -0.009152602404356003, 0.01986525021493435, 0.008732200600206852, -0.024332651868462563, -0.007942047901451588, 0.05660735070705414, 0.0017487193690612912, 0.01986525021493435, -0.02382614277303219, 0.015873964875936508, -0.02648024633526802, 0.04761176556348801, -0.024535255506634712, 0.0470849983394146, -0.04631510749459267, 0.006680842489004135, -0.024555515497922897, -0.0021020087879151106, -0.008200366981327534, 0.014638085849583149, 0.004477532114833593, -0.0034771785140037537, -0.06766948848962784, 0.014769777655601501, 0.015063552185893059, 0.059970565140247345, 0.0034822435118258, 0.08549857884645462, -0.03415891155600548, -0.04607198014855385, -0.014972381293773651, -0.028810184448957443, -0.08075766265392303, 0.05061029642820358, -0.059686921536922455, -0.032153137028217316, 0.058795467019081116, -0.06244232505559921, -0.019713297486305237, 0.04534260928630829, 0.02923564985394478, -0.013979624956846237, -0.016653988510370255, -0.01946004293859005, -0.03742082417011261, 0.03132246434688568, -0.03338901698589325, 0.024474473670125008, 0.0069138361141085625, -0.05640474706888199, 0.0115686459466815, 0.01529654674232006, -0.06600814312696457, 0.05198799818754196, -0.020007072016596794, 0.05587797984480858, -0.006640322040766478, -0.000027600737666944042, -0.061024103313684464, 0.024433953687548637, 0.02257000282406807, 0.003902645315974951, 0.008043349720537663, -0.008929738774895668, -0.016329823061823845, -0.032355740666389465, -0.07779965549707413, 0.03539479151368141, -0.03245704248547554, 0.013554158620536327, 0.009091821499168873, 0.08047401905059814, 0.008306733332574368, 0.02810107171535492, 0.039993882179260254, 0.06175347417593002, 0.000887022411916405, 0.03403734788298607, 0.002372990595176816, 0.08002828806638718, -0.0190548375248909, -0.016046177595853806, 0.015894226729869843, -0.008747396059334278, 0.00884363241493702, -0.0071974811144173145, -0.009294424206018448, -0.07196468114852905, -0.01787973754107952, 0.04307345300912857, 0.003512633964419365, -0.026054779067635536, -0.032760947942733765, 0.02712857723236084, 0.04615302383899689, -0.016562815755605698, -0.0005245524807833135, -0.006847990211099386, 0.018700281158089638, -0.059970565140247345, -0.07528737187385559, -0.019267570227384567, 0.009608459658920765, 0.05040769279003143, 0.00646810932084918, 0.0009231111034750938, 0.06118618696928024, 0.028242895379662514, 0.00579445343464613, 0.04201991483569145, 0.014273399487137794, -0.0109608368948102, 0.05433819442987442, -0.07362602651119232, -0.0026211796794086695, -0.0007983834948390722, 0.0368332713842392, -0.022995470091700554, 0.02911408804357052, -0.01081901416182518, -0.015093943104147911, -0.03628624603152275, -0.03180871158838272, -0.02046293020248413, 0.010206139646470547, -0.013594678603112698, 0.019885510206222534, 0.0565263107419014, 0.015772663056850433, -0.006696037948131561, 0.01007444690912962, -0.05770140886306763, 0.003125155344605446, -0.014455743134021759, 0.024899940937757492, -0.020047591999173164, -0.014627955853939056, 0.025041762739419937, 0.03505036607384682, 0.020159024745225906, 0.024859420955181122, -0.0023755233269184828, -0.01626904122531414, 0.06531929224729538, -0.03111986070871353, -0.0014904002891853452, 0.0115686459466815, -0.058511823415756226, -0.009471702389419079, 0.05397350713610649, 0.03282172977924347, -0.020209675654768944, 0.015306676737964153, 0.0348680205643177, -0.06535981595516205, -0.012389189563691616, -0.009162732400000095, -0.032153137028217316, 0.03124142251908779, 0.03539479151368141, -0.005374051630496979, -0.027270399034023285, 0.016005657613277435, -0.004181224852800369, -0.04611250385642052, -0.03245704248547554, -0.05198799818754196, 0.012490491382777691, -0.032355740666389465, -0.006062902510166168, 0.04518052563071251, 0.013311034068465233, 0.013837803155183792, 0.03464515879750252, -0.037684205919504166, 0.018598979339003563, -0.05604006350040436, -0.07630039006471634, 0.03705613687634468, 0.05535121262073517, 0.058309219777584076, 0.0017981039127334952, 0.006584606133401394, -0.00497644254937768, -0.03436151146888733, 0.018821842968463898, -0.01889275386929512, 0.01808234117925167, -0.006675777491182089, -0.01152812596410513, -0.038859304040670395, 0.0532846562564373, 0.0018715476617217064, -0.021901411935687065, -0.00672136340290308, -0.000081357873568777, -0.04189835488796234, -0.049394674599170685, -0.049516238272190094, 0.0692092776298523, -0.00900064967572689, -0.015245895832777023, -0.000845868606120348, -0.019794339314103127, 0.04684187471866608, -0.01293621864169836, 0.06912823021411896, 0.03505036607384682, -0.05344673991203308, -0.007167090196162462, -0.038778264075517654, 0.04619354382157326, 0.020077982917428017, -0.0192574393004179, -0.06175347417593002, 0.04242512211203575, 0.003682314185425639, -0.006599801126867533, -0.04566677659749985, -0.003039048984646797, 0.07346393913030624, -0.037278998643159866, 0.024393431842327118, 0.05259580537676811, -0.028202373534440994, -0.03209235519170761, -0.03367266058921814, -0.02265104465186596, 0.03505036607384682, -0.010849405080080032, -0.00273514399304986, 0.04558573290705681, -0.03606338053941727, -0.034179169684648514, 0.010535369627177715, -0.049192070960998535, 0.021009957417845726, -0.024494733661413193, 0.01132552232593298, 0.02188115194439888, -0.028040291741490364, 0.06608918309211731, -0.02745274268090725, 0.006290831137448549, 0.05182591453194618, -0.023319635540246964, 0.01051510963588953, -0.002742741722613573, -0.007835681550204754, 0.02281312644481659, -0.05198799818754196, 0.024292131885886192, 0.006437718868255615, 0.04720655828714371, -0.005713412072509527, -0.007673598360270262, 0.009213383309543133, -0.007430474739521742, -0.008109195157885551, 0.09190084040164948, 0.029883980751037598, -0.04291136935353279, -0.01844702661037445, -0.013331294991075993, -0.023765362799167633, -0.02175959013402462, -0.04189835488796234, 0.0196626465767622, -0.009258968755602837, -0.060051605105400085, -0.024737859144806862, 0.06292857229709625, -0.0010421405313536525, -0.007374758832156658, 0.0893075168132782, -0.03847435861825943, 0.060294732451438904, -0.007901526987552643, 0.02546723000705242, -0.02175959013402462, 0.02611556090414524, 0.0064579788595438, 0.04518052563071251, -0.0072582620196044445, -0.006554215680807829, 0.020321106538176537, -0.012784265913069248, -0.07771860808134079, 0.039710238575935364, -0.005708347074687481, 0.02720961719751358, 0.01828494481742382, 0.0065035647712647915, 0.015174984000623226, -0.009481832385063171, -0.004429413937032223, -0.03553661331534386, 0.048260096460580826, -0.0005581086734309793, -0.0037025746423751116, 0.014161967672407627, -0.0027554044499993324, 0.006746688392013311, -0.027999769896268845, 0.058309219777584076, 0.05397350713610649, -0.00950715783983469, -0.00875752605497837, 0.005054951179772615, -0.029661117121577263, 0.0009066495695151389, -0.04420803114771843, 0.026378944516181946, 0.029802938923239708, -0.029417993500828743, -0.010535369627177715, -0.0704248920083046, 0.0368940532207489, 0.01844702661037445, 0.06669699400663376, 0.011011486873030663, 0.032396260648965836, 0.0225294828414917, 0.02631816454231739, 0.033895526081323624, -0.01401001587510109, 0.037278998643159866, -0.023279115557670593, -0.0020298315212130547, -0.005870429333299398, 0.024089528247714043, 0.03355110064148903, 0.019966552034020424, -0.007313977926969528, -0.011052007786929607, 0.04230356216430664, 0.031869493424892426, -0.010332765989005566, -0.008646094240248203, -0.05296049267053604, -0.04554521292448044, -0.03606338053941727, -0.0023793219588696957, -0.011720598675310612, -0.05547277256846428, 0.058268699795007706, -0.02220531739294529, -0.02546723000705242, 0.025406448170542717, 0.0019323285669088364, 0.015722014009952545, 0.05579693987965584, 0.002479357412084937, 0.05478392168879509, 0.024292131885886192, 0.05373038351535797, 0.048827387392520905, -0.0009516021818853915, -0.060456812381744385, 0.014516524039208889, 0.020766833797097206, -0.019206788390874863, -0.002712351270020008, 0.038535140454769135, -0.004257201217114925, 0.008225692436099052, -0.008139586076140404, 0.020847875624895096, 0.029377473518252373, 0.010626541450619698, -0.048867907375097275, -0.016329823061823845, -0.07245092839002609, -0.011426824145019054, 0.00801295880228281, 0.03249756246805191, -0.0647520050406456, -0.05344673991203308, 0.03531374782323837, -0.0068834456615149975, -0.030289188027381897, 0.03265964612364769, -0.10486745089292526, 0.006311091594398022, -0.0059767961502075195, 0.00410778122022748, -0.0007781231543049216, 0.033409278839826584, -0.020280586555600166, -0.028891224414110184, 0.03484776243567467, 0.010266920551657677, 0.047773849219083786, -0.017869608476758003, -0.05016456916928291, -0.016481775790452957, -0.07342342287302017, 0.010525239631533623, -0.015326936729252338, 0.05405455082654953, -0.009998470544815063, 0.09311646223068237, 0.04518052563071251, -0.014577304944396019, 0.024677077308297157, -0.024555515497922897, 0.0086005087941885, 0.04542365297675133, 0.0041179112158715725, 0.03624572232365608, -0.033328235149383545, -0.050002485513687134, -0.009497027844190598, -0.009552744217216969, 0.04570729658007622, 0.0737881064414978, 0.050043005496263504, 0.0016752757364884019, 0.04214147850871086, -0.027878208085894585, -0.0422225184738636, 0.0034822435118258, -0.05527016893029213, -0.047449685633182526, -0.03217339888215065, -0.047976452857255936, 0.02232687920331955, 0.019551215693354607, -0.010596150532364845, -0.03201131522655487, -0.034908540546894073, -0.016005657613277435, 0.047733329236507416, 0.012531011365354061, 0.03577973693609238, 0.03184923157095909, -0.032112617045640945, 0.04364074394106865, -0.0030466464813798666, 0.007962307892739773, 0.005520938895642757, 0.05129914730787277, -0.006326287053525448, 0.061105143278837204, 0.002034896519035101, 0.005171448457986116, -0.02571035362780094, -0.011274871416389942, -0.04736864194273949, 0.09773581475019455, 0.03596207872033119, 0.000464088108856231, -0.01772778481245041, -0.028972266241908073, 0.017383359372615814 ]
42,887
linearmodels.system.model
__init__
null
def __init__( self, equations: Mapping[ str, Mapping[str, ArrayLike | None] | Sequence[ArrayLike | None] ], *, sigma: ArrayLike | None = None, ) -> None: super().__init__(equations, sigma=sigma)
(self, equations: collections.abc.Mapping[str, collections.abc.Mapping[str, typing.Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType]] | collections.abc.Sequence[typing.Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType]]], *, sigma: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None) -> NoneType
[ 0.07070969045162201, -0.04274400696158409, 0.048471491783857346, -0.014610390178859234, -0.08287175744771957, 0.000022269408873398788, -0.07756853103637695, -0.06692672520875931, 0.046067364513874054, 0.026763617992401123, -0.009457421489059925, 0.02409432642161846, -0.036875102669000626, 0.0340467169880867, -0.025508521124720573, -0.01625438965857029, 0.053916141390800476, 0.01713826134800911, 0.008772420696914196, 0.021513422951102257, -0.03203149139881134, 0.010659486055374146, 0.012621680274605751, 0.062083110213279724, 0.01374419592320919, 0.05999717116355896, 0.014592712745070457, -0.03125368431210518, 0.01854361593723297, -0.05285549536347389, -0.02282155305147171, 0.0006374920485541224, -0.013152002356946468, 0.014972777105867863, 0.04924929887056351, -0.08159898221492767, 0.01430103462189436, 0.0365569107234478, -0.061093173921108246, 0.06756310909986496, 0.05837085098028183, -0.028796521946787834, 0.024235745891928673, -0.022149810567498207, -0.010350131429731846, -0.005002710502594709, -0.016192520037293434, 0.004896645899862051, -0.017217809334397316, 0.007875291630625725, 0.01840219646692276, -0.040658071637153625, 0.04878968745470047, -0.025384780019521713, -0.057557687163352966, 0.10556957125663757, 0.036132652312517166, 0.058689042925834656, 0.03881962224841118, -0.01474297046661377, -0.0001600635441718623, 0.03445329889655113, -0.010226389393210411, -0.05395149439573288, -0.015414712950587273, 0.004914323333650827, -0.026268649846315384, 0.005904259160161018, 0.03420581296086311, 0.02004619687795639, 0.002256080973893404, -0.011737808585166931, -0.06848233938217163, -0.008259776048362255, 0.04295613616704941, 0.043557170778512955, -0.09156905114650726, 0.011260517872869968, 0.016351616010069847, -0.027028778567910194, -0.02004619687795639, -0.024359488859772682, -0.057946592569351196, 0.0033874360378831625, 0.006363872438669205, -0.014168454334139824, 0.03634478151798248, 0.023263487964868546, 0.025402456521987915, 0.006390388123691082, -0.08923563361167908, 0.007870872505009174, -0.007954840548336506, 0.04076413810253143, 0.013629293069243431, 0.048224009573459625, 0.03252645954489708, -0.10281188786029816, 0.021637165918946266, -0.001116439700126648, 0.06696207821369171, -0.003853678237646818, 0.033463362604379654, -0.022538714110851288, -0.0378296859562397, -0.013691163621842861, 0.009050840511918068, -0.05847691372036934, 0.040658071637153625, -0.001477169687859714, -0.03553162142634392, 0.09340750426054001, -0.04101162031292915, 0.05624955892562866, -0.05596671998500824, 0.04122374951839447, -0.01628090627491474, 0.019639616832137108, 0.029326844960451126, 0.030970845371484756, -0.01662561669945717, 0.05441110581159592, -0.05108775198459625, 0.06522969156503677, 0.05356259271502495, 0.05052207410335541, 0.009978905320167542, 0.011251679621636868, 0.011278195306658745, -0.05260800942778587, 0.053138334304094315, -0.022485680878162384, 0.00749964639544487, 0.025649940595030785, 0.019957810640335083, 0.02054116502404213, 0.02800103835761547, -0.05582530051469803, -0.008542614988982677, 0.05784052610397339, 0.01153451856225729, -0.012975228019058704, 0.00844538863748312, -0.03878426551818848, -0.060456786304712296, 0.03931458666920662, 0.04656233265995979, -0.015688713639974594, -0.006421323865652084, -0.0037454040721058846, -0.02446555346250534, 0.06657317280769348, -0.019445165991783142, 0.022538714110851288, -0.021283617243170738, -0.01524677686393261, 0.07474014163017273, -0.025296391919255257, 0.05875975266098976, 0.022379618138074875, -0.025154972448945045, -0.010244066826999187, -0.022839229553937912, -0.04564310610294342, -0.03365781158208847, -0.02724090777337551, 0.00858238898217678, -0.07785136997699738, 0.009209937416017056, -0.0027576780412346125, -0.04189549386501312, -0.08633653074502945, -0.07954840362071991, 0.02874348871409893, 0.08591227233409882, 0.029468264430761337, -0.008166969753801823, 0.07215923815965652, -0.014725293032824993, -0.03369316831231117, 0.047729041427373886, -0.004702194593846798, -0.06370943039655685, 0.006929549854248762, 0.008295130915939808, 0.014141938649117947, -0.033074457198381424, 0.008317227475345135, -0.009413227438926697, 0.004182920325547457, 0.004008355550467968, -0.011119099333882332, 0.006876517552882433, 0.008206743746995926, 0.04578452557325363, 0.028814198449254036, 0.01866735890507698, -0.009351356886327267, -0.05154736340045929, 0.03896104171872139, -0.038536783307790756, -0.008326065726578236, -0.005944033619016409, 0.002947710221633315, -0.019445165991783142, 0.018225422129034996, 0.010182195343077183, -0.026038844138383865, -0.026162585243582726, -0.025437811389565468, 0.009271807968616486, -0.04652697592973709, 0.016466518864035606, -0.048966459929943085, 0.03551394119858742, -0.00484803318977356, 0.055789947509765625, -0.0072433240711688995, -0.024730714038014412, -0.01505232509225607, 0.13017654418945312, -0.029538974165916443, 0.020611874759197235, -0.00900222733616829, -0.014804841950535774, 0.026286328211426735, 0.03487755358219147, 0.016696326434612274, -0.03645084425806999, 0.02117755264043808, -0.013258066959679127, -0.00032565128640271723, -0.03166026249527931, -0.0819525346159935, 0.0019544600509107113, -0.021531101316213608, -0.002117976313456893, -0.050628140568733215, 0.010641808621585369, -0.012975228019058704, 0.016360454261302948, 0.008105098269879818, -0.027170198038220406, -0.001897008391097188, -0.0013998309150338173, -0.03319820016622543, 0.037228651344776154, 0.04550168663263321, -0.04680981487035751, -0.017217809334397316, 0.008286291733384132, -0.019621938467025757, -0.001279403455555439, 0.04270865395665169, 0.019356777891516685, 0.045678459107875824, 0.0327562652528286, 0.04313291236758232, 0.05458788201212883, -0.05950220674276352, 0.0182961318641901, -0.0378296859562397, -0.015140712261199951, 0.023758456110954285, -0.006231291685253382, 0.03899639472365379, -0.015909681096673012, -0.0022936456371098757, -0.011057227849960327, 0.008878485299646854, 0.06791666150093079, 0.0806090459227562, 0.025384780019521713, -0.005555130075663328, 0.018967874348163605, 0.02494284324347973, 0.04118839651346207, 0.016537228599190712, 0.0014175083488225937, 0.03984491154551506, 0.04171871766448021, -0.041648007929325104, 0.003935436252504587, -0.0011125728487968445, 0.03604426607489586, -0.014504325576126575, -0.011508001945912838, 0.010906970128417015, 0.04514813795685768, -0.047587621957063675, 0.020488133653998375, 0.051476653665304184, 0.017421100288629532, 0.028160134330391884, 0.024518584832549095, -0.05522426962852478, 0.009881678968667984, 0.053880784660577774, 0.02117755264043808, -0.030033940449357033, 0.03166026249527931, -0.02623329497873783, 0.1097414419054985, 0.025756005197763443, -0.028584392741322517, -0.04716336354613304, 0.02812477946281433, 0.01424800232052803, 0.041153039783239365, 0.012604002840816975, 0.010915808379650116, 0.09178117662668228, -0.056178849190473557, 0.00025452725822106004, -0.0012805083533748984, 0.05016852542757988, 0.006730678956955671, -0.013770712539553642, 0.011428453959524632, 0.07410375773906708, 0.030794071033596992, -0.03843071684241295, -0.019745681434869766, -0.05681523680686951, -0.0232988428324461, -0.0022196213249117136, 0.019091617316007614, -0.0554717518389225, 0.04475923627614975, 0.0013998309150338173, 0.002393081085756421, -0.01725316420197487, 0.017863035202026367, -0.019091617316007614, -0.03666297346353531, -0.04967355728149414, 0.00078056869097054, -0.005369517020881176, -0.038501426577568054, -0.057946592569351196, 0.006191517226397991, -0.05091097950935364, -0.033445682376623154, -0.006054517347365618, 0.011066067032516003, -0.04313291236758232, -0.026056520640850067, -0.08216466009616852, 0.005015968810766935, -0.0070223561488091946, -0.009846324101090431, 0.008560292422771454, 0.026427747681736946, -0.016422325745224953, 0.02481910213828087, 0.007769227493554354, -0.01916232705116272, 0.01462806761264801, -0.03959742560982704, -0.006125227082520723, 0.06130530312657356, -0.010005421005189419, -0.046314846724271774, -0.019957810640335083, 0.03708723187446594, -0.039243876934051514, 0.024129681289196014, 0.012162066996097565, 0.04726943001151085, 0.024182714521884918, 0.02409432642161846, -0.05115846171975136, -0.07756853103637695, 0.0264807790517807, 0.0025897424202412367, 0.028920263051986694, -0.05271407589316368, 0.003036097390577197, -0.04698659107089043, -0.06830555945634842, -0.018349165096879005, -0.038890331983566284, 0.03455936163663864, 0.00869287271052599, -0.06066891551017761, 0.000015838901163078845, 0.00674393679946661, 0.05458788201212883, 0.06225988268852234, 0.045961298048496246, -0.004971775226294994, -0.05875975266098976, 0.04012775048613548, -0.00589542044326663, -0.049461428076028824, 0.008560292422771454, 0.010500389151275158, -0.00734496908262372, -0.061588142067193985, 0.014460131525993347, -0.026374714449048042, -0.0440874919295311, -0.002775355475023389, 0.045430976897478104, 0.026887360960245132, -0.07410375773906708, -0.00969606637954712, 0.018844133242964745, 0.05886581912636757, 0.041046977043151855, 0.009024323895573616, -0.043168265372514725, 0.013399486429989338, -0.025367101654410362, -0.04182478412985802, -0.03600890934467316, 0.002901307074353099, -0.06349730491638184, 0.009218775667250156, -0.017863035202026367, 0.06059820577502251, 0.004118839744478464, 0.02280387468636036, 0.017845358699560165, 0.061446722596883774, 0.03051123209297657, -0.024165036156773567, -0.06484078615903854, -0.0000572099415876437, 0.024165036156773567, -0.054658591747283936, -0.01103955041617155, -0.024129681289196014, -0.02255639061331749, 0.019604261964559555, -0.022715488448739052, -0.01664329320192337, -0.017376907169818878, 0.023723101243376732, -0.012710067443549633, 0.03160723298788071, 0.02508426271378994, 0.04765833169221878, -0.03768826648592949, -0.018985552713274956, 0.0017622180748730898, 0.027453036978840828, 0.03477149084210396, 0.010853937827050686, -0.03666297346353531, 0.03984491154551506, -0.02015226148068905, 0.012745421379804611, -0.007305195089429617, 0.04854220151901245, -0.004746388178318739, -0.008591227233409882, -0.06834091991186142, -0.011198647320270538, 0.03187239170074463, -0.02939755469560623, -0.04348646104335785, 0.010023098438978195, 0.006416904274374247, -0.05221910774707794, 0.05115846171975136, 0.03302142396569252, -0.022856907919049263, -0.024377165362238884, -0.044052138924598694, 0.016546066850423813, 0.04391071945428848, 0.0006032420787960291, -0.04528955742716789, -0.059184011071920395, -0.004604968708008528, 0.005612581968307495, -0.03125368431210518, -0.015282131731510162, -0.036132652312517166, -0.026056520640850067, -0.007234485354274511, 0.006315259262919426, 0.01728851906955242, 0.01273658312857151, -0.007605710998177528, 0.009634195826947689, -0.06604284793138504, 0.022874584421515465, 0.02671058662235737, -0.0756593719124794, 0.052006978541612625, 0.04189549386501312, 0.02937987633049488, 0.008343743160367012, 0.022485680878162384, -0.001172234071418643, 0.009466259740293026, 0.024995876476168633, -0.020222971215844154, -0.035248782485723495, -0.016546066850423813, -0.04528955742716789, -0.0220791008323431, 0.029804134741425514, -0.010694840922951698, -0.06073962524533272, -0.004189549013972282, -0.010358969680964947, -0.010553421452641487, -0.0416126549243927, -0.05769910663366318, -0.015458906069397926, 0.005484420340508223, 0.022414973005652428, -0.02043510042130947, -0.05320904403924942, 0.0003353186184540391, -0.007230065762996674, 0.01713826134800911, 0.04210761934518814, 0.02331652119755745, -0.013832583092153072, -0.007764807902276516, 0.030475877225399017, -0.016166003420948982, 0.03793574869632721, -0.055294979363679886, 0.0416126549243927, -0.011861550621688366, 0.018702713772654533, -0.08039692044258118, -0.04263794422149658, 0.08916492015123367, -0.043026845902204514, 0.1020340844988823, 0.08753859996795654, -0.020629553124308586, 0.008361420594155788, 0.040410589426755905, -0.010420841164886951, 0.047587621957063675, 0.05483536422252655, -0.00689861411228776, 0.055648528039455414, 0.0028062909841537476, -0.03793574869632721, 0.036875102669000626, 0.02306903712451458, -0.024165036156773567, -0.03715794160962105, 0.003995097707957029, 0.035743750631809235, 0.028831876814365387, 0.019604261964559555, -0.042920783162117004, -0.02195535972714424, -0.021230584010481834, -0.011393099091947079, 0.024925166741013527, 0.03369316831231117, 0.021531101316213608, 0.04861291125416756, 0.005771678406745195, -0.013726518489420414, 0.021531101316213608, -0.02195535972714424, 0.02686968259513378, -0.013850260525941849, 0.03558465093374252, -0.013169679790735245, -0.01715593971312046, 0.049107879400253296, 0.02911471575498581, -0.007473130710422993, -0.000514854968059808, -0.0017390165012329817, 0.005608162377029657, -0.0719471126794815, -0.07268956303596497, -0.01412426121532917, -0.0018483955645933747, -0.09241756796836853, -0.021495746448636055, 0.0592193678021431, 0.0009148066164925694, -0.0643104612827301, 0.03362245857715607, -0.021018454805016518, 0.02382916584610939, -0.0017489599995315075, -0.0021433874499052763, -0.011870389804244041, 0.040021684020757675, -0.04726943001151085, 0.008281872607767582, -0.028690457344055176, -0.04751691222190857, -0.01505232509225607, -0.052006978541612625, -0.08916492015123367, 0.025685295462608337, -0.03487755358219147, 0.033710844814777374, 0.008529356680810452, -0.008860807865858078, 0.049461428076028824, 0.041294459253549576, -0.005144129972904921, -0.021707875654101372, 0.014928583987057209, 0.007504065986722708, 0.006827904377132654, 0.010120324790477753, 0.00529880728572607, -0.0403752326965332, -0.04762297868728638, 0.05685059353709221, 0.04175407439470291, -0.009961227886378765, -0.02368774637579918, 0.0007302985177375376, -0.02860206924378872, 0.003919968381524086, -0.04479458928108215, 0.014769487082958221, 0.047835107892751694, -0.06484078615903854, 0.0025786941405385733, -0.04741084948182106, 0.07078040391206741, -0.004635903984308243, 0.03388762101531029, -0.051618073135614395, -0.014981616288423538, 0.011817357502877712, 0.0007673106156289577, 0.010518066585063934, -0.04171871766448021, 0.07742711156606674, -0.05575459077954292, -0.041789427399635315, 0.011048389598727226, 0.03878426551818848, -0.00548883993178606, 0.005484420340508223, -0.040163103491067886, -0.00788854993879795, -0.0006949437083676457, 0.02798335999250412, 0.0019931294955313206, 0.013399486429989338, -0.01750064827501774, 0.016466518864035606, 0.012073679827153683, -0.008719388395547867, -0.02280387468636036, -0.054764654487371445, 0.026569167152047157, -0.004666839726269245, -0.014707615599036217, -0.017606712877750397, -0.03942065313458443, 0.0021687988191843033, 0.042178329080343246, -0.04804723337292671, 0.015123034827411175, -0.015503100119531155, 0.022485680878162384, 0.062472011893987656, 0.008516098372638226, -0.029538974165916443, -0.010385486297309399, -0.058052655309438705, -0.016227874904870987, 0.02683432772755623, 0.02055884338915348, 0.00839235633611679, 0.060456786304712296, -0.03494826331734657, 0.025685295462608337, -0.0010960001964122057, 0.028778843581676483, -0.013664647936820984, -0.042284395545721054, -0.031819362193346024, -0.024925166741013527, 0.041789427399635315, 0.019993165507912636, -0.008688453584909439, 0.02142503671348095, -0.06187098100781441, 0.04182478412985802, -0.03376387804746628, 0.0020306939259171486, -0.004556355532258749, -0.026940392330288887, -0.058441560715436935, 0.0479411706328392, -0.020824003964662552, 0.05649704486131668, 0.04221368581056595, -0.048825040459632874, 0.04338039457798004, -0.028177812695503235, 0.012913357466459274, -0.009227614849805832, 0.013479035347700119, 0.04719872027635574, -0.003595145884901285, 0.02711716666817665, 0.0016959276981651783, 0.05370401218533516, -0.05890117213129997, 0.02671058662235737, 0.03438258916139603, 0.07375020533800125, 0.07664930820465088, -0.024606972932815552, -0.023157423362135887, 0.00939555000513792, -0.015936195850372314, 0.04295613616704941, -0.005590484943240881, 0.00030742143280804157, 0.003789597423747182, -0.040905557572841644, -0.039137814193964005, 0.01689077727496624, 0.0034824523609131575, -0.00564351724460721, 0.05398684740066528, -0.005935194902122021, -0.03455936163663864, -0.07290168851613998, -0.0403752326965332, -0.0541989766061306, -0.007185872178524733, 0.002090355148538947, 0.006456678733229637, 0.01053574401885271, -0.026905037462711334, 0.005055742803961039, 0.019586583599448204, 0.0391024574637413, -0.006253388244658709, -0.006381549406796694, 0.036097295582294464, 0.014221486635506153, 0.01103955041617155, 0.021707875654101372, 0.037865038961172104, 0.01360277645289898, 0.016581421718001366, -0.0025322907604277134, -0.04719872027635574, 0.07622504979372025, -0.07049756497144699, -0.020611874759197235, -0.02130129374563694, -0.03268555551767349, -0.0078045823611319065, 0.027382327243685722, 0.008714969269931316, 0.004277936182916164, -0.008343743160367012, 0.018366841599345207, -0.01047387346625328 ]
42,888
linearmodels.system.model
__repr__
null
def __repr__(self) -> str: return self.__str__() + f"\nid: {hex(id(self))}"
(self) -> str
[ 0.005903043318539858, -0.029679913073778152, 0.08099564909934998, 0.05405488982796669, 0.016868315637111664, -0.056759364902973175, 0.00048243944183923304, 0.009951092302799225, 0.03456877917051315, -0.038278765976428986, -0.038972221314907074, -0.009959761053323746, 0.0016610436141490936, 0.0762801542878151, -0.01113863568753004, 0.012482206337153912, -0.041572682559490204, -0.0478137843310833, -0.012681575492024422, 0.0011680398602038622, -0.005985391326248646, 0.058042261749506, 0.04569874331355095, -0.03949231281876564, 0.00968237780034542, 0.0544709637761116, -0.02052629552781582, 0.012716247700154781, -0.03321653977036476, -0.017258383333683014, -0.05641263723373413, -0.07031642645597458, -0.00038952718023210764, -0.03196831792593002, 0.0011377010960131884, -0.007688692305237055, -0.06705718487501144, 0.04011642560362816, -0.05530310794711113, -0.03233238309621811, 0.062029629945755005, 0.027564872056245804, -0.018359245732426643, -0.02612595073878765, -0.0515931211411953, -0.010592538863420486, 0.07184202969074249, 0.0072379461489617825, -0.04160735383629799, -0.04885397106409073, 0.005326608195900917, 0.032228365540504456, -0.02825832925736904, 0.027287490665912628, -0.027807582169771194, 0.008005081675946712, 0.02550184167921543, -0.017717799171805382, -0.005590988323092461, 0.042682211846113205, -0.04320230334997177, 0.026542024686932564, 0.06237636134028435, -0.030113322660326958, -0.003759831190109253, -0.03437807783484459, -0.046461544930934906, 0.031500235199928284, -0.012915616855025291, 0.010601207613945007, 0.054262924939394, -0.032054997980594635, -0.013349026441574097, 0.03344191238284111, -0.001217881916090846, -0.02092503197491169, -0.021653160452842712, 0.023872219026088715, 0.033632613718509674, -0.013080311939120293, 0.018428590148687363, -0.013123652897775173, -0.026871416717767715, -0.013323022052645683, -0.0022797363344579935, -0.044173140078783035, -0.0037294926587492228, -0.021531805396080017, -0.09222963452339172, -0.02855304814875126, 0.00959569588303566, 0.027287490665912628, -0.05506040155887604, 0.025051094591617584, -0.02784225530922413, -0.04864593222737312, 0.02304007299244404, -0.04587210714817047, 0.056690022349357605, -0.011476695537567139, 0.012802929617464542, -0.010401838459074497, -0.07021240890026093, -0.027252817526459694, -0.056828711181879044, -0.017960507422685623, -0.027634218335151672, 0.0236815195530653, -0.03682250902056694, -0.000507902295794338, -0.0225719902664423, 0.07135661691427231, 0.0005130490171723068, -0.006128416862338781, 0.05932515487074852, -0.04562940075993538, 0.005920379888266325, 0.010185133665800095, 0.07607211172580719, -0.014545237645506859, 0.017908498644828796, 0.002401091158390045, -0.04597612842917442, 0.0033589270897209644, -0.04344501346349716, 0.030234677717089653, -0.026004597544670105, -0.00909294094890356, -0.004297259729355574, -0.1142815351486206, 0.044797252863645554, 0.006756861228495836, -0.03553961589932442, 0.04517865180969238, 0.07836052030324936, 0.013158326037228107, -0.007771040312945843, 0.030234677717089653, 0.010202470235526562, 0.10193801671266556, 0.003822675673291087, -0.02203456126153469, 0.029471876099705696, 0.04500528797507286, -0.03132687136530876, 0.011676063761115074, -0.036302417516708374, 0.06854812055826187, -0.0126729067414999, -0.04028978943824768, 0.04171137511730194, 0.02014489471912384, 0.0489233136177063, 0.03519288823008537, -0.010956603102385998, 0.027391508221626282, -0.014033813960850239, -0.0017477256478741765, 0.023889556527137756, -0.029957296326756477, -0.03775867447257042, -0.02808496542274952, 0.07045511901378632, -0.044485196471214294, -0.0029341853223741055, 0.013071644119918346, 0.001966597745195031, -0.051177047193050385, 0.01660826988518238, 0.02492973953485489, -0.01337503083050251, -0.07988612353801727, -0.05658600106835365, 0.053777504712343216, -0.017249716445803642, 0.04230080917477608, 0.0021659662015736103, 0.07107923179864883, -0.019624803215265274, -0.005378617439419031, 0.04680827260017395, -0.045352015644311905, -0.02550184167921543, -0.004236582200974226, 0.063589908182621, -0.053222741931676865, 0.039700351655483246, 0.008988922461867332, 0.08432424068450928, -0.023265445604920387, 0.01380844134837389, 0.024132266640663147, -0.028414355590939522, 0.02447899430990219, -0.0057080090045928955, -0.0458027645945549, 0.0019015861907973886, -0.07253549247980118, 0.006895552389323711, -0.020023539662361145, 0.02666337974369526, 0.05616993084549904, -0.01334035862237215, -0.00430809473618865, 0.007424312178045511, -0.014389210380613804, -0.0031768949702382088, -0.009136281907558441, 0.02966257743537426, -0.01510867103934288, 0.043306320905685425, 0.006531487684696913, 0.009725718759000301, 0.043618377298116684, 0.030546732246875763, -0.058735717087984085, -0.059151791036129, -0.015498739667236805, -0.02132377028465271, 0.021341105923056602, 0.07042045146226883, -0.026316652074456215, -0.034430086612701416, -0.04972079023718834, -0.0742691308259964, -0.01965947449207306, 0.008490500971674919, -0.007961740717291832, 0.011667395941913128, -0.025120440870523453, 0.04458921402692795, -0.03162159025669098, -0.02746085450053215, 0.017804481089115143, -0.013123652897775173, 0.05419357866048813, -0.03807073086500168, -0.013817109167575836, -0.03720391169190407, -0.002849670359864831, -0.04289024695754051, 0.020907696336507797, 0.05419357866048813, -0.008126436732709408, 0.07295156270265579, -0.020422276109457016, 0.0000948761444306001, 0.07128726691007614, -0.044485196471214294, -0.03581699728965759, 0.007602010387927294, -0.04864593222737312, -0.03553961589932442, -0.012048796750605106, 0.023820210248231888, -0.06650242209434509, -0.05838898941874504, 0.008763548918068409, 0.008871901780366898, 0.05738347768783569, -0.01849793642759323, 0.01825522631406784, -0.007138262037187815, 0.023733528330922127, 0.03838278353214264, 0.015992827713489532, -0.09396328032016754, 0.018289899453520775, -0.005296269431710243, -0.021895870566368103, 0.11643125116825104, -0.012222160585224628, -0.05901309847831726, 0.0404631532728672, -0.05304937809705734, -0.061405520886182785, -0.03845212981104851, 0.004223580006510019, -0.08994123339653015, -0.06951895356178284, 0.0005585570470429957, -0.03028668649494648, 0.018757982179522514, -0.02548450417816639, 0.016478246077895164, -0.021462460979819298, 0.023941565304994583, 0.011034617200493813, 0.004949541762471199, -0.009526350535452366, 0.03266177326440811, 0.018931346014142036, -0.02486039511859417, 0.029367858543992043, 0.058805063366889954, -0.02045694924890995, 0.029090475291013718, 0.04365304857492447, -0.026021933183073997, -0.0001883978839032352, -0.02792893722653389, 0.006635506171733141, 0.042058102786540985, 0.000029763074053335004, -0.05412423610687256, -0.015073997899889946, -0.022225262597203255, 0.03838278353214264, 0.02650735154747963, -0.0046374863013625145, -0.0046504889614880085, 0.035608962178230286, 0.024531003087759018, 0.06043468415737152, 0.034100696444511414, 0.04295959323644638, -0.02274535410106182, -0.02414960227906704, 0.030182668939232826, 0.0764881893992424, -0.017171701416373253, 0.01105195377022028, -0.02125442400574684, 0.041503336280584335, 0.058180950582027435, -0.03319920226931572, -0.021826524287462234, 0.02376820147037506, 0.009786396287381649, 0.040151096880435944, -0.01416383683681488, -0.051801156252622604, 0.02390689216554165, 0.01399914175271988, 0.008746212348341942, 0.00034483178751543164, 0.026576697826385498, 0.011754077859222889, -0.0469122938811779, -0.04344501346349716, 0.06646774709224701, 0.02203456126153469, -0.0025506175588816404, -0.011147303506731987, -0.015264698304235935, 0.03451676666736603, -0.0371345654129982, 0.026091279461979866, 0.022832036018371582, 0.008200116455554962, -0.03364994749426842, -0.05367348715662956, 0.023629510775208473, -0.019399428740143776, -0.0180125180631876, 0.014891966246068478, -0.005144576076418161, 0.025623196735978127, -0.038521476089954376, 0.0386948399245739, 0.0172323789447546, -0.0458027645945549, 0.00782304909080267, -0.013739095069468021, -0.04552537947893143, -0.0019828504882752895, -0.011225317604839802, -0.007706028874963522, 0.05138508230447769, 0.00983840599656105, -0.06653709709644318, 0.01318433042615652, -0.04289024695754051, -0.05041424557566643, -0.027426181361079216, 0.04517865180969238, 0.005872705020010471, 0.02345614694058895, -0.02753020077943802, -0.08536442369222641, 0.033875320106744766, -0.0073593007400631905, 0.02463502064347267, 0.04282090440392494, -0.014406546950340271, 0.026472680270671844, 0.02730482630431652, 0.01357439998537302, 0.011970782652497292, 0.03297382965683937, -0.047467056661844254, -0.001976349391043186, 0.027790246531367302, -0.0008348558912985027, -0.03703054413199425, -0.033077847212553024, 0.051419757306575775, -0.007892395369708538, -0.05391619727015495, -0.013513722456991673, 0.009864410385489464, -0.0020987875759601593, 0.011632722802460194, -0.0015721946256235242, 0.00225156475789845, 0.027478190138936043, 0.008668199181556702, -0.00028279999969527125, -0.01770913042128086, -0.044346507638692856, -0.018740646541118622, -0.01077457144856453, -0.035990361124277115, -0.041572682559490204, 0.08682068437337875, -0.020630313083529472, -0.03340723738074303, -0.0011756244348362088, 0.028379682451486588, -0.009214295074343681, -0.04642687365412712, 0.06837475299835205, -0.010462515987455845, 0.05783422291278839, -0.051662467420101166, 0.03879885748028755, 0.0025051094125956297, 0.059983935207128525, 0.053465452045202255, 0.05856235325336456, -0.005361280869692564, 0.01399914175271988, 0.0469122938811779, 0.01137267705053091, 0.026316652074456215, -0.05079564452171326, 0.023421473801136017, -0.04587210714817047, -0.014337200671434402, 0.08120368421077728, 0.022676007822155952, -0.02477371320128441, -0.002312242053449154, -0.006964897736907005, 0.011459358967840672, -0.028761083260178566, -0.03782802075147629, 0.0005512432544492185, 0.032523080706596375, 0.023508155718445778, 0.03651045262813568, 0.015056661330163479, -0.012464869767427444, -0.020734332501888275, -0.0050318893045187, -0.04996350035071373, -0.006440471857786179, -0.041260626167058945, -0.006076407618820667, -0.01152003649622202, -0.06948428601026535, 0.05089966580271721, -0.013409703969955444, 0.03626774623990059, -0.013739095069468021, -0.04389575868844986, 0.04209277406334877, 0.009431000798940659, -0.07149530202150345, -0.00608074152842164, 0.03115350753068924, 0.02186119742691517, -0.02336946502327919, 0.0038551813922822475, -0.016868315637111664, 0.0678199902176857, -0.01645224168896675, -0.03817474842071533, -0.045352015644311905, -0.028119636699557304, -0.04337566718459129, -0.06327785551548004, -0.012508210726082325, -0.003801005193963647, 0.012785593047738075, 0.03959633409976959, 0.02895178459584713, 0.03956165909767151, -0.0006040651351213455, 0.036926526576280594, 0.009769060648977757, 0.056135255843400955, -0.11365742236375809, 0.013877786695957184, 0.018549945205450058, 0.01416383683681488, -0.011112631298601627, -0.03723858296871185, -0.07253549247980118, -0.025051094591617584, -0.017050348222255707, -0.027911599725484848, 0.0009069103398360312, -0.016798969358205795, 0.02974925935268402, 0.010991276241838932, 0.011624054983258247, 0.0527026504278183, -0.00554764736443758, 0.0010818996233865619, 0.050483591854572296, -0.08640460669994354, 0.05207853764295578, -0.011970782652497292, -0.017657121643424034, -0.015221357345581055, 0.009274972602725029, 0.004045881796628237, -0.03477681428194046, 0.002466102596372366, 0.016885651275515556, 0.005612658802419901, -0.05239059403538704, -0.009352986700832844, -0.03727325424551964, 0.06587830930948257, -0.02642066963016987, 0.017726466059684753, -0.03044271469116211, 0.0829373300075531, -0.02014489471912384, 0.007333296351134777, 0.017518430948257446, -0.0032722451724112034, -0.030893461778759956, 0.0869593694806099, -0.049928825348615646, 0.01652158796787262, 0.00830413494259119, -0.0023014068137854338, 0.0031335540115833282, -0.03349392116069794, -0.027339499443769455, -0.031101498752832413, -0.013487717136740685, -0.040567170828580856, 0.024912403896450996, 0.01385178230702877, 0.005083898548036814, -0.003315586131066084, 0.0386948399245739, -0.0366838164627552, 0.012022792361676693, -0.040151096880435944, 0.015923481434583664, 0.04351435974240303, 0.03293915465474129, 0.020630313083529472, -0.006817538291215897, 0.031118834391236305, -0.009431000798940659, 0.051731809973716736, 0.0818277969956398, -0.04375706985592842, 0.018757982179522514, 0.03959633409976959, 0.008546844124794006, -0.027166135609149933, -0.022710680961608887, -0.0072899553924798965, -0.005786022637039423, -0.0015721946256235242, 0.0631391629576683, 0.0015927815111353993, -0.07919266819953918, 0.011242654174566269, -0.035435598343610764, 0.04264754056930542, 0.021999888122081757, -0.007086252793669701, -0.04216212034225464, 0.027668891474604607, -0.018705973401665688, -0.03510620445013046, -0.0014205011539161205, 0.02477371320128441, -0.05239059403538704, 0.01691165566444397, 0.019156720489263535, -0.03841745853424072, -0.04053249955177307, -0.04531734436750412, -0.008663864806294441, -0.0017997347749769688, 0.061370849609375, -0.02973192185163498, 0.032991163432598114, -0.017189038917422295, 0.0027759906370192766, 0.0299052856862545, 0.055580493062734604, 0.005551981274038553, 0.010523193515837193, 0.03689185529947281, 0.04899265989661217, -0.0011225317139178514, 0.0005623493925668299, 0.019018027931451797, -0.044415850192308426, 0.02099437825381756, -0.0236815195530653, 0.04216212034225464, 0.023802874609827995, -0.059290479868650436, -0.02179185301065445, -0.038348112255334854, -0.00003143915091641247, 0.017275720834732056, -0.06660643965005875, 0.028691738843917847, 0.005010218825191259, 0.018775319680571556, -0.06327785551548004, 0.010453848168253899, 0.010297819972038269, 0.013019634410738945, -0.011572045274078846, 0.001064021373167634, 0.04167670011520386, -0.023248109966516495, 0.019070038571953773, 0.018688637763261795, -0.024531003087759018, -0.06397131085395813, -0.02910781279206276, -0.01510867103934288, -0.009925087913870811, 0.038105402141809464, -0.04490127041935921, 0.03931894898414612, -0.010592538863420486, 0.004862859379500151, -0.11289462447166443, -0.007272618822753429, -0.03751596435904503, -0.019382093101739883, -0.016174858435988426, -0.10110587626695633, 0.004979880526661873, -0.055892545729875565, -0.047709766775369644, 0.009803732857108116, 0.030147995799779892, 0.006176091730594635, 0.033008500933647156, 0.012976293452084064, -0.03831344097852707, 0.02508576773107052, -0.04635752737522125, 0.002799828303977847, -0.004451120272278786, -0.022780027240514755, -0.020352931693196297, -0.05512974411249161, 0.03155224397778511, 0.02872641198337078, 0.0007281287107616663, 0.004485792946070433, -0.003361094044521451, -0.04233548417687416, -0.025987260043621063, 0.030512060970067978, -0.04143399000167847, -0.039076242595911026, -0.06951895356178284, -0.03553961589932442, -0.0057080090045928955, 0.03775867447257042, 0.02446165680885315, -0.017137030139565468, 0.012326179072260857, -0.005833697970956564, -0.034100696444511414, -0.07184202969074249, 0.02203456126153469, 0.04500528797507286, -0.006041734479367733, 0.03727325424551964, 0.004236582200974226, -0.05436694249510765, -0.050240881741046906, -0.026698052883148193, 0.006795867811888456, 0.020803676918148994, 0.04108726233243942, 0.0045854770578444, 0.056204602122306824, -0.057002075016498566, 0.015507407486438751, -0.022832036018371582, 0.019884848967194557, 0.02170517109334469, 0.05145442858338356, -0.010809243656694889, 0.0489233136177063, 0.013062975369393826, 0.047328367829322815, 0.02101171389222145, 0.012958957813680172, 0.028293000534176826, 0.019399428740143776, 0.09306178241968155, 0.00955235492438078, -0.015238693915307522, -0.0032375722657889128, 0.010973939672112465, 0.0030533731915056705, 0.029697248712182045, -0.04649621993303299, 0.01849793642759323, -0.0015028490452095866, 0.04167670011520386, 0.06639840453863144, 0.008642194792628288, 0.011450691148638725, 0.09306178241968155, 0.01258622482419014, -0.03210701048374176, -0.01920872926712036, -0.021826524287462234, 0.02557118609547615, 0.05006751790642738, -0.05402021482586861, -0.021843861788511276, 0.028934448957443237, -0.001289394567720592, 0.03448209539055824, -0.017033010721206665, -0.013461712747812271, 0.018775319680571556, 0.000270068587269634, 0.03564363345503807, 0.017518430948257446, 0.047467056661844254, 0.002427095780149102, 0.03540092334151268, 0.03278312832117081, 0.05516441911458969, -0.019694147631525993, 0.015706775709986687, 0.04680827260017395, 0.07669622451066971, -0.046530891209840775, 0.012560220435261726, 0.04985947906970978, -0.014146500267088413, 0.0180125180631876, 0.05585787445306778, 0.037793345749378204, -0.034412749111652374, -0.04028978943824768, -0.027634218335151672, 0.03493284061551094, 0.011398681439459324, -0.018376581370830536, 0.050379570573568344, -0.012404192239046097, -0.001892917905934155 ]
42,889
linearmodels.system.model
__str__
null
def __str__(self) -> str: out = self._model_name + ", " out += f"{len(self._y)} Equations:\n" eqns = ", ".join(self._equations.keys()) out += "\n".join(textwrap.wrap(eqns, 70)) if self._common_exog: out += "\nCommon Exogenous Variables" return out
(self) -> str
[ 0.02505733259022236, -0.0476541630923748, 0.04001936316490173, 0.008919324725866318, 0.01892416551709175, -0.04494037106633186, -0.03151615336537361, -0.09364386647939682, 0.021475128829479218, -0.01770295947790146, 0.020552439615130424, -0.03419376164674759, -0.017503948882222176, 0.04237131401896477, -0.028458615764975548, -0.007616705261170864, 0.02386326529085636, -0.1275843381881714, 0.03536973521113396, -0.009543496184051037, 0.0025057331658899784, 0.028874730691313744, -0.002372305141761899, -0.05923300236463547, 0.015559065155684948, -0.013695595785975456, -0.013957928866147995, -0.029091835021972656, 0.020461980253458023, -0.026812249794602394, -0.10225562751293182, -0.049210067838430405, -0.01885179802775383, -0.03305396810173988, 0.00817303266376257, -0.013849377632141113, 0.021963611245155334, 0.013966974802315235, 0.012745769694447517, -0.023609977215528488, 0.024026092141866684, -0.018227625638246536, -0.0018137166043743491, -0.001140922773629427, -0.07511772215366364, -0.0163822490721941, 0.0202991534024477, 0.05152583494782448, 0.018652787432074547, -0.0476541630923748, 0.01957547478377819, -0.026341859251260757, -0.015857582911849022, -0.0016384510090574622, -0.017259707674384117, -0.03831872344017029, 0.02865762822329998, -0.018652787432074547, 0.02368234470486641, 0.014817296527326107, -0.028820455074310303, 0.03773977980017662, 0.03296350687742233, -0.014817296527326107, -0.00824540015310049, 0.010719472542405128, -0.021927427500486374, 0.049969930201768875, 0.02035342901945114, 0.0017413488822057843, 0.017820557579398155, -0.06263428181409836, -0.013008102774620056, 0.008670561015605927, 0.008281583897769451, -0.0350983589887619, -0.08850575238466263, -0.009896289557218552, 0.014138848520815372, -0.06838752329349518, -0.023971816524863243, -0.01634606532752514, -0.026993170380592346, -0.04407195746898651, 0.022017886862158775, -0.05098307877779007, -0.02798822522163391, -0.008770066313445568, 0.065890833735466, -0.012067321687936783, -0.03296350687742233, 0.049246251583099365, -0.03556874766945839, 0.05112781375646591, 0.005178817082196474, -0.002982908161357045, 0.009299255907535553, -0.04606207087635994, 0.03788451477885246, -0.016617443412542343, 0.0008175293914973736, -0.016183236613869667, -0.04935480281710625, 0.029073743149638176, -0.08076240867376328, -0.038029249757528305, -0.032511211931705475, 0.0039440421387553215, 0.020570531487464905, -0.019032716751098633, -0.03636479377746582, 0.0700157955288887, 0.007765963673591614, -0.01044809352606535, 0.031009579077363014, -0.002310114214196801, -0.0688217282295227, 0.019213637337088585, 0.03683518245816231, -0.020552439615130424, 0.024098459631204605, 0.017748190090060234, -0.06346651166677475, 0.025328710675239563, -0.0071327462792396545, 0.05489093437790871, -0.030430637300014496, 0.02436983957886696, 0.011705483309924603, -0.1214330792427063, 0.02364616096019745, -0.0349174365401268, 0.0313895083963871, 0.027101721614599228, 0.06238099932670593, 0.035206910222768784, -0.008091618306934834, 0.0005975993117317557, 0.0460982546210289, 0.09197940677404404, 0.0018465082393959165, -0.0018318085931241512, -0.017956247553229332, 0.01259198784828186, 0.009317347779870033, 0.03202272951602936, 0.01082802377641201, 0.03015925921499729, -0.023284321650862694, -0.05326266214251518, -0.0014507471350952983, 0.04342064633965492, -0.012772907502949238, -0.0829334408044815, -0.013270435854792595, 0.017766281962394714, -0.0004927226109430194, -0.03189608454704285, 0.03824635595083237, -0.009272117167711258, -0.044325243681669235, -0.0258895605802536, -0.0015694755129516125, 0.015531927347183228, 0.0449041873216629, 0.0294174887239933, -0.042154211550951004, -0.048594940453767776, 0.023410966619849205, 0.00610150583088398, -0.039404239505529404, -0.0680980533361435, -0.05793038010597229, 0.043601568788290024, 0.015161043033003807, 0.05438436195254326, -0.012709585949778557, 0.06806186586618423, -0.03556874766945839, -0.0285490769892931, 0.01257389597594738, -0.019340280443429947, -0.0614040344953537, 0.0216741394251585, 0.03567729890346527, -0.06129548326134682, 0.02655896358191967, -0.013858423568308353, 0.02093237079679966, -0.010755656287074089, -0.007481015753000975, 0.001821631914936006, 0.0067437696270644665, 0.036636169999837875, 0.000002513259687475511, -0.023971816524863243, 0.07319997251033783, -0.06238099932670593, 0.04494037106633186, -0.03008688986301422, -0.03625624254345894, 0.0029354167636483908, -0.0027024829760193825, 0.01793815568089485, -0.04403577372431755, 0.012302516959607601, 0.016391294077038765, -0.011587885208427906, -0.015323870815336704, -0.003516620257869363, 0.0435292012989521, 0.035188816487789154, -0.028331972658634186, -0.016110869124531746, 0.06621649116277695, 0.05952247232198715, 0.020082049071788788, 0.03305396810173988, -0.06444347649812698, 0.037486493587493896, 0.04114106297492981, -0.058256037533283234, 0.02223498933017254, -0.026034297421574593, -0.0292365700006485, -0.020100140944123268, 0.01943073980510235, 0.024840228259563446, -0.0026911755558103323, -0.035152632743120193, 0.03158852085471153, 0.03625624254345894, -0.06393690407276154, 0.01792006380856037, -0.04559168219566345, 0.07030526548624039, -0.07728875428438187, 0.003914642613381147, 0.003882981836795807, -0.027445467188954353, -0.021402761340141296, 0.014238353818655014, -0.007557906676083803, -0.026920801028609276, 0.07251248508691788, -0.0932096615433693, 0.05514422431588173, 0.05518040806055069, -0.024912597611546516, -0.03406711667776108, 0.04135816916823387, -0.000532016041688621, -0.014790158718824387, -0.007037763483822346, 0.026956986635923386, 0.013424216769635677, -0.013189021497964859, 0.0013591567985713482, 0.03641906753182411, -0.026830341666936874, -0.014808250591158867, 0.029761236160993576, -0.04703903570771217, 0.0067482925951480865, 0.02313958667218685, 0.026757974177598953, -0.030430637300014496, -0.016934052109718323, -0.015351008623838425, 0.0069789644330739975, 0.07207827270030975, 0.03705228492617607, -0.08626235276460648, 0.004690334666520357, -0.024605033919215202, 0.003914642613381147, 0.004826024174690247, 0.0007191544864326715, -0.04410814121365547, -0.0020647423807531595, 0.015776168555021286, -0.02661323919892311, 0.009326393716037273, -0.002645945642143488, 0.030466821044683456, -0.03195036202669144, -0.02806059457361698, -0.07417693734169006, 0.04541075974702835, 0.006354792974889278, 0.0020647423807531595, 0.01085516158491373, 0.02514779195189476, 0.027445467188954353, 0.06010141223669052, -0.05188767611980438, 0.08213739097118378, 0.031172407791018486, 0.018435683101415634, 0.02234354242682457, 0.00437824847176671, 0.035261183977127075, 0.0390423983335495, -0.029688868671655655, -0.03692564368247986, -0.043348278850317, 0.047111403197050095, -0.04244368523359299, 0.06086127460002899, -0.035279277712106705, -0.02780730649828911, 0.026179032400250435, 0.04266078770160675, 0.04873967915773392, -0.0033854537177830935, 0.07215064018964767, -0.03933187201619148, 0.007797624915838242, 0.028422432020306587, 0.06017377972602844, 0.017259707674384117, -0.005061219446361065, 0.002183470642194152, -0.01111749466508627, 0.01777532696723938, -0.05007848143577576, -0.031715165823698044, -0.01400315947830677, 0.035966768860816956, -0.024804044514894485, -0.016608398407697678, -0.07142696529626846, 0.015423376113176346, 0.016934052109718323, 0.0431673601269722, -0.01601136475801468, 0.02572673372924328, 0.03222173824906349, -0.021475128829479218, -0.009326393716037273, 0.05778564512729645, -0.013831285759806633, -0.028205329552292824, 0.00981487613171339, -0.011596931144595146, -0.0062100570648908615, -0.02862144447863102, -0.0011550571070984006, 0.032945416867733, 0.02379089593887329, -0.01892416551709175, 0.028132962062954903, 0.03972989320755005, -0.03712465241551399, 0.01634606532752514, 0.01432881411164999, -0.028476707637310028, 0.0294174887239933, -0.02446029894053936, 0.0431673601269722, -0.011316506192088127, -0.016852639615535736, -0.010665196925401688, 0.07215064018964767, -0.015522881411015987, -0.026269491761922836, 0.03196845203638077, 0.006386453751474619, 0.07786769419908524, 0.005531609524041414, -0.06133166700601578, -0.011226046830415726, -0.0011590146459639072, -0.018046706914901733, -0.04135816916823387, 0.08286107331514359, -0.003136689541861415, 0.005002420395612717, -0.0009826183086261153, -0.12917642295360565, 0.04805218428373337, -0.030376361683011055, -0.008476071991026402, 0.015224364586174488, -0.021493220701813698, 0.02645041234791279, 0.03614769130945206, 0.026902709156274796, 0.02239781804382801, 0.04812455177307129, 0.006481436546891928, -0.01290859654545784, 0.00033272203290835023, 0.018978441134095192, -0.022886300459504128, -0.02154749631881714, -0.020443888381123543, 0.0011002159444615245, -0.08988074213266373, 0.023591885343194008, -0.012510574422776699, -0.026830341666936874, -0.037486493587493896, -0.01218491978943348, -0.032438840717077255, -0.03271022066473961, 0.019050808623433113, 0.035297367721796036, 0.007675504311919212, 0.02939939685165882, -0.012827183119952679, -0.015215318650007248, -0.015179134905338287, 0.0013614182826131582, 0.009715369902551174, 0.0073679410852491856, -0.018173350021243095, -0.054167259484529495, 0.036780908703804016, 0.012673401273787022, -0.021131381392478943, 0.03399474918842316, 0.024984965100884438, 0.06896646320819855, -0.025292526930570602, 0.06263428181409836, -0.06741055846214294, 0.03126286715269089, 0.08438079059123993, 0.04327591136097908, -0.043022625148296356, 0.007661935407668352, -0.014790158718824387, -0.005061219446361065, -0.0011471419129520655, -0.04968045651912689, 0.043022625148296356, -0.023609977215528488, -0.006535712163895369, 0.016110869124531746, 0.014265492558479309, -0.02997833862900734, -0.003905596910044551, 0.051236364990472794, -0.030557280406355858, 0.028259605169296265, -0.028530985116958618, -0.018652787432074547, -0.045048922300338745, 0.03269213065505028, 0.08655182272195816, 0.056085005402565, -0.04200947657227516, -0.01256485003978014, 0.05785801261663437, -0.02936321310698986, 0.0054863798432052135, -0.05807511508464813, -0.0039236885495483875, -0.02239781804382801, -0.03214937075972557, 0.04660483077168465, 0.016725994646549225, 0.06498623639345169, -0.005676344968378544, -0.05720670521259308, 0.015540973283350468, -0.012438206933438778, -0.04620680585503578, -0.011171771213412285, 0.005386874079704285, -0.0014699698658660054, -0.03403093293309212, 0.008815295994281769, -0.03303587809205055, 0.03607532009482384, 0.025672458112239838, 0.017096880823373795, 0.002401704667136073, -0.06495005637407303, -0.05105544626712799, -0.06878554075956345, -0.05641065910458565, 0.0021405022125691175, 0.05290082469582558, 0.07519008964300156, 0.01770295947790146, -0.020606715232133865, -0.03781214728951454, -0.010638059116899967, 0.01261007972061634, 0.06317704170942307, -0.04982519522309303, -0.03860819339752197, -0.007096562068909407, 0.01896034926176071, -0.02444220706820488, -0.019756395369768143, -0.07182499021291733, 0.037993066012859344, 0.01111749466508627, -0.013189021497964859, 0.009643002413213253, -0.029851695522665977, 0.01076470222324133, -0.0035414965823292732, 0.04143053665757179, 0.0080418661236763, -0.020823819562792778, -0.020516255870461464, 0.01876133866608143, -0.10334113985300064, 0.04548312723636627, -0.0018261548830196261, -0.01950310729444027, -0.05243043228983879, 0.011768804863095284, 0.034736517816782, 0.0025441786274313927, 0.04457853361964226, -0.027083629742264748, -0.007571475580334663, -0.07417693734169006, 0.0022298311814665794, -0.026070481166243553, 0.06741055846214294, -0.01611991599202156, 0.012745769694447517, -0.02865762822329998, 0.07182499021291733, 0.021384669467806816, -0.027590204030275345, -0.0031683503184467554, 0.04982519522309303, -0.02717408910393715, 0.07917031645774841, -0.018354270607233047, -0.008326813578605652, 0.020045865327119827, 0.023410966619849205, 0.005522563587874174, 0.0048802997916936874, -0.028947098180651665, -0.02943558059632778, 0.02163795568048954, -0.006730200257152319, 0.09024257957935333, 0.00626885611563921, 0.025654366239905357, -0.009453036822378635, -0.026269491761922836, -0.028132962062954903, -0.0020376043394207954, -0.044252876192331314, 0.020751452073454857, 0.028114870190620422, 0.03298160061240196, 0.009059537202119827, -0.017304938286542892, 0.011235092766582966, 0.0035053128376603127, -0.01952119916677475, 0.05785801261663437, -0.0032972553744912148, 0.017377305775880814, 0.07081183791160583, 0.022090254351496696, -0.0046089207753539085, -0.03140760213136673, -0.005459242034703493, -0.023537609726190567, 0.003905596910044551, 0.025998113676905632, -0.008290629833936691, -0.0388614796102047, -0.018046706914901733, 0.0164727084338665, 0.040055546909570694, -0.008950985968112946, 0.033759552985429764, -0.0545290969312191, 0.005337121430784464, -0.03556874766945839, -0.010194806382060051, 0.03187799081206322, 0.034483231604099274, 0.002273930236697197, 0.024279378354549408, 0.037305574864149094, -0.0005190124502405524, -0.04114106297492981, -0.00045569066423922777, -0.017241615802049637, -0.0013467185199260712, 0.03824635595083237, -0.0029128019232302904, -0.04479563608765602, 0.009615864604711533, 0.011850218288600445, 0.01258294191211462, -0.00011604281462496147, 0.016952143982052803, 0.015450513921678066, 0.04899296537041664, -0.02306721918284893, 0.015812352299690247, 0.02733691595494747, 0.04349301755428314, -0.032366473227739334, 0.023302415385842323, -0.0005566097679547966, 0.014781111851334572, -0.04888441413640976, -0.07073947042226791, -0.06773620843887329, -0.003242979757487774, -0.007422217167913914, 0.01226633321493864, -0.04349301755428314, 0.008019250817596912, 0.023501425981521606, 0.04190092533826828, -0.080472931265831, 0.014772065915167332, -0.02031724527478218, 0.06741055846214294, 0.009588726796209812, -0.034519415348768234, 0.030231626704335213, -0.04906533285975456, 0.010375726036727428, 0.03488125279545784, 0.021927427500486374, -0.037993066012859344, -0.035206910222768784, 0.00033809305750764906, 0.0057577588595449924, 0.02436983957886696, -0.045736417174339294, -0.009715369902551174, 0.008399181999266148, 0.03770359605550766, -0.023989908397197723, 0.050585053861141205, -0.035912495106458664, 0.05992049351334572, -0.036654263734817505, -0.03900621458888054, 0.023284321650862694, -0.04544694349169731, -0.027119813486933708, -0.012800045311450958, 0.021511312574148178, -0.014744928106665611, -0.005246661603450775, -0.007282004691660404, -0.03269213065505028, -0.024677401408553123, 0.017594408243894577, -0.025256343185901642, -0.03980226069688797, -0.02152940444648266, -0.002178947674110532, -0.04906533285975456, 0.10088063776493073, 0.011750712990760803, 0.0030756292399019003, 0.016273697838187218, 0.04935480281710625, -0.012338700704276562, 0.016517939046025276, -0.03994699567556381, -0.017594408243894577, -0.014039343222975731, -0.04812455177307129, 0.0007208505994640291, 0.0474732406437397, 0.043022625148296356, 0.02154749631881714, -0.06075272336602211, 0.05912444740533829, -0.006490482483059168, 0.006662355735898018, -0.08655182272195816, 0.03544210270047188, 0.01793815568089485, -0.027789214625954628, 0.06306849420070648, 0.006015568971633911, -0.029128018766641617, -0.09588726609945297, -0.03140760213136673, 0.005291891284286976, -0.030973395332694054, 0.10377535223960876, -0.061802055686712265, 0.045808784663677216, -0.04211802780628204, 0.010059116408228874, -0.01777532696723938, 0.035297367721796036, 0.031787533313035965, -0.023447150364518166, 0.01565857045352459, 0.02236163429915905, 0.029616501182317734, 0.0472923219203949, -0.000901769963093102, -0.04837783798575401, -0.0570981539785862, 0.05586789920926094, 0.05514422431588173, -0.0015807829331606627, -0.03616578131914139, 0.021077105775475502, 0.003335700836032629, 0.020679084584116936, 0.04837783798575401, 0.01010434702038765, -0.00643620640039444, 0.005499948747456074, 0.0688217282295227, 0.02717408910393715, -0.03140760213136673, 0.01048427727073431, 0.07482825219631195, -0.031660888344049454, -0.013722733594477177, 0.018526142463088036, -0.014545917510986328, -0.02161986380815506, 0.01811002939939499, -0.00401641009375453, 0.006418114528059959, 0.009561588987708092, 0.004407647997140884, -0.026378042995929718, -0.010312403552234173, -0.03692564368247986, -0.004780794493854046, 0.02308531105518341, 0.05369686707854271, 0.05677249655127525, -0.025998113676905632, 0.026016205549240112, 0.00401188712567091, 0.03350626677274704, 0.059015896171331406, -0.013930791057646275, -0.028386248275637627, 0.03813780099153519, 0.07880847901105881, 0.027716847136616707, -0.023899449035525322, 0.033162519335746765, -0.031045762822031975, 0.04172000661492348, 0.003916904330253601, 0.0046496279537677765, -0.01258294191211462, -0.023519517853856087, -0.04349301755428314, 0.04338446259498596, 0.06473294645547867, -0.01946692354977131, 0.021402761340141296, 0.004238035995513201, -0.014744928106665611 ]
42,890
linearmodels.system.model
_common_indiv_results
null
def _common_indiv_results( self, index: int, beta: Float64Array, cov: Float64Array, wresid: Float64Array, resid: Float64Array, method: str, cov_type: str, cov_est: ( HomoskedasticCovariance | HeteroskedasticCovariance | KernelCovariance | ClusteredCovariance | GMMHeteroskedasticCovariance | GMMHomoskedasticCovariance ), iter_count: int, debiased: bool, constant: bool, total_ss: float, *, weight_est: None | ( HomoskedasticWeightMatrix | HeteroskedasticWeightMatrix | KernelWeightMatrix ) = None, ) -> AttrDict: loc = 0 for i in range(index): loc += self._wx[i].shape[1] i = index stats = AttrDict() # Static properties stats["eq_label"] = self._eq_labels[i] stats["dependent"] = self._dependent[i].cols[0] stats["instruments"] = ( self._instr[i].cols if self._instr[i].shape[1] > 0 else None ) stats["endog"] = self._endog[i].cols if self._endog[i].shape[1] > 0 else None stats["method"] = method stats["cov_type"] = cov_type stats["cov_estimator"] = cov_est stats["cov_config"] = cov_est.cov_config stats["weight_estimator"] = weight_est stats["index"] = self._dependent[i].rows stats["original_index"] = self._original_index stats["iter"] = iter_count stats["debiased"] = debiased stats["has_constant"] = constant assert self._constant_loc is not None stats["constant_loc"] = self._constant_loc[i] # Parameters, errors and measures of fit wxi = self._wx[i] nobs, df = wxi.shape b = beta[loc : loc + df] e = wresid[:, [i]] nobs = e.shape[0] df_c = nobs - int(constant) df_r = nobs - df stats["params"] = b stats["cov"] = cov[loc : loc + df, loc : loc + df] stats["wresid"] = e stats["nobs"] = nobs stats["df_model"] = df stats["resid"] = resid[:, [i]] stats["fitted"] = self._x[i] @ b stats["resid_ss"] = float(np.squeeze(resid[:, [i]].T @ resid[:, [i]])) stats["total_ss"] = total_ss stats["r2"] = 1.0 - stats.resid_ss / stats.total_ss stats["r2a"] = 1.0 - (stats.resid_ss / df_r) / (stats.total_ss / df_c) names = self._param_names[loc : loc + df] offset = len(stats.eq_label) + 1 stats["param_names"] = [n[offset:] for n in names] # F-statistic stats["f_stat"] = self._f_stat(stats, debiased) return stats
(self, index: int, beta: numpy.ndarray, cov: numpy.ndarray, wresid: numpy.ndarray, resid: numpy.ndarray, method: str, cov_type: str, cov_est: linearmodels.system.covariance.HomoskedasticCovariance | linearmodels.system.covariance.HeteroskedasticCovariance | linearmodels.system.covariance.KernelCovariance | linearmodels.system.covariance.ClusteredCovariance | linearmodels.system.covariance.GMMHeteroskedasticCovariance | linearmodels.system.covariance.GMMHomoskedasticCovariance, iter_count: int, debiased: bool, constant: bool, total_ss: float, *, weight_est: Union[NoneType, linearmodels.system.gmm.HomoskedasticWeightMatrix, linearmodels.system.gmm.HeteroskedasticWeightMatrix, linearmodels.system.gmm.KernelWeightMatrix] = None) -> linearmodels.shared.utility.AttrDict
[ 0.017772359773516655, -0.04527069255709648, -0.04339580610394478, 0.0031223692931234837, 0.006454686634242535, -0.009823623113334179, -0.03611109033226967, -0.09343183040618896, 0.027576452121138573, 0.028025643900036812, -0.0162978395819664, -0.020272208377718925, 0.04659873619675636, -0.0023790060076862574, -0.04187246039509773, 0.049254823476076126, -0.0015965828206390142, 0.017118101939558983, -0.0203112680464983, -0.010663415305316448, -0.05792617425322533, -0.017225516960024834, -0.0703863576054573, 0.06276962906122208, 0.017157161608338356, 0.007528840098530054, 0.019500769674777985, -0.07769060134887695, 0.0657772570848465, 0.0009209646377712488, -0.024568822234869003, -0.05296553671360016, -0.022928297519683838, -0.02820141427218914, 0.0023765647783875465, -0.05480136349797249, 0.01591700315475464, 0.005849254783242941, -0.05944951996207237, 0.060269780457019806, 0.035251766443252563, -0.06413673609495163, 0.024549292400479317, -0.03798597678542137, -0.0258773360401392, -0.0002882210537791252, -0.000496185733936727, 0.051598433405160904, -0.019657010212540627, -0.005424475762993097, -0.008061034604907036, -0.06339459121227264, -0.005815077107399702, 0.03806409612298012, 0.00010382976324763149, 0.04331768676638603, -0.010292344726622105, 0.012723837979137897, 0.03781020641326904, -0.04945012554526329, 0.00134879513643682, -0.004906929098069668, 0.04577847197651863, 0.05394203960895538, -0.04613001272082329, -0.024549292400479317, -0.018592622131109238, 0.010595060884952545, -0.0015123594785109162, 0.005107112228870392, 0.01924687996506691, 0.007938971742987633, 0.028552955016493797, 0.010526705533266068, -0.023182187229394913, 0.01276289764791727, -0.016991157084703445, -0.04616907611489296, 0.023514198139309883, -0.021873673424124718, 0.0511687695980072, 0.0325956791639328, -0.08038575202226639, -0.06913643330335617, -0.03230272978544235, -0.03325970098376274, -0.011337202973663807, -0.004306379240006208, 0.05378580093383789, -0.029080267995595932, -0.0414818599820137, 0.033728424459695816, 0.07222218066453934, 0.00953555479645729, 0.015594757162034512, 0.01724504865705967, -0.017430583015084267, -0.02365090884268284, 0.0022960032802075148, -0.02103388123214245, -0.018621917814016342, 0.02058468945324421, 0.027400681748986244, 0.06702718138694763, -0.03249802812933922, -0.013251149095594883, -0.01662985049188137, -0.028513895347714424, 0.020779989659786224, -0.007885264232754707, -0.05167655274271965, 0.0313652865588665, -0.04527069255709648, -0.02275252714753151, -0.01273360289633274, -0.007807143498212099, -0.044801969081163406, 0.04769241809844971, -0.030388781800866127, 0.03163870424032211, 0.03175588697195053, 0.010321639478206635, -0.03656028211116791, -0.009281663224101067, 0.029353687539696693, -0.03154105693101883, 0.028689665719866753, 0.02925603836774826, 0.012118405662477016, 0.012743367813527584, 0.023045476526021957, -0.025662505999207497, 0.007094296161085367, 0.01164968404918909, 0.03866953030228615, 0.022342395037412643, 0.009848035871982574, -0.025213314220309258, -0.03081844374537468, -0.01697162725031376, 0.041520919650793076, 0.014735434204339981, -0.03989992290735245, -0.005229175090789795, 0.0028025642968714237, 0.03298627957701683, 0.024275870993733406, -0.06753496825695038, -0.015223685652017593, 0.0008379618520848453, 0.014774494804441929, -0.006796462927013636, -0.019657010212540627, -0.033396411687135696, -0.01769423857331276, -0.07624537497758865, 0.03544706851243973, -0.021873673424124718, 0.010380229912698269, -0.040466297417879105, -0.03392372280359268, -0.047145579010248184, 0.04652061685919762, 0.03163870424032211, -0.004560270346701145, 0.07644067704677582, -0.095697320997715, -0.00744095491245389, -0.02408057078719139, -0.031912125647068024, -0.016834916546940804, -0.015565462410449982, -0.07374552637338638, -0.009603909216821194, -0.07120662182569504, 0.05925421789288521, -0.008710409514605999, -0.06030884385108948, 0.005351237952709198, -0.025447675958275795, 0.0013475745217874646, -0.04589565470814705, -0.03866953030228615, -0.011737569235265255, -0.07624537497758865, 0.06495700031518936, 0.04476290941238403, -0.037966448813676834, 0.061050985008478165, 0.012606657110154629, -0.04183340072631836, -0.033904194831848145, -0.025115665048360825, 0.023963389918208122, 0.01493073534220457, -0.015604522079229355, 0.03743913397192955, -0.007934088818728924, 0.0439426489174366, -0.024275870993733406, -0.03359171375632286, 0.008612758480012417, -0.016590790823101997, -0.0007403115159831941, -0.03642357140779495, 0.02870919555425644, -0.030525492504239082, 0.0313652865588665, -0.0002200183953391388, 0.0377320870757103, -0.028689665719866753, -0.0002779982751235366, 0.03466586768627167, 0.04468479007482529, 0.05077816918492317, 0.018934398889541626, 0.034626804292201996, 0.00003186986214132048, 0.024451641365885735, -0.011991459876298904, 0.058043353259563446, -0.0878852978348732, -0.023436078801751137, 0.006435156334191561, -0.003954838030040264, -0.01953006535768509, 0.05351237952709198, 0.03187306597828865, 0.027674103155732155, -0.03476351499557495, 0.010341169312596321, 0.06413673609495163, 0.052653055638074875, -0.06046508252620697, -0.0662069246172905, 0.02302594669163227, -0.039743684232234955, 0.04105219617486, -0.01919805444777012, -0.027576452121138573, -0.025994516909122467, -0.010302109643816948, -0.011083312332630157, 0.05757463350892067, -0.0016820268938317895, -0.05734027177095413, 0.017430583015084267, 0.0742923691868782, -0.022225214168429375, -0.023045476526021957, -0.01485261507332325, -0.011083312332630157, -0.019539831206202507, -0.024158690124750137, 0.009203542955219746, -0.009110775776207447, 0.007211476564407349, 0.03616968169808388, 0.045036330819129944, -0.05394203960895538, 0.011307908222079277, -0.02859201654791832, -0.03087703324854374, -0.0005572171648964286, -0.05788711458444595, 0.020057376474142075, 0.014169062487781048, 0.02708820067346096, -0.028435776010155678, 0.07276902347803116, -0.03331829234957695, 0.07120662182569504, -0.027517862617969513, -0.009467199444770813, -0.01020445954054594, 0.04238024353981018, -0.024959424510598183, -0.014003057032823563, 0.00565883656963706, 0.030349722132086754, -0.00043515427387319505, -0.028240473940968513, -0.01852426677942276, 0.0044699436984956264, -0.003398231463506818, -0.02597498707473278, -0.015946298837661743, -0.006606044713407755, 0.043630167841911316, -0.028670135885477066, -0.017225516960024834, -0.012079345062375069, -0.00043118721805512905, -0.006093380507081747, 0.02036985754966736, 0.036462631076574326, -0.0089252395555377, 0.03097468428313732, -0.0011235891142860055, 0.025076603516936302, -0.03060361184179783, -0.00718706427142024, -0.0013402507174760103, 0.00040860558510757983, -0.0011901133693754673, 0.033240173012018204, 0.07409706711769104, -0.017479408532381058, 0.015829117968678474, -0.014598723500967026, -0.03898201137781143, 0.06109004467725754, 0.035857200622558594, 0.05050474777817726, 0.014735434204339981, -0.06628504395484924, -0.01515533123165369, 0.00934513658285141, 0.03478304669260979, 0.07358928769826889, -0.028767786920070648, -0.0020665249321609735, 0.04945012554526329, -0.022205684334039688, 0.06425391882658005, 0.007411659695208073, 0.029627108946442604, -0.026443708688020706, 0.005160819739103317, 0.014217888005077839, -0.04796583950519562, -0.02591639757156372, 0.02185414358973503, 0.019549595192074776, -0.017811419442296028, 0.004152580164372921, 0.03386513516306877, -0.0033127872738987207, 0.04761429876089096, -0.01696186140179634, 0.038474228233098984, -0.04448948800563812, -0.023104067891836166, 0.01182545442134142, -0.0497235469520092, -0.08968205749988556, 0.033396411687135696, 0.01653219945728779, -0.012567597441375256, 0.023221246898174286, -0.02070186845958233, 0.0063326237723231316, 0.09163506329059601, 0.08405739814043045, 0.07269090414047241, 0.07565947622060776, -0.03659934177994728, -0.03738054633140564, 0.02070186845958233, -0.00837351568043232, -0.041911520063877106, 0.06679282337427139, -0.008539521135389805, 0.02675618976354599, 0.00489472271874547, -0.043083325028419495, -0.04339580610394478, 0.01952029950916767, 0.021014349535107613, -0.07937018573284149, -0.024568822234869003, -0.038630470633506775, -0.025389084592461586, -0.023846209049224854, 0.05429358035326004, -0.01602441817522049, -0.06773027032613754, -0.02708820067346096, -0.03948979079723358, -0.03833751752972603, 0.00169301254209131, -0.021658843383193016, -0.02769363299012184, 0.00336649501696229, 0.0040720184333622456, -0.01346598006784916, 0.04745806008577347, -0.012948432937264442, 0.013592925854027271, -0.008949652314186096, -0.002875802107155323, -0.016512669622898102, -0.006078732665628195, 0.0032273433171212673, -0.018446147441864014, 0.021834613755345345, 0.03972415253520012, -0.0028831257950514555, -0.08835401386022568, -0.01485261507332325, -0.013426920399069786, -0.04054441675543785, -0.020955760031938553, 0.05132501199841499, -0.015145565383136272, -0.07847180217504501, -0.021170590072870255, 0.01975466124713421, -0.01079036109149456, 0.03296675160527229, -0.06683188676834106, 0.0255843847990036, -0.0031345754396170378, 0.01830943673849106, -0.05925421789288521, 0.062222789973020554, -0.039587441831827164, 0.03519317880272865, 0.04745806008577347, 0.03812268748879433, 0.07647973299026489, -0.029627108946442604, 0.07308150827884674, 0.06046508252620697, 0.019569125026464462, -0.0018883132142946124, -0.027185851708054543, -0.03806409612298012, -0.024373522028326988, -0.0275373924523592, -0.005028991959989071, 0.0025071720592677593, -0.07511263340711594, -0.017772359773516655, 0.009891978465020657, -0.0398218035697937, -0.08155754953622818, 0.039606973528862, 0.019569125026464462, 0.04730181768536568, 0.03550565987825394, 0.01653219945728779, 0.038454700261354446, -0.017889540642499924, -0.03593531996011734, 0.02458835206925869, -0.003342082491144538, 0.010936836712062359, -0.08905709534883499, -0.07319868355989456, 0.11772723495960236, 0.02380714938044548, 0.0019786397460848093, 0.0010082395747303963, 0.018114136531949043, -0.035622838884592056, 0.003520294325426221, -0.028279535472393036, 0.004360087215900421, 0.006693929899483919, -0.01635642908513546, 0.03376748412847519, -0.06780838966369629, -0.023553259670734406, -0.009242603555321693, 0.03283004090189934, -0.00042355828918516636, 0.001539213233627379, 0.018270377069711685, 0.021873673424124718, -0.0414818599820137, 0.005365885328501463, -0.04448948800563812, -0.04855174198746681, 0.04011475294828415, 0.015350631438195705, -0.09546296298503876, -0.02997864969074726, 0.003742448752745986, 0.0028440658934414387, 0.0005764421075582504, 0.013075378723442554, 0.04511445015668869, -0.01182545442134142, 0.049489185214042664, -0.009613675065338612, 0.050036028027534485, 0.012665247544646263, 0.017664944753050804, -0.005976200103759766, -0.005151054821908474, 0.02769363299012184, 0.010165398940443993, 0.04476290941238403, -0.030564552173018456, 0.03702900558710098, 0.06671470403671265, 0.004389382433146238, 0.05140313133597374, -0.03333782032132149, 0.05601222813129425, -0.051364071667194366, -0.007221241481602192, -0.01543851662427187, -0.01507721096277237, -0.03415808454155922, -0.047419000416994095, 0.000004734705726150423, -0.02365090884268284, -0.016991157084703445, -0.03593531996011734, -0.05124689266085625, 0.030916092917323112, 0.011444617994129658, 0.05402016267180443, -0.0359157919883728, -0.05023133009672165, -0.001899298862554133, 0.023045476526021957, 0.030408311635255814, 0.02986147068440914, -0.02175649255514145, 0.0024742151144891977, -0.0026805014349520206, 0.009237720631062984, 0.03814221918582916, -0.01540922187268734, -0.028670135885477066, 0.01796765998005867, 0.0065474542789161205, -0.11858655512332916, -0.0651913583278656, -0.005185232497751713, 0.07151909917593002, 0.029685700312256813, -0.027674103155732155, 0.04816114157438278, -0.05968388170003891, 0.06339459121227264, 0.013710105791687965, -0.002931951079517603, -0.018368026241660118, 0.04644249379634857, -0.04038817435503006, 0.026599949225783348, 0.01869027316570282, -0.0060689677484333515, 0.019871842116117477, 0.009750384837388992, -0.03931402042508125, 0.00959902722388506, -0.04644249379634857, 0.041638098657131195, 0.022440046072006226, -0.003561795689165592, 0.03593531996011734, 0.00214098347350955, -0.022791586816310883, 0.021561192348599434, 0.017977425828576088, 0.009105892851948738, -0.010360700078308582, 0.05886361747980118, -0.05749651417136192, 0.02525237388908863, 0.031130924820899963, 0.08561980724334717, 0.02398291975259781, -0.05480136349797249, -0.04796583950519562, -0.032576147466897964, 0.045036330819129944, -0.05917609855532646, 0.008632289245724678, -0.010067748837172985, 0.012216055765748024, 0.020662808790802956, -0.04566129297018051, -0.01919805444777012, -0.01818249002099037, -0.024275870993733406, -0.019481239840388298, 0.05585598573088646, -0.009794327430427074, 0.015243216417729855, 0.04913764446973801, -0.0400366336107254, 0.0071040610782802105, 0.03550565987825394, 0.017840715125203133, -0.04769241809844971, 0.011630154214799404, -0.011688743717968464, -0.03542754054069519, 0.034685395658016205, 0.04788772016763687, -0.05788711458444595, -0.024432111531496048, -0.019998786970973015, -0.034626804292201996, -0.0371461845934391, -0.0027659456245601177, 0.05007508769631386, 0.01703021675348282, -0.0019761985167860985, 0.010839186608791351, -0.013963996432721615, 0.03991945460438728, -0.003488557878881693, -0.012557832524180412, 0.00870552659034729, -0.012225820682942867, 0.019608186557888985, -0.009086363017559052, 0.026521828025579453, -0.015575227327644825, -0.03199024870991707, 0.018826983869075775, 0.046754974871873856, -0.010907541960477829, 0.012528536841273308, -0.011776629835367203, -0.030115360394120216, 0.04183340072631836, -0.04105219617486, 0.02546720579266548, 0.07194875925779343, -0.08960393816232681, -0.0016783650498837233, 0.0004028076073154807, 0.0016283191507682204, 0.04890328273177147, 0.08616665005683899, -0.031072333455085754, 0.037946917116642, -0.000996643677353859, 0.049762606620788574, 0.05128595232963562, -0.028689665719866753, 0.03603297099471092, 0.0540592223405838, 0.00665975222364068, 0.0381617471575737, 0.0255843847990036, -0.0045553878881037235, -0.01673726551234722, -0.009130305610597134, -0.022947827354073524, 0.0946817547082901, 0.050582870841026306, -0.0032346670050174, -0.011034486815333366, -0.07323774695396423, -0.010770831257104874, 0.02648276835680008, 0.002071407623589039, -0.005644188728183508, -0.00803662184625864, 0.03048643283545971, 0.0017723534256219864, 0.008993594907224178, -0.0005550810601562262, 0.0008550506900064647, -0.07960454374551773, 0.03226366639137268, 0.02257675491273403, 0.00046322873095050454, -0.008100094273686409, 0.020096438005566597, -0.022010384127497673, 0.01232347171753645, 0.043083325028419495, -0.04284896329045296, 0.02074092999100685, -0.040700655430555344, 0.021795552223920822, 0.0023082096595317125, 0.03132622316479683, -0.02546720579266548, -0.022557225078344345, 0.07105037569999695, 0.032068368047475815, -0.010858716443181038, -0.018280141055583954, 0.046637795865535736, -0.07023011893033981, 0.0013561189407482743, -0.0357009582221508, -0.006581631954759359, -0.016551731154322624, -0.05792617425322533, -0.037185244262218475, 0.01903204806149006, -0.021444011479616165, -0.0001965212868526578, -0.02925603836774826, 0.019207818433642387, -0.04862986132502556, 0.030896563082933426, 0.0192957054823637, 0.01321208942681551, -0.03365030139684677, 0.008422340266406536, 0.027849873527884483, -0.020955760031938553, 0.04952824488282204, -0.023006416857242584, -0.007938971742987633, 0.003969485871493816, -0.07296432554721832, 0.005688131786882877, 0.010770831257104874, 0.021541662514209747, 0.02013549767434597, -0.0023570347111672163, 0.042302120476961136, 0.031462933868169785, 0.011434853076934814, 0.012538301758468151, 0.03241990879178047, 0.03376748412847519, 0.017674708738923073, 0.05023133009672165, 0.06265244632959366, -0.016063479706645012, -0.013094908557832241, 0.07003481686115265, 0.014149532653391361, 0.05929327756166458, -0.003842540318146348, 0.03882576897740364, -0.029783349484205246, -0.03593531996011734, -0.0027561804745346308, 0.013719870708882809, -0.04238024353981018, 0.025935927405953407, -0.031736355274915695, -0.030408311635255814, 0.02242051437497139, -0.014598723500967026, 0.013592925854027271, -0.04214588180184364, -0.05394203960895538, -0.0540592223405838, 0.026853840798139572, 0.06882394850254059, 0.01690327189862728, 0.03550565987825394, -0.08460424095392227, 0.06425391882658005, -0.01869027316570282, 0.026014046743512154, 0.05749651417136192, 0.05245775729417801, 0.04288802295923233, 0.0449582114815712, -0.04331768676638603, 0.019539831206202507, -0.010556000284850597, 0.02208850346505642, -0.010975896380841732, 0.0009331709588877857, 0.07808119803667068, -0.004352763295173645, 0.011737569235265255, 0.02441258169710636, 0.02986147068440914 ]
42,891
linearmodels.system.model
_common_results
null
def _common_results( self, beta: Float64Array, cov: Float64Array, method: str, iter_count: int, nobs: int, cov_type: str, sigma: Float64Array, individual: AttrDict, debiased: bool, ) -> AttrDict: results = AttrDict() results["method"] = method results["iter"] = iter_count results["nobs"] = nobs results["cov_type"] = cov_type results["index"] = self._dependent[0].rows results["original_index"] = self._original_index names = list(individual.keys()) results["sigma"] = DataFrame(sigma, columns=names, index=names) results["individual"] = individual results["params"] = beta results["df_model"] = beta.shape[0] results["param_names"] = self._param_names results["cov"] = cov results["debiased"] = debiased total_ss = resid_ss = 0.0 residuals = [] for key in individual: total_ss += individual[key].total_ss resid_ss += individual[key].resid_ss residuals.append(individual[key].resid) resid = np.hstack(residuals) results["resid_ss"] = resid_ss results["total_ss"] = total_ss results["r2"] = 1.0 - results.resid_ss / results.total_ss results["resid"] = resid results["constraints"] = self._constraints results["model"] = self x = self._x k = len(x) loc = 0 fitted_vals = [] for i in range(k): nb = x[i].shape[1] b = beta[loc : loc + nb] fitted_vals.append(x[i] @ b) loc += nb fitted = np.hstack(fitted_vals) results["fitted"] = fitted return results
(self, beta: numpy.ndarray, cov: numpy.ndarray, method: str, iter_count: int, nobs: int, cov_type: str, sigma: numpy.ndarray, individual: linearmodels.shared.utility.AttrDict, debiased: bool) -> linearmodels.shared.utility.AttrDict
[ 0.03762941062450409, -0.05872008949518204, -0.04775748774409294, 0.019725095480680466, -0.016358552500605583, -0.039374325424432755, -0.03736388310790062, -0.11592286825180054, 0.05431987717747688, 0.02313905395567417, -0.02672371082007885, 0.008686628192663193, -0.011882472783327103, 0.02934107929468155, -0.04017091542482376, 0.02577538788318634, 0.008710335940122604, 0.0482126846909523, -0.012204902246594429, 0.011303996667265892, -0.04096750542521477, 0.029929038137197495, -0.07131380587816238, 0.0464298389852047, 0.0277099646627903, 0.04563324898481369, -0.004800879396498203, -0.07658647745847702, 0.06122365966439247, 0.03260330483317375, 0.0035182740539312363, -0.07529675960540771, 0.0032408898696303368, 0.0007977757486514747, 0.00029501700191758573, -0.03482237830758095, 0.002963505918160081, 0.050261057913303375, -0.0439642034471035, 0.021583804860711098, 0.01420586183667183, -0.09392179548740387, 0.038691531866788864, -0.03658625856041908, -0.00019322057778481394, -0.034480981528759, 0.0088668093085289, 0.03812253847718239, -0.04331934452056885, -0.03713628277182579, -0.007335269823670387, -0.029284179210662842, 0.03787597641348839, 0.017430156469345093, -0.0007971830782480538, -0.005097229965031147, -0.008753011003136635, 0.039829518646001816, -0.0042129200883209705, -0.006282632239162922, 0.0011759190820157528, -0.01347565371543169, -0.001459230319596827, 0.0066572194918990135, -0.07996249943971634, -0.03429131954908371, -0.04536771774291992, -0.0013798082945868373, -0.004703676328063011, 0.040815774351358414, 0.04058817774057388, 0.004668114241212606, -0.001902570715174079, 0.025490891188383102, -0.043129678815603256, 0.010431540198624134, -0.017562920227646828, -0.06198231875896454, 0.027785830199718475, -0.04400213435292244, 0.03305850178003311, 0.027823762968182564, -0.08003836870193481, -0.0836799219250679, -0.023082153871655464, -0.029170380905270576, -0.04138476774096489, -0.018112948164343834, 0.0549268014729023, -0.026553012430667877, -0.057126909494400024, 0.02626851573586464, 0.07207246124744415, 0.028241025283932686, 0.02177347056567669, 0.026439214125275612, -0.0013964039972051978, 0.0029066065326333046, 0.011446245014667511, -0.03453788161277771, -0.019355248659849167, -0.0070602563209831715, 0.030611829832196236, 0.04847821220755577, -0.012555781751871109, 0.0033499470446258783, -0.011816090904176235, -0.01843537762761116, 0.02363218180835247, 0.015637828037142754, -0.08952158689498901, 0.0487058125436306, -0.031085990369319916, -0.02036995440721512, -0.012271285057067871, -0.007648215629160404, -0.047681622207164764, 0.03577069938182831, -0.042674485594034195, 0.018093980848789215, 0.014291210100054741, 0.04381246864795685, -0.018729357048869133, 0.01931731589138508, -0.028525521978735924, -0.027084073051810265, 0.058568358421325684, 0.03827426955103874, 0.020863080397248268, 0.00578950485214591, 0.007610282860696316, -0.004423921462148428, 0.009985829703509808, 0.025965053588151932, 0.07025168091058731, 0.019497497007250786, 0.003233777591958642, -0.007814171724021435, -0.023233884945511818, 0.002102903788909316, 0.05955461412668228, 0.018387960270047188, -0.011285030283033848, -0.01775258593261242, -0.01381704956293106, -0.00360836461186409, 0.03732594847679138, -0.058795955032110214, -0.023309752345085144, -0.030630797147750854, -0.003947389777749777, 0.00460884440690279, 0.0026221100706607103, -0.04001918435096741, -0.008487480692565441, -0.038653600960969925, 0.05136111378669739, -0.03165498375892639, -0.006472296547144651, -0.05651998147368431, -0.05249909684062004, -0.016813747584819794, 0.004191582556813955, 0.003141316119581461, 0.017885349690914154, 0.05249909684062004, -0.08974917978048325, -0.018093980848789215, -0.009397869929671288, -0.07123793661594391, -0.015182632952928543, -0.00938364490866661, -0.022740758955478668, -0.013304955326020718, -0.06008567288517952, 0.06744465231895447, 0.012034204788506031, -0.05158871039748192, 0.012906660325825214, -0.006401172373443842, 0.04073990881443024, -0.05887182056903839, -0.03193948045372963, -0.02220969833433628, -0.05105764791369438, 0.010355674661695957, 0.0004083710955455899, -0.018814705312252045, 0.03762941062450409, 0.01659563183784485, -0.036320727318525314, 0.004514012020081282, -0.008677145466208458, 0.043850403279066086, -0.017686203122138977, -0.013333405368030071, 0.028980717062950134, 0.02222866378724575, 0.04563324898481369, 0.015789559110999107, -0.020635483786463737, 0.020407887175679207, -0.026325415819883347, 0.024409804493188858, -0.030137669295072556, 0.010592754930257797, -0.06433415412902832, -0.0023233885876834393, -0.01217645313590765, 0.013029942288994789, -0.025927118957042694, -0.015495579689741135, 0.05253703147172928, 0.00016151106683537364, 0.04191582649946213, 0.002510682214051485, 0.05909941717982292, -0.00251779449172318, 0.02410634234547615, -0.03764837980270386, 0.07552435249090195, -0.1455105096101761, 0.04426766559481621, 0.041726160794496536, 0.002527277683839202, -0.0052110287360847, 0.038653600960969925, 0.027804797515273094, 0.013162707909941673, -0.041270967572927475, -0.005149387754499912, 0.030137669295072556, 0.04085370525717735, -0.06642046570777893, -0.055457863956689835, -0.014490358531475067, -0.004229515325278044, 0.019336283206939697, -0.01864400878548622, -0.03260330483317375, -0.007989611476659775, -0.0006739012314938009, -0.013172190636396408, 0.03833116963505745, -0.021451041102409363, -0.06361342966556549, 0.04798508808016777, 0.04703676328063011, -0.018008632585406303, -0.05132317915558815, -0.00928881298750639, -0.005381726659834385, 0.0031673950143158436, 0.010905701667070389, 0.01961129531264305, -0.04138476774096489, 0.016074055805802345, 0.023556314408779144, 0.055495794862508774, -0.013636868447065353, 0.050526589155197144, 0.0017057940131053329, -0.03258433938026428, 0.004921790678054094, -0.05674758180975914, 0.030384233221411705, -0.002807032782584429, 0.02055961824953556, 0.0002708644315134734, 0.04984379559755325, -0.002963505918160081, 0.06763431429862976, -0.0074964845553040504, -0.033930957317352295, -0.03165498375892639, 0.07798998802900314, -0.04726436361670494, -0.014101546257734299, -0.02220969833433628, -0.01966819539666176, 0.006164092104882002, -0.036529358476400375, -0.013162707909941673, -0.017477571964263916, 0.018900055438280106, -0.03956398740410805, -0.0108677688986063, 0.03000490367412567, 0.03742077946662903, -0.029379012063145638, 0.007923229597508907, -0.029966970905661583, 0.022607993334531784, -0.010592754930257797, -0.0020614147651940584, 0.0037126801908016205, 0.02177347056567669, -0.01313425786793232, 0.04073990881443024, -0.009137080982327461, -0.01547661330550909, 0.028563454747200012, 0.055192332714796066, 0.008013320155441761, -0.011607459746301174, 0.047643691301345825, 0.09058370441198349, -0.04377453774213791, -0.016055088490247726, -0.0009406167664565146, -0.0357138030230999, 0.08557656407356262, 0.038426000624895096, 0.04464699327945709, -0.00924613792449236, -0.09194929152727127, -0.03235674276947975, -0.01101001724600792, 0.008843101561069489, 0.04073990881443024, -0.019393181428313255, -0.008933192119002342, 0.01876728981733322, -0.03717421740293503, 0.04984379559755325, 0.006059776525944471, -0.001356100314296782, 0.017212042585015297, -0.015049868263304234, 0.032072246074676514, -0.010564305819571018, -0.008032286539673805, 0.034670647233724594, 0.08982504904270172, -0.007074481341987848, 0.02177347056567669, 0.011749708093702793, -0.012944593094289303, 0.050981782376766205, -0.013968780636787415, 0.028942784294486046, -0.05390261486172676, -0.045102186501026154, -0.009639691561460495, -0.04688503220677376, -0.06547214090824127, 0.034139588475227356, 0.004651518538594246, 0.01643441803753376, -0.0019488014513626695, -0.03174981474876404, 0.03470858186483383, 0.06239957734942436, 0.09771508723497391, 0.0554199293255806, 0.06300650537014008, -0.06634459644556046, -0.023764945566654205, 0.03279297053813934, -0.013655834831297398, -0.0006152238347567618, 0.05811316519975662, -0.004637293983250856, 0.02626851573586464, 0.05174044147133827, -0.020028557628393173, -0.03836910426616669, 0.04024678096175194, 0.015685243532061577, -0.0719207301735878, 0.0027951786760240793, -0.03738284856081009, -0.013333405368030071, 0.0019452451961115003, 0.056178588420152664, -0.017041344195604324, -0.07442429661750793, -0.031370487064123154, 0.0029042356181889772, -0.007316302973777056, -0.0259840190410614, -0.008477997034788132, 0.0026908633299171925, -0.0002744206285569817, 0.02581332065165043, -0.01512573380023241, 0.02907554805278778, -0.011057432740926743, 0.02788066305220127, -0.0022641185205429792, -0.00897112488746643, -0.01587490737438202, -0.016178371384739876, 0.01206265389919281, -0.03764837980270386, -0.006173575296998024, 0.021470006555318832, -0.023082153871655464, -0.07798998802900314, -0.019393181428313255, -0.043850403279066086, -0.013380821794271469, -0.013608418405056, 0.034234419465065, -0.027008207514882088, -0.09483218938112259, -0.019763028249144554, 0.004388359375298023, -0.027842730283737183, 0.03736388310790062, -0.04866787791252136, -0.008639211766421795, -0.01639648526906967, 0.003653409890830517, -0.03929845988750458, 0.05458540841937065, 0.010118594393134117, 0.0078046889975667, 0.08679042011499405, 0.04726436361670494, 0.08603175729513168, -0.019573362544178963, 0.0501851923763752, 0.04320554435253143, -0.0031223497353494167, 0.0028544487431645393, -0.014224828220903873, 0.010611721314489841, -0.01337133813649416, -0.02791859582066536, 0.030232500284910202, -0.037743210792541504, -0.06979648768901825, -0.01783793419599533, -0.004625440109521151, -0.007562866900116205, -0.045102186501026154, 0.010535855777561665, 0.053333621472120285, 0.033722326159477234, 0.0005020179087296128, 0.01571369357407093, 0.026211615651845932, 0.006548162549734116, -0.06004774197936058, -0.003641556017100811, 0.04305381327867508, 0.016149921342730522, -0.06592733412981033, -0.0619443841278553, 0.11220544576644897, -0.0021846964955329895, 0.03929845988750458, -0.03212914615869522, 0.011797123588621616, -0.009853064082562923, 0.027728931978344917, -0.04392626881599426, -0.004902823828160763, 0.04756782576441765, -0.008653436787426472, -0.005647256504744291, -0.020692383870482445, 0.002785695483908057, -0.05007139593362808, 0.012441982515156269, 0.00475820479914546, -0.00862024538218975, -0.024068409577012062, 0.010222909972071648, -0.01783793419599533, -0.000894386088475585, -0.02765306644141674, -0.02150793932378292, -0.0072356960736215115, 0.008037027902901173, -0.038179438561201096, -0.02507363073527813, -0.028013428673148155, -0.0176103375852108, 0.018075015395879745, 0.012679063715040684, 0.03284987062215805, -0.010336708277463913, 0.03859670087695122, -0.0055808741599321365, 0.042940013110637665, 0.038881197571754456, 0.02458050288259983, 0.033949922770261765, -0.03256537392735481, 0.01182557363063097, 0.04028471186757088, 0.05064038932323456, -0.05007139593362808, 0.029151413589715958, 0.07681407034397125, 0.014243794605135918, 0.03618796169757843, -0.05413021147251129, 0.045747045427560806, -0.08747320622205734, -0.02368908002972603, -0.006216249894350767, 0.0003618440532591194, -0.03264123946428299, -0.0791279748082161, -0.002151505323126912, -0.01659563183784485, -0.007842621766030788, -0.04305381327867508, -0.04202962666749954, 0.02006649039685726, -0.0156093779951334, 0.03734491392970085, -0.05029899254441261, -0.009061215445399284, -0.01703186146914959, -0.0074395849369466305, -0.007501225918531418, 0.04734022915363312, 0.01465157326310873, 0.008032286539673805, -0.002210775390267372, 0.01169280894100666, 0.04946446791291237, -0.006642994470894337, 0.011313480325043201, -0.0002775323227979243, -0.017543954774737358, -0.087928406894207, -0.05033692345023155, 0.009440544061362743, 0.06050293520092964, 0.014983485452830791, -0.038463935256004333, 0.06346169859170914, -0.014803304336965084, 0.0314653180539608, 0.008283591829240322, 0.05113351345062256, 0.03222397714853287, 0.0334947295486927, -0.02059755101799965, 0.033741291612386703, 0.0013063133228570223, -0.01041257381439209, 0.007743048015981913, 0.02014235593378544, -0.023347685113549232, 0.01633010245859623, -0.009340970776975155, 0.028980717062950134, 0.029644541442394257, -0.011910922825336456, 0.012223868630826473, -0.020882047712802887, -0.021185509860515594, 0.0329447016119957, 0.025490891188383102, 0.012328184209764004, -0.0004658631223719567, 0.03738284856081009, -0.027273736894130707, 0.03685178607702255, 0.028791051357984543, 0.040095049887895584, 0.05488887056708336, -0.05485093593597412, -0.058530423790216446, -0.006695152260363102, 0.02486499957740307, -0.0661928653717041, -0.027728931978344917, 0.0182267464697361, 0.019478531554341316, -0.0032811935525387526, -0.04684710130095482, -0.051171448081731796, 0.010886735282838345, -0.02198210172355175, -0.014983485452830791, 0.04085370525717735, -0.059251151978969574, 0.003335722256451845, 0.017562920227646828, -0.09407352656126022, 0.0023802879732102156, 0.034443050622940063, 0.008198242634534836, -0.050754185765981674, 0.035087909549474716, -0.05079212039709091, -0.05181630700826645, 0.022304531186819077, 0.061602987349033356, -0.036794889718294144, -0.021678637713193893, -0.046695370227098465, -0.07017581909894943, -0.02763409912586212, -0.02765306644141674, 0.04897134006023407, 0.007842621766030788, 0.0003704382397700101, -0.0055476827546954155, -0.0392225906252861, 0.017581887543201447, 0.03199638053774834, 0.02014235593378544, -0.00008275589789263904, -0.020654451102018356, 0.00970133300870657, -0.006823176052421331, 0.04589877650141716, -0.02361321449279785, -0.05280256271362305, 0.019706128165125847, 0.03783804178237915, -0.0029066065326333046, 0.021128611639142036, 0.009231913834810257, -0.018141398206353188, 0.02837379090487957, -0.0791279748082161, 0.01798018254339695, 0.04305381327867508, -0.08868706226348877, 0.02268385887145996, -0.019326800480484962, -0.005120938178151846, 0.06129952520132065, 0.10408780723810196, -0.03461374714970589, 0.04491252452135086, -0.0062446994706988335, 0.05928908288478851, 0.06213404983282089, -0.033741291612386703, 0.014499841257929802, 0.054433673620224, 0.004255594220012426, -0.004039851017296314, 0.050261057913303375, -0.02763409912586212, -0.01876728981733322, -0.012916143983602524, -0.009639691561460495, 0.10241875797510147, 0.027027172967791557, -0.020502718165516853, -0.0161025058478117, -0.0549268014729023, -0.00938364490866661, 0.016320619732141495, -0.014452424831688404, 0.003494566073641181, -0.002158617600798607, 0.046505704522132874, 0.018691424280405045, 0.03125668689608574, -0.010289291851222515, -0.0009619540069252253, -0.07264145463705063, 0.030194567516446114, 0.025130528956651688, 0.002123055513948202, -0.02266489341855049, 0.024978797882795334, 0.003274081274867058, 0.03520170599222183, 0.03006180375814438, -0.017724135890603065, -0.008387906476855278, -0.020863080397248268, 0.01639648526906967, -0.03209121152758598, 0.03461374714970589, -0.03267917037010193, -0.017847416922450066, 0.07761066406965256, 0.001779288868419826, -0.013067875057458878, 0.0064817797392606735, 0.033001601696014404, -0.07533469051122665, 0.02953074313700199, -0.03616899624466896, -0.008487480692565441, -0.022570060566067696, -0.031806714832782745, -0.0769658014178276, 0.0429779477417469, -0.03226190805435181, -0.018587108701467514, -0.0038857487961649895, -0.009160789661109447, -0.06543421000242233, 0.009729782119393349, -0.007064997684210539, 0.01657666638493538, -0.025604689493775368, 0.017373256385326385, 0.035334471613168716, -0.010365158319473267, 0.07138966768980026, -0.012356634251773357, -0.008297815918922424, 0.0562165193259716, -0.0554199293255806, 0.006415397394448519, 0.0007936268812045455, 0.022342463955283165, -0.005998136010020971, -0.007487001363188028, 0.057544171810150146, 0.02816515974700451, 0.037022486329078674, -0.024409804493188858, 0.026571977883577347, 0.02653404511511326, 0.00914656464010477, 0.03643452748656273, 0.029853172600269318, -0.024201173335313797, 0.00849696435034275, 0.059213217347860336, 0.008990091271698475, 0.0434710755944252, -0.00870085321366787, 0.015220565721392632, 0.00496446480974555, -0.021906234323978424, 0.0024798617232590914, -0.02243729494512081, -0.03929845988750458, 0.019146619364619255, -0.04605051130056381, 0.0169939287006855, 0.032489508390426636, -0.055192332714796066, 0.03825530409812927, -0.021413108333945274, -0.029910070821642876, -0.028980717062950134, 0.04468492791056633, 0.04214342311024666, -0.01740170642733574, 0.0472264289855957, -0.08557656407356262, 0.05185423791408539, 0.006002877373248339, 0.016671499237418175, 0.042902082204818726, 0.04419180005788803, 0.0429779477417469, 0.0554199293255806, -0.04237101972103119, 0.017600852996110916, -0.026571977883577347, 0.024902932345867157, 0.006296857260167599, 0.0203509870916605, 0.036756955087184906, 0.02010442316532135, 0.022323496639728546, 0.04202962666749954, 0.030460098758339882 ]
42,892
linearmodels.system.model
_construct_xhat
null
def _construct_xhat(self) -> None: k = len(self._x) self._xhat = [] self._wxhat = [] for i in range(k): x, z = self._x[i], self._z[i] if z.shape == x.shape and np.all(z == x): # OLS, no instruments self._xhat.append(x) self._wxhat.append(self._wx[i]) else: delta = lstsq(z, x, rcond=None)[0] xhat = z @ delta self._xhat.append(xhat) w = self._w[i] self._wxhat.append(xhat * np.sqrt(w))
(self) -> NoneType
[ -0.01797478087246418, -0.0547749400138855, 0.003633747110143304, -0.012721620500087738, 0.046437185257673264, -0.01578752137720585, -0.03123854100704193, -0.007940497249364853, 0.007898434065282345, 0.06580470502376556, -0.012656189501285553, -0.0008558584377169609, 0.01121671125292778, -0.03138809651136398, -0.05301765725016594, 0.04247394949197769, 0.013992847874760628, -0.015703396871685982, -0.03963238000869751, -0.014245224185287952, 0.01949838362634182, -0.009599635377526283, -0.05937379226088524, 0.06965577602386475, -0.0017420955700799823, 0.025200212374329567, -0.01976010762155056, 0.020077913999557495, 0.000554117257706821, -0.05612094700336456, -0.040978386998176575, 0.013684388250112534, 0.018507573753595352, -0.07107656449079514, -0.01299269124865532, -0.026209715753793716, 0.02933170087635517, -0.04064188525080681, 0.01938621699810028, 0.032678019255399704, 0.10289463400840759, -0.035613059997558594, 0.02819133549928665, 0.04067927226424217, -0.015890341252088547, 0.05006392300128937, -0.01153451856225729, 0.0887615755200386, -0.00815548375248909, -0.012020575813949108, -0.04767102375626564, -0.009665066376328468, 0.023106426000595093, -0.033182770013809204, 0.006739374250173569, 0.007374987937510014, 0.05899990350008011, 0.02878955937922001, 0.025461934506893158, -0.013992847874760628, -0.0014172781957313418, 0.08427489548921585, 0.03815551474690437, 0.029013894498348236, -0.0033182771876454353, -0.01134757325053215, -0.04333389550447464, 0.002906997688114643, 0.019292743876576424, 0.029986009001731873, 0.049017030745744705, 0.03617389500141144, -0.012515980750322342, 0.01579686813056469, 0.021349141374230385, -0.00923976581543684, 0.03744512051343918, -0.05200815200805664, -0.003217794233933091, -0.044530343264341354, -0.0474092997610569, 0.05866340175271034, -0.08165766298770905, 0.04381995275616646, 0.018544962629675865, 0.06307531148195267, 0.018638435751199722, 0.01300203800201416, 0.0033463190775364637, 0.03710862249135971, -0.038548100739717484, 0.014422821812331676, 0.014806059189140797, -0.010468930937349796, 0.026452744379639626, 0.04101577401161194, -0.02394767850637436, -0.06535603851079941, 0.058177344501018524, 0.019348828122019768, -0.003972585313022137, -0.027705278247594833, -0.03464094549417496, 0.08337755501270294, -0.05294287949800491, 0.020489193499088287, 0.024190707132220268, -0.05253159999847412, -0.0015504766488447785, -0.001528276945464313, 0.013665693812072277, 0.02267645113170147, 0.03847331926226616, -0.026546217501163483, -0.03009817562997341, -0.07829264551401138, -0.013880680315196514, 0.05010131374001503, -0.003147689625620842, -0.02002182975411415, 0.04195050150156021, -0.04561462625861168, -0.027256609871983528, 0.03809943050146103, 0.019928358495235443, -0.01484344806522131, 0.04576418176293373, -0.04195050150156021, 0.015376241877675056, -0.06157974526286125, 0.0021043019369244576, 0.04221222549676895, -0.034865278750658035, 0.0077161630615592, -0.08203154802322388, -0.04456773400306702, -0.003217794233933091, -0.09040669351816177, 0.016638122498989105, -0.09324826300144196, 0.00649634562432766, 0.03578130900859833, -0.007898434065282345, 0.05574705824255943, -0.05369066074490547, 0.06935666501522064, 0.010749348439276218, 0.002161553828045726, 0.0286960881203413, -0.005996267311275005, -0.03151895850896835, -0.0028275460936129093, -0.014394779689610004, -0.08360189199447632, -0.047110188752412796, -0.059336405247449875, -0.013460054062306881, -0.009795928373932838, 0.048119693994522095, 0.023106426000595093, -0.03211718425154686, -0.027237914502620697, -0.030042093247175217, 0.0071833692491054535, -0.06217797100543976, 0.021610863506793976, -0.01548840943723917, -0.003000470343977213, 0.021741725504398346, 0.0028836296405643225, 0.0035683163441717625, -0.011300836689770222, -0.030528150498867035, 0.0069216457195580006, -0.04116533324122429, -0.03546350449323654, -0.0440816767513752, 0.004888616967946291, 0.004129151813685894, -0.029369089752435684, -0.0007688120822422206, -0.040230605751276016, -0.015768827870488167, -0.05937379226088524, -0.039856716990470886, -0.023274676874279976, 0.057653896510601044, 0.023293370380997658, -0.014441516250371933, 0.017105484381318092, -0.04617546126246452, -0.030434677377343178, 0.007823656313121319, 0.050811704248189926, 0.01096433587372303, 0.03314538300037384, 0.028583919629454613, 0.04512856900691986, -0.039333269000053406, -0.011674727313220501, -0.0777691975235939, -0.01732047274708748, -0.004458643030375242, -0.06711332499980927, 0.03596825525164604, 0.006655248813331127, -0.01656334474682808, -0.024302875623106956, -0.06894538551568985, 0.010954988189041615, 0.03361274674534798, -0.025312379002571106, -0.05731739476323128, 0.011712116189301014, -0.03522047400474548, 0.02944386750459671, -0.005365327000617981, -0.009870706126093864, 0.030266426503658295, -0.06685160100460052, -0.05354110524058342, -0.03551958501338959, -0.07354424148797989, 0.036379534751176834, -0.005304569844156504, 0.05982246249914169, 0.07466591149568558, 0.03866026550531387, -0.0430721715092659, -0.031687211245298386, 0.013824597001075745, 0.0019021673360839486, 0.014563030563294888, -0.030154259875416756, -0.046698909252882004, -0.021517392247915268, 0.0027293998282402754, -0.008122768253087997, 0.016339009627699852, -0.028396975249052048, -0.015198644250631332, -0.06027112901210785, 0.01900297962129116, 0.011001724749803543, -0.00560835562646389, 0.03583739325404167, 0.00796853844076395, 0.04030538350343704, -0.05660700425505638, 0.023368149995803833, -0.0308646522462368, 0.002813525265082717, 0.03884721174836159, -0.05428888276219368, 0.013796554878354073, -0.0718243420124054, 0.0191151462495327, 0.005005457438528538, 0.009393995627760887, -0.055148832499980927, -0.0177037101238966, 0.03731426224112511, 0.045315515249967575, 0.012497286312282085, -0.06995489448308945, 0.028883032500743866, -0.0021907640621066093, 0.02716313675045967, -0.030883345752954483, 0.03707123175263405, 0.005870079156011343, 0.01836736500263214, -0.0278922226279974, -0.0005655091954395175, -0.0022947522811591625, 0.07346946001052856, 0.012347729876637459, -0.04572679474949837, -0.010983030311763287, 0.030939429998397827, 0.027237914502620697, -0.061243247240781784, 0.03836115449666977, 0.05428888276219368, -0.014123708941042423, 0.012515980750322342, -0.03630475699901581, -0.06389787048101425, 0.055522721260786057, -0.07361901551485062, -0.018423449248075485, 0.05440105125308037, 0.038809821009635925, -0.030995512381196022, 0.06954361498355865, 0.019199270755052567, -0.023255981504917145, 0.017114832997322083, 0.046960633248090744, 0.03839854151010513, 0.016890497878193855, 0.0030261753126978874, 0.022227782756090164, -0.033313632011413574, -0.028583919629454613, -0.011656032875180244, 0.035351336002349854, -0.0037178725469857454, 0.02129305712878704, -0.04699802026152611, 0.0007939328788779676, 0.06928189098834991, 0.02409723587334156, -0.022153005003929138, 0.0205265823751688, -0.03198632225394249, 0.0077488780952990055, -0.03925849124789238, 0.03993149474263191, 0.09145358949899673, 0.0487179160118103, -0.04909180849790573, 0.01197383925318718, 0.0110204191878438, 0.01821780949831009, -0.004002964124083519, 0.002004987094551325, -0.05432627350091934, -0.033575356006622314, -0.06554298847913742, -0.03022903762757778, -0.03336971625685692, -0.015609923750162125, 0.019348828122019768, -0.03314538300037384, 0.032715409994125366, -0.00004253733277437277, 0.018180420622229576, 0.004638577811419964, -0.0507369264960289, -0.016142716631293297, 0.025966687127947807, -0.0604206882417202, 0.062252748757600784, 0.005757912062108517, -0.05612094700336456, 0.014628461562097073, -0.0504378117620945, -0.04654935374855995, 0.09571593999862671, -0.011188670061528683, 0.014693892560899258, 0.0838262215256691, 0.03836115449666977, 0.11037243902683258, 0.07896564900875092, -0.055261000990867615, 0.002617232734337449, -0.02662099525332451, 0.051036037504673004, 0.07586236298084259, 0.05212032049894333, -0.024415042251348495, 0.0013693735236302018, -0.02333075925707817, -0.05301765725016594, 0.05099865049123764, 0.013263761065900326, -0.06195363774895668, 0.01045023649930954, -0.04310956224799156, -0.021255668252706528, -0.08831290900707245, 0.017488723620772362, -0.0005821590311825275, 0.04082883149385452, -0.013198330998420715, -0.008169504813849926, 0.0019302091095596552, -0.046698909252882004, 0.04628762975335121, -0.018329976126551628, 0.007197389844805002, 0.011104544624686241, -0.009094883687794209, -0.012665537185966969, 0.02243342250585556, -0.018301934003829956, 0.06236491724848747, 0.042511336505413055, 0.044418178498744965, -0.0443807877600193, 0.04572679474949837, 0.012852482497692108, 0.021124806255102158, 0.000890326511580497, 0.047596246004104614, 0.017488723620772362, -0.07552585750818253, 0.06483259052038193, 0.014684544876217842, -0.06116846576333046, 0.004023995250463486, 0.01885342225432396, -0.05559749901294708, -0.09466904401779175, -0.037146009504795074, 0.031687211245298386, -0.04041755199432373, 0.047371912747621536, -0.0359121710062027, 0.025929298251867294, 0.03667864575982094, -0.055896613746881485, 0.017656972631812096, -0.019816190004348755, 0.001671991078183055, 0.02448982000350952, -0.01962924562394619, 0.049914367496967316, 0.023760734125971794, -0.024676766246557236, 0.02804177813231945, 0.05470016226172447, 0.002066912828013301, 0.0591120719909668, -0.07070267200469971, -0.04400689899921417, -0.02205953374505043, -0.005126971751451492, -0.031948935240507126, 0.010534361936151981, -0.038921989500522614, -0.00931454449892044, 0.0018121999455615878, 0.002857924671843648, 0.02076961100101471, 0.011067155748605728, -0.03710862249135971, 0.04284783825278282, -0.02101263962686062, 0.03138809651136398, 0.029799064621329308, 0.03073379024863243, -0.033332329243421555, 0.022358644753694534, -0.003213120624423027, -0.01581556349992752, -0.03963238000869751, -0.008837834000587463, 0.032173268496990204, 0.03768815100193024, 0.04845619574189186, -0.02819133549928665, 0.03351927176117897, -0.01848888024687767, -0.014394779689610004, -0.014740628190338612, -0.038435932248830795, 0.022732535377144814, 0.0018589362734928727, 0.027611805126070976, 0.001379889203235507, -0.015254727564752102, -0.02549932524561882, -0.039071545004844666, 0.026677079498767853, -0.002701357938349247, 0.02245211787521839, 0.0026826635003089905, 0.032715409994125366, 0.016086634248495102, 0.02968689613044262, 0.01331984531134367, 0.013740471564233303, -0.055373165756464005, -0.026415355503559113, 0.036416925489902496, 0.012151437811553478, -0.04980219900608063, -0.06307531148195267, -0.015011698938906193, -0.0023414886090904474, -0.006491671781986952, -0.002563485875725746, 0.06842193752527237, 0.006613186094909906, -0.06008418649435043, 0.017563501372933388, -0.03121984750032425, -0.0315750427544117, 0.0550740547478199, -0.0034281075932085514, 0.009141620248556137, -0.011310184374451637, 0.02727530337870121, -0.003114974359050393, 0.02140522375702858, 0.03507091850042343, 0.016535302624106407, 0.021723031997680664, -0.028359586372971535, -0.055896613746881485, -0.015011698938906193, -0.017133526504039764, 0.007795614656060934, 0.019217966124415398, -0.045951128005981445, -0.04079144075512886, -0.017563501372933388, 0.01961055025458336, -0.047596246004104614, -0.04210005700588226, 0.009786580689251423, 0.013273108750581741, -0.023125121369957924, -0.07130089402198792, 0.0410531647503376, 0.023106426000595093, 0.019797496497631073, 0.032678019255399704, 0.024508515372872353, -0.03937065601348877, -0.02675185725092888, 0.004404895938932896, 0.04598851874470711, -0.014740628190338612, -0.009450079873204231, 0.019161881878972054, 0.03839854151010513, -0.04666151851415634, -0.035370029509067535, -0.06019635125994682, 0.05466277524828911, -0.0018367365701124072, 0.004068394657224417, 0.008884570561349392, -0.047222357243299484, 0.018012169748544693, -0.007281515281647444, -0.006599165499210358, -0.03796856850385666, 0.002507402328774333, -0.0861443430185318, -0.03432313725352287, 0.04819447174668312, -0.04692324250936508, 0.016385747119784355, -0.08031165599822998, -0.030135564506053925, 0.004477337468415499, -0.035613059997558594, 0.01887211762368679, 0.021517392247915268, 0.03007948212325573, 0.018451491370797157, 0.005267180968075991, -0.0159370768815279, -0.01186167262494564, 0.04935353249311447, -0.003841723781079054, -0.012020575813949108, 0.07844220101833344, -0.04411906749010086, -0.0674872174859047, 0.005972899030894041, 0.008164831437170506, 0.010983030311763287, -0.04153922200202942, 0.01305812131613493, -0.03404271975159645, 0.06516909599304199, -0.02256428450345993, 0.01050631981343031, -0.030920734629034996, -0.01421718206256628, 0.02675185725092888, -0.05413932725787163, 0.008842507377266884, -0.005215771030634642, 0.04180094599723816, -0.02473284862935543, -0.007174022030085325, -0.03643561899662018, 0.06711332499980927, 0.01707744412124157, -0.019722718745470047, 0.007024465594440699, -0.02155478112399578, 0.016002507880330086, -0.014946267940104008, 0.02817264012992382, -0.028471753001213074, 0.009683760814368725, 0.01910579949617386, -0.02968689613044262, 0.01370308268815279, -0.039071545004844666, -0.01313289999961853, -0.012076659128069878, 0.046063296496868134, 0.05238204449415207, -0.03888459876179695, 0.05298026651144028, 0.0166942048817873, -0.0055008623749017715, -0.004869922064244747, -0.013310497626662254, -0.02484501712024212, -0.05548533424735069, 0.02933170087635517, 0.026807941496372223, 0.04471728950738907, -0.007029139436781406, -0.038435932248830795, -0.020190080627799034, 0.028490448370575905, 0.03200501576066017, 0.0507369264960289, 0.021068723872303963, -0.0013623631093651056, 0.005066214594990015, -0.04011843726038933, 0.043932121247053146, 0.013843291439116001, -0.0440816767513752, 0.0701044499874115, -0.019965747371315956, 0.03937065601348877, 0.010655876249074936, 0.05585922300815582, 0.005421410780400038, 0.0019430615939199924, -0.03402402624487877, -0.014067625626921654, 0.07361901551485062, -0.016862455755472183, 0.014862142503261566, 0.009833317250013351, 0.051036037504673004, 0.026994885876774788, -0.0025050656404346228, 0.045838963240385056, 0.0032668672502040863, 0.023667261004447937, 0.0035870110150426626, -0.013768513686954975, -0.032061100006103516, -0.036790814250707626, -0.01680637337267399, 0.013544179499149323, 0.00038761916221119463, -0.04931614175438881, 0.050811704248189926, -0.004921332001686096, -0.01191775593906641, -0.05443844199180603, -0.004517063032835722, 0.047222357243299484, -0.0270322747528553, 0.0009686097619123757, 0.006846867501735687, 0.01808694750070572, 0.004540431313216686, 0.04512856900691986, 0.061131078749895096, 0.024508515372872353, -0.048493582755327225, -0.04482945799827576, 0.016600733622908592, -0.03247237950563431, -0.020358331501483917, -0.021984754130244255, -0.009076189249753952, -0.032846271991729736, -0.017105484381318092, -0.01747002825140953, 0.0764605849981308, 0.02217170037329197, -0.021330446004867554, 0.06584209948778152, -0.008837834000587463, 0.05021347850561142, -0.030565539374947548, -0.010983030311763287, -0.020713526755571365, -0.004339465405791998, -0.011450393125414848, -0.03058423288166523, -0.015049087814986706, -0.05787823349237442, 0.012759009376168251, 0.034341830760240555, 0.022115616127848625, -0.015553840436041355, 0.018965590745210648, -0.01680637337267399, -0.044792067259550095, 0.039557602256536484, -0.036005645990371704, 0.049129195511341095, 0.02101263962686062, -0.04782057926058769, 0.059598129242658615, 0.008080706000328064, 0.0007915960741229355, 0.0003175147285219282, -0.02116219513118267, -0.006323421373963356, 0.02574235387146473, -0.013880680315196514, 0.019965747371315956, -0.009417364373803139, -0.030490761622786522, 0.017909349873661995, 0.011871019378304482, 0.017675668001174927, 0.012590758502483368, 0.020059218630194664, 0.05660700425505638, 0.05238204449415207, 0.0088518550619483, 0.039445437490940094, 0.06700115650892258, -0.05548533424735069, 0.027817444875836372, 0.053728047758340836, 0.012226215563714504, -0.018956242129206657, -0.035613059997558594, 0.0006280189845710993, 0.025200212374329567, 0.02295687049627304, 0.06793588399887085, 0.03445399925112724, -0.007533891126513481, -0.025050656870007515, 0.014647156000137329, 0.030883345752954483, 0.037015147507190704, -0.011768199503421783, -0.03314538300037384, -0.024022458121180534, 0.0004992021131329238, 0.003685157047584653, -0.010917599312961102, 0.0530550442636013, 0.011824283748865128, 0.005865405313670635, -0.035893477499485016, 0.00480916490778327, 0.00503817293792963, -0.024022458121180534, -0.006655248813331127, 0.050400424748659134, 0.050811704248189926, -0.02817264012992382, -0.024807626381516457, -0.009015431627631187, -0.04030538350343704, -0.020470498129725456, -0.042997393757104874, 0.022115616127848625, 0.09758538752794266, -0.04146444424986839, 0.04782057926058769, 0.03862287849187851, 0.03647300601005554 ]
42,893
linearmodels.system.model
_drop_missing
null
def _drop_missing(self) -> None: k = len(self._dependent) nobs = self._dependent[0].shape[0] self._original_index = Index(self._dependent[0].rows) missing = np.zeros(nobs, dtype=bool) values = [self._dependent, self._exog, self._endog, self._instr, self._weights] for i in range(k): for value in values: nulls = value[i].isnull if nulls.any(): missing |= np.asarray(nulls) missing_warning(missing, stacklevel=4) if np.any(missing): for i in range(k): self._dependent[i].drop(missing) self._exog[i].drop(missing) self._endog[i].drop(missing) self._instr[i].drop(missing) self._weights[i].drop(missing)
(self) -> NoneType
[ -0.028425954282283783, 0.03655315935611725, -0.02780967392027378, 0.03715017810463905, 0.020183198153972626, -0.028021520003676414, -0.029427411034703255, -0.02000986784696579, 0.02742449752986431, -0.009398282505571842, -0.032085120677948, 0.04679882526397705, 0.04055898264050484, -0.07195078581571579, -0.006369840353727341, 0.03117995895445347, 0.028040777891874313, 0.07996243983507156, 0.06209029629826546, -0.046221062541007996, -0.02397717721760273, -0.03807460144162178, -0.078306183218956, 0.05149796977639198, -0.04067453742027283, -0.008358309045433998, -0.004853211808949709, 0.008685708045959473, -0.007313520181924105, 0.028406694531440735, 0.022917943075299263, -0.006259102374315262, 0.013028562068939209, -0.005195054691284895, -0.000835349434055388, -0.03765090927481651, 0.029331116005778313, -0.0007492867880500853, 0.02463197521865368, 0.04645216837525368, 0.035725031048059464, -0.017987696453928947, -0.012364134192466736, -0.04271596670150757, 0.01224858220666647, 0.003493060590699315, 0.04837804660201073, 0.04086712375283241, -0.04830101132392883, 0.06270657479763031, 0.04348631575703621, 0.0704486072063446, 0.009682349860668182, 0.028387436643242836, -0.003543614875525236, 0.09683312475681305, 0.0016971796285361052, 0.008652005344629288, 0.04256189614534378, -0.060318488627672195, -0.0011049723252654076, 0.05923999473452568, 0.03447321057319641, 0.002857520943507552, 0.019778763875365257, 0.03616798296570778, 0.011555265635251999, -0.039441972970962524, -0.02744375541806221, -0.03560947626829147, -0.0021822601556777954, -0.0032595479860901833, -0.011950070969760418, 0.06463245302438736, -0.0009436800610274076, -0.05373198539018631, 0.04144488647580147, -0.01974024623632431, 0.00031686705187894404, -0.08003947138786316, 0.006249472964555025, -0.01366410218179226, -0.0577378123998642, 0.03152661770582199, 0.02384236454963684, 0.03347175195813179, -0.03483912721276283, 0.04529664292931557, 0.0474151074886322, -0.020337268710136414, -0.007429073099046946, 0.03220067545771599, -0.007453146390616894, 0.01102564949542284, 0.028137072920799255, 0.08889850974082947, -0.04260041192173958, -0.05527268722653389, -0.03449246659874916, -0.013885578140616417, 0.04683734476566315, -0.023938659578561783, -0.020414302125573158, 0.08404529839754105, -0.010496033355593681, -0.018093619495630264, 0.043293729424476624, -0.04768472909927368, -0.032508812844753265, 0.0027251169085502625, -0.04837804660201073, 0.01550331525504589, -0.01876767724752426, -0.0029128899332135916, -0.03117995895445347, -0.05457937344908714, -0.023823106661438942, 0.017554374411702156, -0.04260041192173958, 0.00009742232214193791, -0.011198978871107101, -0.03013998456299305, -0.07453146576881409, -0.010515292175114155, 0.05396309122443199, -0.034434691071510315, 0.010601956397294998, 0.04718400165438652, -0.006591316312551498, -0.006485392805188894, 0.006109846755862236, -0.044410739094018936, -0.016369959339499474, 0.003948049154132605, -0.06474800407886505, -0.0010345573537051678, -0.00026781734777614474, -0.0474151074886322, 0.026365265250205994, -0.0237075537443161, -0.012951526790857315, -0.03245103731751442, 0.02193574607372284, 0.033413976430892944, 0.04591292142868042, 0.04714548587799072, 0.007977948524057865, -0.026114901527762413, -0.003413618076592684, -0.02565268985927105, -0.03383766859769821, 0.02461271546781063, -0.021512053906917572, -0.06940863281488419, -0.008233127184212208, 0.021242430433630943, 0.017756592482328415, 0.0005717449239455163, -0.07472405582666397, 0.00961012952029705, -0.02574898488819599, -0.018055103719234467, 0.019239516928792, -0.012306357733905315, -0.019701728597283363, 0.014838887378573418, 0.015012215822935104, -0.0577378123998642, -0.03951900824904442, 0.06767533719539642, -0.0021846673917025328, 0.00824757106602192, -0.011458971537649632, -0.03761238977313042, -0.05908592417836189, 0.009046809747815132, -0.047530658543109894, -0.025864535942673683, -0.0218009352684021, 0.055080100893974304, -0.0055272686295211315, -0.03899902105331421, -0.056736353784799576, -0.03820941224694252, 0.03254733234643936, -0.0035195413511246443, -0.01231598760932684, -0.08404529839754105, 0.03064071387052536, 0.020837996155023575, -0.0004065407265443355, 0.022282404825091362, -0.008454603143036366, 0.06054959446191788, 0.06640426069498062, 0.045335158705711365, 0.03726573288440704, 0.0551571361720562, -0.004874877631664276, -0.05049651116132736, -0.00312714371830225, -0.055966004729270935, -0.03551318496465683, 0.012951526790857315, -0.052268318831920624, 0.005719856359064579, -0.07002490758895874, -0.01690920628607273, 0.07483960688114166, 0.012123399414122105, -0.0017044016858562827, -0.02078021876513958, 0.00027774766203947365, -0.05165203660726547, 0.013683361001312733, -0.004963949788361788, -0.01763140968978405, -0.007703510578721762, 0.06628870964050293, -0.00733759393915534, -0.053539399057626724, -0.030467383563518524, -0.0007035471498966217, -0.0056043039076030254, 0.015849972143769264, 0.02361126057803631, 0.034049518406391144, 0.010053081437945366, -0.031873274594545364, -0.01975950412452221, 0.012730050832033157, -0.010938985273241997, -0.025960830971598625, -0.024516422301530838, 0.07383815199136734, 0.03431914001703262, -0.03539763018488884, -0.030698489397764206, 0.07356852293014526, -0.02461271546781063, -0.07222041487693787, -0.021974263712763786, -0.002881594467908144, -0.017034387215971947, 0.01526258047670126, -0.010120486840605736, -0.012104140594601631, 0.048146940767765045, 0.05504158139228821, -0.01610996574163437, 0.004559515509754419, -0.02538306638598442, 0.009995304979383945, -0.004217672161757946, 0.06902345269918442, -0.06105032190680504, 0.06725164502859116, -0.013654472306370735, 0.03951900824904442, -0.04325520992279053, 0.02024097368121147, -0.010264927521348, -0.046221062541007996, 0.052614975720644, -0.053385328501462936, 0.058161504566669464, 0.08905258029699326, -0.037516094744205475, 0.010592327453196049, -0.005334680899977684, 0.08604821562767029, 0.08550896495580673, -0.02193574607372284, -0.017621779814362526, 0.003091033548116684, 0.08450751006603241, 0.011564895510673523, -0.04183006286621094, 0.015349244698882103, 0.03824792802333832, 0.05958665534853935, -0.055580828338861465, 0.06517169624567032, 0.08373715728521347, -0.01790103316307068, 0.007534996140748262, -0.03476209193468094, -0.11978958547115326, 0.006393913645297289, 0.009826790541410446, 0.012797457166016102, 0.05196017771959305, 0.06494059413671494, 0.003420840250328183, 0.020106162875890732, -0.01898915320634842, -0.03206586092710495, 0.004730436950922012, -0.019913574680685997, 0.047646213322877884, 0.0057054124772548676, -0.012585610151290894, 0.019817281514406204, 0.012104140594601631, 0.046221062541007996, -0.05612007528543472, 0.028368176892399788, 0.007323149591684341, 0.009403097443282604, 0.004525812342762947, -0.025960830971598625, -0.02730894461274147, 0.06497911363840103, 0.020163938403129578, 0.030987370759248734, -0.026365265250205994, 0.040982674807310104, -0.004992837551981211, 0.025171220302581787, 0.06197474151849747, 0.04857063293457031, -0.03909531608223915, -0.05916295945644379, 0.01749659888446331, -0.0832749456167221, 0.032142896205186844, -0.007106488570570946, 0.005941332317888737, -0.0628606453537941, -0.00868089310824871, 0.00836312398314476, -0.020876513794064522, -0.00206189276650548, 0.014107054099440575, 0.022474991157650948, -0.003141587832942605, 0.011439712718129158, -0.08473861962556839, 0.06131994351744652, 0.050958722829818726, -0.009672719985246658, 0.016552917659282684, -0.02409272827208042, 0.005763188935816288, 0.019817281514406204, 0.033529531210660934, 0.03221993148326874, -0.026134159415960312, -0.03886421024799347, 0.025826018303632736, -0.0014757037861272693, 0.06856124103069305, -0.022147592157125473, 0.021955005824565887, 0.05581193417310715, 0.013423367403447628, -0.031603652983903885, 0.05823853984475136, -0.01197895873337984, 0.05654376745223999, 0.0397501140832901, 0.025363808497786522, 0.03630279377102852, 0.04371742159128189, 0.07676548510789871, -0.060318488627672195, 0.01031307503581047, -0.028888164088129997, -0.13612103462219238, -0.009870123118162155, -0.03487764298915863, -0.04645216837525368, -0.03293250873684883, 0.046991415321826935, -0.015898119658231735, 0.008979404345154762, 0.014444082044064999, -0.01550331525504589, 0.020221715793013573, 0.015927007421851158, -0.05092020332813263, -0.03664945065975189, -0.03451172634959221, -0.014318900182843208, -0.05427123233675957, -0.021261688321828842, -0.03703462705016136, -0.005344310309737921, 0.007236485369503498, -0.009764199145138264, 0.07799804210662842, -0.06128142774105072, 0.028945941478013992, 0.019913574680685997, 0.028002260252833366, 0.0047954353503882885, -0.017477339133620262, -0.003938419744372368, -0.0173136405646801, -0.011555265635251999, -0.011343419551849365, -0.08019354194402695, -0.06051107496023178, 0.03876791521906853, 0.048917293548583984, -0.010813802480697632, -0.03728499263525009, 0.027270426973700523, 0.018594348803162575, 0.028945941478013992, -0.01930692419409752, 0.019798021763563156, 0.020953549072146416, -0.032489556819200516, 0.009403097443282604, -0.015811454504728317, 0.022359440103173256, -0.0053924573585391045, 0.04760769382119179, 0.02848372980952263, 0.05115130916237831, -0.017438821494579315, -0.003769905539229512, -0.010794544592499733, -0.05465640872716904, -0.025691207498311996, -0.044449254870414734, 0.00956198200583458, 0.0009250231087207794, 0.04325520992279053, -0.012094511650502682, 0.0018813416827470064, -0.0339532233774662, -0.036996107548475266, -0.041868578642606735, 0.03437691554427147, -0.03308657929301262, -0.008175350725650787, 0.014424823224544525, 0.03857532888650894, -0.04795435443520546, 0.032085120677948, 0.01443445309996605, -0.039037540555000305, 0.003370285965502262, 0.053154222667217255, 0.022975720465183258, 0.01333670224994421, -0.04256189614534378, 0.029966656118631363, -0.011189348995685577, -0.014723334461450577, 0.01744845137000084, -0.07014046609401703, -0.025325290858745575, 0.013712248764932156, -0.0237075537443161, -0.061358463019132614, -0.06513318419456482, 0.01462704036384821, 0.019008412957191467, 0.01863286644220352, -0.04645216837525368, -0.02384236454963684, 0.017544744536280632, 0.07160413265228271, 0.01237376406788826, -0.03100663051009178, -0.03730424866080284, 0.01928766444325447, 0.019894316792488098, -0.010765655897557735, -0.015811454504728317, -0.011767112649977207, -0.044680360704660416, -0.05138241499662399, 0.017149940133094788, 0.052499424666166306, 0.06128142774105072, -0.017978068441152573, -0.020298751071095467, 0.008030910044908524, -0.030217019841074944, 0.006437246222048998, -0.016312183812260628, 0.016485512256622314, -0.0538475401699543, -0.03639908879995346, 0.03689981624484062, -0.02322608418762684, -0.019894316792488098, -0.08496972173452377, 0.013173002749681473, -0.03510874882340431, 0.06655833125114441, 0.028021520003676414, 0.017987696453928947, 0.029080752283334732, 0.0948302149772644, -0.03703462705016136, 0.027020063251256943, 0.023669036105275154, -0.019817281514406204, 0.009181621484458447, -0.015609238296747208, -0.0845845490694046, 0.03254733234643936, 0.006543169263750315, -0.061242908239364624, -0.07487811893224716, -0.0156862735748291, -0.0044054449535906315, -0.008916813880205154, -0.009350135922431946, 0.0326821431517601, -0.04025084152817726, -0.052229803055524826, -0.04248486086726189, 0.0020185604225844145, 0.049032844603061676, -0.018758047372102737, -0.008093500509858131, -0.02784818969666958, 0.04899432882666588, -0.045989956706762314, 0.02409272827208042, -0.019720986485481262, 0.0013108004350215197, -0.015532203018665314, -0.035455405712127686, -0.0027828931342810392, -0.022128334268927574, 0.017207717522978783, 0.030929595232009888, -0.029908878728747368, -0.02243647351861, 0.031122183427214622, -0.036996107548475266, -0.021569829434156418, 0.010871578939259052, 0.03670722618699074, -0.013038191944360733, 0.03428062051534653, -0.025999348610639572, -0.007847951725125313, 0.02834891900420189, -0.025460101664066315, 0.004812286701053381, 0.007626475300639868, 0.08574007451534271, -0.03574428707361221, -0.015849972143769264, 0.06382358819246292, -0.025460101664066315, 0.04248486086726189, -0.030217019841074944, 0.03474283218383789, 0.046991415321826935, 0.0576992928981781, -0.0003240891091991216, 0.014386305585503578, -0.050034299492836, 0.06035700440406799, -0.06571094691753387, -0.034415435045957565, -0.005252831149846315, -0.01038048043847084, -0.018170654773712158, 0.027520790696144104, 0.04760769382119179, -0.05427123233675957, 0.021589089184999466, -0.025864535942673683, -0.007448331918567419, -0.000013776420018984936, -0.013182632625102997, -0.012604868970811367, 0.0030862188432365656, -0.034434691071510315, -0.06128142774105072, 0.022147592157125473, 0.0006523910560645163, -0.00165866210591048, -0.010804173536598682, 0.023726811632514, -0.008579785004258156, -0.0474151074886322, 0.010043451562523842, 0.048647668212652206, -0.0027227094396948814, 0.0641317218542099, -0.03266288340091705, -0.01102564949542284, -0.018055103719234467, 0.002843076828867197, 0.04213820397853851, -0.013432996347546577, -0.061859190464019775, -0.017862515524029732, -0.016418106853961945, 0.05912444368004799, -0.019432105123996735, 0.000537741172593087, 0.015618867240846157, -0.040982674807310104, 0.05330829322338104, -0.03013998456299305, 0.02027949132025242, 0.014598152600228786, -0.010024192743003368, -0.023823106661438942, 0.048031389713287354, 0.007664992939680815, -0.030698489397764206, -0.05284608155488968, -0.00280455918982625, 0.03164216876029968, -0.016735875979065895, 0.021627604961395264, 0.032008085399866104, -0.030563678592443466, -0.07094933092594147, -0.010515292175114155, 0.00003641112562036142, 0.024034952744841576, -0.013163373805582523, 0.023919399827718735, 0.004179154522716999, -0.022975720465183258, 0.07391518354415894, -0.028657060116529465, -0.044680360704660416, -0.01461741141974926, 0.03849829360842705, -0.020587632432579994, 0.012489316053688526, 0.04887877404689789, -0.01928766444325447, 0.02114613726735115, 0.050034299492836, -0.04040491208434105, -0.014983328059315681, 0.017602521926164627, 0.03624501824378967, -0.0051035755313932896, -0.030794782564044, -0.03707314282655716, 0.0019379144068807364, -0.010351592674851418, 0.024189023301005363, 0.00424896739423275, 0.0025253070052713156, -0.0391145758330822, -0.07121895253658295, -0.016167743131518364, 0.026962287724018097, -0.04079008847475052, 0.02012542076408863, 0.03485838696360588, -0.00192467391025275, 0.020086903125047684, -0.0028358548879623413, -0.03614872321486473, -0.0007402591872960329, 0.05746818706393242, -0.005628377199172974, 0.008218682371079922, -0.05149796977639198, 0.00013308115012478083, 0.015628496184945107, -0.009277915582060814, 0.011507119052112103, 0.007024638820439577, 0.025691207498311996, -0.03478135168552399, -0.013721877709031105, 0.030448125675320625, 0.08766595274209976, 0.028291141614317894, 0.00465821661055088, 0.044410739094018936, 0.020221715793013573, 0.016668470576405525, -0.02707783877849579, 0.02076096087694168, -0.0069379741325974464, -0.023495707660913467, -0.0030115910340100527, -0.001029140898026526, -0.014646299183368683, -0.024978632107377052, -0.02488233894109726, 0.05781484767794609, 0.04818545654416084, -0.004687104839831591, -0.041984133422374725, 0.04090563952922821, -0.029331116005778313, 0.05947110056877136, -0.03539763018488884, 0.04625958204269409, 0.01563812606036663, -0.03412654995918274, 0.011584154330193996, 0.005503195337951183, 0.04656771942973137, -0.009927899576723576, 0.04718400165438652, -0.037766460329294205, 0.0022412401158362627, -0.025344548746943474, 0.03117995895445347, -0.02859928272664547, -0.027732638642191887, -0.034165069460868835, 0.03657241538167, -0.01185377687215805, -0.017024759203195572, -0.009176806546747684, -0.012932267971336842, 0.02012542076408863, 0.07079526036977768, -0.030332572758197784, 0.024015694856643677, -0.012787827290594578, 0.11200904101133347, -0.03664945065975189, -0.05311570689082146, -0.037997566163539886, 0.000988817773759365, 0.022109074518084526, 0.020472079515457153, 0.01526258047670126, 0.015098880976438522, -0.0012373763602226973, -0.044179633259773254, 0.03582132235169411, 0.04156043753027916, 0.0024097543209791183, -0.003326953621581197, -0.056235626339912415, -0.004612477030605078, 0.01819954439997673, 0.043139658868312836, 0.03510874882340431, 0.03410729393362999, -0.025575654581189156, 0.006047255825251341, -0.015166286379098892, -0.02078021876513958, 0.04398704692721367, -0.013644843362271786, -0.020587632432579994, -0.002294201636686921, -0.015281839296221733, 0.028772611171007156, 0.030428865924477577, -0.019952092319726944, -0.009769014082849026, -0.04348631575703621, -0.020972806960344315, -0.015715161338448524, -0.03778572008013725, 0.0461825467646122, 0.008834963664412498, 0.03304805979132652, 0.0030091837979853153, -0.012518204748630524 ]
42,894
linearmodels.system.model
_f_stat
null
def _f_stat( self, stats: AttrDict, debiased: bool ) -> WaldTestStatistic | InvalidTestStatistic: cov = stats.cov k = cov.shape[0] sel = list(range(k)) if stats.has_constant: sel.pop(stats.constant_loc) cov = cov[sel][:, sel] params = stats.params[sel] df = params.shape[0] nobs = stats.nobs null = "All parameters ex. constant are zero" name = "Equation F-statistic" try: stat = float(np.squeeze(params.T @ inv(cov) @ params)) except np.linalg.LinAlgError: return InvalidTestStatistic( "Covariance is singular, possibly due " "to constraints.", name=name ) if debiased: total_reg = np.sum([s.shape[1] for s in self._wx]) df_denom = len(self._wx) * nobs - total_reg wald = WaldTestStatistic(stat / df, null, df, df_denom=df_denom, name=name) else: return WaldTestStatistic(stat, null=null, df=df, name=name) return wald
(self, stats: linearmodels.shared.utility.AttrDict, debiased: bool) -> linearmodels.shared.hypotheses.WaldTestStatistic | linearmodels.shared.hypotheses.InvalidTestStatistic
[ 0.06933656334877014, -0.03201122209429741, 0.06134731322526932, -0.008228746242821217, 0.03372836858034134, -0.05494868382811546, -0.018364427611231804, -0.0018820827826857567, -0.02958914265036583, 0.06796284019947052, -0.01247190497815609, 0.04547726362943649, -0.010836097411811352, 0.001974718179553747, -0.014803608879446983, 0.07974789291620255, -0.02754664234817028, 0.03325841203331947, -0.01409867499023676, -0.0016550127184018493, -0.03257155418395996, 0.0032060928642749786, -0.049670714884996414, 0.02009964920580387, 0.008133850991725922, -0.007153269834816456, -0.0019679400138556957, -0.04001854732632637, 0.07385537028312683, -0.019756220281124115, -0.023823145776987076, -0.007266240194439888, 0.0009658947819843888, -0.020406927913427353, 0.007406323216855526, -0.02550414204597473, -0.00730239087715745, 0.039042484015226364, -0.04739324003458023, 0.024383477866649628, 0.01939471624791622, -0.04601952061057091, 0.03446945175528526, 0.028974585235118866, -0.021871021017432213, 0.03287883475422859, 0.017099162563681602, 0.027962371706962585, -0.05733461305499077, 0.004085000604391098, 0.027600867673754692, -0.04175376892089844, 0.017704682424664497, 0.015291639603674412, 0.01840057782828808, 0.009245477616786957, -0.00258475705049932, -0.006665239110589027, 0.047827042639255524, -0.04995992034673691, 0.03425255045294762, -0.011062037199735641, 0.005205664783716202, -0.04262137785553932, -0.053213462233543396, -0.03810257464647293, -0.017912548035383224, -0.008883972652256489, 0.02671518176794052, 0.022485578432679176, -0.00046684916014783084, 0.063913993537426, -0.0004970686859451234, 0.03493940830230713, -0.00944430474191904, -0.0034162173978984356, 0.0005942229763604701, -0.04920076206326485, -0.009137026034295559, -0.050285276025533676, 0.03965704143047333, -0.015924273058772087, -0.028974585235118866, -0.027094760909676552, -0.028323877602815628, -0.02035270258784294, 0.02060575596988201, -0.07859107851982117, 0.045911069959402084, 0.04605567082762718, -0.03824717551469803, -0.02188909612596035, 0.0422237254679203, -0.02532338909804821, 0.012480942532420158, 0.024256952106952667, -0.033059585839509964, 0.0059331925585865974, 0.010004636831581593, 0.03325841203331947, 0.035102084279060364, 0.009245477616786957, 0.03378259390592575, 0.09963063895702362, 0.014803608879446983, 0.015562768094241619, 0.015580843202769756, -0.04970686882734299, 0.02035270258784294, -0.02469075657427311, -0.03878943249583244, -0.0489838570356369, 0.03799412027001381, 0.01831923983991146, -0.015119925141334534, -0.04319978505373001, -0.01415290031582117, 0.0074289171025156975, -0.01712627522647381, 0.014740345068275928, 0.032101597636938095, 0.03054712899029255, -0.04283828288316727, -0.007844647392630577, 0.020696131512522697, -0.01564410701394081, 0.0074289171025156975, -0.024510003626346588, 0.0770004540681839, 0.0716501921415329, 0.0352647639811039, 0.006588419433683157, 0.027203213423490524, 0.05371956527233124, 0.029806045815348625, 0.022810934111475945, 0.04153686389327049, 0.02234097756445408, 0.030366377905011177, -0.006565825082361698, 0.051116734743118286, 0.030709806829690933, -0.037704918533563614, 0.015110887587070465, 0.0030999009031802416, 0.07996479421854019, 0.014387878589332104, 0.024708831682801247, -0.009941373020410538, 0.005847335327416658, 0.018997060135006905, -0.018292127177119255, -0.029119186103343964, -0.019358566030859947, -0.01278822124004364, -0.07873567938804626, -0.0006987203960306942, -0.006778209004551172, -0.0010698273545131087, -0.006986074149608612, -0.016638243570923805, -0.013312403112649918, -0.018997060135006905, 0.007523812353610992, 0.011658519506454468, 0.017144350335001945, -0.056141648441553116, 0.029534917324781418, 0.003996883984655142, 0.007297871634364128, 0.03410794958472252, -0.009272590279579163, -0.026353677734732628, 0.046923283487558365, 0.007248165085911751, 0.014794571325182915, -0.009372004307806492, -0.05158669129014015, 0.001978107262402773, -0.05776841565966606, 0.053611114621162415, -0.02373277023434639, -0.041898369789123535, -0.05650315061211586, 0.013737170957028866, 0.01680092141032219, -0.015698332339525223, 0.015571805648505688, 0.0059331925585865974, -0.023624317720532417, -0.03663847967982292, -0.013167801313102245, 0.010095013305544853, -0.044392749667167664, 0.0077813840471208096, -0.0009896185947582126, -0.00025559496134519577, -0.02933608926832676, 0.07266240566968918, -0.05870832875370979, -0.038211025297641754, 0.0016290296334773302, 0.004306422080844641, -0.0006992852431721985, -0.06387784332036972, 0.03907863423228264, -0.00872129574418068, 0.005888004321604967, -0.01914166286587715, -0.015454316511750221, -0.0020074795465916395, 0.0030953821260482073, -0.05925058573484421, 0.02895651012659073, -0.011197601445019245, -0.03680115565657616, 0.10729452967643738, 0.04077770560979843, -0.03564434126019478, -0.005711771082133055, 0.04312748461961746, -0.08126620948314667, 0.03296921029686928, 0.0019498647889122367, 0.05400877073407173, -0.00185271049849689, 0.0464533269405365, -0.011025886982679367, -0.06438394635915756, -0.033186111599206924, 0.01335759088397026, 0.026317527517676353, 0.01100781187415123, -0.033746443688869476, -0.03535513952374458, -0.014794571325182915, 0.004008180927485228, -0.02429310232400894, 0.012444792315363884, -0.027203213423490524, -0.012959935702383518, -0.015861010178923607, 0.02380507066845894, 0.040126997977495193, -0.012245964258909225, -0.07132483273744583, -0.0010314175160601735, 0.0478631928563118, -0.02646212838590145, 0.021780645474791527, 0.004803490824997425, -0.02347971685230732, -0.036114297807216644, -0.0014245535712689161, -0.033999498933553696, -0.025739120319485664, -0.001676477026194334, 0.034704431891441345, 0.06293793022632599, -0.041645318269729614, 0.003425254952162504, -0.06850510090589523, -0.0384279265999794, 0.058129921555519104, -0.02201562374830246, -0.010772833600640297, 0.02926378883421421, -0.01800292357802391, -0.01387273520231247, 0.03215582296252251, 0.016629206016659737, 0.021798720583319664, -0.016457492485642433, -0.062395673245191574, -0.015870047733187675, 0.02799852192401886, 0.03893403336405754, -0.03799412027001381, 0.08025399595499039, 0.004505249671638012, 0.014487292617559433, -0.09731701016426086, -0.0109083978459239, 0.07801266759634018, -0.015924273058772087, 0.06864970177412033, -0.012264039367437363, -0.005720808636397123, 0.04638102650642395, 0.019882746040821075, 0.026190999895334244, 0.0102757653221488, 0.01767756976187229, -0.011188563890755177, 0.004227343015372753, -0.025088410824537277, 0.0349755585193634, -0.02194332331418991, 0.05874447897076607, -0.0020741319749504328, -0.015047624707221985, -0.013827546499669552, -0.01116145122796297, 0.02602832391858101, -0.04739324003458023, -0.04262137785553932, 0.023190513253211975, -0.05115288496017456, 0.005503905937075615, -0.024510003626346588, -0.00464533269405365, 0.018689781427383423, 0.013231064192950726, 0.01278822124004364, 0.03595162183046341, -0.0477185919880867, -0.05133363604545593, -0.024419628083705902, 0.022865159437060356, 0.08611036837100983, 0.0013601606478914618, 0.0325896292924881, 0.062395673245191574, 0.001728443312458694, -0.04171761870384216, 0.036674629896879196, 0.00639411062002182, -0.031215911731123924, -0.004026256036013365, 0.021202238276600838, -0.056720055639743805, -0.05256275087594986, 0.04855005443096161, 0.019123587757349014, -0.04403124749660492, 0.08379673957824707, 0.03987394645810127, 0.007221051957458258, 0.035102084279060364, -0.02360624261200428, -0.018545180559158325, -0.003002746729180217, -0.026552503928542137, -0.002266181167215109, -0.010194426402449608, -0.05133363604545593, 0.02272055670619011, 0.0026344640646129847, 0.07945868372917175, 0.02882998250424862, -0.02158181741833687, -0.04938151314854622, 0.016014648601412773, 0.013863696716725826, 0.035915471613407135, -0.008400460705161095, -0.03143281489610672, 0.03777721896767616, 0.029932571575045586, -0.011504880152642727, -0.038391776382923126, 0.05050217732787132, -0.04865850508213043, 0.01017635129392147, 0.016701506450772285, -0.04052465409040451, 0.02214214950799942, -0.012282115407288074, 0.026751331984996796, -0.05089983344078064, 0.024383477866649628, -0.0005337839829735458, -0.03054712899029255, -0.0109083978459239, 0.029372239485383034, -0.02042500302195549, 0.03437907621264458, 0.0022311604116111994, 0.0232989639043808, -0.0051469202153384686, -0.019864670932292938, -0.023118212819099426, -0.027347814291715622, 0.05274350568652153, -0.003090863348916173, -0.007862722501158714, -0.045911069959402084, -0.02875768207013607, 0.017063012346625328, -0.03174009546637535, -0.021075712516903877, -0.024419628083705902, -0.0035427440889179707, 0.04544111341238022, -0.008499874733388424, 0.032933060079813004, 0.07157789170742035, -0.03723496198654175, -0.026172924786806107, 0.0382833257317543, -0.020406927913427353, -0.04789934307336807, -0.055129434913396835, 0.028595004230737686, -0.01610502414405346, -0.02277478203177452, 0.017207613214850426, 0.014713232405483723, -0.008165482431650162, 0.06720368564128876, 0.0021588595118373632, 0.03278845548629761, -0.10028134286403656, 0.028992660343647003, -0.03810257464647293, 0.0475739911198616, -0.07013186812400818, 0.029372239485383034, 0.028360027819871902, 0.031089385971426964, 0.052273549139499664, -0.0608050562441349, -0.015616994351148605, 0.013538342900574207, -0.0014155160170048475, 0.0074289171025156975, -0.03137858957052231, -0.00218823179602623, -0.01604176126420498, 0.01825597696006298, 0.002810697304084897, 0.021798720583319664, -0.0464533269405365, -0.01596946083009243, 0.008635438047349453, -0.05314115807414055, -0.047754742205142975, -0.015255489386618137, -0.0009190121782012284, 0.04544111341238022, -0.009064724668860435, 0.01825597696006298, 0.035535890609025955, 0.017469704151153564, -0.0851704552769661, -0.018563255667686462, 0.041645318269729614, -0.03347531706094742, -0.005259890109300613, -0.05581629276275635, 0.05794917047023773, 0.013402778655290604, -0.007898872718214989, 0.04515191167593002, -0.023190513253211975, -0.053213462233543396, 0.004292865749448538, -0.02628137543797493, 0.0003784500004258007, 0.030438678339123726, -0.0451880618929863, 0.007898872718214989, -0.09146063774824142, -0.02112993784248829, -0.0475739911198616, 0.008572175167500973, 0.08278452605009079, -0.0006049551884643734, 0.03484903275966644, 0.0026457610074430704, 0.02830580063164234, -0.005047506652772427, 0.0012799517717212439, -0.013077424839138985, -0.00009136461449088529, 0.012137513607740402, -0.04225987568497658, 0.00319705531001091, 0.022250602021813393, -0.004505249671638012, 0.025919871404767036, 0.013384703546762466, -0.006163651589304209, -0.009932335466146469, 0.05082752928137779, -0.06492620706558228, -0.030583279207348824, 0.012038099579513073, 0.013140687718987465, 0.028992660343647003, 0.0159784983843565, -0.019629694521427155, 0.04999607056379318, -0.007279796525835991, -0.052454300224781036, 0.007501218002289534, 0.05267120525240898, 0.0003016302944160998, 0.017523929476737976, -0.02539568953216076, 0.034198325127363205, -0.03002294711768627, -0.06655297428369522, -0.031722020357847214, -0.05773226544260979, -0.02837810292840004, -0.006213358603417873, -0.006484486628323793, -0.005621394608169794, -0.02385929599404335, 0.018942834809422493, -0.003619563765823841, -0.018617480993270874, -0.008626400493085384, 0.026679031550884247, -0.049779169261455536, -0.006954442709684372, 0.022124074399471283, -0.0033936232794076204, -0.017957735806703568, -0.025811420753598213, 0.035481665283441544, -0.03387296944856644, 0.0021294874604791403, 0.010619194246828556, -0.00045159817091189325, -0.0232989639043808, -0.006281140260398388, 0.09334045648574829, -0.016909372061491013, -0.027022460475564003, -0.045911069959402084, 0.03613237291574478, 0.002901073545217514, 0.01928626373410225, -0.040633104741573334, 0.03557204082608223, -0.053213462233543396, -0.12818948924541473, -0.02868538163602352, 0.014749383553862572, -0.011694670654833317, -0.009561793878674507, -0.03192084655165672, 0.02648020349442959, -0.04204297065734863, 0.014767458662390709, -0.030962860211730003, 0.04995992034673691, -0.058382973074913025, -0.02035270258784294, -0.025937946513295174, -0.0006156873423606157, 0.03428870067000389, -0.020262327045202255, 0.044248148798942566, -0.011857347562909126, 0.055201735347509384, -0.0257571954280138, 0.027383964508771896, -0.05390032008290291, -0.0198465958237648, 0.057623814791440964, 0.0025621631648391485, -0.015607955865561962, 0.007013187278062105, 0.10765603929758072, 0.05021297186613083, 0.00017369161651004106, 0.0005608968203887343, -0.02901073545217514, 0.08018169552087784, -0.03262577950954437, 0.021148012951016426, -0.00206848350353539, -0.012399603612720966, 0.007975692860782146, -0.037126511335372925, 0.005381898023188114, 0.01221885159611702, -0.07197554409503937, -0.049345362931489944, -0.036548104137182236, 0.021419141441583633, -0.026679031550884247, 0.0423683263361454, -0.0502491220831871, 0.014080599881708622, 0.008350753225386143, 0.03633120283484459, -0.0819169133901596, -0.06933656334877014, -0.023913521319627762, -0.05089983344078064, -0.00024330946325790137, -0.01069149561226368, -0.04808009788393974, -0.004451023880392313, 0.006199801806360483, 0.03663847967982292, -0.02564874291419983, -0.021599892526865005, 0.029101110994815826, -0.02100341022014618, 0.02398582361638546, 0.019521242007613182, -0.003908767364919186, 0.03450560197234154, -0.056647755205631256, -0.020822659134864807, -0.013321440666913986, 0.026552503928542137, 0.04413969814777374, 0.07584363967180252, 0.05422567203640938, -0.00807962566614151, -0.02075035683810711, 0.012209814041852951, 0.036927685141563416, 0.029227638617157936, -0.026136774569749832, 0.05267120525240898, -0.026805557310581207, 0.04294673353433609, 0.014378841035068035, -0.02340741641819477, 0.07837416976690292, -0.07801266759634018, -0.048007797449827194, -0.03199314698576927, -0.03860867768526077, 0.033945269882678986, -0.002410782966762781, -0.013926960527896881, -0.059720542281866074, 0.007681970484554768, 0.02544991672039032, 0.019774295389652252, 0.018427690491080284, 0.012905710376799107, 0.00944430474191904, 0.040886156260967255, 0.07071027904748917, -0.0118934977799654, -0.001640326576307416, 0.023823145776987076, -0.021599892526865005, -0.05324961245059967, 0.049851469695568085, -0.01483072154223919, -0.023136287927627563, 0.005503905937075615, -0.06261257827281952, 0.0038093535695225, 0.10028134286403656, -0.03792181983590126, -0.005684657953679562, 0.009724470786750317, 0.02246750332415104, 0.024148499593138695, -0.024961885064840317, -0.04779089242219925, 0.04544111341238022, 0.0017307027010247111, -0.017596231773495674, 0.006656201556324959, -0.011134338565170765, -0.0057524400763213634, -0.028016597032546997, -0.0952925831079483, 0.04117536172270775, 0.05216509848833084, -0.026444053277373314, -0.02888420782983303, -0.020714206621050835, 0.03347531706094742, -0.008508912287652493, 0.08170001208782196, -0.022033698856830597, -0.023913521319627762, 0.11083727329969406, 0.05299655720591545, 0.011080112308263779, 0.017722757533192635, 0.06687833368778229, -0.04319978505373001, -0.029281863942742348, -0.03219197317957878, -0.0653238594532013, -0.006308253388851881, -0.064890056848526, -0.0851704552769661, 0.03387296944856644, 0.01018538884818554, 0.03334878757596016, -0.09428036957979202, 0.020461153239011765, 0.0675651878118515, 0.04576646909117699, 0.018020998686552048, -0.020208101719617844, 0.001564636593684554, 0.029860271140933037, 0.02550414204597473, 0.02226867713034153, -0.005734364967793226, 0.042729832231998444, -0.02405812405049801, 0.03347531706094742, -0.06275717914104462, -0.0006179467309266329, 0.01059208158403635, -0.041392263025045395, 0.03224620223045349, -0.02792622148990631, 0.06550461053848267, -0.014008298516273499, -0.028269650414586067, 0.008115775883197784, -0.015418166294693947, 0.04938151314854622, 0.004130188841372728, 0.00008042062836466357, 0.05285195633769035, -0.005675620399415493, -0.05158669129014015, 0.02608254924416542, 0.016638243570923805, 0.00922288279980421, -0.02722128853201866, 0.03792181983590126, -0.027709318324923515, -0.05209279805421829, -0.005205664783716202, -0.03161356598138809, 0.015861010178923607, 0.019015135243535042, 0.002322666347026825, -0.0422237254679203, 0.0952925831079483, 0.020262327045202255, 0.08329063653945923, -0.008626400493085384, -0.023750845342874527, -0.03029407560825348, 0.056720055639743805, -0.01788543537259102, -0.006669757887721062, 0.003908767364919186, -0.04938151314854622, 0.062070321291685104, -0.037054210901260376, 0.00969735812395811, 0.07620514929294586, 0.09088222682476044, -0.007207495626062155, 0.009390079416334629, -0.025287238880991936, -0.0007275277748703957, -0.030276000499725342, 0.006010012235492468, 0.004939055070281029, 0.05158669129014015, 0.020262327045202255, -0.03933168947696686, 0.04352514073252678, -0.026534428820014, 0.035897396504879 ]
42,895
linearmodels.system.model
_gls_estimate
Core estimation routine for iterative GLS
def _gls_estimate( self, eps: Float64Array, nobs: int, total_cols: int, ci: Sequence[int], full_cov: bool, debiased: bool, ) -> tuple[Float64Array, Float64Array, Float64Array, Float64Array]: """Core estimation routine for iterative GLS""" wy, wx, wxhat = self._wy, self._wx, self._wxhat if self._sigma is None: sigma = eps.T @ eps / nobs sigma *= self._sigma_scale(debiased) else: sigma = self._sigma est_sigma = sigma if not full_cov: sigma = np.diag(np.diag(sigma)) sigma_inv = inv(sigma) k = len(wy) xpx = blocked_inner_prod(wxhat, sigma_inv) xpy = np.zeros((total_cols, 1)) for i in range(k): sy = np.zeros((nobs, 1)) for j in range(k): sy += sigma_inv[i, j] * wy[j] xpy[ci[i] : ci[i + 1]] = wxhat[i].T @ sy beta = _parameters_from_xprod(xpx, xpy, constraints=self.constraints) loc = 0 for j in range(k): _wx = wx[j] _wy = wy[j] kx = _wx.shape[1] eps[:, [j]] = _wy - _wx @ beta[loc : loc + kx] loc += kx return beta, eps, sigma, est_sigma
(self, eps: numpy.ndarray, nobs: int, total_cols: int, ci: collections.abc.Sequence[int], full_cov: bool, debiased: bool) -> tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray, numpy.ndarray]
[ -0.0017780899070203304, -0.09603346139192581, -0.003017652314156294, 0.035167984664440155, -0.00011594949319260195, -0.02793700620532036, -0.011558176949620247, -0.09185808897018433, 0.014528382569551468, 0.003862215206027031, -0.03044222667813301, -0.02188272401690483, -0.03044222667813301, 0.052571676671504974, -0.0860125795006752, 0.05773394927382469, -0.004533595405519009, -0.015496307983994484, -0.036952003836631775, -0.023495933040976524, -0.08624032139778137, 0.008213138207793236, -0.019643208011984825, 0.03444678336381912, -0.014756129123270512, -0.0037673204205930233, 0.05663317069411278, -0.05128110945224762, 0.04152593016624451, -0.008882146328687668, -0.009095659479498863, -0.03186564892530441, 0.02389449067413807, -0.07382809370756149, 0.018789155408740044, -0.04384136199951172, 0.01703360304236412, -0.00910514872521162, -0.017916124314069748, -0.023135334253311157, -0.020630111917853355, -0.06771687418222427, 0.0682862401008606, -0.027405595406889915, -0.007909474894404411, -0.02315431274473667, 0.00865439884364605, 0.052154138684272766, -0.008374459110200405, -0.010334035381674767, -0.010675656609237194, -0.05181251838803291, -0.005760109517723322, -0.04953504726290703, 0.008986529894173145, 0.04346178472042084, 0.023609807714819908, 0.02300248108804226, 0.0497627928853035, -0.031637899577617645, 0.04444868862628937, -0.06691975891590118, -0.030385291203856468, 0.00227035628631711, 0.008796741254627705, -0.04441073164343834, -0.031220363453030586, -0.028999827802181244, 0.027690280228853226, 0.053330834954977036, -0.0107515724375844, 0.02455875463783741, 0.0077291750349104404, 0.00614917790517211, -0.03336498513817787, 0.037654224783182144, -0.04365157335996628, -0.07063963264226913, -0.026665417477488518, -0.04953504726290703, 0.006263051647692919, 0.013019556179642677, -0.0004563842958305031, 0.0029464811086654663, -0.0013949524145573378, 0.014993365854024887, -0.004099451936781406, -0.018428554758429527, 0.037654224783182144, 0.07561211287975311, -0.024065302684903145, 0.017621949315071106, 0.04460052028298378, 0.028923911973834038, 0.0329284705221653, 0.020914796739816666, -0.02611502818763256, 0.049231383949518204, 0.05185047537088394, -0.01952933333814144, 0.046840034425258636, 0.007620046380907297, -0.0032809851691126823, 0.04847222566604614, -0.01637882925570011, 0.01385462936013937, 0.059024516493082047, -0.020098702982068062, 0.1088632270693779, -0.039779867976903915, -0.02541280724108219, 0.0005586926708929241, 0.017536545172333717, 0.008659143932163715, -0.05834127590060234, -0.022262301295995712, -0.030005712062120438, 0.03268174082040787, -0.02408428117632866, 0.028677185997366905, -0.08365918695926666, -0.02732967957854271, -0.02770925872027874, 0.04581517353653908, 0.03410516306757927, -0.02080092392861843, 0.021996596828103065, 0.008697101846337318, 0.02154110185801983, -0.020022787153720856, 0.032055437564849854, -0.04930729791522026, 0.03511104732751846, -0.04498009756207466, 0.03680017217993736, -0.0019038254395127296, 0.00652875704690814, -0.033763542771339417, 0.007923709228634834, -0.0009133617277257144, 0.020857859402894974, 0.02685520611703396, -0.07652310281991959, 0.02173089236021042, 0.006310499273240566, 0.04577721282839775, 0.0559878870844841, -0.021351313218474388, -0.017764292657375336, -0.004635607358068228, -0.035870205610990524, 0.005219209939241409, -0.0528753399848938, -0.010571272112429142, -0.012791808694601059, -0.05317900329828262, 0.03562347963452339, -0.00041130930185317993, -0.01840008608996868, -0.01493642944842577, -0.06646426767110825, -0.02653256431221962, -0.0180205088108778, 0.013664839789271355, 0.010476377792656422, 0.042512837797403336, -0.08457017689943314, 0.015069281682372093, -0.028297606855630875, -0.025621574372053146, -0.03600305691361427, -0.007088636048138142, -0.004604766611009836, -0.03171381726861, -0.018191318958997726, 0.021958639845252037, 0.0002735636953730136, 0.00011075993825215846, -0.0039072902873158455, -0.028525354340672493, 0.061985231935977936, -0.03642059490084648, -0.0058692386373877525, -0.03268174082040787, -0.015875887125730515, 0.03985578194260597, 0.030081627890467644, -0.04501805827021599, -0.0012348175514489412, -0.01820080727338791, -0.06832420080900192, -0.00973619893193245, 0.02850637398660183, -0.019908912479877472, 0.00891061406582594, 0.07375217974185944, 0.049610961228609085, 0.05811353027820587, 0.0011974527733400464, 0.03448474407196045, -0.027690280228853226, -0.01787816546857357, -0.02974000573158264, -0.04308220371603966, 0.010315055958926678, 0.0069462936371564865, -0.04236100614070892, -0.06619855761528015, 0.009821604005992413, 0.03928641602396965, -0.02767130173742771, 0.023685723543167114, -0.02611502818763256, 0.02653256431221962, 0.04160184785723686, 0.003530083689838648, 0.06536348164081573, 0.02493833377957344, -0.004977228119969368, -0.038033805787563324, 0.011634092777967453, -0.12207257002592087, 0.03082180581986904, -0.039020709693431854, -0.017726333811879158, -0.02080092392861843, 0.04384136199951172, 0.03866010904312134, -0.022698817774653435, 0.003878821851685643, -0.007814580574631691, -0.02827862836420536, 0.0668058842420578, -0.01923516020178795, -0.03833746910095215, -0.01994687132537365, -0.041146352887153625, 0.047067783772945404, 0.015543756075203419, 0.020725008100271225, -0.0720820352435112, -0.014813066460192204, -0.033099278807640076, 0.08350735902786255, -0.018476001918315887, -0.0041872295551002026, 0.04023536294698715, 0.031543005257844925, -0.009541664272546768, 0.05306512862443924, 0.007397043518722057, -0.018001528456807137, -0.011985203251242638, 0.0005281484336592257, -0.03216931223869324, -0.015856908634305, 0.02583034336566925, 0.07583986222743988, 0.046877991408109665, -0.05780986696481705, 0.04676412045955658, 0.018172338604927063, -0.03683813288807869, 0.014006461016833782, -0.017517566680908203, 0.0559878870844841, 0.056898877024650574, -0.01707156002521515, 0.03518696501851082, 0.09041569381952286, 0.0355665422976017, 0.10339728742837906, -0.041753679513931274, -0.02080092392861843, 0.009162085130810738, 0.0454355925321579, -0.031827691942453384, 0.0075631095096468925, 0.02338206022977829, 0.0018184201326221228, 0.043309953063726425, -0.04839630797505379, -0.048434264957904816, 0.06570510566234589, -0.045853130519390106, 0.004668820183724165, -0.036249782890081406, -0.056101761758327484, 0.030518142506480217, -0.009821604005992413, 0.01952933333814144, -0.008673377335071564, 0.023495933040976524, 0.005579809658229351, 0.08737906068563461, -0.0100398613139987, 0.014680213294923306, 0.01750807650387287, 0.023495933040976524, 0.037711162120103836, 0.04554946720600128, -0.03378252312541008, -0.024387944489717484, -0.013332708738744259, 0.009375598281621933, -0.04710574075579643, 0.0069083357229828835, -0.06805849820375443, -0.02611502818763256, -0.019776061177253723, -0.0547732338309288, 0.02761436440050602, 0.02793700620532036, 0.002538433764129877, -0.05082561448216438, -0.058265358209609985, -0.06657813489437103, -0.06710954755544662, 0.04661228880286217, 0.029986731708049774, -0.004972483497112989, 0.011273493058979511, 0.03139117360115051, -0.0020758220925927162, -0.0033901140559464693, 0.012288866564631462, -0.002977321855723858, 0.015259071253240108, 0.01229835581034422, -0.006979506928473711, -0.028069859370589256, -0.02837352268397808, 0.030461207032203674, 0.03655344620347023, -0.026836227625608444, -0.0005305208032950759, 0.015771502628922462, -0.01258304063230753, 0.010381482541561127, -0.09990516304969788, 0.042550794780254364, 0.0056272572837769985, -0.05799965560436249, 0.031922586262226105, -0.012269888073205948, -0.0655912309885025, 0.0757259875535965, -0.03533879667520523, 0.0038076508790254593, 0.02748151123523712, -0.04008353129029274, 0.001421048422344029, 0.027120912447571754, 0.03501615300774574, 0.02395142801105976, 0.09170626103878021, -0.023040438070893288, -0.022186385467648506, 0.046460457146167755, -0.06338967382907867, 0.008806230500340462, 0.03687608987092972, -0.02023155428469181, 0.0004397777374833822, 0.023495933040976524, -0.057658035308122635, 0.0050626336596906185, -0.03167586028575897, 0.018238766118884087, -0.020819902420043945, 0.007098125293850899, -0.04847222566604614, -0.013152408413589, 0.035395730286836624, -0.026077069342136383, -0.010552293621003628, -0.035262878984212875, -0.030897721648216248, -0.00417299522086978, -0.02554566040635109, 0.018893539905548096, -0.02207251265645027, 0.027367638424038887, -0.006580948829650879, 0.047637149691581726, -0.015780992805957794, 0.020212575793266296, 0.034598615020513535, -0.005361551884561777, -0.06411087512969971, 0.0027875325176864862, -0.004559691529721022, 0.008388693444430828, -0.0007674610824324191, 0.021806808188557625, -0.01595180295407772, 0.12731076776981354, -0.02936042658984661, -0.03207441791892052, 0.005038909614086151, -0.04995258152484894, 0.018428554758429527, -0.021996596828103065, 0.01975708082318306, -0.07500478625297546, -0.09823501855134964, -0.017612461000680923, -0.006941549014300108, -0.021256418898701668, 0.03514900431036949, -0.010248630307614803, 0.06946294009685516, -0.07602965086698532, -0.003015279769897461, -0.022414132952690125, 0.026285838335752487, -0.05811353027820587, 0.014110845513641834, 0.013930545188486576, 0.04072881489992142, 0.026836227625608444, -0.014471445232629776, 0.0442209392786026, 0.05750620365142822, 0.014813066460192204, 0.004388880915939808, -0.08715131133794785, -0.09216175228357315, -0.043727487325668335, -0.027785174548625946, 0.021901702508330345, -0.010134756565093994, -0.02577340602874756, 0.036724258214235306, -0.015192645601928234, -0.030613036826252937, -0.043917279690504074, 0.056101761758327484, -0.0044339559972286224, -0.013892587274312973, 0.01256406120955944, 0.04262670874595642, -0.0049962070770561695, 0.030176522210240364, -0.00385272572748363, -0.008213138207793236, 0.023401038721203804, -0.043727487325668335, -0.07629536092281342, -0.006509778089821339, 0.04501805827021599, 0.035073090344667435, 0.0593661405146122, -0.008673377335071564, -0.020781943574547768, -0.036344677209854126, 0.010732593014836311, -0.04380340501666069, -0.005285636056214571, 0.060011424124240875, 0.028050880879163742, 0.004901312291622162, 0.00910514872521162, 0.014528382569551468, -0.008270075544714928, -0.049041591584682465, 0.051167234778404236, 0.016198528930544853, -0.027405595406889915, -0.025982175022363663, 0.013085982762277126, 0.010922382585704327, 0.0205541979521513, -0.030897721648216248, -0.02102867141366005, -0.02045930176973343, -0.06096037104725838, -0.005935664754360914, 0.03199850022792816, -0.031030574813485146, -0.018884049728512764, -0.011795413680374622, 0.017394203692674637, 0.04710574075579643, 0.036857109516859055, 0.021579060703516006, 0.020687049254775047, 0.008682867512106895, 0.0018907773774117231, -0.01430063508450985, -0.02338206022977829, -0.016568617895245552, 0.027690280228853226, 0.037654224783182144, -0.025090165436267853, -0.010229650884866714, 0.06767891347408295, -0.0355665422976017, 0.05743028596043587, -0.05875881388783455, 0.04342382401227951, -0.037046898156404495, -0.003065099474042654, -0.0033806245774030685, -0.023533891886472702, -0.09451514482498169, 0.041981425136327744, 0.0363067202270031, -0.006533501669764519, 0.006481309421360493, -0.005983112379908562, -0.034181080758571625, 0.03712281584739685, -0.035775311291217804, 0.007368575315922499, -0.04816856235265732, 0.012450187467038631, 0.008924848400056362, 0.03364966809749603, -0.012545082718133926, 0.047485318034887314, -0.02338206022977829, -0.003155249636620283, 0.023742659017443657, 0.021351313218474388, 0.028620248660445213, -0.02503322809934616, 0.018267234787344933, 0.028069859370589256, 0.013114450499415398, -0.023230228573083878, -0.008986529894173145, 0.019111797213554382, 0.02315431274473667, -0.0037103837821632624, -0.047485318034887314, 0.04797877371311188, -0.0761435255408287, -0.03560449928045273, -0.050977446138858795, 0.021996596828103065, -0.015467840246856213, 0.03890683501958847, 0.030745889991521835, -0.023438995704054832, 0.027766196057200432, 0.00623458344489336, 0.003916779533028603, 0.006324733141809702, -0.02154110185801983, 0.044296856969594955, 0.022224344313144684, -0.01952933333814144, 0.011178598739206791, 0.0065762042067945, 0.02493833377957344, -0.059024516493082047, 0.024672627449035645, -0.05458344519138336, 0.01557222381234169, -0.010400461964309216, -0.010011393576860428, 0.03383945673704147, 0.017773780971765518, 0.03161892294883728, 0.022243322804570198, 0.05917634814977646, 0.035965099930763245, -0.0006357946549542248, 0.01670147106051445, 0.0023901609238237143, 0.01768837682902813, -0.029910815879702568, 0.00368191534653306, -0.0004474879242479801, -0.004298730753362179, 0.03393435478210449, -0.005361551884561777, -0.015629161149263382, 0.005276146810501814, 0.043120160698890686, -0.06908335536718369, 0.019073840230703354, -0.009684006683528423, 0.038982752710580826, 0.06073262169957161, -0.08639215677976608, 0.03647753223776817, 0.030745889991521835, 0.020914796739816666, -0.039817824959754944, 0.06399700045585632, -0.028449438512325287, -0.0879104733467102, -0.019643208011984825, 0.04702982306480408, -0.05147089809179306, -0.01727083884179592, -0.050408076494932175, 0.006832419894635677, -0.07401788234710693, 0.015534265898168087, 0.028866974636912346, 0.03317519649863243, -0.004384136293083429, -0.01079901959747076, 0.019965849816799164, 0.007235722616314888, 0.011017276905477047, 0.015543756075203419, 0.022376175969839096, -0.03814768046140671, 0.01928260736167431, 0.03588918596506119, -0.03159994259476662, -0.012099076993763447, 0.0012229557614773512, 0.019121287390589714, 0.06847602874040604, 0.022224344313144684, 0.012915171682834625, 0.007477703969925642, -0.0451698899269104, 0.017631439492106438, 0.0003377659013494849, -0.021617017686367035, 0.023495933040976524, -0.039210498332977295, 0.006424372550100088, 0.0018978944281116128, -0.03410516306757927, 0.017669398337602615, 0.030897721648216248, -0.00341146532446146, 0.031410153955221176, -0.008981785736978054, 0.05974571779370308, 0.0009430163190700114, -0.040956564247608185, 0.06259255856275558, -0.02207251265645027, 0.05363449826836586, 0.04031127691268921, 0.005456446669995785, 0.0045241061598062515, 0.05856902152299881, -0.024482838809490204, 0.06050487607717514, 0.07834508270025253, 0.03306132182478905, 0.03626876324415207, 0.029796943068504333, -0.0292085949331522, -0.021560080349445343, -0.007406533230096102, -0.0052903806790709496, -0.011539198458194733, 0.017631439492106438, 0.034598615020513535, 0.006130198948085308, 0.0002790497965179384, -0.03298540413379669, 0.06403496116399765, -0.04406910762190819, -0.024312028661370277, 0.002391346963122487, -0.0020722635090351105, 0.024122238159179688, 0.00682293064892292, -0.04778898134827614, -0.01661606691777706, -0.019178222864866257, -0.0658569410443306, -0.0014803577214479446, -0.07246161252260208, -0.016862792894244194, -0.014537871815264225, -0.02596319653093815, 0.0012858235277235508, 0.018039487302303314, 0.11136844754219055, 0.05181251838803291, -0.041336141526699066, -0.022243322804570198, 0.03552858531475067, -0.04767511039972305, -0.005162273067981005, -0.004948759917169809, 0.002977321855723858, -0.04027331992983818, -0.05674704536795616, -0.014623276889324188, 0.04520784690976143, 0.01430063508450985, 0.022831670939922333, -0.030707933008670807, -0.0012051629601046443, -0.0010195252252742648, 0.027633342891931534, 0.005451702047139406, 0.010447909124195576, -0.0015337360091507435, -0.015970781445503235, 0.059669800102710724, 0.019320566207170486, 0.04930729791522026, 0.02131335437297821, -0.01858038641512394, 0.005760109517723322, -0.006315243896096945, -0.0015301774255931377, -0.038413383066654205, -0.000836852821521461, 0.004080472979694605, 0.02004176564514637, 0.019073840230703354, 0.03364966809749603, -0.02729172259569168, -0.010628209449350834, 0.032776638865470886, 0.019016902893781662, 0.007961667142808437, 0.0215031448751688, -0.041336141526699066, -0.016530660912394524, -0.009181064553558826, 0.027082953602075577, -0.007899985648691654, 0.06171952933073044, 0.023970406502485275, -0.009793135337531567, -0.03410516306757927, -0.0017887655412778258, 0.0075251515954732895, -0.05701274797320366, 0.005475425627082586, -0.033289067447185516, -0.012962618842720985, -0.01778327114880085, 0.002514710184186697, -0.008720825426280499, 0.06350354850292206, 0.004723384976387024, -0.029607154428958893, -0.06111220270395279, 0.04505601525306702, -0.015515287406742573, -0.03452270105481148, 0.03680017217993736, -0.02121846005320549, 0.09071935713291168, 0.01811540313065052, 0.05754416063427925, 0.050787657499313354, 0.04653637111186981, -0.011890308931469917, 0.037616267800331116, -0.048244476318359375, -0.041146352887153625, -0.013228324241936207, 0.018419066444039345, 0.02080092392861843, 0.008322266861796379, 0.07648514956235886, -0.04414502531290054, 0.021711912006139755, -0.030309375375509262, 0.01428165566176176 ]
42,896
linearmodels.system.model
_gls_finalize
Collect results to return after GLS estimation
def _gls_finalize( self, beta: Float64Array, sigma: Float64Array, full_sigma: Float64Array, est_sigma: Float64Array, gls_eps: Float64Array, eps: Float64Array, full_cov: bool, cov_type: str, iter_count: int, **cov_config: bool, ) -> SystemResults: """Collect results to return after GLS estimation""" k = len(self._wy) # Covariance estimation cov_estimator = COV_EST[cov_type] gls_eps = np.reshape(gls_eps, (k, gls_eps.shape[0] // k)).T eps = np.reshape(eps, (k, eps.shape[0] // k)).T cov_est = cov_estimator( self._wxhat, eps, sigma, full_sigma, gls=True, constraints=self._constraints, **cov_config, ) cov = cov_est.cov # Repackage results for individual equations individual = AttrDict() debiased = cov_config.get("debiased", False) method = "Iterative GLS" if iter_count > 1 else "GLS" for i in range(k): cons = bool(self.has_constant.iloc[i]) if cons: c = np.sqrt(self._w[i]) ye = self._wy[i] - c @ lstsq(c, self._wy[i], rcond=None)[0] else: ye = self._wy[i] total_ss = float(np.squeeze(ye.T @ ye)) stats = self._common_indiv_results( i, beta, cov, gls_eps, eps, method, cov_type, cov_est, iter_count, debiased, cons, total_ss, ) key = self._eq_labels[i] individual[key] = stats # Populate results dictionary nobs = eps.size results = self._common_results( beta, cov, method, iter_count, nobs, cov_type, est_sigma, individual, debiased, ) # wresid is different between GLS and OLS wresiduals = [] for individual_key in individual: wresiduals.append(individual[individual_key].wresid) wresid = np.hstack(wresiduals) results["wresid"] = wresid results["cov_estimator"] = cov_est results["cov_config"] = cov_est.cov_config individual = results["individual"] r2s = [individual[eq].r2 for eq in individual] results["system_r2"] = self._system_r2( eps, sigma, "gls", full_cov, debiased, r2s ) return SystemResults(results)
(self, beta: numpy.ndarray, sigma: numpy.ndarray, full_sigma: numpy.ndarray, est_sigma: numpy.ndarray, gls_eps: numpy.ndarray, eps: numpy.ndarray, full_cov: bool, cov_type: str, iter_count: int, **cov_config: bool) -> linearmodels.system.results.SystemResults
[ 0.014399208128452301, -0.06779947876930237, -0.05139824375510216, 0.03749954327940941, -0.002056170254945755, -0.01539059728384018, -0.05986836552619934, -0.09340234845876694, 0.051937252283096313, 0.007497983518987894, -0.022657576948404312, -0.0196737851947546, -0.02868291549384594, 0.023754842579364777, -0.0729585513472557, 0.044275641441345215, -0.03969407454133034, -0.02044379524886608, -0.0023304868955165148, -0.032763972878456116, -0.07272755354642868, 0.027027390897274017, 0.013359692879021168, 0.04670117422938347, 0.00868187565356493, -0.023928096517920494, 0.04227361083030701, -0.0412725955247879, 0.006521031726151705, 0.004278374370187521, -0.026257378980517387, -0.04046408459544182, 0.012454929761588573, -0.04262011498212814, 0.02186831645667553, -0.043890636414289474, 0.024640357121825218, -0.012156550772488117, -0.041503600776195526, 0.006299653556197882, -0.009153507649898529, -0.04365963116288185, 0.036787282675504684, -0.021136805415153503, 0.006184151861816645, -0.012965062633156776, -0.03155120462179184, 0.05574880540370941, -0.03807704895734787, -0.017739132046699524, -0.019279154017567635, -0.04023308306932449, -0.01151166670024395, -0.01467833761125803, 0.02723914384841919, 0.018124137073755264, 0.02475585788488388, 0.035054758191108704, 0.058289844542741776, -0.038789309561252594, 0.049819719046354294, -0.04250461608171463, -0.0949423760175705, 0.02023204229772091, -0.01574672758579254, -0.04323612526059151, -0.014514709822833538, -0.00013655665679834783, 0.048395201563835144, 0.0681459829211235, -0.01919252797961235, 0.011877421289682388, -0.0011255397694185376, -0.006554719991981983, -0.0043986886739730835, 0.04643167182803154, -0.031300950795412064, -0.06487343460321426, -0.011752295307815075, -0.04458364471793175, 0.03950157016515732, 0.03676803037524223, -0.015072967857122421, -0.02822090871632099, -0.02668088488280773, 0.00760385999456048, 0.010491401888430119, -0.011723419651389122, 0.04146509990096092, 0.0070215389132499695, -0.03207096457481384, 0.028374910354614258, 0.06552794575691223, 0.004466064739972353, 0.030838945880532265, -0.004812569357454777, -0.027373895049095154, -0.02523711510002613, 0.031012197956442833, -0.03667178004980087, 0.039463069289922714, -0.00834499578922987, -0.008782939054071903, 0.0681459829211235, 0.014630211517214775, 0.019279154017567635, 0.0369412824511528, -0.03761504217982292, 0.0623709000647068, -0.0072092292830348015, -0.006756847724318504, 0.02714289166033268, 0.010712780058383942, -0.0005110347410663962, -0.06953200697898865, -0.018095262348651886, -0.04065658897161484, 0.021752813830971718, -0.011684918776154518, 0.021156055852770805, -0.03980957716703415, -0.010963033884763718, 0.008580811321735382, 0.05840534344315529, 0.02157956175506115, 0.0005591604276560247, -0.0054382034577429295, 0.004023308400064707, 0.011261412873864174, -0.020097291097044945, 0.08185218274593353, 0.014379957690834999, -0.01189667172729969, -0.010741655714809895, 0.06964750587940216, -0.014071953482925892, -0.03877006098628044, -0.0364215262234211, 0.0058665224350988865, 0.01589110493659973, 0.019327279180288315, 0.016131732612848282, -0.05286126583814621, -0.0044083138927817345, 0.013812074437737465, 0.07276605069637299, 0.047933194786310196, -0.0036719907075166702, -0.04966571927070618, -0.03407299146056175, -0.010789780877530575, 0.003034325083717704, 0.02090580202639103, -0.024909859523177147, -0.05459379032254219, -0.03844280540943146, 0.024582605808973312, -0.01553497463464737, -0.008749251253902912, -0.011271038092672825, -0.03547826409339905, -0.007445045281201601, -0.029818682000041008, -0.010578027926385403, -0.00982726737856865, 0.008633749559521675, -0.04924221336841583, 0.004538252949714661, -0.0402715839445591, -0.022465074434876442, -0.016295360401272774, -0.015737103298306465, -0.046778175979852676, -0.020193541422486305, -0.015275095589458942, 0.06317941099405289, 0.01842251606285572, 0.015303971245884895, -0.006463280878961086, -0.029106421396136284, 0.022484324872493744, -0.05728882923722267, -0.045045651495456696, -0.002358159050345421, -0.035651516169309616, 0.047432687133550644, -0.004215810913592577, -0.062101397663354874, 0.006270778365433216, -0.011482791043817997, -0.05775083601474762, 0.0012097597355023026, 0.01563122682273388, 0.003412111895158887, 0.04854920133948326, 0.030088184401392937, 0.004817381966859102, 0.034477248787879944, -0.02820165827870369, 0.017710255458950996, -0.048318199813365936, 0.015101843513548374, -0.02752789855003357, -0.04939621314406395, -0.021040555089712143, -0.011271038092672825, -0.009321947582066059, -0.03588251769542694, 0.002683007624000311, 0.03911656513810158, -0.024428602308034897, 0.0196545347571373, -0.003125763963907957, 0.04134959727525711, 0.03330298140645027, -0.017806507647037506, 0.0699940100312233, 0.003686428302899003, 0.0055007669143378735, -0.04115709662437439, 0.013744698837399483, -0.11480866372585297, -0.0027191017288714647, -0.033610984683036804, -0.06964750587940216, 0.014803463593125343, 0.031416453421115875, 0.023004082962870598, -0.0073151057586073875, -0.014495459385216236, 0.010905282571911812, 0.001956309424713254, 0.0825451910495758, -0.04481464624404907, -0.07954215258359909, -0.04046408459544182, -0.020944302901625633, 0.08077416568994522, 0.015438723377883434, -0.004521409049630165, -0.04616216570138931, -0.056634318083524704, -0.06094638258218765, 0.05551780387759209, -0.03378423675894737, -0.00042952183866873384, 0.03530501201748848, 0.034015242010354996, 0.017036495730280876, 0.02906792052090168, -0.013359692879021168, -0.03058869205415249, -0.010789780877530575, -0.021059803664684296, -0.02514086291193962, -0.0863182470202446, -0.003224421525374055, 0.04181160405278206, 0.06756847351789474, -0.06052287667989731, 0.029125671833753586, 0.02063629776239395, -0.05717332661151886, 0.04392913356423378, -0.05205275118350983, 0.019086651504039764, 0.04458364471793175, -0.0032677347771823406, 0.05886735022068024, 0.10079445689916611, 0.10033245384693146, 0.03969407454133034, -0.04827969893813133, -0.018538018688559532, 0.016892118379473686, 0.08554823696613312, 0.0014979123370721936, 0.00901875551789999, 0.0527457632124424, 0.0412725955247879, 0.08685725927352905, 0.018749771639704704, -0.011280663311481476, 0.022657576948404312, -0.02562212012708187, 0.021079054102301598, -0.06129288673400879, -0.06883899867534637, 0.024505604058504105, -0.030357688665390015, 0.016304986551404, -0.012349053286015987, 0.06190889701247215, 0.02034754492342472, 0.09871542453765869, 0.0026661634910851717, 0.015236595645546913, -0.016381986439228058, 0.044083137065172195, 0.011492416262626648, 0.03012668527662754, -0.004839038942009211, 0.0441216379404068, -0.017238624393939972, 0.005313077010214329, -0.07588459551334381, 0.03836580365896225, -0.08277619630098343, -0.02427460066974163, 0.011617543175816536, -0.07215004414319992, 0.04358262941241264, 0.0517832487821579, 0.026911888271570206, -0.012156550772488117, -0.02377409301698208, -0.028432661667466164, -0.06483493745326996, 0.0042519052512943745, 0.016766993328928947, -0.0035829581320285797, 0.0008746845414862037, 0.06733747571706772, -0.012772560119628906, 0.0068964120000600815, -0.02820165827870369, -0.01880752108991146, 0.006675033830106258, 0.041773103177547455, -0.03830805420875549, -0.0431976243853569, -0.06845398992300034, 0.039001062512397766, 0.02696963958442211, 0.018124137073755264, -0.0016723679145798087, 0.0517832487821579, -0.02964542806148529, 0.004422751255333424, -0.10464451462030411, 0.03913581743836403, 0.011675293557345867, -0.060484375804662704, 0.031993962824344635, -0.03748029097914696, -0.029048670083284378, 0.04277411848306656, -0.07072552293539047, -0.0033230793196707964, -0.026623135432600975, -0.0460466668009758, -0.00107019511051476, 0.008782939054071903, 0.08323820680379868, 0.023350587114691734, 0.059521861374378204, 0.002904385793954134, -0.022753829136490822, 0.015361722558736801, -0.040733590722084045, -0.023908846080303192, 0.08870528638362885, -0.053862277418375015, 0.017623629420995712, 0.03776904568076134, -0.07553809136152267, 0.011261412873864174, -0.015650475397706032, 0.03210946545004845, -0.04288962110877037, 0.0056162686087191105, -0.06379542499780655, -0.0045454720966517925, 0.02562212012708187, -0.02417835034430027, 0.011386539787054062, -0.0012584869982674718, -0.02437085285782814, -0.019981788471341133, -0.06564345210790634, 0.02340833842754364, 0.016218358650803566, -0.00491844629868865, -0.007517233490943909, 0.06791498512029648, -0.021945318207144737, -0.003493925556540489, 0.025352615863084793, 0.03482375293970108, -0.03547826409339905, 0.013638822361826897, -0.0011435868218541145, 0.0661439597606659, 0.01563122682273388, 0.00835462100803852, 0.026141878217458725, 0.026700135320425034, -0.0004015487793367356, -0.04731718450784683, 0.031243201345205307, -0.03058869205415249, 0.001816745032556355, -0.04046408459544182, 0.022696077823638916, -0.05351577326655388, -0.1121906191110611, 0.017094247043132782, -0.024640357121825218, -0.022696077823638916, 0.06752997636795044, -0.03349548578262329, 0.026122627779841423, -0.06483493745326996, -0.030357688665390015, -0.04462214559316635, 0.010905282571911812, -0.022946331650018692, 0.056749820709228516, 0.07215004414319992, 0.0691085010766983, 0.015361722558736801, 0.025160113349556923, 0.09817641973495483, 0.07638510316610336, 0.02725839428603649, 0.0297224298119545, -0.0806201621890068, -0.02943367511034012, -0.07076402008533478, -0.008417184464633465, 0.00568364467471838, 0.006063837558031082, -0.01936578005552292, -0.005207200068980455, -0.02140630967915058, -0.00868187565356493, -0.04377513378858566, 0.054439786821603775, -0.029048670083284378, -0.0031233576592057943, 0.05775083601474762, 0.028567412868142128, -0.006492156535387039, 0.035940270870923996, 0.008590436540544033, 0.002683007624000311, -0.0025290052872151136, -0.040926091372966766, -0.07257355004549026, -0.005313077010214329, 0.017325250431895256, 0.04242761433124542, 0.028086155652999878, -0.008807002566754818, -0.02514086291193962, -0.008181368000805378, 0.019539032131433487, -0.03012668527662754, -0.0383850559592247, 0.006458468269556761, -0.015660101547837257, -0.01251268107444048, 0.00346505013294518, 0.0316474586725235, 0.00024724577087908983, -0.05343877151608467, 0.012127675116062164, 0.039366818964481354, -0.03894331306219101, -0.03149345517158508, -0.016362736001610756, 0.041580602526664734, 0.023677842691540718, -0.02236882410943508, -0.02140630967915058, -0.022022318094968796, -0.10710854828357697, -0.00380192999728024, -0.005370827857404947, -0.04477614909410477, -0.009649202227592468, 0.0014967091847211123, 0.02820165827870369, 0.043120622634887695, 0.045623160898685455, -0.007690486032515764, 0.05917535722255707, -0.0263728816062212, 0.03684503212571144, 0.005168699659407139, -0.03778829798102379, -0.0018949492368847132, 0.01591997966170311, 0.0451226532459259, -0.03518950939178467, 0.01319606602191925, 0.027989905327558517, -0.03316823020577431, 0.04804869368672371, -0.022965582087635994, 0.03713378682732582, -0.04404463618993759, -0.023273587226867676, -0.015438723377883434, 0.026931138709187508, -0.058174341917037964, 0.00394390057772398, 0.02311958372592926, -0.021136805415153503, 0.02082880027592182, -0.0643344298005104, -0.04050258547067642, 0.051090240478515625, -0.01970265991985798, 0.010568402707576752, 0.004162872675806284, 0.010789780877530575, 0.011376914568245411, -0.03867381066083908, 0.03984807804226875, -0.014158579520881176, 0.026045626029372215, -0.024024346843361855, 0.015332846902310848, 0.011068910360336304, 0.0184706412255764, -0.032552219927310944, -0.0004451626737136394, 0.025198614224791527, -0.004066621419042349, -0.015862230211496353, -0.005130199249833822, -0.02071329951286316, 0.029760930687189102, 0.02723914384841919, -0.011396165005862713, 0.028644414618611336, -0.06776098161935806, 0.00417731050401926, -0.03830805420875549, -0.00029958246159367263, -0.017979759722948074, 0.05802033841609955, 0.019394654780626297, -0.03330298140645027, 0.024505604058504105, 0.034015242010354996, 0.009360447525978088, 0.005674019455909729, -0.01697874628007412, 0.01070315483957529, 0.0022835643030703068, 0.009312322363257408, -0.006963788066059351, 0.0020489515736699104, 0.007117790635675192, -0.039001062512397766, 0.010404775850474834, -0.016131732612848282, 0.011088160797953606, -0.0033615799620747566, 0.02236882410943508, 0.01986628770828247, 0.01151166670024395, 0.005077261012047529, 0.02897166833281517, 0.07157253473997116, 0.04265861585736275, -0.040156081318855286, 0.008811814710497856, 0.038500554859638214, -0.023658592253923416, -0.045045651495456696, -0.03902031481266022, 0.003212390234693885, 0.005726957693696022, 0.014370332472026348, -0.023908846080303192, -0.015217345207929611, -0.00836905837059021, 0.033899739384651184, -0.043505627661943436, -0.00779636250808835, -0.045892663300037384, 0.038500554859638214, 0.06498894095420837, -0.06294841319322586, 0.0263728816062212, 0.021348558366298676, 0.05451678857207298, -0.027893653139472008, 0.08562523871660233, -0.02687338925898075, -0.10141046345233917, 0.0017349313711747527, 0.04593116417527199, -0.021502560004591942, -0.004947321489453316, -0.040425583720207214, 0.0030222937930375338, -0.06529694050550461, 0.03522801026701927, 0.017450377345085144, 0.02121380716562271, -0.020790301263332367, -0.011935172602534294, 0.024293851107358932, 0.025756873190402985, 0.011992922984063625, 0.010462526232004166, 0.004331312607973814, -0.04115709662437439, 0.024101348593831062, 0.008961004205048084, 0.023158084601163864, -0.020001038908958435, -0.011338413693010807, -0.0013607540167868137, 0.07923414558172226, 0.02256132662296295, 0.016892118379473686, 0.022003067657351494, -0.03713378682732582, 0.01535209733992815, -0.03667178004980087, -0.0015123500488698483, 0.011684918776154518, -0.03671028092503548, 0.010606903582811356, -0.027316145598888397, -0.0565958172082901, -0.016054732725024223, 0.05863634869456291, -0.04269711673259735, 0.06464243680238724, -0.011983298696577549, 0.001305409474298358, 0.033437732607126236, 0.00016167225840035826, 0.03413074463605881, -0.011049659922719002, 0.04681667685508728, 0.04134959727525711, 0.008782939054071903, -0.05097473785281181, 0.0311854500323534, 0.0030054496601223946, 0.031243201345205307, 0.08716525882482529, 0.01970265991985798, 0.003912618849426508, 0.04777919128537178, -0.0022137819323688745, -0.02437085285782814, -0.043428629636764526, -0.007353606168180704, 0.008778126910328865, -0.023427588865160942, 0.0374225415289402, -0.008961004205048084, 0.008027366362512112, -0.019009649753570557, 0.053862277418375015, -0.02369709312915802, -0.031435705721378326, -0.021521810442209244, 0.01955828256905079, 0.03701828420162201, 0.04593116417527199, -0.011348038911819458, -0.005645144265145063, -0.049742721021175385, -0.009504824876785278, 0.0045454720966517925, -0.08308420330286026, 0.013754324056208134, -0.014630211517214775, -0.007132227998226881, -0.0044925338588654995, 0.021637313067913055, 0.014851589687168598, 0.055286798626184464, -0.0728430524468422, -0.010712780058383942, 0.01486121490597725, -0.016150983050465584, -0.015294346027076244, 0.00022739391715731472, 0.00951445009559393, -0.030011184513568878, -0.036902785301208496, 0.005789521150290966, 0.03628677502274513, -0.028066905215382576, 0.0044732834212481976, 0.011434664949774742, 0.02148331142961979, -0.057211827486753464, 0.038134802132844925, -0.00966845266520977, 0.046277668327093124, -0.02791290357708931, -0.013879450969398022, 0.057789336889982224, 0.015650475397706032, 0.04727868363261223, 0.01424520555883646, -0.02656538411974907, -0.006381467450410128, -0.025102363899350166, 0.017421502619981766, -0.02023204229772091, 0.007748236879706383, -0.011145911179482937, -0.0021704689133912325, -0.0020477483049035072, 0.00577508332207799, 0.003587770741432905, -0.0017553847283124924, -0.018307015299797058, 0.02943367511034012, 0.03655627742409706, 0.04358262941241264, -0.03182071074843407, 0.016555238515138626, 0.004737974610179663, 0.06310240924358368, 0.01022189762443304, 0.0892442911863327, 0.0041989670135080814, -0.020193541422486305, -0.02388959564268589, -0.01567935198545456, 0.02600712515413761, -0.03455425053834915, 0.0036358963698148727, -0.02119455672800541, 0.014187455177307129, -0.013542571105062962, 0.004831819795072079, 0.010789780877530575, 0.05613381043076515, -0.02600712515413761, -0.04358262941241264, -0.04939621314406395, 0.03330298140645027, 0.00594352325424552, -0.0057943337596952915, -0.002471254440024495, -0.04069508984684944, 0.0833922028541565, -0.02285008132457733, 0.05162924528121948, 0.04566166177392006, 0.008566373959183693, 0.016237609088420868, 0.037441790103912354, -0.05763533338904381, -0.02090580202639103, -0.01084753219038248, 0.036614030599594116, 0.00254344311542809, 0.01719049923121929, 0.05363127589225769, -0.017325250431895256, 0.030242187902331352, -0.032263465225696564, 0.006217840127646923 ]
42,897
linearmodels.system.model
_multivariate_ls_finalize
null
def _multivariate_ls_finalize( self, beta: Float64Array, eps: Float64Array, sigma: Float64Array, cov_type: str, **cov_config: bool, ) -> SystemResults: k = len(self._wx) # Covariance estimation cov_estimator = COV_EST[cov_type] cov_est = cov_estimator( self._wxhat, eps, sigma, sigma, gls=False, constraints=self._constraints, **cov_config, ) cov = cov_est.cov individual = AttrDict() debiased = cov_config.get("debiased", False) for i in range(k): wy = wye = self._wy[i] w = self._w[i] cons = bool(self.has_constant.iloc[i]) if cons: wc = np.ones_like(wy) * np.sqrt(w) wye = wy - wc @ lstsq(wc, wy, rcond=None)[0] total_ss = float(np.squeeze(wye.T @ wye)) stats = self._common_indiv_results( i, beta, cov, eps, eps, "OLS", cov_type, cov_est, 0, debiased, cons, total_ss, ) key = self._eq_labels[i] individual[key] = stats nobs = eps.size results = self._common_results( beta, cov, "OLS", 0, nobs, cov_type, sigma, individual, debiased ) results["wresid"] = results.resid results["cov_estimator"] = cov_est results["cov_config"] = cov_est.cov_config individual = results["individual"] r2s = [individual[eq].r2 for eq in individual] results["system_r2"] = self._system_r2(eps, sigma, "ols", False, debiased, r2s) return SystemResults(results)
(self, beta: numpy.ndarray, eps: numpy.ndarray, sigma: numpy.ndarray, cov_type: str, **cov_config: bool) -> linearmodels.system.results.SystemResults
[ 0.013947553932666779, -0.049713678658008575, -0.01228600088506937, 0.0031189732253551483, -0.005051122512668371, -0.011668852530419827, -0.03621236979961395, -0.11021321266889572, 0.030857421457767487, 0.05119483545422554, -0.05635989084839821, -0.012504376471042633, -0.04132046177983284, 0.019957629963755608, -0.0888693705201149, 0.0495617650449276, -0.01568506471812725, 0.0035984499845653772, -0.013919070363044739, -0.02153373323380947, -0.0892491564154625, 0.047700826078653336, 0.005487873684614897, 0.0374656580388546, 0.01661553420126438, -0.021932505071163177, 0.009741450659930706, -0.06965231895446777, 0.020261457189917564, -0.005150815472006798, -0.023375682532787323, 0.01888474076986313, 0.013501308858394623, -0.031085291877388954, 0.030800452455878258, -0.006190473213791847, 0.02058427408337593, 0.006451574619859457, 0.007334571797400713, 0.02066023088991642, 0.020869111642241478, -0.04629562422633171, 0.06767744570970535, -0.004918198101222515, 0.02185654826462269, 0.006071791052818298, -0.01572304219007492, 0.058562636375427246, -0.015172356739640236, -0.023299725726246834, -0.03448435291647911, -0.02358456328511238, 0.033060166984796524, -0.04428277164697647, 0.02054629474878311, 0.008977135643362999, 0.027116551995277405, 0.014887519180774689, 0.033876702189445496, -0.015476183034479618, 0.029850995168089867, -0.01768842339515686, -0.06942445039749146, 0.02544550411403179, -0.027933087199926376, -0.08188135176897049, -0.013415857218205929, 0.01274174079298973, 0.03159799799323082, 0.0654367208480835, 0.020907089114189148, -0.03161698952317238, -0.036041468381881714, 0.009442370384931564, 0.026110125705599785, 0.001074669067747891, -0.026129115372896194, -0.08119774609804153, -0.02671777829527855, -0.00022238113160710782, 0.02369849942624569, 0.02172362431883812, -0.04808060824871063, -0.011602390557527542, -0.0019701276905834675, 0.01764095015823841, -0.016131309792399406, -0.021970484405755997, 0.06463917344808578, 0.02755330316722393, -0.017242176458239555, 0.03288926184177399, 0.059550076723098755, -0.006954787764698267, -0.01434632670134306, 0.041814178228378296, -0.0061477478593587875, -0.02274904027581215, 0.05013144016265869, -0.06934849172830582, 0.022976910695433617, -0.02947121113538742, 0.015305280685424805, 0.05051122605800629, -0.02067921869456768, 0.02675575762987137, 0.02561640739440918, -0.02356557548046112, 0.020869111642241478, 0.011773292906582355, 0.024287164211273193, 0.042725659906864166, -0.02867366559803486, 0.008037171326577663, -0.0691206231713295, -0.03212969750165939, -0.04561201483011246, 0.0306865181773901, -0.02950918860733509, 0.012827192433178425, -0.04819454252719879, 0.02185654826462269, -0.00884421169757843, 0.024363121017813683, -0.01683391071856022, -0.003491635899990797, 0.005312223918735981, -0.024173228070139885, -0.0009619207703508437, -0.009632262401282787, 0.03138911724090576, -0.004353269934654236, 0.01959683559834957, 0.016235750168561935, 0.04914400354027748, -0.025958212092518806, -0.03636428341269493, -0.0695004090666771, 0.003933134488761425, -0.02381243370473385, 0.027116551995277405, 0.07098156213760376, -0.06779137998819351, 0.006617730017751455, -0.032148685306310654, 0.058638595044612885, 0.040788762271404266, -0.06179079785943031, -0.03625034913420677, -0.030059875920414925, -0.05043526738882065, -0.005179299507290125, -0.01033011544495821, -0.017299145460128784, -0.01787831448018551, -0.05829678848385811, 0.05696754530072212, -0.02457200177013874, -0.014165929518640041, -0.030287746340036392, -0.04109258949756622, -0.010206685401499271, -0.03721879795193672, 0.02667980082333088, -0.041928112506866455, 0.0003020466829184443, -0.033952657133340836, -0.012703762389719486, -0.023850413039326668, -0.03334500268101692, -0.04116854816675186, -0.0019974245224148035, -0.0004566304851323366, -0.02939525432884693, -0.011820766143500805, 0.027116551995277405, 0.009921847842633724, -0.014612175524234772, 0.009580042213201523, -0.06342386454343796, 0.007723849732428789, -0.03520594537258148, -0.03945951908826828, -0.0057062492705881596, -0.04204205051064491, 0.056473828852176666, -0.01963481493294239, -0.03237655386328697, -0.0031284678261727095, -0.005938866641372442, -0.06733564287424088, 0.008003939874470234, 0.0021849428303539753, 0.04306746646761894, 0.029243340715765953, 0.04226991906762123, 0.027173519134521484, 0.044738512486219406, -0.01583697833120823, -0.011213111691176891, -0.02157171070575714, 0.013909575529396534, -0.025274600833654404, -0.014887519180774689, 0.02743936888873577, -0.007946972735226154, -0.01692885532975197, -0.004172872751951218, -0.036117423325777054, 0.005606555845588446, -0.02743936888873577, 0.03152204304933548, 0.033838722854852676, 0.016235750168561935, 0.03463626652956009, -0.03854804113507271, 0.04363714158535004, 0.005250508897006512, 0.02159070037305355, -0.03433244302868843, 0.029888972640037537, -0.08962894231081009, 0.011127660982310772, 0.029167383909225464, -0.05605606734752655, 0.022919943556189537, 0.02159070037305355, 0.03161698952317238, 0.01868535578250885, 0.024458065629005432, -0.024192217737436295, 0.01585596613585949, 0.06517087668180466, -0.05294184014201164, -0.0944901704788208, -0.00785202719271183, -0.04659945145249367, 0.06027166545391083, -0.016226256266236305, 0.026356983929872513, -0.055562347173690796, -0.06304408609867096, -0.018447989597916603, 0.026945648714900017, -0.04120652377605438, -0.007666882127523422, 0.06828510016202927, 0.06182877719402313, 0.013700694777071476, 0.012675278820097446, 0.011877733282744884, -0.01980571635067463, 0.008587857708334923, 0.025901244953274727, 0.008345745503902435, -0.06122112274169922, 0.04709317162632942, 0.024970773607492447, 0.05108090117573738, -0.05901837721467018, 0.03057258389890194, 0.02945222146809101, 0.010937768965959549, 0.06748755276203156, -0.09388251602649689, 0.020964056253433228, 0.006171484012156725, 0.012551849707961082, 0.039991218596696854, 0.06106920912861824, 0.027895107865333557, 0.042004071176052094, -0.02056528441607952, -0.01784983091056347, 0.0018490715883672237, 0.07876712828874588, -0.027382399886846542, -0.0005331806023605168, 0.03163597732782364, 0.021267883479595184, 0.04914400354027748, 0.01183975487947464, -0.014203907921910286, -0.00370289059355855, -0.012979106046259403, -0.02366052009165287, -0.0666140541434288, -0.043751075863838196, 0.006480058189481497, -0.03573764115571976, -0.022027451545000076, -0.06866488605737686, 0.06517087668180466, 0.005378685891628265, 0.07329824566841125, 0.00940439198166132, -0.020109543576836586, 0.0016900371992960572, 0.0513087697327137, 0.008773001842200756, -0.023394672200083733, 0.019017666578292847, 0.013957048766314983, -0.02578730881214142, 0.005084353499114513, -0.051688551902770996, 0.06570257246494293, -0.07515918463468552, -0.003213919000700116, 0.01582748256623745, -0.016055352985858917, 0.0772479921579361, 0.009005619212985039, 0.043902989476919174, -0.023318715393543243, -0.022407235577702522, -0.03649720922112465, -0.06995614618062973, -0.0033729535061866045, 0.029888972640037537, -0.0011743622599169612, -0.048954110592603683, 0.04128248244524002, -0.039041757583618164, 0.048802196979522705, -0.012969611212611198, -0.025027742609381676, -0.0008776562754064798, 0.029015470296144485, -0.01775488443672657, -0.05909433588385582, -0.030838431790471077, 0.014878024347126484, 0.0332120805978775, 0.013045568019151688, -0.05316970869898796, 0.024894818663597107, -0.006271177437156439, 0.04697923734784126, -0.09768035262823105, 0.024268174543976784, -0.0051318262703716755, -0.05970199033617973, 0.014355821534991264, -0.033117134124040604, -0.030306734144687653, 0.04067482799291611, -0.03953547775745392, 0.01028264220803976, 0.02159070037305355, -0.010501017794013023, 0.03752262517809868, 0.006575004197657108, 0.07660236209630966, 0.016511093825101852, 0.06429737061262131, -0.014203907921910286, -0.0609932541847229, 0.020185500383377075, -0.05195440351963043, 0.024325141683220863, 0.08104582875967026, -0.027363412082195282, 0.021134959533810616, 0.059056356549263, -0.05928422510623932, -0.012428419664502144, -0.006731665227562189, 0.04021908715367317, -0.06015772745013237, -0.0073298243805766106, -0.04177619889378548, 0.008692298084497452, 0.01876131258904934, -0.0025991443544626236, 0.0024614727590233088, -0.035035040229558945, -0.032053738832473755, 0.014773583970963955, -0.026432940736413002, 0.031237203627824783, -0.031142259016633034, 0.013624737970530987, -0.032927241176366806, 0.04177619889378548, -0.011668852530419827, -0.0006290166638791561, 0.013548781163990498, -0.000023940463506733067, 0.02770521678030491, 0.03731374442577362, 0.01091877929866314, 0.05996783822774887, -0.018970193341374397, 0.018182141706347466, 0.02578730881214142, -0.018258098512887955, -0.005744227673858404, -0.028293881565332413, 0.047928694635629654, -0.025312580168247223, 0.03706688433885574, -0.03326904773712158, 0.04462457820773125, -0.05146068334579468, -0.10801047086715698, -0.027857130393385887, 0.005236267112195492, -0.03062955103814602, 0.057499244809150696, -0.011573906056582928, 0.017033295705914497, -0.022426223382353783, -0.05495469272136688, 0.000937590841203928, 0.03961143270134926, 0.011355530470609665, 0.0009998991154134274, 0.08484366536140442, 0.04754891246557236, 0.046789344400167465, 0.004668965004384518, 0.11993567645549774, 0.04424479603767395, 0.019938640296459198, 0.012884160503745079, -0.06782935559749603, -0.011156144551932812, -0.06000581383705139, -0.03676305711269379, -0.005796447861939669, -0.015504667535424232, -0.039041757583618164, 0.01776438020169735, -0.009223994798958302, -0.010956757701933384, -0.04033302143216133, 0.046751365065574646, -0.0007494792807847261, 0.007410528138279915, 0.02838882803916931, 0.05890444293618202, -0.043827030807733536, 0.030192799866199493, -0.017394090071320534, 0.011023220606148243, 0.0337817557156086, -0.025407524779438972, -0.06589246541261673, 0.009337930008769035, 0.0313701294362545, 0.03919367119669914, 0.04462457820773125, -0.03564269468188286, 0.022065429016947746, -0.014403294771909714, 0.009769934229552746, -0.042763639241456985, -0.016463620588183403, -0.018096690997481346, 0.0021398435346782207, -0.05696754530072212, 0.010054771788418293, -0.0011257024016231298, -0.002902971114963293, -0.05408119037747383, 0.01179228164255619, 0.02647092007100582, 0.005843920633196831, -0.017185209318995476, -0.0225591491907835, 0.03847208246588707, 0.01782134734094143, -0.007719102315604687, -0.030838431790471077, -0.03061056137084961, -0.07196900248527527, 0.0074912323616445065, 0.007790312170982361, -0.029319297522306442, -0.007671629544347525, 0.010947263799607754, 0.03864298388361931, 0.04610573500394821, 0.02157171070575714, -0.027078574523329735, 0.08484366536140442, -0.018106184899806976, 0.07044986635446548, 0.009546811692416668, -0.029756048694252968, 0.019501889124512672, 0.046941258013248444, 0.06961434334516525, -0.03659215569496155, -0.029775038361549377, 0.007177910767495632, -0.03161698952317238, 0.06532278656959534, -0.03414255008101463, 0.05814487487077713, -0.02449604496359825, 0.005848668050020933, -0.0358135960996151, 0.03180687874555588, -0.03254745900630951, -0.00945186521857977, -0.02939525432884693, -0.039877280592918396, -0.012798708863556385, -0.053663428872823715, -0.042080026119947433, 0.01974874921143055, -0.027135541662573814, 0.01682441495358944, 0.009798417799174786, 0.0008628209470771253, 0.0335918627679348, 0.019501889124512672, 0.02958514541387558, 0.02369849942624569, -0.04496638476848602, -0.010557984933257103, 0.009413886815309525, 0.018011238425970078, 0.03630731627345085, -0.03638327121734619, 0.029945939779281616, -0.004054190590977669, 0.04728306457400322, -0.06087931618094444, -0.0513087697327137, -0.05028335377573967, 0.02650889754295349, -0.008502406068146229, -0.03526291251182556, -0.010206685401499271, -0.04113056883215904, 0.022293299436569214, 0.000055521104513900355, 0.004013838246464729, -0.0011203617323189974, 0.04561201483011246, 0.012039141729474068, -0.04219396412372589, 0.033952657133340836, 0.0017897303914651275, 0.0058106896467506886, -0.032927241176366806, 0.0022881964687258005, 0.05746126547455788, -0.01138401497155428, -0.028369838371872902, 0.011127660982310772, -0.018229614943265915, -0.01281769759953022, -0.017118748277425766, -0.030154820531606674, -0.031882837414741516, 0.027971064671874046, 0.0014669143129140139, 0.018514452502131462, 0.04405490309000015, -0.000672929163556546, 0.017004812136292458, 0.039003778249025345, 0.05799296125769615, 0.019188567996025085, -0.04557403549551964, -0.013681706041097641, 0.03961143270134926, -0.06760148704051971, -0.03511099889874458, -0.051840465515851974, -0.014431778341531754, 0.03938356414437294, 0.06741159409284592, -0.027363412082195282, -0.03759858012199402, 0.021989472210407257, -0.0007043799851089716, -0.022217342630028725, 0.019501889124512672, -0.06885477155447006, 0.0266228336840868, 0.009048345498740673, -0.05548638850450516, -0.004493315238505602, 0.009845891036093235, 0.0708676278591156, -0.05320768803358078, 0.09593334794044495, -0.06593044102191925, -0.09585738927125931, 0.0002487879537511617, 0.013017084449529648, 0.0156375914812088, 0.007348813582211733, -0.030059875920414925, 0.0028412563260644674, -0.05449895188212395, -0.009679735638201237, 0.015077410265803337, 0.0296231247484684, -0.03258543834090233, -0.030211789533495903, 0.023394672200083733, -0.019122106954455376, 0.037085872143507004, 0.022255321964621544, 0.009162280708551407, -0.03288926184177399, 0.02764824964106083, 0.027078574523329735, 0.030211789533495903, -0.007676376961171627, -0.032224640250205994, -0.01783084124326706, 0.0747414231300354, -0.0010206685401499271, -0.0054688844829797745, -0.010690909810364246, -0.01978672854602337, -0.0027700469363480806, -0.055638302117586136, 0.029110416769981384, -0.0019357097335159779, -0.06084134057164192, 0.02742037922143936, -0.00794222578406334, -0.04033302143216133, 0.04325735569000244, 0.07656437903642654, -0.034123558551073074, 0.04990357160568237, 0.010966252535581589, 0.0133114168420434, 0.024989763274788857, -0.0015855967067182064, 0.03558572754263878, 0.014251381158828735, 0.03159799799323082, 0.0474349781870842, 0.024799872189760208, -0.018134668469429016, 0.04113056883215904, 0.014602680690586567, 0.021476764231920242, 0.06239845231175423, 0.041814178228378296, 0.007856774143874645, 0.013681706041097641, -0.019283514469861984, 0.03243352472782135, -0.037028905004262924, -0.004424479324370623, 0.0412445031106472, -0.0013411110267043114, 0.05427108332514763, 0.0011601203586906195, 0.01790679804980755, -0.04644753783941269, -0.005378685891628265, -0.030705507844686508, 0.056739676743745804, -0.010187695734202862, -0.004469578620046377, 0.02871164306998253, 0.04701721668243408, -0.04413085803389549, 0.06471513211727142, -0.05256205424666405, -0.025255613029003143, 0.0034726466983556747, -0.05142270401120186, -0.013995027169585228, -0.056625742465257645, -0.018305571749806404, -0.011934701353311539, 0.019368965178728104, 0.024989763274788857, 0.023052867501974106, -0.05123281478881836, -0.028293881565332413, 0.020527305081486702, -0.030800452455878258, 0.038927823305130005, -0.004654723219573498, -0.0070924595929682255, -0.04314342141151428, -0.029205361381173134, -0.004657096695154905, 0.012551849707961082, 0.009874374605715275, -0.016397159546613693, 0.028844567015767097, 0.022862974554300308, -0.06828510016202927, 0.02054629474878311, 0.00044802602496929467, 0.03342096135020256, -0.020907089114189148, -0.014374811202287674, 0.07010806351900101, 0.008972388692200184, 0.07029794901609421, 0.009893364273011684, -0.022900953888893127, 0.05841072276234627, -0.023964347317814827, -0.005392927676439285, 0.014963475055992603, 0.05841072276234627, -0.027363412082195282, 0.005483126267790794, 0.029319297522306442, -0.0031925563234835863, -0.018134668469429016, -0.0008711287518963218, 0.02066023088991642, 0.02476189285516739, 0.01963481493294239, -0.013254448771476746, -0.027819151058793068, -0.0017458179499953985, 0.00027831020997837186, 0.04853634908795357, 0.035889554768800735, 0.08590705692768097, -0.009532568976283073, -0.016406653448939323, -0.021134959533810616, -0.03239554539322853, 0.04428277164697647, -0.03442738577723503, 0.007182658184319735, -0.02254015952348709, 0.0168908778578043, -0.02364153228700161, 0.020033586770296097, -0.0010800097370520234, 0.025863265618681908, -0.00978892296552658, -0.016292719170451164, -0.06023368611931801, 0.018400518223643303, 0.021400807425379753, 0.03268038108944893, 0.06904466450214386, -0.05825880914926529, 0.04014313220977783, -0.03372478857636452, 0.014678637497127056, 0.02578730881214142, -0.012827192433178425, -0.002568286843597889, 0.0634998232126236, -0.08552727848291397, -0.03159799799323082, -0.019938640296459198, 0.04637158289551735, 0.002421120647341013, 0.08013434708118439, 0.10041479766368866, -0.01281769759953022, 0.021932505071163177, -0.02267308346927166, 0.018058711662888527 ]
42,898
linearmodels.system.model
_multivariate_ls_fit
null
def _multivariate_ls_fit(self) -> tuple[Float64Array, Float64Array]: wy, wx, wxhat = self._wy, self._wx, self._wxhat k = len(wxhat) xpx = blocked_inner_prod(wxhat, np.eye(len(wxhat))) _xpy = [] for i in range(k): _xpy.append(wxhat[i].T @ wy[i]) xpy = np.vstack(_xpy) beta = _parameters_from_xprod(xpx, xpy, constraints=self.constraints) loc = 0 eps = [] for i in range(k): nb = wx[i].shape[1] b = beta[loc : loc + nb] eps.append(wy[i] - wx[i] @ b) loc += nb eps_arr = np.hstack(eps) return beta, eps_arr
(self) -> tuple[numpy.ndarray, numpy.ndarray]
[ 0.028486859053373337, -0.03315281122922897, 0.012089913710951805, 0.016075806692242622, -0.00553491385653615, -0.012033242732286453, -0.01464013010263443, -0.07080155611038208, 0.032491642981767654, 0.0887097418308258, -0.039027754217386246, -0.044052623212337494, 0.007584531791508198, 0.0006375540397129953, -0.05383789911866188, 0.02965806983411312, -0.032510533928871155, -0.013383912853896618, -0.05134435370564461, 0.025256585329771042, -0.047150664031505585, 0.03970780968666077, -0.017851512879133224, 0.04152129963040352, 0.005530191119760275, -0.009993069805204868, 0.0340217724442482, -0.012656629085540771, 0.01675586588680744, -0.011362629942595959, -0.04461934044957161, 0.0255399439483881, 0.05550026148557663, -0.05935392156243324, -0.03060259483754635, -0.0375165157020092, 0.016151368618011475, -0.03551412373781204, -0.011919899843633175, -0.0374598428606987, 0.04737735167145729, -0.03677978366613388, 0.06970591098070145, 0.0056860377080738544, -0.027088964357972145, 0.004299947991967201, -0.009105216711759567, 0.05995841696858406, -0.023764237761497498, -0.006229139398783445, -0.025634394958615303, -0.03677978366613388, 0.02788236364722252, -0.0510421060025692, 0.00433536758646369, 0.07423962652683258, 0.02929915115237236, 0.0340595543384552, 0.015074611641466618, -0.04726400598883629, 0.011296513490378857, -0.01532963290810585, -0.02285749278962612, 0.0375165157020092, -0.03126376122236252, -0.0716327428817749, -0.027466773986816406, 0.0024652089923620224, -0.020363949239253998, 0.06400097906589508, 0.017445368692278862, -0.011145389638841152, -0.0579560250043869, 0.00798123236745596, -0.024973228573799133, 0.025369929149746895, 0.003674200503155589, -0.05508467182517052, -0.018541015684604645, -0.014781808480620384, -0.02281971275806427, 0.04027452692389488, -0.06384985893964767, -0.011343739926815033, -0.02455763705074787, 0.026295563206076622, -0.005501855630427599, 0.04643282666802406, 0.04155907779932022, 0.03449403494596481, -0.0408790223300457, 0.0646432563662529, 0.05897611007094383, 0.01037087943404913, 0.008538501337170601, 0.03517409414052963, -0.012052132748067379, 0.004165353253483772, 0.029544727876782417, -0.0009516084683127701, 0.0051759942434728146, -0.032453861087560654, 0.016293048858642578, 0.09815499186515808, -0.03891441226005554, -0.006078015547245741, 0.01396007277071476, -0.03462626785039902, 0.028524640947580338, -0.017860958352684975, 0.0340973362326622, 0.024330951273441315, 0.022064093500375748, 0.07563752681016922, -0.08976761251688004, -0.012788861989974976, -0.05992063507437706, 0.01634971983730793, 0.004637615289539099, 0.037950996309518814, -0.02278193086385727, 0.02009948156774044, -0.025766629725694656, -0.021572940051555634, 0.007471188902854919, -0.02519991435110569, 0.022895274683833122, -0.043108098208904266, 0.008396822959184647, -0.05629366263747215, 0.01482903491705656, 0.025313258171081543, 0.006474715657532215, 0.04635726287961006, -0.050928764045238495, -0.04503493010997772, -0.008585727773606777, -0.06740126758813858, 0.029714742675423622, -0.05618032068014145, -0.012543286196887493, 0.08908755332231522, -0.03436180204153061, 0.03334171697497368, -0.01970278099179268, 0.009383851662278175, 0.042692508548498154, -0.04386371746659279, 0.023764237761497498, 0.013506701216101646, -0.04492158815264702, -0.019948357716202736, -0.01632138341665268, 0.0015017939731478691, -0.015764113515615463, -0.015395750291645527, 0.0187393669039011, 0.02587997168302536, 0.04805740714073181, -0.02004281058907509, -0.051646601408720016, -0.09362126886844635, -0.018493790179491043, 0.03857438266277313, -0.031868256628513336, 0.03502297028899193, -0.03910331428050995, 0.023575332015752792, 0.027353430166840553, -0.0010997807839885354, 0.0024179827887564898, 0.032208286225795746, -0.01767205446958542, -0.05417792871594429, -0.03337949514389038, -0.01483848039060831, -0.0016765310429036617, -0.04896415024995804, 0.03268054872751236, -0.006068570073693991, -0.016293048858642578, -0.04027452692389488, -0.006946978159248829, -0.016217486932873726, -0.03891441226005554, 0.07061265408992767, 0.005421570967882872, 0.021006224676966667, -0.059429485350847244, -0.011617652140557766, -0.08961648494005203, -0.03549523279070854, -0.008099297992885113, 0.0307159386575222, -0.04348590970039368, 0.1055600643157959, 0.04042565077543259, 0.06332092732191086, -0.0060071758925914764, -0.03609972819685936, -0.019570548087358475, -0.031528227031230927, -0.03224606812000275, 0.00869434792548418, 0.013978962786495686, 0.013336686417460442, -0.00587966525927186, -0.016104143112897873, -0.05916501581668854, -0.01803097315132618, -0.024047594517469406, 0.021875187754631042, -0.025766629725694656, 0.012798307463526726, 0.013147781603038311, -0.01224103756248951, 0.00029723005718551576, -0.005388512276113033, -0.0004637025122065097, -0.044770464301109314, 0.010531448759138584, -0.10654236376285553, -0.02008059248328209, 0.045526083558797836, -0.0043755099177360535, 0.030413689091801643, 0.0885586217045784, 0.04499714821577072, -0.02178073488175869, 0.04197467118501663, -0.03328504413366318, -0.006375540513545275, 0.08138023316860199, -0.0050957100465893745, -0.0921100303530693, 0.027353430166840553, -0.05183550715446472, 0.011438191868364811, -0.0022149099968373775, 0.014895152300596237, -0.030867062509059906, -0.046810634434223175, -0.014243429526686668, 0.039367783814668655, -0.015480756759643555, 0.029393604025244713, 0.03806433826684952, 0.04129461199045181, 0.006262197624891996, 0.011154835112392902, -0.007296451833099127, 0.0476040355861187, 0.03719537705183029, 0.015792449936270714, -0.006904474459588528, -0.08606507629156113, 0.04609279707074165, 0.029355822131037712, 0.03211383521556854, -0.04594167321920395, 0.029695851728320122, 0.06199859082698822, -0.03617528825998306, 0.041407953947782516, -0.07597755640745163, 0.025464382022619247, -0.0023365176748484373, 0.019513877108693123, -0.03001699037849903, 0.0714438334107399, 0.07941561937332153, 0.058447178453207016, 0.009322457015514374, 0.016576405614614487, -0.01243938785046339, 0.05172216519713402, 0.018257658928632736, 0.0005109287449158728, 0.025785518810153008, 0.013780612498521805, 0.04144573584198952, -0.039330001920461655, 0.0062999785877764225, 0.04386371746659279, 0.004977644421160221, -0.001252675661817193, -0.03494740650057793, -0.050248704850673676, 0.02650335803627968, -0.04325922206044197, -0.029034683480858803, -0.021327363327145576, 0.06978147476911545, 0.01534852385520935, 0.043825939297676086, 0.020231716334819794, 0.0022278972901403904, 0.014555122703313828, 0.07552418112754822, 0.01126817800104618, -0.0077309333719313145, -0.0008412171737290919, 0.03515520319342613, 0.011088717728853226, 0.02076064981520176, -0.04635726287961006, 0.01945720613002777, -0.028845779597759247, -0.02722119726240635, -0.012297709472477436, -0.0036411420442163944, 0.08092686533927917, 0.010644791647791862, -0.028090160340070724, -0.0409168042242527, -0.022611917927861214, -0.010899812914431095, -0.01597191020846367, 0.03343616798520088, 0.05648256838321686, 0.04450599476695061, -0.032567206770181656, 0.047490693628787994, -0.032831672579050064, 0.03309613838791847, 0.010011959820985794, 0.03464515879750252, -0.04288141429424286, 0.006016621366143227, -0.035551901906728745, -0.0272778682410717, 0.00023391740978695452, 0.00646999292075634, 0.030224785208702087, -0.02622000128030777, 0.04563942551612854, 0.012562176212668419, 0.00901548657566309, 0.049568645656108856, -0.0987594872713089, 0.01765316352248192, -0.018626023083925247, -0.0510043241083622, 0.016283603385090828, -0.008939924649894238, -0.043788157403469086, 0.018314329907298088, -0.0017154926899820566, 0.003093317849561572, 0.067967988550663, -0.0019327333429828286, -0.019665000960230827, 0.04231470078229904, 0.004614002536982298, 0.07083933800458908, 0.05584029108285904, -0.06033622846007347, -0.016576405614614487, -0.0026942561380565166, 0.010994265787303448, -0.012212702073156834, 0.0306592658162117, -0.050626516342163086, 0.018304886296391487, 0.0442037470638752, -0.031244872137904167, 0.023613113909959793, -0.032548315823078156, -0.005393235012888908, -0.01037087943404913, -0.0011039130622521043, -0.035287436097860336, -0.041030146181583405, 0.018890490755438805, -0.05281781032681465, 0.01740758679807186, -0.048813026398420334, -0.013553926721215248, -0.0005138803971931338, -0.032453861087560654, 0.017879849299788475, -0.05474464222788811, 0.05141991376876831, -0.018503235653042793, 0.05289337411522865, -0.020609525963664055, -0.011372075416147709, -0.05678481608629227, 0.012798307463526726, 0.03685534745454788, 0.08251366019248962, -0.016850316897034645, 0.03466404974460602, 0.00331291975453496, 0.0153579693287611, -0.03368174657225609, 0.06513441354036331, 0.006729737389832735, -0.05723818764090538, 0.012099359184503555, -0.02178073488175869, -0.030413689091801643, -0.04046343266963959, 0.021894078701734543, -0.04016118496656418, -0.025785518810153008, -0.026748934760689735, 0.06906363368034363, -0.042390260845422745, 0.03572191670536995, -0.013572817668318748, 0.07212389260530472, -0.002082676626741886, -0.07548639923334122, 0.011853782460093498, 0.03819657117128372, -0.015074611641466618, 0.023008618503808975, 0.052326660603284836, 0.02349977008998394, 0.05244000256061554, -0.05644478648900986, 0.05618032068014145, 0.007641203235834837, -0.013157227076590061, 0.01570744253695011, -0.08810524642467499, -0.06109184771776199, -0.0037285105790942907, -0.060411788523197174, -0.03677978366613388, -0.015008495189249516, -0.044770464301109314, 0.0059788404032588005, -0.02863798290491104, -0.03307724744081497, -0.03439958393573761, 0.06558778136968613, -0.050550952553749084, -0.04726400598883629, 0.006521942093968391, 0.009487749077379704, 0.03721426799893379, 0.012807752937078476, -0.033209484070539474, -0.012571621686220169, -0.003950473852455616, -0.0034640436060726643, -0.11387187987565994, 0.009303566999733448, 0.050626516342163086, 0.06018510460853577, 0.09339458495378494, -0.013761722482740879, 0.01125873252749443, 0.010899812914431095, -0.005511300638318062, -0.10389769822359085, -0.015027385205030441, -0.002689533634111285, 0.041710201650857925, -0.00919494591653347, 0.028524640947580338, 0.00663528498262167, -0.033946212381124496, -0.07295507192611694, 0.01945720613002777, -0.013195008039474487, 0.015036830678582191, -0.0037544849328696728, 0.0018949523800984025, 0.010493667796254158, 0.025275476276874542, -0.011778220534324646, -0.015282406471669674, -0.023386428132653236, 0.00783483125269413, 0.016614185646176338, 0.03472072258591652, -0.0375354066491127, -0.04730178788304329, -0.05130657181143761, 0.025086572393774986, 0.03213272616267204, 0.018975498154759407, -0.004082707222551107, -0.009322457015514374, -0.023707564920186996, -0.005851329304277897, 0.04907749593257904, -0.014111196622252464, 0.05829605460166931, 0.04677285626530647, 0.042730290442705154, -0.03033812716603279, -0.022895274683833122, 0.044430434703826904, 0.021912969648838043, 0.023613113909959793, -0.02348087914288044, -0.011475972831249237, -0.024312062188982964, 0.017898740246891975, -0.034588489681482315, 0.019551657140254974, -0.0578426830470562, 0.029431384056806564, -0.03449403494596481, -0.032548315823078156, -0.02349977008998394, -0.014876261353492737, -0.08334484696388245, -0.02455763705074787, -0.0013081664219498634, 0.01036143396049738, 0.004162991885095835, -0.018956607207655907, 0.036647550761699677, 0.053951241075992584, 0.0029681683517992496, 0.04726400598883629, -0.010446441359817982, 0.03921665996313095, -0.05376233533024788, 0.023650893941521645, 0.027334539219737053, -0.011919899843633175, 0.008052071556448936, 0.009109939448535442, 0.03137710317969322, -0.026711152866482735, -0.029846975579857826, -0.004972921684384346, -0.007575086783617735, -0.027107853442430496, -0.04148351773619652, -0.03228385001420975, -0.034229569137096405, -0.05557582527399063, 0.010673127137124538, -0.013657825067639351, -0.005062651354819536, 0.018219878897070885, -0.024349842220544815, -0.012854978442192078, 0.02926136925816536, -0.06717458367347717, 0.02518102340400219, -0.041407953947782516, -0.02480321377515793, 0.037686530500650406, -0.007249225862324238, -0.02151626907289028, 0.011372075416147709, -0.03279389068484306, -0.015405194833874702, -0.03917887806892395, 0.006488883402198553, -0.07635536044836044, 0.0028453802224248648, -0.007031985092908144, -0.005818271078169346, 0.06675899028778076, -0.02484099566936493, -0.023310866206884384, -0.024312062188982964, 0.031074857339262962, 0.017435923218727112, -0.07000815868377686, 0.011032046750187874, -0.017898740246891975, 0.06554999947547913, -0.019324971362948418, -0.01174043957144022, 0.007707320153713226, -0.01672752946615219, 0.028335735201835632, -0.06056291237473488, -0.06932809948921204, 0.011343739926815033, 0.05595363304018974, 0.007962341420352459, -0.0013282375875860453, -0.009841945953667164, 0.021346254274249077, 0.027088964357972145, -0.04254138469696045, 0.00013393063272815198, -0.049568645656108856, 0.0510043241083622, -0.044128187000751495, 0.07934006303548813, -0.03441847488284111, -0.03579748049378395, 0.012108804658055305, 0.02756122499704361, -0.02759900689125061, -0.002153516048565507, -0.014706246554851532, -0.016793645918369293, 0.00035596766974776983, 0.017813732847571373, -0.02557772397994995, 0.040350086987018585, 0.006885583978146315, -0.036250852048397064, 0.0170108862221241, 0.0028595479670912027, 0.016859762370586395, -0.007674261927604675, 0.02963918074965477, -0.0374787338078022, 0.07015927881002426, 0.0013081664219498634, -0.009308288805186749, 0.02011837251484394, -0.008887975476682186, -0.0038324082270264626, 0.07212389260530472, -0.01124928705394268, -0.01023864559829235, -0.006384985987097025, -0.015244625508785248, 0.024274280294775963, 0.0170108862221241, -0.017568156123161316, 0.0038182404823601246, -0.04220135509967804, 0.0254832711070776, -0.0018890490755438805, -0.003336532972753048, 0.033965103328228, 0.07643092423677444, -0.0034475144930183887, 0.04801962897181511, 0.06985703110694885, 0.01845601014792919, -0.029828084632754326, -0.01496126875281334, 0.032151613384485245, -0.009331902489066124, 0.029695851728320122, 0.05145769566297531, -0.01345947477966547, 0.04601723700761795, 0.04998423904180527, -0.020533964037895203, 0.008798246271908283, 0.05723818764090538, 0.024312062188982964, 0.024463186040520668, -0.029828084632754326, -0.049908675253391266, 0.020873991772532463, 0.02283860370516777, 0.006238584406673908, 0.0016600018134340644, -0.011617652140557766, 0.03538189083337784, -0.03813990205526352, -0.009487749077379704, -0.031112637370824814, 0.04843521863222122, -0.03207605332136154, 0.0477929413318634, 0.03133932501077652, -0.02584219165146351, -0.043825939297676086, -0.01038032490760088, -0.015509093180298805, -0.0374031700193882, -0.005459351930767298, -0.05678481608629227, -0.00008788505510892719, -0.04628170281648636, 0.006507773883640766, -0.04832187667489052, -0.03307724744081497, 0.017634272575378418, 0.00722561264410615, 0.04152129963040352, 0.013147781603038311, -0.009756938554346561, -0.008113465271890163, -0.005388512276113033, -0.022234108299016953, 0.0221585463732481, 0.02792014554142952, -0.026711152866482735, -0.0221018735319376, -0.011542090214788914, -0.02722119726240635, 0.0005307047395035625, 0.011967126280069351, -0.010994265787303448, -0.022970836609601974, 0.02285749278962612, -0.05338452756404877, 0.04609279707074165, -0.008410991169512272, -0.008812413550913334, 0.008987151086330414, -0.04843521863222122, 0.04322144389152527, 0.00969082210212946, 0.02793903648853302, 0.0016340274596586823, -0.010474776849150658, -0.03160379081964493, 0.009667208418250084, -0.02858131192624569, -0.032208286225795746, 0.05251556262373924, -0.021270692348480225, 0.020269496366381645, 0.0028689932078123093, -0.020005028694868088, -0.04322144389152527, 0.032170504331588745, 0.07012150436639786, 0.033171702176332474, 0.004639976657927036, 0.016585851088166237, -0.02451985701918602, 0.009402741678059101, 0.015376859344542027, 0.04454377666115761, 0.012288263998925686, 0.059807293117046356, -0.025124352425336838, 0.03853660076856613, -0.0017154926899820566, -0.02178073488175869, 0.026767825707793236, 0.01074868906289339, 0.00613468699157238, -0.015055720694363117, 0.017228128388524055, 0.016973106190562248, 0.026106657460331917, 0.012524395249783993, 0.018937716260552406, -0.009832500480115414, -0.006361372768878937, -0.05274225026369095, 0.03787543252110481, -0.003988254815340042, 0.012911650352180004, 0.029846975579857826, -0.07004594057798386, 0.046168360859155655, 0.010181974619626999, -0.020496182143688202, 0.013591707684099674, 0.040690116584300995, 0.0002473473723512143, 0.07601533085107803, -0.07911337167024612, -0.0477551594376564, -0.03101818636059761, 0.014989604242146015, 0.019891686737537384, 0.060109540820121765, 0.12006796151399612, -0.07729988545179367, -0.0013790058437734842, 0.021648501977324486, 0.05073985829949379 ]
42,899
linearmodels.system.model
_sigma_scale
null
def _sigma_scale(self, debiased: bool) -> float | Float64Array: if not debiased: return 1.0 nobs = float(self._wx[0].shape[0]) scales = np.array([nobs - x.shape[1] for x in self._wx], dtype=np.float64) scales = cast(Float64Array, np.sqrt(nobs / scales)) return scales[:, None] @ scales[None, :]
(self, debiased: bool) -> float | numpy.ndarray
[ 0.04329875111579895, -0.011508064344525337, 0.0571485199034214, -0.01417778991162777, 0.00972217321395874, -0.017877135425806046, 0.011981871910393238, -0.05835126340389252, 0.006519414018839598, 0.0865246057510376, -0.020464856177568436, 0.011052479967474937, 0.002464712131768465, 0.009189139120280743, -0.013631087727844715, 0.03675655648112297, -0.0090889111161232, 0.031089086085557938, 0.03294787183403969, 0.08266124874353409, -0.03462442010641098, 0.01784980110824108, -0.0043508317321538925, -0.026059433817863464, -0.024783797562122345, 0.03633742034435272, 0.010469331406056881, -0.04581357538700104, 0.018050257116556168, -0.0041321516036987305, 0.005029652733355761, 0.01589989848434925, 0.059809133410453796, -0.016647057607769966, 0.07457006722688675, -0.0076128169894218445, -0.007303019519895315, 0.024091308936476707, -0.047635916620492935, -0.013257509097456932, -0.028701823204755783, 0.010560448281466961, 0.07777738571166992, 0.008692552335560322, 0.015918122604489326, 0.00956727471202612, 0.007621928583830595, 0.05787745490670204, -0.054269224405288696, 0.026697251945734024, 0.03557203710079193, -0.02507537044584751, -0.014432917349040508, -0.0051207696087658405, -0.03138066083192825, 0.07183656096458435, 0.02308902144432068, 0.05547196790575981, 0.030232587829232216, -0.04202311486005783, 0.03378614783287048, 0.010378214530646801, 0.013703981414437294, -0.09512604027986526, 0.0101321991533041, -0.017230205237865448, -0.017275763675570488, 0.030505938455462456, 0.015280304476618767, 0.04840129613876343, -0.0331665500998497, -0.009303035214543343, -0.03998209536075592, 0.020410185679793358, 0.007430583238601685, 0.022378310561180115, -0.0029225745238363743, -0.02604120969772339, -0.03477020934224129, -0.04388190060853958, 0.04960403963923454, 0.026205221191048622, 0.008432868868112564, -0.004642406012862921, -0.014569592662155628, -0.004006865434348583, -0.0009316703071817756, 0.03440574184060097, -0.022323640063405037, -0.018104927614331245, 0.026186997070908546, -0.012127659283578396, 0.08127627521753311, 0.10248828679323196, -0.06221462041139603, 0.04749012738466263, -0.04792748764157295, -0.01784980110824108, 0.06119411066174507, 0.0005065530422143638, 0.049458254128694534, 0.04694342613220215, 0.05477948114275932, 0.040455903857946396, -0.030833959579467773, 0.11152708530426025, 0.06975910067558289, -0.02489313669502735, 0.018788304179906845, -0.0013063885271549225, -0.007672043051570654, 0.044683728367090225, -0.003200481180101633, 0.022196076810359955, -0.08944034576416016, -0.048182617872953415, -0.012820147909224033, 0.014341799542307854, 0.033731475472450256, 0.057367198169231415, -0.08790958672761917, 0.02290678769350052, -0.004619626794010401, 0.005990935955196619, -0.030433043837547302, 0.018897645175457, 0.041731540113687515, -0.027772430330514908, -0.017366880550980568, 0.08324439823627472, -0.0014202846214175224, 0.0193532295525074, 0.02893872745335102, 0.004583179950714111, 0.021503588184714317, 0.026150550693273544, 0.018934091553092003, 0.014077560976147652, 0.07646530121564865, -0.007166344206780195, 0.014141342602670193, 0.03845133259892464, 0.0020763264037668705, 0.015070735476911068, -0.023070799186825752, 0.05266556888818741, 0.0938868522644043, 0.04942180588841438, 0.03220071271061897, 0.006214172579348087, -0.03819620609283447, 0.04490240663290024, 0.05401409789919853, 0.02658791095018387, 0.01898876205086708, -0.010533113963901997, 0.013221061788499355, 0.011098038405179977, -0.004182265605777502, 0.01702974922955036, -0.07052448391914368, -0.023435266688466072, -0.01898876205086708, -0.03433284908533096, -0.04220534861087799, -0.03557203710079193, -0.002029628958553076, 0.061267003417015076, 0.005553575232625008, 0.02330770343542099, -0.00029242830350995064, 0.024510445073246956, -0.08878430724143982, 0.008829227648675442, -0.006091164890676737, 0.06061096116900444, 0.015416979789733887, 0.006715315394103527, -0.008965902961790562, 0.011817862279713154, 0.04774525389075279, -0.02726217545568943, -0.003949917387217283, -0.024419328197836876, -0.0003621896612457931, 0.01467893272638321, -0.03139888495206833, 0.011061592027544975, -0.032237157225608826, -0.03624630346894264, -0.00014414978795684874, -0.035007111728191376, -0.0009333787602372468, -0.09286634624004364, -0.01118004322052002, 0.05230110138654709, 0.025476284325122833, -0.029795225709676743, -0.015025177039206028, -0.06746295094490051, 0.008000063709914684, -0.04089326411485672, -0.03702990710735321, 0.009913519024848938, 0.022688107565045357, -0.021594705060124397, -0.009530827403068542, 0.0020672145765274763, 0.002197056310251355, 0.006318957079201937, -0.07296641170978546, 0.009512604214251041, -0.02921207807958126, -0.03057883121073246, 0.04894799739122391, -0.04730789363384247, 0.06695269793272018, -0.008656105026602745, -0.019735921174287796, -0.018897645175457, -0.005558130796998739, -0.07814185321331024, 0.027553750202059746, 0.04180443286895752, -0.020938662812113762, 0.00016870863328222185, 0.01971769705414772, 0.0035786163061857224, -0.0051253256388008595, -0.005831481423228979, -0.012282557785511017, 0.011808750219643116, -0.0019806534983217716, -0.042096007615327835, -0.015690330415964127, 0.020464856177568436, 0.036865897476673126, -0.0570756271481514, 0.037831734865903854, 0.04420991986989975, -0.03030548058450222, -0.015617436729371548, 0.009968188591301441, 0.04103905335068703, -0.02698882482945919, 0.011170932091772556, 0.02443755231797695, 0.030815735459327698, -0.004102538339793682, 0.028829386457800865, 0.007480697240680456, -0.04785459488630295, 0.00223236414603889, 0.01922566629946232, 0.04107549786567688, 0.02717105858027935, 0.029649438336491585, 0.07668398320674896, 0.007444250863045454, -0.05856994166970253, 0.012483015656471252, -0.04552200436592102, -0.03444218635559082, 0.0336221344769001, -0.03928960859775543, 0.04399123787879944, 0.028774715960025787, 0.02226896956562996, -0.012437457218766212, 0.044137027114629745, 0.0920645147562027, 0.068155437707901, -0.012510349974036217, -0.08018287271261215, -0.0312713198363781, 0.024783797562122345, -0.007972728461027145, 0.014569592662155628, 0.022050289437174797, 0.02830090932548046, -0.05816902965307236, -0.08360886573791504, 0.042861390858888626, 0.058679282665252686, 0.010414661839604378, 0.006031938828527927, 0.05299358814954758, -0.06538549065589905, 0.04140352085232735, 0.06994133442640305, -0.029649438336491585, 0.054050546139478683, -0.04369966685771942, 0.03128954395651817, -0.029139185324311256, -0.059043750166893005, 0.01031443290412426, -0.002765398006886244, -0.001603657379746437, 0.02540339156985283, -0.008774557150900364, 0.02972233295440674, -0.05066099762916565, 0.09097111225128174, 0.023690393194556236, 0.010013747029006481, 0.06093898415565491, -0.04876576364040375, 0.029813449829816818, 0.016656169667840004, -0.05926243215799332, 0.01667439192533493, -0.057950347661972046, -0.003462442196905613, 0.024546893313527107, -0.003956751432269812, 0.03553559258580208, 0.014733602292835712, -0.01630992442369461, 0.10649742931127548, 0.005631024483591318, 0.011580958031117916, -0.0341506153345108, -0.027827100828289986, -0.015079846605658531, 0.02662435732781887, -0.06246974691748619, 0.0038998033851385117, -0.0024783797562122345, 0.005467013921588659, -0.06257908791303635, -0.029795225709676743, -0.0043166629038751125, 0.02245120331645012, 0.014733602292835712, -0.08215099573135376, 0.04574068263173103, -0.023562829941511154, -0.027954664081335068, -0.06972265243530273, -0.05853349715471268, -0.025822529569268227, -0.011189155280590057, -0.03735793009400368, 0.013986444100737572, -0.011389612220227718, 0.027134612202644348, -0.07427849620580673, 0.008305305615067482, 0.023745063692331314, 0.004637849982827902, -0.012619690969586372, 0.035280462354421616, 0.01355819497257471, 0.009731285274028778, -0.0340777188539505, -0.04165864735841751, 0.054086990654468536, -0.009840625338256359, -0.0005723280482925475, -0.01949901692569256, 0.04442860186100006, -0.03413239121437073, -0.024966031312942505, 0.033731475472450256, -0.0011110566556453705, -0.05871573090553284, -0.03998209536075592, 0.045230429619550705, 0.007968172430992126, 0.017230205237865448, -0.03048771433532238, -0.10482088476419449, -0.0015227912226691842, 0.007881611585617065, 0.02461978606879711, -0.06370893865823746, -0.0570756271481514, 0.022888565436005592, 0.03867001086473465, -0.022469427436590195, -0.005116214044392109, 0.029831672087311745, -0.001790447044186294, 0.037503715604543686, 0.027462633326649666, -0.02485669031739235, -0.00499776192009449, -0.020300844684243202, -0.06695269793272018, 0.0011013755574822426, -0.024565115571022034, -0.007899834774434566, -0.017020637169480324, -0.03542625159025192, -0.02738974057137966, 0.015052511356770992, -0.004148096777498722, 0.008095736615359783, 0.061084769666194916, -0.07595504820346832, 0.057403646409511566, -0.029612991958856583, 0.028155121952295303, -0.04012788087129593, -0.054998159408569336, -0.028319131582975388, 0.06338091194629669, 0.012209664098918438, 0.04832840338349342, 0.05040586739778519, 0.013175503350794315, -0.040091436356306076, -0.023872626945376396, -0.024182425811886787, -0.01510718185454607, -0.020464856177568436, -0.020391961559653282, 0.020063940435647964, -0.012218776158988476, -0.029594769701361656, -0.013467078097164631, -0.0060729412361979485, -0.015453426167368889, 0.02017328143119812, -0.039143819361925125, -0.036865897476673126, -0.030706394463777542, -0.025567401200532913, -0.013184615410864353, 0.03380436822772026, 0.0076583754271268845, -0.02671547420322895, 0.00933948252350092, 0.022742778062820435, -0.05809613689780235, -0.01590901054441929, 0.030651725828647614, -0.025840751826763153, -0.034460410475730896, -0.005776811391115189, 0.020501302555203438, 0.027735983952879906, -0.04661540687084198, 0.05084323137998581, -0.03247406333684921, 0.028100451454520226, 0.004585457965731621, -0.023453490808606148, -0.04278849437832832, -0.010013747029006481, -0.05164505913853645, 0.04056524485349655, -0.013403295539319515, -0.0181778222322464, -0.01428712997585535, 0.020938662812113762, -0.08207810670137405, 0.024510445073246956, 0.018332719802856445, 0.006883881986141205, -0.019571909680962563, -0.053686078637838364, -0.011334942653775215, -0.007407804019749165, 0.06075675040483475, 0.04329875111579895, 0.00449889712035656, 0.05678405240178108, -0.010979586280882359, 0.06483878940343857, 0.03302076458930969, 0.029503652825951576, -0.03690234571695328, -0.02689770795404911, -0.02181338518857956, -0.01743977516889572, -0.02848314307630062, 0.036592546850442886, 0.012136771343648434, -0.002726673148572445, -0.00486108660697937, 0.008337195962667465, 0.021685821935534477, 0.0006509163649752736, -0.026843039318919182, -0.02848314307630062, 0.009011461399495602, 0.03580894321203232, 0.044137027114629745, 0.011298495344817638, 0.008082069456577301, 0.035918280482292175, 0.024364659562706947, -0.03542625159025192, -0.06994133442640305, 0.040273670107126236, -0.011553622782230377, 0.047417234629392624, -0.031016193330287933, -0.027407962828874588, -0.02239653468132019, -0.04038301110267639, 0.00041970721213147044, -0.025476284325122833, -0.031417105346918106, -0.06338091194629669, 0.03393193334341049, -0.034187059849500656, -0.033603914082050323, -0.010706235654652119, -0.009986411780118942, -0.06374537944793701, -0.044647280126810074, 0.03775884211063385, -0.044100578874349594, -0.037048131227493286, 0.03480665385723114, 0.03903447836637497, -0.013184615410864353, -0.023143691942095757, -0.031781572848558426, -0.055727094411849976, 0.010168645530939102, 0.016464823856949806, -0.023016128689050674, -0.06574995815753937, 0.009375928901135921, 0.05383186414837837, -0.010050194337964058, -0.0024054860696196556, -0.05649247765541077, 0.03983630985021591, 0.04031011462211609, -0.015590101480484009, -0.024656232446432114, 0.020738206803798676, -0.032237157225608826, -0.03265629708766937, -0.014004667289555073, -0.011061592027544975, -0.06341736018657684, 0.0030341928359121084, 0.03447863459587097, -0.018915867432951927, 0.01702974922955036, -0.03812330961227417, 0.0372668132185936, 0.0405287966132164, -0.06502102315425873, 0.03639208897948265, 0.03402305021882057, 0.06400050967931747, 0.013403295539319515, 0.042059559375047684, 0.014943171292543411, -0.032419394701719284, 0.04271560162305832, -0.037831734865903854, -0.003767683869227767, -0.025658518075942993, -0.042096007615327835, 0.09337659925222397, -0.012401009909808636, -0.0002542730944696814, 0.006255174987018108, -0.03298431634902954, 0.030159693211317062, 0.0368112288415432, 0.029904566705226898, -0.06502102315425873, 0.014323576353490353, 0.04810972139239311, 0.04238758236169815, 0.006965886801481247, 0.03568137809634209, 0.04067458212375641, -0.05397764965891838, -0.057184964418411255, -0.022469427436590195, -0.010159534402191639, -0.06006425991654396, -0.04767236113548279, 0.05080678313970566, -0.013230173848569393, -0.011617404408752918, -0.08703485876321793, -0.007594593800604343, -0.026879485696554184, 0.033057212829589844, -0.03834199160337448, 0.008095736615359783, -0.0561644583940506, -0.032966095954179764, -0.011808750219643116, -0.0013633365742862225, 0.0012061599409207702, -0.029321419075131416, 0.018505841493606567, 0.018022922798991203, 0.012127659283578396, -0.020756429061293602, 0.04176798835396767, 0.004389556590467691, 0.05375897139310837, -0.028009334579110146, 0.03489777073264122, -0.057585880160331726, 0.003020525211468339, -0.03848777711391449, -0.04071103036403656, 0.011608293280005455, -0.03265629708766937, 0.07799606770277023, -0.02281567081809044, 0.019954601302742958, -0.007271128706634045, -0.012300781905651093, 0.045230429619550705, 0.015252969227731228, -0.012072988785803318, 0.006164058111608028, 0.042314689606428146, -0.02239653468132019, 0.018378278240561485, -0.04581357538700104, 0.03735793009400368, -0.022068513557314873, -0.06119411066174507, -0.061084769666194916, 0.01445114053785801, 0.02203206717967987, 0.025840751826763153, -0.06779097020626068, 0.004312107339501381, 0.06531259417533875, -0.010341768153011799, -0.00515721645206213, -0.031781572848558426, 0.06257908791303635, 0.04730789363384247, 0.006692536175251007, 0.01415045466274023, 0.019389675930142403, 0.0005387286655604839, 0.01431446522474289, -0.008624214679002762, 0.029467204585671425, -0.05106190964579582, 0.03976341336965561, 0.007448806427419186, -0.04238758236169815, -0.045048195868730545, -0.0184420607984066, 0.07074315845966339, -0.009120801463723183, 0.007644707802683115, 0.029048068448901176, -0.03322122246026993, -0.028009334579110146, 0.0033234888687729836, -0.0368841215968132, -0.01694774255156517, 0.0000054323113545251545, 0.03189091384410858, -0.02172226831316948, -0.027407962828874588, -0.013658422976732254, -0.07001422345638275, -0.05485237389802933, 0.033913709223270416, -0.022414756938815117, -0.0792352557182312, -0.08637882024049759, -0.020410185679793358, 0.022870341315865517, 0.0019362340681254864, 0.0216311514377594, -0.0050979903899133205, -0.037011682987213135, 0.016801957041025162, 0.008086624555289745, -0.0023268978111445904, 0.03815975785255432, 0.05853349715471268, -0.09308502823114395, 0.001144656096585095, -0.014806495979428291, -0.04555844888091087, 0.012018319219350815, -0.010250651277601719, -0.08375465124845505, 0.00552168395370245, 0.009120801463723183, -0.0014145898167043924, -0.015580989420413971, 0.030141470953822136, 0.08091180771589279, 0.02226896956562996, 0.03229182958602905, 0.013931773602962494, 0.00933948252350092, -0.011025144718587399, 0.01694774255156517, 0.01065156515687704, 0.02348993718624115, 0.01659238710999489, 0.012164105661213398, 0.0327109657227993, 0.039872754365205765, 0.012300781905651093, 0.0009316703071817756, 0.03487955033779144, -0.0025239381939172745, -0.013749539852142334, 0.005275668576359749, -0.03633742034435272, 0.019462570548057556, 0.012874817475676537, 0.01839650236070156, -0.02053774893283844, -0.04694342613220215, -0.010241539217531681, -0.011808750219643116, -0.04311651736497879, -0.01649215817451477, 0.052592676132917404, 0.03274741396307945, 0.038779351860284805, -0.020592419430613518, 0.0052118864841759205, 0.0010074111633002758, -0.004494341090321541, -0.026059433817863464, -0.039508286863565445, 0.012118547223508358, -0.014296241104602814, -0.024747349321842194, 0.005886151921004057, -0.0020899937953799963, 0.014997841790318489, 0.026879485696554184, 0.045594897121191025, -0.026478571817278862, 0.030742842704057693, 0.031508222222328186, -0.011845196597278118, -0.022688107565045357, 0.031325988471508026, -0.04585002362728119, 0.03819620609283447, 0.011553622782230377, -0.04140352085232735, 0.016483047977089882, 0.03358568996191025, -0.06432852894067764, 0.0543421171605587, -0.03743082284927368, -0.03152644634246826, 0.0009174332953989506, 0.04162219911813736, -0.011717633344233036, 0.012000096030533314, 0.013230173848569393, -0.022378310561180115, 0.0036241747438907623, -0.001190214534290135, -0.01394999772310257 ]
42,900
linearmodels.system.model
_system_r2
null
def _system_r2( self, eps: Float64Array, sigma: Float64Array, method: str, full_cov: bool, debiased: bool, r2s: Sequence[float], ) -> Series: sigma_resid = sigma # System regression on a constant using weights if provided wy, w = self._wy, self._w wi = [cast(Float64Array, np.sqrt(weights)) for weights in w] if method == "ols": est_sigma = np.eye(len(wy)) else: # gls est_sigma = sigma if not full_cov: est_sigma = np.diag(np.diag(est_sigma)) est_sigma_inv = inv(est_sigma) nobs = wy[0].shape[0] k = len(wy) xpx = blocked_inner_prod(wi, est_sigma_inv) xpy = np.zeros((k, 1)) for i in range(k): sy = np.zeros((nobs, 1)) for j in range(k): sy += est_sigma_inv[i, j] * wy[j] xpy[i : (i + 1)] = wi[i].T @ sy mu = _parameters_from_xprod(xpx, xpy) eps_const = np.hstack([self._y[j] - mu[j] for j in range(k)]) # Judge judge = 1 - (eps**2).sum() / (eps_const**2).sum() # Dhrymes tot_eps_const_sq = (eps_const**2).sum(0) r2s_arr = np.asarray(r2s) dhrymes = (r2s_arr * tot_eps_const_sq).sum() / tot_eps_const_sq.sum() # Berndt sigma_y = (eps_const.T @ eps_const / nobs) * self._sigma_scale(debiased) berndt = np.nan # Avoid division by 0 if np.linalg.det(sigma_y) > 0: berndt = 1 - np.linalg.det(sigma_resid) / np.linalg.det(sigma_y) mcelroy = np.nan # Check that the matrix is invertible if np.linalg.matrix_rank(sigma) == sigma.shape[0]: # McElroy sigma_m12 = inv_matrix_sqrt(sigma) std_eps = eps @ sigma_m12 numerator = (std_eps**2).sum() std_eps_const = eps_const @ sigma_m12 denom = (std_eps_const**2).sum() mcelroy = 1.0 - numerator / denom r2 = dict(mcelroy=mcelroy, berndt=berndt, judge=judge, dhrymes=dhrymes) return Series(r2)
(self, eps: numpy.ndarray, sigma: numpy.ndarray, method: str, full_cov: bool, debiased: bool, r2s: collections.abc.Sequence[float]) -> pandas.core.series.Series
[ 0.05573222413659096, -0.0163772851228714, 0.03383878245949745, 0.024156970903277397, 0.0006042214808985591, -0.03302086889743805, -0.052536655217409134, -0.07228069752454758, 0.01765170879662037, 0.0454987995326519, 0.0006146237137727439, 0.03456158936023712, 0.007175761740654707, 0.039259832352399826, -0.06406352669000626, 0.05519963055849075, -0.0024775161873549223, -0.012477931566536427, -0.025564542040228844, 0.002907871501520276, -0.059688642621040344, -0.010651892982423306, 0.011393721215426922, 0.042036931961774826, 0.0002558950800448656, 0.042531486600637436, -0.025069991126656532, -0.02868402563035488, -0.02729547582566738, -0.04652594402432442, -0.029730193316936493, -0.02720036916434765, -0.0006116516306065023, 0.004664958454668522, 0.06680258363485336, -0.019468236714601517, -0.003221722086891532, 0.00976740475744009, -0.09023674577474594, 0.048846535384655, 0.018831023946404457, -0.023243950679898262, 0.06676454097032547, -0.040477193892002106, 0.0017606532201170921, -0.03718651831150055, 0.003321583615615964, 0.0205239150673151, -0.016662603244185448, 0.006253231782466173, 0.016282178461551666, -0.051699720323085785, 0.0454987995326519, -0.05299316719174385, -0.011022807098925114, 0.022958632558584213, -0.0012340027606114745, 0.06569935381412506, 0.026325391605496407, -0.03707239031791687, 0.05200406163930893, -0.01565447822213173, -0.056416988372802734, 0.03134699910879135, -0.02980627864599228, 0.01753758080303669, -0.009386980906128883, -0.02031468041241169, 0.05059649050235748, 0.08278042078018188, 0.03600720316171646, -0.006866666488349438, -0.022159740328788757, 0.028265558183193207, 0.032982826232910156, 0.022616250440478325, -0.0219124648720026, -0.07821532338857651, -0.029387811198830605, -0.05843323841691017, 0.041314125061035156, 0.039754386991262436, 0.0013540743384510279, -0.04260757192969322, -0.0655091404914856, 0.013438504189252853, -0.003086195793002844, 0.03785226121544838, -0.021018465980887413, -0.03267848491668701, -0.02680092304944992, -0.020619021728634834, 0.02280646376311779, 0.02352927066385746, 0.04241735860705376, -0.01051874365657568, -0.02014349028468132, -0.030395936220884323, 0.025050969794392586, -0.06680258363485336, 0.05276491120457649, 0.02934976853430271, -0.008664173074066639, 0.0571778379380703, 0.004289289005100727, 0.021398890763521194, -0.020904339849948883, 0.03836583346128464, 0.005958402529358864, -0.03366759046912193, -0.05672132968902588, 0.10088863968849182, -0.035550691187381744, -0.0070426128804683685, -0.11808384209871292, -0.022996675223112106, -0.01270618662238121, 0.055465925484895706, 0.007713111583143473, 0.027771005406975746, -0.02318688854575157, 0.030338872224092484, 0.008283748291432858, 0.027561772614717484, -0.01930655539035797, -0.005421052686870098, -0.007627516053617001, 0.0191543847322464, 0.009843490086495876, -0.024594459682703018, -0.001150784781202674, -0.007908078841865063, 0.03695826232433319, 0.05112908408045769, 0.014579778537154198, -0.060791872441768646, -0.01959187351167202, -0.0017024007393047214, 0.04466186463832855, -0.005573222413659096, 0.0493791326880455, 0.015397691167891026, -0.04907479137182236, -0.025507478043437004, -0.030224746093153954, -0.006904709152877331, 0.043254293501377106, 0.024042842909693718, 0.012696675956249237, 0.01909732259809971, -0.05093887448310852, 0.029559003189206123, 0.07482954859733582, 0.016244135797023773, 0.03617839142680168, -0.023947738111019135, 0.059460386633872986, -0.012573037296533585, -0.01939215138554573, -0.021341828629374504, -0.07589473575353622, -0.03762400522828102, -0.009315650910139084, -0.007922344841063023, -0.001478901132941246, 0.019087811931967735, -0.0532975047826767, -0.01129861455410719, 0.026059094816446304, 0.008920960128307343, -0.04139021039009094, -0.024993905797600746, -0.04306408017873764, -0.028455769643187523, -0.03484690561890602, 0.0377381332218647, 0.028493812307715416, -0.0001566279970575124, -0.012620590627193451, -0.0040705446153879166, 0.058471281081438065, -0.03478984162211418, -0.043292336165905, -0.03490396961569786, -0.03102363832294941, 0.07353610545396805, 0.015606924891471863, -0.07581865042448044, -0.0296921506524086, 0.015017266385257244, 0.016691135242581367, 0.03800443187355995, 0.030985595658421516, 0.026002030819654465, 0.03085244633257389, 0.017004985362291336, 0.042265187948942184, 0.04245540127158165, 0.005739658139646053, 0.034599628299474716, 0.03595013916492462, 0.07026445120573044, -0.030319850891828537, 0.02885521575808525, 0.01029048953205347, -0.02558356337249279, -0.011222530156373978, -0.01556888222694397, -0.016596028581261635, 0.027675900608301163, -0.020257618278265, 0.024613481014966965, 0.0047243996523320675, -0.02069510519504547, 0.05481920391321182, 0.03695826232433319, 0.054628994315862656, -0.0045175435952842236, -0.01742345280945301, -0.03227904066443443, 0.03079538233578205, -0.07623711973428726, -0.023205909878015518, 0.015787627547979355, -0.03600720316171646, 0.00620092311874032, 0.025887902826070786, -0.0059013389982283115, 0.023072760552167892, 0.03408605605363846, 0.027219390496611595, 0.02098042517900467, 0.046487901359796524, -0.06569935381412506, -0.053411632776260376, 0.01725226268172264, -0.015426223166286945, 0.03372465446591377, -0.04066740348935127, 0.0382707305252552, -0.02541237324476242, -0.035094182938337326, -0.020257618278265, 0.026819944381713867, 0.007746398914605379, -0.02020055428147316, 0.05417248234152794, 0.0095771923661232, -0.022996675223112106, -0.02141791209578514, 0.008930470794439316, -0.060411449521780014, 0.03119482845067978, 0.03513222560286522, -0.02063804306089878, -0.09693222492933273, 0.07094921171665192, 0.026838965713977814, 0.04139021039009094, -0.03585503250360489, 0.04097174480557442, 0.015806647017598152, -0.0687807947397232, 0.004365373868495226, -0.054857246577739716, 0.039107661694288254, -0.03808051720261574, 0.02934976853430271, 0.03220295533537865, 0.041922807693481445, -0.00032246942282654345, 0.012839335016906261, -0.057025667279958725, -0.010185872204601765, 0.03157525509595871, 0.08065004646778107, 0.008012696169316769, -0.042036931961774826, 0.028645982965826988, 0.012278208509087563, -0.010347552597522736, -0.01728079468011856, 0.027904154732823372, 0.008122067898511887, -0.019325576722621918, -0.021227700635790825, -0.03319205716252327, -0.059840813279151917, 0.045422714203596115, -0.006590858567506075, 0.011127423495054245, -0.014665373601019382, 0.034105077385902405, 0.03956417366862297, 0.08658467233181, 0.01315318513661623, -0.008987534791231155, -0.026896029710769653, 0.06204727664589882, -0.04279778152704239, -0.003975438419729471, 0.026705816388130188, 0.02647756226360798, 0.03168937936425209, 0.01788947358727455, -0.08346518874168396, 0.08141089230775833, -0.03233610466122627, -0.015188457444310188, -0.0003032995737157762, -0.042036931961774826, 0.04732483625411987, 0.008283748291432858, 0.006590858567506075, -0.030510064214468002, -0.003682987065985799, -0.029787257313728333, -0.005582733079791069, 0.020542936399579048, 0.04865632578730583, 0.018735919147729874, -0.0027485687751322985, 0.04321625083684921, -0.029387811198830605, 0.02891227975487709, 0.018688365817070007, -0.027732962742447853, -0.005782456137239933, 0.032317083328962326, 0.017956048250198364, 0.012030932120978832, -0.00840738695114851, 0.054971374571323395, 0.026230284944176674, 0.014246906153857708, -0.02259722910821438, 0.03362954780459404, -0.0296921506524086, 0.010395105928182602, -0.06231357157230377, 0.03785226121544838, -0.028170451521873474, -0.04435752332210541, -0.01459879893809557, -0.02269233576953411, -0.015245521441102028, 0.045917265117168427, -0.0399445965886116, 0.0022171628661453724, 0.010594828985631466, 0.0027200367767363787, 0.03777617588639259, -0.002810387872159481, 0.07520996779203415, -0.026934072375297546, 0.04032502323389053, -0.04915087670087814, 0.030681254342198372, 0.016367774456739426, -0.06923729926347733, -0.015274053439497948, 0.06813406944274902, -0.05394422635436058, 0.009748384356498718, 0.032545335590839386, -0.0394120030105114, -0.03893647342920303, 0.07897617667913437, 0.04679224267601967, -0.053525760769844055, -0.007865281775593758, -0.028455769643187523, -0.021265743300318718, 0.009054108522832394, -0.021931486204266548, 0.010385595262050629, -0.039488088339567184, -0.04587922245264053, 0.03079538233578205, -0.01794653758406639, 0.004327331203967333, -0.014674884267151356, -0.03906961902976036, -0.03730064630508423, 0.08384561538696289, -0.0017119112890213728, 0.005972668528556824, 0.012943951413035393, 0.042987994849681854, -0.04477599263191223, 0.01267765462398529, -0.0064101568423211575, 0.02236897498369217, 0.018602769821882248, -0.03747183829545975, 0.018764451146125793, 0.06474828720092773, 0.016919391229748726, -0.06744930893182755, 0.03362954780459404, -0.09076934307813644, 0.030148660764098167, 0.04032502323389053, -0.014246906153857708, -0.029787257313728333, -0.09685613960027695, 0.01892613060772419, -0.017385410144925117, -0.012382824905216694, 0.07821532338857651, -0.023396121338009834, 0.007004570681601763, -0.04241735860705376, -0.05934625864028931, -0.034276269376277924, 0.008050738833844662, -0.0009296629577875137, -0.00016316655091941357, 0.07798707485198975, 0.021988550201058388, 0.000423222518293187, -0.012810803018510342, 0.02746666595339775, 0.0318986140191555, 0.021284764632582664, 0.020333701744675636, -0.051471468061208725, 0.017803877592086792, -0.05154755339026451, 0.013324376195669174, 0.03530341759324074, 0.005511403549462557, -0.07125355303287506, -0.03644469007849693, -0.018831023946404457, -0.02569769136607647, -0.019192427396774292, -0.014351523481309414, 0.04169455170631409, -0.0095676826313138, 0.005768190138041973, 0.027828069403767586, -0.0029839565977454185, -0.04158042371273041, -0.04074348881840706, -0.05204210430383682, 0.01750904880464077, -0.004893213044852018, -0.06010710820555687, -0.06311246752738953, 0.0385560467839241, 0.002895983401685953, 0.07943268865346909, -0.013771375641226768, -0.04690637066960335, -0.019877193495631218, 0.06356897205114365, -0.057406093925237656, -0.010566296987235546, 0.019382640719413757, -0.009805447421967983, -0.02914053574204445, -0.06208531931042671, 0.028037304058670998, 0.00031830850639380515, 0.016491413116455078, 0.016025392338633537, -0.010613850317895412, 0.0058109876699745655, -0.002879339735955, -0.00788905844092369, -0.00991006474941969, 0.027904154732823372, -0.03707239031791687, -0.0738023966550827, 0.024651523679494858, -0.0766175389289856, -0.031613294035196304, -0.01361920591443777, -0.0029530469328165054, -0.023719482123851776, -0.05455290898680687, 0.013885502703487873, 0.028265558183193207, 0.03513222560286522, -0.04519445821642876, 0.03783323988318443, 0.0028698290698230267, 0.030491042882204056, 0.005245106294751167, -0.023567313328385353, 0.006253231782466173, 0.0410478301346302, 0.08795420080423355, -0.048199813812971115, -0.00960572436451912, 0.01884053461253643, 0.00668596476316452, 0.028817174956202507, -0.04196085035800934, 0.007432548329234123, -0.043977100402116776, -0.02914053574204445, -0.027904154732823372, 0.004372506868094206, -0.018802491948008537, -0.060183193534612656, 0.004945521708577871, -0.008374099619686604, 0.019030747935175896, -0.014294459484517574, -0.014142289757728577, 0.030453000217676163, 0.0006449388456530869, -0.018916619941592216, -0.002079258905723691, -0.02853185497224331, 0.049188919365406036, -0.03090951032936573, 0.0191543847322464, -0.002879339735955, -0.007375484798103571, 0.008745013736188412, 0.007432548329234123, 0.028056325390934944, -0.020714126527309418, -0.04523250088095665, -0.0031599029898643494, 0.03667294606566429, 0.012173592112958431, -0.02596398815512657, -0.027675900608301163, -0.03195567801594734, 0.004893213044852018, -0.028037304058670998, -0.000003733660832949681, 0.023947738111019135, -0.027713941410183907, -0.06075382977724075, -0.027542751282453537, -0.016110988333821297, -0.000671687419526279, 0.05980277061462402, 0.028760110959410667, -0.05166168138384819, -0.003193190088495612, -0.01531209610402584, -0.009486841969192028, -0.008274237625300884, -0.042379315942525864, 0.022273868322372437, -0.0061628809198737144, 0.06170489266514778, 0.0335724838078022, 0.007161495741456747, -0.03290674090385437, -0.03227904066443443, 0.013704800978302956, -0.007613250054419041, 0.012858356349170208, -0.038384854793548584, 0.028056325390934944, 0.05877562239766121, 0.0068571558222174644, -0.015369159169495106, 0.044319480657577515, 0.03872723877429962, -0.00166792469099164, -0.06421569734811783, -0.017898984253406525, -0.012601569294929504, -0.017432963475584984, 0.0057634348049759865, 0.0004903912777081132, 0.009776915423572063, 0.04519445821642876, 0.06615586578845978, -0.042151059955358505, -0.06642215698957443, -0.011193998157978058, 0.00884011946618557, -0.02124672196805477, -0.021322807297110558, -0.08894330263137817, 0.012506463564932346, 0.002829408971592784, -0.08536731451749802, 0.044091228395700455, -0.02263527177274227, 0.03186057135462761, 0.0014313480351120234, 0.03168937936425209, -0.054743118584156036, -0.10682326555252075, -0.019116343930363655, 0.028493812307715416, 0.00621518911793828, -0.02063804306089878, -0.0296921506524086, 0.028493812307715416, -0.058585409075021744, -0.013077100738883018, 0.0626939982175827, -0.04028698056936264, -0.03730064630508423, -0.025450415909290314, -0.0027699675410985947, -0.04462382197380066, 0.0026724839117377996, 0.013714311644434929, 0.005335457157343626, -0.013333886861801147, 0.023015696555376053, 0.024347184225916862, 0.06961772590875626, 0.010946721769869328, -0.019496768712997437, -0.006338827311992645, 0.08559556305408478, -0.018536195158958435, -0.008987534791231155, 0.0263634342700243, 0.007860526442527771, -0.005026361905038357, -0.04690637066960335, 0.03918374702334404, 0.0033667590469121933, -0.051471468061208725, 0.046487901359796524, -0.04310212284326553, -0.03125189244747162, -0.011888273060321808, 0.08042179048061371, -0.05755826458334923, 0.04519445821642876, -0.01577811688184738, 0.01985817216336727, 0.032545335590839386, -0.009562927298247814, 0.0998995378613472, 0.025393351912498474, 0.010613850317895412, -0.02153204008936882, 0.04527054354548454, -0.059460386633872986, 0.0352463535964489, 0.01704302802681923, 0.029159557074308395, 0.0516236387193203, 0.04416731372475624, -0.01993425562977791, 0.03195567801594734, -0.04523250088095665, 0.001582329161465168, 0.008240951225161552, -0.035493627190589905, 0.030605170875787735, -0.013048568740487099, 0.009872022084891796, -0.014579778537154198, 0.05394422635436058, -0.009358448907732964, 0.012943951413035393, -0.00668596476316452, -0.017385410144925117, -0.031042659655213356, 0.04097174480557442, 0.026382455602288246, 0.008607110008597374, -0.0021054132375866175, 0.053525760769844055, -0.07094921171665192, 0.005906093865633011, -0.011479316279292107, -0.02934976853430271, 0.007627516053617001, -0.028170451521873474, -0.02130378596484661, -0.014779501594603062, 0.054628994315862656, 0.027428623288869858, 0.027999261394143105, -0.03990655392408371, -0.027790026739239693, 0.026705816388130188, -0.035151246935129166, 0.013809418305754662, 0.04158042371273041, -0.06394939869642258, -0.052536655217409134, -0.017518559470772743, -0.01848864182829857, 0.010376084595918655, -0.00864039734005928, 0.020714126527309418, 0.026991134509444237, -0.009168236516416073, -0.01889759860932827, 0.03895549476146698, 0.0011585121974349022, 0.012810803018510342, -0.01800360158085823, 0.008811588399112225, 0.05980277061462402, 0.007494367193430662, 0.07403065264225006, -0.029292704537510872, 0.0015549861127510667, 0.03612132743000984, -0.04489012062549591, 0.0026344412472099066, 0.016215603798627853, 0.10804062336683273, -0.0521562322974205, 0.0148460753262043, -0.019354108721017838, -0.004902723710983992, 0.01698596403002739, -0.01906879059970379, 0.07589473575353622, -0.031670358031988144, -0.026705816388130188, 0.03817562386393547, -0.011412742547690868, -0.01918291673064232, 0.032107848674058914, -0.0009035087423399091, 0.012354293838143349, 0.06961772590875626, -0.005606509745121002, -0.02664875239133835, 0.0028769620694220066, -0.0040776776149868965, 0.04667811468243599, -0.03237414360046387, -0.057748474180698395, -0.03579796850681305, -0.020447829738259315, 0.036330562084913254, 0.04097174480557442, -0.0037638272624462843, 0.02885521575808525, -0.03366759046912193, -0.03709141165018082, -0.031613294035196304, 0.03513222560286522, -0.03208882734179497, 0.01459879893809557, 0.053982269018888474, -0.012915420345962048, 0.07026445120573044, -0.030453000217676163, 0.009529639966785908, 0.04915087670087814, -0.011812187731266022, -0.02069510519504547, 0.03256435692310333, -0.06197119131684303, -0.03572188317775726, 0.0024097529239952564, 0.034162141382694244, 0.005611265078186989, 0.021608125418424606, 0.06573739647865295, -0.00408718828111887, 0.028436750173568726, -0.01267765462398529, 0.023205909878015518 ]
42,901
linearmodels.system.model
_validate_data
null
def _validate_data(self) -> None: ids = [] for i, key in enumerate(self._equations): self._eq_labels.append(key) eq_data = self._equations[key] dep_name = "dependent_" + str(i) exog_name = "exog_" + str(i) endog_name = "endog_" + str(i) instr_name = "instr_" + str(i) if isinstance(eq_data, (tuple, list)): dep = IVData(eq_data[0], var_name=dep_name) self._dependent.append(dep) current_id: tuple[int, ...] = (id(eq_data[1]),) self._exog.append( IVData(eq_data[1], var_name=exog_name, nobs=dep.shape[0]) ) endog = IVData(eq_data[2], var_name=endog_name, nobs=dep.shape[0]) if endog.shape[1] > 0: current_id += (id(eq_data[2]),) ids.append(current_id) self._endog.append(endog) self._instr.append( IVData(eq_data[3], var_name=instr_name, nobs=dep.shape[0]) ) if len(eq_data) == 5: self._weights.append(IVData(eq_data[4])) else: dep_shape = self._dependent[-1].shape self._weights.append(IVData(np.ones(dep_shape))) elif isinstance(eq_data, (dict, Mapping)): dep = IVData(eq_data["dependent"], var_name=dep_name) self._dependent.append(dep) exog = eq_data.get("exog", None) self._exog.append(IVData(exog, var_name=exog_name, nobs=dep.shape[0])) current_id = (id(exog),) endog_values = eq_data.get("endog", None) endog = IVData(endog_values, var_name=endog_name, nobs=dep.shape[0]) self._endog.append(endog) if "endog" in eq_data: current_id += (id(eq_data["endog"]),) ids.append(current_id) instr_values = eq_data.get("instruments", None) instr = IVData(instr_values, var_name=instr_name, nobs=dep.shape[0]) self._instr.append(instr) if "weights" in eq_data: self._weights.append(IVData(eq_data["weights"])) else: self._weights.append(IVData(np.ones(dep.shape))) else: msg = UNKNOWN_EQ_TYPE.format(key=key, type=type(vars)) raise TypeError(msg) self._has_instruments = False for instr in self._instr: self._has_instruments = self._has_instruments or (instr.shape[1] > 1) for i, comps in enumerate( zip(self._dependent, self._exog, self._endog, self._instr, self._weights) ): shapes = [a.shape[0] for a in comps] if min(shapes) != max(shapes): raise ValueError( "Dependent, exogenous, endogenous and " "instruments, and weights, if provided, do " "not have the same number of observations in " "{eq}".format(eq=self._eq_labels[i]) ) self._drop_missing() self._common_exog = len(set(ids)) == 1 if self._common_exog: # Common exog requires weights are also equal w0 = self._weights[0].ndarray for w in self._weights: self._common_exog = self._common_exog and bool(np.all(w.ndarray == w0)) constant = [] constant_loc = [] exog_ivd: IVData for dep, exog_ivd, endog, instr, w, label in zip( self._dependent, self._exog, self._endog, self._instr, self._weights, self._eq_labels, ): y = cast(Float64Array, dep.ndarray) x = np.concatenate([exog_ivd.ndarray, endog.ndarray], 1, dtype=float) z = np.concatenate([exog_ivd.ndarray, instr.ndarray], 1, dtype=float) w_arr = cast(Float64Array, w.ndarray) w_arr = w_arr / np.nanmean(w_arr) w_sqrt = np.sqrt(w_arr) self._w.append(w_arr) self._y.append(y) self._x.append(x) self._z.append(z) self._wy.append(y * w_sqrt) self._wx.append(x * w_sqrt) self._wz.append(z * w_sqrt) cols = list(exog_ivd.cols) + list(endog.cols) self._param_names.extend([label + "_" + col for col in cols]) if y.shape[0] <= x.shape[1]: raise ValueError( "Fewer observations than variables in " "equation {eq}".format(eq=label) ) if matrix_rank(x) < x.shape[1]: raise ValueError( "Equation {eq} regressor array is not full " "rank".format(eq=label) ) if x.shape[1] > z.shape[1]: raise ValueError( "Equation {eq} has fewer instruments than " "endogenous variables.".format(eq=label) ) if z.shape[1] > z.shape[0]: raise ValueError( "Fewer observations than instruments in " "equation {eq}".format(eq=label) ) if matrix_rank(z) < z.shape[1]: raise ValueError( "Equation {eq} instrument array is full " "rank".format(eq=label) ) for rhs in self._x: const, const_loc = has_constant(rhs) constant.append(const) constant_loc.append(const_loc) self._has_constant = Series( constant, index=[d.cols[0] for d in self._dependent] ) self._constant_loc = constant_loc
(self) -> NoneType
[ 0.061478789895772934, -0.06099534034729004, -0.03426455706357956, 0.044477447867393494, -0.021271822974085808, -0.019106367602944374, -0.03333794325590134, -0.08077652007341385, -0.0014780492056161165, -0.010726558044552803, -0.016971128061413765, -0.025320719927549362, 0.020284777507185936, -0.007448159623891115, -0.03297535330057144, 0.01232798770070076, -0.025280432775616646, -0.0037064538337290287, -0.021835848689079285, -0.04083142429590225, -0.06099534034729004, -0.030195513740181923, -0.054025594145059586, 0.04725728929042816, 0.03575519472360611, 0.024555256590247154, 0.005539536941796541, -0.004658247344195843, 0.05197092890739441, -0.012992732226848602, -0.06353345513343811, -0.040992576628923416, -0.026630066335201263, -0.03990481048822403, 0.009517932310700417, -0.031041551381349564, 0.03432498499751091, 0.002802502131089568, -0.01424164604395628, 0.053582433611154556, 0.027335098013281822, -0.06429892033338547, 0.05656370893120766, -0.005086302291601896, -0.05495220795273781, 0.045847222208976746, -0.033398374915122986, 0.017756734043359756, 0.02705308422446251, -0.02115095965564251, 0.02822142466902733, -0.0556773841381073, 0.016125088557600975, 0.03108183853328228, 0.020325064659118652, 0.05205150693655014, 0.002437396440654993, 0.03875661641359329, 0.0763046070933342, -0.06808594614267349, 0.003155018202960491, -0.014805671758949757, 0.019197015091776848, 0.029772493988275528, -0.034103404730558395, 0.047539301216602325, -0.04274508357048035, 0.00416976073756814, -0.019821470603346825, 0.011502093635499477, -0.0070251403376460075, -0.03867604210972786, 0.01554091926664114, 0.006012915633618832, -0.0017927956068888307, -0.015077613294124603, -0.00020159508858341724, -0.011693459004163742, 0.009457500651478767, -0.06993917375802994, 0.003049263497814536, 0.013889130204916, -0.015107828192412853, 0.000013760320143774152, 0.029832925647497177, 0.031887590885162354, 0.0005350689170882106, 0.05672486126422882, -0.011733747087419033, -0.06454064697027206, -0.019771112129092216, 0.023084761574864388, 0.0051618413999676704, 0.04814361408352852, 0.06824709475040436, 0.0007283232407644391, -0.023991230875253677, -0.09113042056560516, 0.010978355072438717, 0.0008214881527237594, 0.009538075886666775, -0.01952938549220562, -0.02109052799642086, 0.004197458270937204, -0.045001186430454254, -0.046169523149728775, -0.020345209166407585, -0.00795175414532423, 0.008943834342062473, -0.06309029459953308, -0.05793348699808121, 0.06816652417182922, -0.018411407247185707, -0.019096294417977333, -0.026005608960986137, -0.01831068843603134, -0.028644442558288574, 0.051366616040468216, -0.053824156522750854, 0.014825815334916115, 0.006048167590051889, 0.012831582687795162, -0.08903546631336212, 0.059544987976551056, 0.05930326133966446, -0.03772928565740585, 0.021453116089105606, 0.04508176073431969, 0.00673305569216609, -0.11618927121162415, -0.02173512987792492, -0.03190773352980614, -0.01314381044358015, 0.049996841698884964, -0.03249190375208855, -0.00963879469782114, 0.026126472279429436, -0.035594042390584946, -0.03748755902051926, -0.018592700362205505, 0.02582431584596634, 0.02771782875061035, -0.022500593215227127, 0.04427601024508476, -0.0005678025772795081, 0.02278260514140129, 0.0005731532583013177, -0.017434434965252876, -0.03738683834671974, -0.03466743230819702, -0.03366024047136307, -0.005620112176984549, -0.035271745175123215, -0.04641124978661537, 0.010323682799935341, -0.05608025938272476, -0.0197308249771595, -0.02070779725909233, 0.02465597540140152, -0.044880323112010956, -0.07650604099035263, -0.04262422025203705, -0.00038147266604937613, 0.0021239088382571936, -0.0058014062233269215, 0.06252626329660416, -0.04854648932814598, 0.0026136543601751328, -0.025139426812529564, 0.047337863594293594, 0.008782684803009033, -0.03587605804204941, -0.07731179147958755, 0.001333265914581716, -0.08146141469478607, 0.03762856498360634, 0.016276167705655098, -0.005287739913910627, 0.01498696580529213, 0.03269334137439728, -0.0035327139776200056, -0.003185233799740672, -0.05185006931424141, 0.025139426812529564, 0.004096739459782839, -0.00356041151098907, 0.04177818074822426, -0.026891935616731644, 0.07404850423336029, -0.016658898442983627, -0.027939410880208015, -0.03887747973203659, -0.008183407597243786, 0.03954222425818443, 0.024152381345629692, 0.013506398536264896, 0.04923137649893761, 0.020667510107159615, -0.021976854652166367, -0.021835848689079285, -0.0019803845789283514, -0.05354214459657669, 0.03732640668749809, -0.04359112307429314, -0.08097796142101288, 0.02582431584596634, -0.027858836576342583, -0.004053934011608362, 0.018804211169481277, 0.021956710144877434, -0.0061841378919780254, 0.0037467414513230324, -0.02123153582215309, 0.018522197380661964, 0.062002528458833694, 0.030336519703269005, 0.002706819213926792, -0.006234497297555208, 0.013325104489922523, -0.01999269239604473, 0.03704439476132393, -0.025904890149831772, -0.06393633037805557, -0.02252073585987091, -0.00360321719199419, -0.05374358221888542, 0.023890512064099312, 0.0697377398610115, 0.026005608960986137, -0.012086262926459312, 0.04153645783662796, 0.018512126058340073, 0.010948140174150467, -0.06667588651180267, 0.014644522219896317, 0.05426732078194618, -0.03770913928747177, 0.018572557717561722, 0.030739394947886467, -0.0006392499781213701, -0.028382573276758194, -0.021956710144877434, -0.01700134389102459, -0.01272079162299633, 0.0004633067292161286, -0.017807094380259514, 0.0727190151810646, 0.0677233561873436, -0.0648629441857338, -0.029490482062101364, 0.01148195005953312, -0.042221345007419586, -0.022943755611777306, -0.0235480684787035, 0.0011267921654507518, -0.02296390011906624, 0.030255945399403572, 0.021130817010998726, 0.0852484405040741, -0.06852911412715912, 0.010097065009176731, 0.01595386676490307, 0.0017902776598930359, 0.056362271308898926, -0.05962556228041649, 0.04931195080280304, 0.03257247805595398, -0.015752429142594337, -0.03210917115211487, 0.014886246994137764, -0.02219843678176403, 0.07481396943330765, -0.028382573276758194, 0.018995575606822968, 0.0061942096799612045, 0.0499565526843071, 0.028644442558288574, -0.04054941236972809, -0.02505885250866413, 0.03625878691673279, 0.01616537570953369, -0.007065427955240011, 0.01545027270913124, -0.012630145065486431, -0.018612844869494438, -0.04141559451818466, -0.04479974880814552, -0.05809463560581207, 0.01926751807332039, -0.047015562653541565, -0.020586933940649033, 0.044558022171258926, 0.007760387845337391, 0.029490482062101364, 0.0466126874089241, -0.00023543032875750214, 0.0008687001536600292, 0.018703492358326912, 0.010494904592633247, 0.015782644972205162, -0.013526542112231255, 0.031968165189027786, 0.06446006894111633, -0.03496958687901497, -0.05861837416887283, -0.03543289378285408, 0.06703846901655197, -0.010786989703774452, 0.025663165375590324, -0.05422703176736832, 0.018350975587964058, 0.06852911412715912, 0.0070956433191895485, 0.034687574952840805, 0.05644284933805466, -0.03774942830204964, 0.0007503554807044566, 0.010645982809364796, 0.030578244477510452, 0.0850067138671875, 0.021513547748327255, -0.00460788793861866, 0.012710719369351864, -0.04075084999203682, 0.022037286311388016, -0.024998420849442482, 0.10321668535470963, -0.04060984402894974, 0.023729363456368446, -0.024776838719844818, -0.0016316454857587814, -0.052333518862724304, 0.011955328285694122, 0.009492752142250538, 0.07944703102111816, -0.03343866020441055, 0.010102101601660252, -0.016256023198366165, 0.04600837454199791, 0.03158543258905411, 0.02763725444674492, -0.02094952203333378, -0.034042973071336746, 0.03198830783367157, 0.022863181307911873, -0.08734339475631714, 0.035291887819767, -0.02848329208791256, -0.03265305235981941, 0.08911604434251785, -0.05656370893120766, 0.04886879026889801, 0.0219969991594553, 0.030658820644021034, 0.047660164535045624, 0.00046834268141537905, -0.02380993776023388, -0.012690575793385506, -0.012338059954345226, 0.040388260036706924, 0.016840193420648575, 0.028765305876731873, -0.014110712334513664, 0.02465597540140152, 0.0040816315449774265, -0.051890354603528976, 0.009895627386868, -0.026710640639066696, 0.015289122238755226, -0.029409905895590782, -0.032149460166692734, -0.017474722117185593, -0.009875483810901642, -0.015591278672218323, 0.0176459439098835, 0.028342286124825478, -0.013043091632425785, 0.021533692255616188, 0.0033564558252692223, -0.01816968247294426, 0.022621454671025276, -0.016336599364876747, 0.0022976489271968603, 0.02264159917831421, 0.003661130554974079, -0.023447349667549133, 0.06566869467496872, 0.009538075886666775, 0.028986888006329536, 0.01952938549220562, 0.03394225612282753, -0.008047436363995075, -0.007931609638035297, -0.0034219231456518173, 0.027858836576342583, 0.01368769258260727, -0.0008044918649829924, 0.026912078261375427, -0.06027016416192055, -0.008928726427257061, -0.07429023087024689, -0.01791788451373577, 0.02667035348713398, 0.06329172849655151, 0.011169721372425556, -0.06957658380270004, 0.03440556302666664, 0.02608618326485157, -0.016276167705655098, 0.024635832756757736, -0.019831543788313866, 0.03454656898975372, 0.02660992182791233, -0.01340567972511053, -0.02771782875061035, -0.027435816824436188, 0.011179792694747448, 0.010142388753592968, 0.03605734929442406, 0.035473182797431946, 0.027476103976368904, 0.05346157029271126, 0.04689469933509827, 0.05422703176736832, -0.070583775639534, 0.03023580089211464, -0.05076230317354202, 0.019579745829105377, -0.021855991333723068, 0.0068891700357198715, -0.037608422338962555, 0.04161703214049339, -0.02121139131486416, -0.06482265889644623, -0.005761118605732918, -0.030034363269805908, -0.010535192675888538, -0.001572473207488656, 0.03619835898280144, 0.06478236615657806, 0.01809917949140072, 0.028966743499040604, 0.019750967621803284, -0.011834465898573399, -0.04310766980051994, -0.006758235394954681, -0.04214077070355415, 0.04741843789815903, -0.04927166551351547, -0.021654553711414337, 0.09572320431470871, 0.023648787289857864, 0.02614661492407322, -0.005635220091789961, 0.000871218100655824, 0.011562524363398552, 0.013304960913956165, -0.022500593215227127, -0.004665800835937262, -0.029812781140208244, -0.04395370930433273, 0.018804211169481277, -0.03627893328666687, 0.001801608595997095, 0.0024109575897455215, 0.004854648839682341, 0.008898510597646236, -0.023588355630636215, -0.0029132929630577564, 0.036963820457458496, 0.0124287074431777, -0.011058930307626724, 0.017162492498755455, -0.02602575346827507, 0.0033060964196920395, 0.0014050280442461371, 0.017988387495279312, 0.0017739108297973871, 0.01836104691028595, -0.039683230221271515, 0.037547990679740906, -0.012116478756070137, -0.03686310350894928, -0.00885822344571352, 0.015228691510856152, 0.0023870368022471666, 0.011884825304150581, -0.023890512064099312, -0.02530057728290558, -0.029571056365966797, -0.0702211856842041, -0.003865086240693927, 0.019116438925266266, 0.02737538516521454, 0.03142428398132324, 0.018350975587964058, 0.01184453722089529, -0.024373963475227356, 0.07219527661800385, -0.03861561045050621, 0.05068172886967659, -0.03770913928747177, -0.024434395134449005, -0.026509203016757965, -0.006587013136595488, -0.01673947460949421, -0.004942778032273054, 0.01809917949140072, -0.026247333735227585, -0.02374950610101223, -0.01771644689142704, -0.06421834230422974, 0.04359112307429314, 0.004975511692464352, 0.016507821157574654, 0.006994924508035183, -0.0020962113048881292, 0.03762856498360634, -0.04008610546588898, 0.03370052948594093, 0.0061388141475617886, -0.020536575466394424, -0.020455999299883842, -0.0017172564985230565, 0.026448771357536316, 0.05301840603351593, -0.08597361296415329, -0.08186428993940353, 0.006838810630142689, 0.011562524363398552, -0.06921400129795074, -0.0738067775964737, 0.05797377601265907, 0.04516233503818512, -0.03470771759748459, -0.008868295699357986, 0.12126550078392029, -0.0735650509595871, -0.050963740795850754, -0.0016530482098460197, -0.01281143818050623, 0.030477525666356087, 0.009044553153216839, -0.051044315099716187, 0.010645982809364796, 0.024232957512140274, -0.008525851182639599, 0.04923137649893761, -0.018733708187937737, 0.00611867057159543, -0.01636681519448757, 0.008616498671472073, 0.05946441367268562, -0.007871178910136223, 0.010887708514928818, -0.04939252883195877, 0.040589697659015656, 0.017021486535668373, -0.00030640565091744065, 0.03525159880518913, -0.004376234486699104, -0.015158187597990036, 0.023729363456368446, -0.07727150619029999, 0.011894896626472473, 0.03569476306438446, 0.03277391567826271, -0.023084761574864388, 0.0028176100458949804, -0.008938798680901527, -0.035594042390584946, -0.003970840945839882, 0.010595623403787613, -0.044477447867393494, -0.02121139131486416, -0.0015636602183803916, -0.050399716943502426, -0.02856386825442314, -0.012871869839727879, -0.05825578793883324, 0.0013823662884533405, 0.028785448521375656, 0.014906390570104122, -0.014886246994137764, 0.09846275299787521, 0.023930801078677177, -0.01190496888011694, 0.08677937090396881, 0.03291492164134979, 0.03736669570207596, -0.03509045019745827, 0.04612923786044121, -0.04802275076508522, 0.00503090675920248, 0.026126472279429436, 0.07896358519792557, -0.012136622332036495, 0.0294501930475235, -0.02620704658329487, -0.029148036614060402, -0.041375305503606796, 0.015228691510856152, -0.0033262402284890413, -0.0005797629128210247, -0.02868472971022129, -0.02868472971022129, 0.010107137262821198, 0.017414290457963943, -0.008415060117840767, -0.018391262739896774, 0.05930326133966446, 0.02005312405526638, 0.025804171338677406, -0.06300971657037735, -0.025542302057147026, -0.0323106087744236, -0.031041551381349564, 0.10120230913162231, 0.023386918008327484, 0.008087724447250366, 0.01712220534682274, -0.0020005283877253532, -0.02193656750023365, -0.018723635002970695, -0.030074650421738625, 0.00121618015691638, 0.06663559377193451, -0.04431629553437233, 0.018089106306433678, -0.022420017048716545, 0.017414290457963943, 0.013707836158573627, 0.021110672503709793, -0.009890591725707054, 0.04633067548274994, 0.012791294604539871, 0.04214077070355415, -0.005217236932367086, -0.007936646230518818, 0.057208310812711716, 0.03049767017364502, 0.0017789468402042985, 0.008223694749176502, 0.029893357306718826, 0.0393407866358757, 0.0363595075905323, -0.025904890149831772, -0.05475077033042908, 0.018935145810246468, 0.023004187270998955, 0.011441661976277828, -0.0069042774848639965, -0.06111620366573334, -0.06538668274879456, 0.002860415494069457, 0.013375463895499706, -0.03718540072441101, -0.021775417029857635, 0.018139466643333435, 0.006627300754189491, 0.007936646230518818, 0.044678885489702225, -0.0007151038735173643, -0.05483134463429451, 0.026307765394449234, 0.030578244477510452, 0.046370960772037506, -0.01394956186413765, 0.06043131276965141, 0.031001264229416847, -0.012317916378378868, -0.03452642261981964, 0.015752429142594337, 0.05080259218811989, 0.012408562935888767, -0.021070385351777077, 0.004335946869105101, 0.008248873986303806, 0.020808516070246696, 0.002631280105561018, 0.03853503614664078, 0.029389763250947, 0.05471048504114151, -0.061237066984176636, 0.01394956186413765, -0.07779524475336075, -0.00473630428314209, -0.026650208979845047, 0.05781262367963791, -0.053179558366537094, -0.06514495611190796, 0.021332254633307457, 0.024232957512140274, -0.03359981253743172, 0.015571135096251965, -0.0816628485918045, -0.020868947729468346, -0.027355242520570755, -0.017676159739494324, 0.02147326059639454, 0.0006222536903806031, -0.0262876208871603, -0.018451694399118423, 0.001572473207488656, 0.03225017711520195, 0.06393633037805557, -0.04427601024508476, 0.010268287733197212, -0.028704874217510223, -0.05608025938272476, 0.015883363783359528, 0.04504147171974182, -0.03418397903442383, -0.05736945942044258, 0.023326488211750984, 0.0367220938205719, 0.008812899701297283, 0.02836243063211441, -0.03482858091592789, 0.03132356330752373, 0.028765305876731873, 0.06159965321421623, 0.029611343517899513, 0.01505746878683567, -0.07324275374412537, 0.05241409316658974, 0.05450904369354248, -0.0235480684787035, 0.040267400443553925, 0.0051618413999676704, 0.019710680469870567, 0.04629038646817207, -0.033116359263658524, -0.0012822769349440932, -0.028725018724799156, -0.07134924083948135, -0.024373963475227356, -0.01648767665028572, -0.06212339177727699, 0.02654949016869068, 0.014614306390285492, -0.027878979220986366, -0.05044000223278999, 0.025784026831388474, -0.03277391567826271, 0.019750967621803284, 0.06522553414106369, -0.0069596730172634125, -0.013476182706654072, -0.05523421987891197, 0.038454458117485046, 0.05015799030661583, -0.013022948056459427, 0.01751500926911831, 0.030135082080960274, 0.03249190375208855, 0.055717673152685165, 0.005217236932367086, -0.004756447859108448, -0.05088316649198532, -0.0132042421028018, -0.02620704658329487, 0.028986888006329536, 0.054347895085811615, -0.05172920599579811, 0.03746741637587547, 0.0063301799818873405, 0.04290623217821121 ]
42,902
linearmodels.system.model
add_constraints
Add parameter constraints to a model. Parameters ---------- r : DataFrame Constraint matrix. nconstraints by nparameters q : Series Constraint values (nconstraints). If not set, set to 0 Notes ----- Constraints are of the form .. math :: r \beta = q The property `param_names` can be used to determine the order of parameters.
def add_constraints(self, r: DataFrame, q: Series | None = None) -> None: r""" Add parameter constraints to a model. Parameters ---------- r : DataFrame Constraint matrix. nconstraints by nparameters q : Series Constraint values (nconstraints). If not set, set to 0 Notes ----- Constraints are of the form .. math :: r \beta = q The property `param_names` can be used to determine the order of parameters. """ self._constraints = LinearConstraint( r, q=q, num_params=len(self._param_names), require_pandas=True )
(self, r: pandas.core.frame.DataFrame, q: Optional[pandas.core.series.Series] = None) -> NoneType
[ -0.01299015711992979, 0.013760535046458244, -0.022243540734052658, 0.0019093406153842807, -0.019055772572755814, 0.030797388404607773, -0.0337195098400116, -0.04168893024325371, -0.014557477086782455, 0.009306513704359531, 0.04742691293358803, 0.019463099539279938, 0.02615741267800331, 0.011759324930608273, -0.058371588587760925, 0.010563910938799381, 0.014663736335933208, -0.019480809569358826, -0.04183061048388481, -0.03782818838953972, -0.023802006617188454, 0.025874055922031403, 0.026547029614448547, 0.056954801082611084, -0.017886923626065254, 0.04912705719470978, -0.017205096781253815, -0.03630514442920685, 0.00004105774132767692, 0.015354419127106667, -0.05553801357746124, -0.017780665308237076, -0.04533715546131134, -0.047887369990348816, -0.053271155804395676, 0.025750087574124336, 0.029947316274046898, -0.03359553962945938, 0.038394901901483536, -0.011856728233397007, 0.011927568353712559, 0.025325050577521324, 0.034534160047769547, -0.04239732399582863, 0.040555503219366074, 0.010156584903597832, -0.021482018753886223, 0.026741838082671165, 0.04062633961439133, 0.011626500636339188, 0.056600604206323624, -0.0017986542079597712, 0.057379838079214096, -0.08125267922878265, -0.01285733375698328, 0.014955948106944561, -0.007265456020832062, 0.05475878342986107, 0.012326039373874664, -0.057025641202926636, 0.0300181545317173, -0.03733231499791145, -0.05043758451938629, 0.006689887028187513, 0.01882554590702057, 0.01734677515923977, -0.006167446728795767, -0.056954801082611084, 0.020313169807195663, -0.020667366683483124, -0.013592291623353958, -0.023447809740900993, -0.03143494203686714, 0.006437521893531084, -0.026759548112750053, 0.030868226662278175, -0.037580251693725586, -0.02364261820912361, -0.008788500912487507, -0.007083930540829897, 0.03540194407105446, 0.0002143165620509535, 0.028335722163319588, -0.030496319755911827, -0.008266061544418335, -0.015770601108670235, -0.04678935930132866, -0.017824940383434296, 0.0514647550880909, -0.02769816853106022, -0.04622264578938484, -0.05128765478730202, 0.01285733375698328, 0.011484822258353233, 0.06800573319196701, 0.0207027867436409, 0.04292861744761467, -0.0037389870267361403, -0.007411562371999025, 0.013317788951098919, -0.013565726578235626, 0.006326835602521896, -0.02518337219953537, 0.03733231499791145, -0.02357177808880806, -0.053448256105184555, -0.037155214697122574, -0.03765109181404114, -0.046541422605514526, 0.032107915729284286, -0.004013489466160536, 0.09117018431425095, -0.00466211186721921, 0.02938060089945793, -0.0666952058672905, 0.03782818838953972, -0.050331324338912964, -0.04962293431162834, 0.001538541167974472, 0.07678980380296707, 0.06318865716457367, 0.053448256105184555, 0.005950501654297113, 0.01438923366367817, -0.02606886439025402, 0.002463879529386759, 0.0014212134992703795, 0.02930976264178753, -0.017762955278158188, -0.09676648676395416, 0.01926829107105732, -0.07480630278587341, 0.028725337237119675, 0.05518381670117378, 0.016833189874887466, -0.0062958430498838425, -0.014008472673594952, 0.021092403680086136, 0.004518219269812107, -0.02902640588581562, 0.02661786787211895, 0.050225067883729935, -0.007982703857123852, -0.017222806811332703, 0.008142092265188694, -0.015841439366340637, 0.01571747101843357, -0.032302722334861755, -0.039740849286317825, 0.009474757127463818, -0.07353119552135468, -0.001860638614743948, -0.007044083438813686, -0.056033890694379807, -0.002696321113035083, 0.03359553962945938, 0.04650600254535675, -0.04891454055905342, 0.0011931995395570993, -0.025944896042346954, -0.030761968344449997, -0.03354240953922272, -0.05787571147084236, -0.013973052613437176, -0.01388450339436531, -0.008708806708455086, -0.05369619280099869, -0.017470743507146835, -0.04374327138066292, 0.0316474586725235, 0.04402662813663483, -0.05026048794388771, 0.050579264760017395, 0.010811848565936089, -0.028654498979449272, -0.009722694754600525, 0.03818238526582718, -0.021889345720410347, -0.01021857000887394, -0.0007299769204109907, 0.11079267412424088, -0.0017178531270474195, 0.011617645621299744, 0.011449402198195457, 0.001927050412632525, 0.0022779263090342283, -0.05043758451938629, 0.02688351646065712, -0.007424844428896904, -0.011626500636339188, -0.0023111323826014996, -0.03648224100470543, -0.009297658689320087, -0.006317980587482452, -0.06864328682422638, 0.03582697734236717, 0.04268068075180054, 0.023607198148965836, 0.033471573144197464, -0.01681547984480858, 0.062338586896657944, -0.002191591076552868, -0.012742219492793083, 0.03201936557888985, -0.003046090016141534, -0.026104284450411797, -0.04891454055905342, -0.0020665153861045837, 0.010758719407022, -0.02134034037590027, 0.041901446878910065, 0.005768975708633661, -0.010723299346864223, -0.04972919076681137, -0.018931804224848747, 0.061948973685503006, -0.024793757125735283, -0.015239305794239044, 0.05351909622550011, 0.009350787848234177, 0.0998125821352005, -0.010652460157871246, 0.022243540734052658, 0.004161809105426073, 0.011679630726575851, -0.04048466309905052, 0.028707629069685936, -0.041440993547439575, -0.0030992196407169104, -0.010732154361903667, -0.019551647827029228, 0.013370919041335583, -0.006619047373533249, -0.08521968126296997, 0.03242669254541397, 0.05256276577711105, -0.0033914316445589066, 0.050862621515989304, -0.020136073231697083, -0.026777256280183792, -0.02562611922621727, 0.08755738288164139, -0.0372614748775959, 0.06814741343259811, 0.016275329515337944, -0.04827698692679405, 0.02893785573542118, 0.06513673812150955, -0.04551425203680992, -0.03251523897051811, -0.029504571110010147, -0.04902079701423645, -0.02077362686395645, 0.008704379200935364, -0.004666539374738932, 0.009527886286377907, 0.04370785132050514, 0.01147596724331379, 0.0015418616821989417, 0.0021451027132570744, 0.004086542408913374, 0.024935435503721237, -0.023146742954850197, 0.019286001101136208, 0.009519031271338463, -0.0042237937450408936, -0.04487669840455055, -0.013565726578235626, 0.04873744025826454, -0.01155566144734621, 0.01882554590702057, 0.0618072934448719, 0.006348972674459219, 0.010103455744683743, 0.027007484808564186, -0.02564382739365101, -0.003134639235213399, 0.0025103678926825523, 0.002846854506060481, -0.0022613233886659145, 0.02419162169098854, -0.03219646215438843, 0.001340412418358028, 0.041086796671152115, -0.010873833671212196, -0.0030084566678851843, -0.07140602171421051, -0.021375760436058044, -0.036871857941150665, -0.03694269806146622, -0.06184271350502968, -0.0009911968372762203, 0.03421538323163986, 0.044239144772291183, 0.061417676508426666, 0.013875648379325867, 0.020472558215260506, 0.017948908731341362, 0.07728568464517593, 0.004157381597906351, 0.03019525296986103, 0.030124414712190628, 0.05107513815164566, 0.01863073743879795, -0.04884370043873787, -0.0742395892739296, 0.034197673201560974, -0.003267462830990553, -0.057663194835186005, 0.01917974092066288, 0.011121770367026329, 0.054262906312942505, -0.01972874626517296, 0.0002327181864529848, 0.044132888317108154, -0.023784296587109566, -0.03853658214211464, -0.013733970001339912, -0.06272820383310318, 0.010687880218029022, 0.021818505600094795, -0.059469595551490784, -0.011564516462385654, -0.09768740087747574, 0.0011013298062607646, 0.02410307340323925, 0.016470137983560562, -0.06201981008052826, -0.053802452981472015, -0.01999439299106598, 0.04452250152826309, 0.013078706339001656, 0.014938238076865673, 0.021021563559770584, -0.07338952273130417, -0.027397101745009422, 0.01536327414214611, 0.005259818397462368, 0.030584869906306267, 0.041440993547439575, 0.03325905278325081, -0.019870424643158913, -0.03779276832938194, 0.031505782157182693, -0.01639929972589016, -0.03843032196164131, -0.011697339825332165, -0.026121994480490685, -0.007508966140449047, -0.0007537744822911918, -0.02132263034582138, 0.01617792621254921, -0.046187225729227066, -0.05231482535600662, -0.005645006895065308, 0.03487064689397812, -0.014380378648638725, 0.03533110395073891, 0.030691128224134445, -0.013379774056375027, 0.014052746817469597, 0.047887369990348816, -0.010103455744683743, -0.01712540164589882, -0.030673418194055557, 0.0359332375228405, -0.024581238627433777, 0.03244440257549286, 0.016284184530377388, 0.012804204598069191, 0.043424494564533234, -0.038855358958244324, 0.019427679479122162, 0.05688396096229553, -0.024439560249447823, -0.009067431092262268, 0.007898582145571709, 0.0055741677060723305, -0.00524210836738348, -0.050685521215200424, -0.04930415749549866, -0.08791157603263855, 0.03010670468211174, -0.04462876170873642, -0.03595094755291939, -0.04353075101971626, 0.02160598710179329, -0.04778110980987549, 0.03828864544630051, -0.0013891145354136825, 0.018577607348561287, -0.032568369060754776, 0.027839846909046173, 0.034463319927453995, -0.05762777477502823, -0.025856345891952515, 0.020277751609683037, 0.017222806811332703, -0.06184271350502968, 0.024616658687591553, -0.031505782157182693, -0.03182455897331238, -0.020189201459288597, -0.00524210836738348, 0.010926962830126286, -0.009164835326373577, 0.023961395025253296, 0.10441713780164719, -0.0007786789210513234, 0.07593973726034164, -0.008128809742629528, -0.004148526582866907, -0.015699760988354683, 0.01492052897810936, -0.06007172912359238, -0.01935683935880661, 0.08359038084745407, -0.10030845552682877, 0.03322363272309303, 0.005463481415063143, 0.04236190393567085, -0.035809267312288284, -0.0028402134776115417, 0.08649478852748871, -0.00313685298897326, 0.03782818838953972, 0.047001879662275314, 0.022367510944604874, -0.012556266970932484, 0.010147730819880962, -0.02328842133283615, -0.0005221631727181375, 0.03276317939162254, -0.002855709521099925, -0.02500627376139164, -0.015974262729287148, 0.018577607348561287, 0.01706341840326786, -0.01617792621254921, 0.0045027234591543674, 0.05723815783858299, -0.06361369788646698, 0.006459658965468407, -0.057769451290369034, -0.07416874915361404, 0.006136454641819, 0.006503933575004339, 0.0018506768392398953, -0.08344870060682297, -0.04041382297873497, 0.05277528241276741, 0.035703010857105255, 0.03331218287348747, 0.04693103954195976, 0.022650867700576782, 0.025874055922031403, 0.04516005516052246, -0.10314203053712845, -0.012423442676663399, 0.005715846549719572, 0.022916514426469803, 0.033471573144197464, 0.0025258639361709356, 0.012441152706742287, -0.032479822635650635, 0.07586889714002609, 0.022881096228957176, -0.07884414494037628, -0.006893550045788288, -0.023713456466794014, 0.02966395951807499, 0.05341283604502678, -0.02293422445654869, -0.06676604598760605, -0.042503584176301956, 0.022243540734052658, 0.02456352859735489, 0.035083167254924774, -0.017824940383434296, 0.03899703547358513, 0.02860136888921261, 0.010962381958961487, -0.004555852618068457, 0.047320656478405, 0.059823792427778244, 0.01196298748254776, -0.014769994653761387, -0.012343748472630978, -0.0359332375228405, 0.04827698692679405, 0.0019713251385837793, 0.0030992196407169104, 0.037863608449697495, 0.06963503360748291, -0.0063799647614359856, -0.005268673412501812, 0.01559350173920393, 0.009262238629162312, 0.03949291259050369, 0.019427679479122162, -0.013255804777145386, -0.047462332993745804, -0.05734441801905632, -0.012751074507832527, 0.004456235095858574, -0.042255643755197525, -0.043318234384059906, 0.041795190423727036, -0.04345991462469101, 0.023855136707425117, 0.01262710615992546, 0.012078101746737957, -0.0018805621657520533, 0.016647236421704292, 0.02660015970468521, -0.003586239879950881, -0.019498517736792564, 0.011971842497587204, -0.01367198582738638, -0.006725306622684002, 0.00853170920163393, 0.03796986863017082, 0.062409427016973495, -0.02860136888921261, 0.023890554904937744, 0.000726102851331234, 0.0074956840835511684, -0.06991839408874512, 0.06471170485019684, 0.04275152087211609, 0.02328842133283615, 0.006229431368410587, 0.0032342569902539253, -0.011174900457262993, -0.020649656653404236, 0.06974129378795624, 0.045372575521469116, -0.017577001824975014, -0.002223690040409565, -0.02346551977097988, 0.012148940935730934, 0.053802452981472015, 0.08203191310167313, -0.009483612142503262, -0.03917413577437401, 0.035897817462682724, -0.028264882043004036, -0.031859979033470154, 0.02743251994252205, -0.04094511643052101, -0.030673418194055557, 0.022084152325987816, -0.038040705025196075, 0.025413600727915764, 0.03354240953922272, -0.016939448192715645, 0.04625806584954262, -0.01728479005396366, -0.0190734826028347, -0.0020355230662971735, 0.003723490983247757, -0.047993630170822144, 0.09329536557197571, 0.006871412508189678, -0.05691938102245331, 0.023075902834534645, 0.029362890869379044, -0.03740315139293671, 0.021393470466136932, 0.01979958638548851, 0.008004841394722462, 0.014212135225534439, -0.05624640733003616, -0.01017429493367672, -0.03775734826922417, -0.057379838079214096, 0.027645038440823555, 0.01675349473953247, -0.1015835627913475, 0.06177187338471413, -0.04551425203680992, 0.016939448192715645, -0.012795349583029747, -0.014867398887872696, -0.0006707596476189792, 0.03478209674358368, -0.03662392124533653, 0.03288714587688446, -0.027804426848888397, 0.022721707820892334, -0.007539958693087101, 0.006977671291679144, -0.05256276577711105, -0.05263360217213631, 0.0003755036450456828, 0.0010648033348843455, -0.04218480736017227, -0.03279859945178032, -0.002094186842441559, 0.012078101746737957, -0.026476189494132996, -0.061063479632139206, -0.03138181194663048, -0.01152024231851101, -0.038855358958244324, -0.028867017477750778, -0.05284612253308296, 0.039670009166002274, -0.03363095968961716, -0.02939831092953682, 0.0022779263090342283, -0.004378754645586014, 0.004927759058773518, 0.009120560251176357, -0.021570568904280663, -0.06800573319196701, -0.06602223217487335, 0.02222583256661892, 0.07165395468473434, 0.017515018582344055, -0.019392259418964386, 0.04604554921388626, 0.047710273414850235, 0.05553801357746124, -0.003927154000848532, 0.0190734826028347, -0.0042260074988007545, -0.049233317375183105, -0.033843476325273514, -0.0007759117870591581, -0.002997388131916523, 0.02785755693912506, 0.01602739281952381, -0.014008472673594952, 0.0026520465034991503, -0.007619652897119522, 0.001358122332021594, -0.0018639592453837395, 0.032479822635650635, -0.008469724096357822, 0.007141487207263708, 0.015274724923074245, 0.026316801086068153, -0.039917949587106705, 0.05001254752278328, 0.10717986524105072, -0.05624640733003616, -0.0640387311577797, 0.06163019686937332, -0.04622264578938484, -0.023979105055332184, -0.04597470909357071, -0.020472558215260506, 0.014451217837631702, 0.08082764595746994, 0.04020130634307861, -0.058300748467445374, 0.002191591076552868, 0.028902435675263405, -0.01997668482363224, 0.04048466309905052, -0.039563752710819244, 0.047320656478405, -0.05178353190422058, 0.007584232836961746, 0.0008578196866437793, -0.0228456761687994, -0.030531739816069603, -0.012060391716659069, 0.013025577180087566, -0.014858543872833252, -0.04696645960211754, -0.014672591350972652, 0.011077496223151684, 0.035986367613077164, 0.006486224010586739, -0.04034298285841942, -0.04590386897325516, -0.0016602962277829647, -0.03754483163356781, 0.02302277460694313, -0.028689919039607048, 0.0431765578687191, -0.013627711683511734, 0.018311960622668266, 0.003778834128752351, 0.019516227766871452, 0.01567319594323635, 0.005397069733589888, 0.043247394263744354, 0.01546067837625742, 0.04005962610244751, 0.02884930744767189, -0.010369103401899338, 0.04498295858502388, -0.010289409197866917, -0.04767485335469246, -0.042609840631484985, 0.0317891389131546, 0.022154992446303368, 0.033383022993803024, 0.0300181545317173, -0.039032455533742905, 0.060603026300668716, -0.02169453725218773, 0.00887262262403965, -0.008336900733411312, -0.008212931454181671, -0.032479822635650635, -0.06198439002037048, -0.023731166496872902, 0.028530530631542206, 0.05429832637310028, -0.032851725816726685, -0.0359332375228405, 0.04168893024325371, 0.05302321910858154, -0.0025015128776431084, 0.008018123917281628, 0.026210542768239975, 0.0244749803096056, -0.007522248663008213, 0.009731549769639969, -0.020454850047826767, -0.011918713338673115, 0.002094186842441559, -0.01183016411960125, -0.04473502188920975, -0.011777034029364586, -0.04625806584954262, 0.033383022993803024, 0.05107513815164566, 0.012919317930936813, 0.00235097948461771, -0.01807287707924843, -0.014769994653761387, -0.046187225729227066, -0.006796145811676979, 0.00850957166403532, 0.04827698692679405, 0.00396257359534502, 0.046541422605514526, 0.07749819755554199, -0.061523936688899994, 0.06371995806694031, 0.008235068991780281, -0.03334760293364525, 0.05932791903614998, 0.03232043236494064, 0.03595094755291939, 0.0674390196800232, -0.003929367754608393, 0.03217875584959984, 0.04204312711954117, -0.07310616225004196, -0.03125784173607826, 0.08507800847291946, 0.029593119397759438, 0.015522662550210953, -0.020224621519446373, -0.037580251693725586, 0.009271093644201756, 0.04119305685162544, 0.0499771311879158, 0.022349800914525986, 0.0020377368200570345, 0.036074914038181305, 0.0341622531414032 ]
42,903
linearmodels.system.model
fit
Estimate model parameters Parameters ---------- method : {None, "gls", "ols"} Estimation method. Default auto selects based on regressors, using OLS only if all regressors are identical. The other two arguments force the use of GLS or OLS. full_cov : bool Flag indicating whether to utilize information in correlations when estimating the model with GLS iterate : bool Flag indicating to iterate GLS until convergence of iter limit iterations have been completed iter_limit : int Maximum number of iterations for iterative GLS tol : float Tolerance to use when checking for convergence in iterative GLS cov_type : str Name of covariance estimator. Valid options are * "unadjusted", "homoskedastic" - Classic covariance estimator * "robust", "heteroskedastic" - Heteroskedasticity robust covariance estimator * "kernel" - Allows for heteroskedasticity and autocorrelation * "clustered" - Allows for 1 and 2-way clustering of errors (Rogers). **cov_config Additional parameters to pass to covariance estimator. All estimators support debiased which employs a small-sample adjustment Returns ------- results : SystemResults Estimation results See Also -------- linearmodels.system.covariance.HomoskedasticCovariance linearmodels.system.covariance.HeteroskedasticCovariance linearmodels.system.covariance.KernelCovariance linearmodels.system.covariance.ClusteredCovariance
def fit( self, *, method: Literal["ols", "gls", None] = None, full_cov: bool = True, iterate: bool = False, iter_limit: int = 100, tol: float = 1e-6, cov_type: str = "robust", **cov_config: bool, ) -> SystemResults: """ Estimate model parameters Parameters ---------- method : {None, "gls", "ols"} Estimation method. Default auto selects based on regressors, using OLS only if all regressors are identical. The other two arguments force the use of GLS or OLS. full_cov : bool Flag indicating whether to utilize information in correlations when estimating the model with GLS iterate : bool Flag indicating to iterate GLS until convergence of iter limit iterations have been completed iter_limit : int Maximum number of iterations for iterative GLS tol : float Tolerance to use when checking for convergence in iterative GLS cov_type : str Name of covariance estimator. Valid options are * "unadjusted", "homoskedastic" - Classic covariance estimator * "robust", "heteroskedastic" - Heteroskedasticity robust covariance estimator * "kernel" - Allows for heteroskedasticity and autocorrelation * "clustered" - Allows for 1 and 2-way clustering of errors (Rogers). **cov_config Additional parameters to pass to covariance estimator. All estimators support debiased which employs a small-sample adjustment Returns ------- results : SystemResults Estimation results See Also -------- linearmodels.system.covariance.HomoskedasticCovariance linearmodels.system.covariance.HeteroskedasticCovariance linearmodels.system.covariance.KernelCovariance linearmodels.system.covariance.ClusteredCovariance """ if method is None: method = ( "ols" if (self._common_exog and self._constraints is None) else "gls" ) else: if method.lower() not in ("ols", "gls"): raise ValueError( f"method must be 'ols' or 'gls' when not None. Got {method}." ) method = cast(Literal["ols", "gls"], method.lower()) cov_type = cov_type.lower() if cov_type not in COV_TYPES: raise ValueError(f"Unknown cov_type: {cov_type}") cov_type = COV_TYPES[cov_type] k = len(self._dependent) col_sizes = [0] + [v.shape[1] for v in self._x] col_idx = [int(i) for i in np.cumsum(col_sizes)] total_cols = col_idx[-1] self._construct_xhat() beta, eps = self._multivariate_ls_fit() nobs = eps.shape[0] debiased = cov_config.get("debiased", False) full_sigma = sigma = (eps.T @ eps / nobs) * self._sigma_scale(debiased) if method == "ols": return self._multivariate_ls_finalize( beta, eps, sigma, cov_type, **cov_config ) beta_hist = [beta] nobs = eps.shape[0] iter_count = 0 delta = np.inf while ( (iter_count < iter_limit and iterate) or iter_count == 0 ) and delta >= tol: beta, eps, sigma, est_sigma = self._gls_estimate( eps, nobs, total_cols, col_idx, full_cov, debiased ) beta_hist.append(beta) diff = beta_hist[-1] - beta_hist[-2] delta = float(np.sqrt(np.mean(diff**2))) iter_count += 1 sigma_m12 = inv_matrix_sqrt(sigma) wy = blocked_column_product(self._wy, sigma_m12) wx = blocked_diag_product(self._wx, sigma_m12) gls_eps = wy - wx @ beta y = blocked_column_product(self._y, np.eye(k)) x = blocked_diag_product(self._x, np.eye(k)) eps = y - x @ beta return self._gls_finalize( beta, sigma, full_sigma, est_sigma, gls_eps, eps, full_cov, cov_type, iter_count, **cov_config, )
(self, *, method: Optional[Literal['ols', 'gls', None]] = None, full_cov: bool = True, iterate: bool = False, iter_limit: int = 100, tol: float = 1e-06, cov_type: str = 'robust', **cov_config: bool) -> linearmodels.system.results.SystemResults
[ 0.03504936397075653, -0.04867153614759445, 0.0011861856328323483, -0.009149453602731228, 0.010656053200364113, -0.01768162101507187, -0.04867153614759445, -0.10897736996412277, 0.03500751405954361, 0.003648795885965228, -0.05607898533344269, -0.0572926327586174, 0.003606945974752307, -0.005754373501986265, -0.06536968052387238, 0.07390707731246948, -0.0338984914124012, -0.016719071194529533, 0.005275714211165905, -0.017650233581662178, -0.020203081890940666, 0.03691168874502182, -0.029462391510605812, 0.027390817180275917, 0.042414963245391846, -0.004253005143254995, 0.04377508908510208, 0.00978766568005085, 0.036367639899253845, -0.014940446242690086, -0.04561648890376091, 0.015683284029364586, -0.010870534926652908, -0.025507567450404167, -0.0031047461088746786, -0.06407233327627182, 0.05017813667654991, -0.023854494094848633, -0.03741389140486717, 0.0012286895653232932, -0.01372679602354765, -0.016687683761119843, 0.03724648803472519, 0.0011770309647545218, -0.001235882518813014, -0.02826966717839241, -0.018173357471823692, 0.12889796495437622, -0.012983959168195724, -0.020119382068514824, -0.024419467896223068, -0.05423758551478386, 0.020443718880414963, -0.06536968052387238, 0.002118655713275075, 0.008014272898435593, 0.01921960711479187, 0.017064332962036133, 0.08595987409353256, -0.02335229329764843, 0.04775083810091019, -0.02605161815881729, -0.06926172971725464, 0.0072348169051110744, -0.010996084660291672, -0.0602639839053154, -0.02866724133491516, -0.002249436918646097, 0.050722185522317886, 0.04950853809714317, -0.01018000952899456, 0.008929741568863392, 0.012963034212589264, 0.028332442045211792, 0.010211396962404251, 0.0024469164200127125, -0.031450267881155014, -0.06821548193693161, -0.03555156663060188, -0.060849882662296295, 0.006669841706752777, 0.037895165383815765, -0.011613371782004833, -0.03582359105348587, -0.0564974844455719, -0.008673409931361675, -0.004653195384889841, -0.02448224276304245, 0.08097972720861435, 0.0361793152987957, -0.05021998658776283, 0.033710166811943054, 0.02751636691391468, 0.017922258004546165, 0.009180841036140919, -0.00943194143474102, 0.004590420518070459, -0.008574016392230988, 0.0035310927778482437, -0.035656191408634186, -0.01394650898873806, 0.012575921602547169, 0.030048292130231857, 0.08847087621688843, -0.0034473927225917578, -0.008961129002273083, -0.0156100457534194, -0.009677809663116932, 0.06156133487820625, -0.017597919330000877, -0.04507243633270264, 0.04775083810091019, 0.028185967355966568, -0.012827021069824696, -0.062021683901548386, 0.0005917850066907704, -0.0586736835539341, 0.011874934658408165, -0.07520443201065063, 0.00014598453708458692, -0.022494368255138397, -0.005207708105444908, -0.015191545709967613, 0.008422310464084148, 0.03473548963665962, -0.007961960509419441, 0.01732589490711689, 0.017629306763410568, 0.026616591960191727, -0.044988736510276794, 0.012586384080350399, -0.009196534752845764, 0.007182504516094923, -0.0036331021692603827, 0.032203566282987595, -0.04452838748693466, -0.06457453221082687, -0.03680706396698952, -0.02793486788868904, -0.0035258615389466286, 0.0648256316781044, 0.06608112901449203, -0.028039492666721344, -0.017127107828855515, 0.02829059213399887, 0.041661664843559265, 0.03609561547636986, -0.06524413079023361, -0.04490503668785095, 0.0057282173074781895, -0.0345890149474144, -0.021678294986486435, 0.017127107828855515, -0.05507458373904228, -0.05356798693537712, -0.014145296066999435, -0.020830832421779633, -0.01841399446129799, -0.01001784112304449, -0.023603392764925957, -0.07645992934703827, 0.0013280832208693027, -0.029127592220902443, 0.01996244490146637, -0.005832842085510492, 0.0018584011122584343, -0.09173517674207687, -0.025130918249487877, -0.03682798892259598, 0.0004901026259176433, -0.0068947854451835155, -0.017859483137726784, 0.007977654226124287, -0.0275582168251276, -0.01701202057301998, 0.052605435252189636, 0.018560469150543213, 0.007109266705811024, 0.002227204153314233, -0.00206634309142828, 0.025486642494797707, -0.04293808713555336, -0.015651896595954895, -0.06850843131542206, -0.05001073703169823, 0.03745574131608009, -0.012847946025431156, -0.04002951458096504, -0.04285438731312752, -0.008778034709393978, -0.0301319919526577, -0.006476285867393017, 0.06327718496322632, 0.019700882956385612, -0.029483316466212273, 0.0031099773477762938, 0.035279542207717896, 0.0475834384560585, 0.015672821551561356, 0.026470117270946503, 0.004362861160188913, 0.0580877847969532, 0.01147735957056284, -0.046160537749528885, -0.05800408497452736, 0.022117719054222107, -0.0214062687009573, -0.05176843702793121, 0.007810254115611315, 0.01073452178388834, 0.015453108586370945, 0.021322568878531456, -0.008270603604614735, 0.022138644009828568, 0.026114393025636673, 0.009871366433799267, 0.05959438532590866, -0.016719071194529533, 0.008029966615140438, -0.014176683500409126, 0.05925958231091499, -0.10688487440347672, -0.026846768334507942, -0.011728459037840366, -0.025089068338274956, 0.0018283213721588254, 0.04339843988418579, -0.009939372539520264, 0.0071981982327997684, -0.04419358819723129, 0.014616108499467373, -0.019721807911992073, 0.06842473149299622, -0.010316021740436554, -0.09868226945400238, -0.016018083319067955, -0.015902996063232422, 0.08989377319812775, -0.022096794098615646, 0.00697325449436903, -0.01654120720922947, -0.03197339177131653, -0.05001073703169823, 0.05239618569612503, -0.011686609126627445, 0.026972318068146706, 0.0353841669857502, 0.07026612758636475, -0.008260141126811504, 0.00863679125905037, -0.022117719054222107, -0.010996084660291672, -0.009379629045724869, 0.0011639527510851622, -0.01691785827279091, -0.08780127763748169, 0.01340245921164751, 0.003792655188590288, 0.06373753398656845, -0.013078121468424797, -0.0240846686065197, 0.025507567450404167, -0.0354887917637825, 0.06850843131542206, -0.03833458945155144, 0.020569268614053726, -0.007046491838991642, 0.0015772214392200112, 0.04477948695421219, 0.07666917890310287, -0.04909003525972366, 0.0572926327586174, -0.04262421280145645, 0.00670646084472537, 0.036723364144563675, 0.09181887656450272, -0.040489863604307175, -0.0444028377532959, 0.03965286538004875, 0.01812104508280754, 0.0654115304350853, -0.014584721066057682, 0.007051723077893257, 0.014971833676099777, -0.05846443399786949, 0.010232321918010712, -0.0618542842566967, -0.04448653757572174, 0.019795045256614685, -0.0055922046303749084, 0.023519692942500114, -0.01887434534728527, 0.06147763133049011, 0.015432183630764484, 0.0979289710521698, -0.016059933230280876, 0.044319137930870056, -0.016384270042181015, 0.07202383130788803, -0.03350091725587845, 0.029546091333031654, -0.004517183173447847, 0.03611654043197632, -0.04415173828601837, 0.02933684177696705, -0.0872153788805008, 0.026470117270946503, -0.07319562882184982, -0.02226419374346733, 0.02268269471824169, -0.03950639069080353, 0.07512073218822479, 0.024189293384552002, -0.03649318963289261, -0.00025616769562475383, -0.034463465213775635, -0.04097113758325577, -0.05925958231091499, 0.029253141954541206, 0.02944146655499935, -0.011717996560037136, -0.0031596741173416376, 0.05386093631386757, -0.01623779535293579, -0.011257646605372429, 0.017869945615530014, 0.030822517350316048, 0.026491042226552963, -0.03923436254262924, -0.036765214055776596, 0.019282381981611252, -0.020663432776927948, 0.03611654043197632, 0.026177167892456055, -0.037100013345479965, 0.021761994808912277, 0.039820265024900436, 0.002329213311895728, 0.063444584608078, -0.014396396465599537, 0.08169117569923401, 0.01813150756061077, -0.041661664843559265, 0.0012241121148690581, -0.06746218353509903, -0.008014272898435593, 0.05427943542599678, -0.007266204338520765, 0.0067116920836269855, 0.03730926662683487, -0.03871123865246773, 0.02293379418551922, 0.03163859248161316, 0.047374188899993896, -0.003980980254709721, 0.015965770930051804, -0.006622760556638241, -0.018654633313417435, 0.03718371316790581, -0.06817363202571869, -0.035237688571214676, 0.057460036128759384, -0.06256573647260666, 0.02557034231722355, 0.04448653757572174, -0.04023876413702965, 0.01151920948177576, -0.0005953814834356308, 0.043565839529037476, -0.036702439188957214, 0.0007532997988164425, -0.05942698195576668, -0.011623834259808064, 0.025319242849946022, -0.030424941331148148, 0.030299391597509384, -0.005414342042058706, -0.005717754829674959, 0.011906322091817856, 0.007988116703927517, 0.058171484619379044, -0.041222237050533295, 0.026114393025636673, -0.013046734035015106, 0.045783888548612595, -0.023184893652796745, 0.016467969864606857, -0.020067069679498672, 0.045407239347696304, -0.025109993293881416, 0.04258236289024353, -0.040468938648700714, 0.02109239436686039, 0.01589253358542919, -0.009395322762429714, 0.0031832146923989058, 0.07708767801523209, 0.0001978065847652033, -0.04065726324915886, 0.007030798122286797, -0.013423384167253971, -0.003518014680594206, 0.005398648325353861, 0.016447044909000397, -0.04214293882250786, -0.0856250748038292, 0.02674214355647564, -0.014668420888483524, -0.043858788907527924, 0.07160533219575882, 0.00025126340915448964, 0.046871986240148544, -0.04787638783454895, -0.005995010957121849, -0.026511967182159424, 0.04264513775706291, -0.021657368168234825, 0.03477733954787254, 0.06742033362388611, 0.03998766466975212, 0.060849882662296295, -0.033772941678762436, 0.04507243633270264, 0.06553708016872406, 0.02105054445564747, 0.03881586343050003, -0.06846658140420914, -0.05737633258104324, -0.05499088391661644, -0.025361092761158943, 0.014637033455073833, -0.01509738340973854, -0.03605376556515694, 0.001339199603535235, -0.04220571368932724, -0.024189293384552002, -0.06909433007240295, 0.018633706495165825, -0.032956864684820175, 0.009719659574329853, 0.026553817093372345, -0.011655221693217754, -0.019104519858956337, 0.022431593388319016, -0.06189613416790962, 0.0041666897013783455, 0.01771300844848156, -0.035572491586208344, -0.09215367585420609, -0.015421721152961254, 0.0511406846344471, 0.037916090339422226, 0.04069911316037178, 0.003308764658868313, -0.019303306937217712, -0.03324981406331062, 0.028918342664837837, -0.014867208898067474, -0.017566531896591187, 0.0056288233026862144, 0.0001827667438192293, 0.013852345757186413, 0.0042582363821566105, 0.020851757377386093, -0.025151843205094337, -0.03643041476607323, 0.0229965690523386, 0.05779483541846275, -0.011581984348595142, -0.03396126627922058, -0.02939961664378643, 0.004362861160188913, 0.0029844273813068867, -0.0156100457534194, -0.036325789988040924, 0.032998714596033096, -0.04511428624391556, 0.03507028892636299, -0.01205279678106308, -0.04040616378188133, 0.011362272314727306, -0.03324981406331062, 0.02716064266860485, 0.0162064079195261, 0.05168473720550537, -0.005487579852342606, 0.024963518604636192, 0.008354304358363152, -0.00868910364806652, 0.007140654139220715, -0.05243803560733795, 0.02969256602227688, 0.02228511869907379, 0.06361198425292969, -0.008160747587680817, 0.01890573278069496, 0.015296170487999916, -0.03316611424088478, 0.049927037209272385, -0.023833569139242172, 0.05766928568482399, -0.010221859440207481, -0.021657368168234825, 0.0006509635131806135, 0.006957560777664185, -0.032182641327381134, 0.002003568224608898, 0.00754869170486927, -0.02632364258170128, -0.016039008274674416, -0.02678399346768856, -0.02973441779613495, 0.04971778765320778, 0.011132096871733665, -0.0011430277954787016, -0.017514219507575035, -0.01394650898873806, 0.017210807651281357, 0.012534071691334248, 0.02490074373781681, -0.0001098562206607312, -0.0034944741055369377, 0.02492166869342327, -0.017650233581662178, 0.027014167979359627, 0.031031766906380653, -0.021699219942092896, -0.028730018064379692, 0.02523554302752018, 0.03624209016561508, 0.009463328868150711, -0.010216628201305866, -0.019418394193053246, 0.05348428711295128, 0.03088529221713543, -0.028478916734457016, 0.0005038346280343831, -0.06532783061265945, 0.0044857957400381565, -0.03797886520624161, -0.02257806807756424, 0.01317228376865387, 0.03799979016184807, 0.0618542842566967, -0.01650981977581978, -0.02444039285182953, 0.03437976539134979, -0.027411742135882378, -0.016091320663690567, -0.010880997404456139, 0.0064292047172784805, 0.003996673971414566, -0.02709786780178547, 0.020485568791627884, -0.023477843031287193, -0.03965286538004875, -0.03207801654934883, 0.021029619500041008, 0.010656053200364113, 0.00906052254140377, -0.0436076894402504, 0.037895165383815765, 0.04038523882627487, -0.02444039285182953, 0.01372679602354765, 0.05725078284740448, 0.05758558586239815, 0.014145296066999435, -0.010295096784830093, -0.020255394279956818, 0.03758129104971886, 0.006193798501044512, -0.08340702950954437, -0.0107554467394948, 0.0035494021140038967, 0.051015134900808334, 0.015986695885658264, -0.004069911316037178, -0.08905677497386932, 0.023205818608403206, 0.025109993293881416, -0.0497596375644207, -0.014469633810222149, -0.05323318392038345, 0.022661767899990082, 0.05725078284740448, -0.0596780851483345, 0.01204233430325985, 0.0014438246143981814, 0.04628608748316765, -0.0290438923984766, 0.044988736510276794, -0.02182476967573166, -0.08210967481136322, -0.012774708680808544, 0.07206568121910095, -0.0109019223600626, -0.03092714212834835, -0.02148996852338314, 0.007485916838049889, -0.038941413164138794, 0.03128286823630333, 0.026114393025636673, 0.029608866199851036, -0.0383555144071579, 0.010394491255283356, -0.02682584337890148, 0.031450267881155014, 0.039820265024900436, 0.006764004472643137, -0.0184872318059206, -0.028437066823244095, 0.017399132251739502, 0.000017614594980841503, 0.0027934866957366467, 0.016290107741951942, -0.008406616747379303, 0.01429177075624466, 0.11500377207994461, -0.02529831789433956, 0.020234469324350357, -0.0019067900720983744, -0.01656213216483593, 0.01736774481832981, -0.03613746538758278, 0.02860446646809578, -0.014731195755302906, -0.07629252970218658, -0.005623592063784599, -0.03312426432967186, -0.03812533989548683, -0.0016596135683357716, 0.03730926662683487, 0.01614363305270672, 0.06390493363142014, -0.02594699338078499, 0.04030153900384903, 0.011027472093701363, 0.011717996560037136, 0.008202597498893738, -0.013653558678925037, 0.01076590921729803, 0.053693536669015884, 0.03576081618666649, -0.03950639069080353, 0.05959438532590866, -0.00011018317309208214, 0.03695353865623474, 0.11207427084445953, 0.0035153990611433983, 0.0011299496982246637, 0.035635266453027725, -0.06177058443427086, -0.0162064079195261, 0.00883557926863432, -0.03956916555762291, 0.007700398098677397, 0.014459171332418919, 0.0715634822845459, -0.02906481735408306, 0.010404953733086586, -0.003240758553147316, 0.06331903487443924, -0.005858998280018568, -0.023603392764925957, -0.007062185555696487, 0.011676146648824215, -0.01662490703165531, 0.02366616763174534, 0.024775194004178047, -0.005696829874068499, -0.0333125926554203, -0.034798264503479004, 0.02565404213964939, -0.035656191408634186, -0.009688272140920162, -0.034526240080595016, -0.03739296644926071, -0.02074713259935379, 0.040092289447784424, 0.04193368926644325, 0.04377508908510208, -0.035949140787124634, 0.006340273190289736, 0.02678399346768856, -0.005158010870218277, 0.02452409267425537, 0.0007755326223559678, -0.013622171245515347, -0.03130379319190979, -0.027788393199443817, 0.022766394540667534, 0.024607792496681213, -0.008788497187197208, 0.03174321725964546, 0.003277377225458622, -0.03571896627545357, -0.07704582810401917, 0.033417217433452606, -0.02333136834204197, 0.04716493561863899, -0.00906052254140377, -0.018633706495165825, 0.0909818783402443, 0.003884202102199197, 0.038209039717912674, 0.009955066256225109, -0.004880754742771387, -0.001770777627825737, -0.04636978730559349, 0.030299391597509384, 0.00443871458992362, 0.032559290528297424, -0.026093468070030212, 0.032203566282987595, -0.0025306164752691984, -0.00036030224873684347, -0.03362646698951721, -0.013099046424031258, 0.031136391684412956, 0.06327718496322632, -0.019355619326233864, 0.03268484026193619, -0.03659781441092491, 0.042017389088869095, 0.001014862209558487, 0.04662088677287102, 0.04695568606257439, 0.049131885170936584, -0.006094404496252537, 0.04398433864116669, 0.0064292047172784805, -0.013611708767712116, 0.042331263422966, 0.015725133940577507, -0.03421236574649811, -0.05247988551855087, 0.048838935792446136, -0.007501610554754734, 0.012785171158611774, -0.024000968784093857, 0.039778415113687515, -0.04224756360054016, -0.05206138640642166, -0.05377723649144173, 0.050638485699892044, -0.009180841036140919, 0.003732495941221714, 0.02452409267425537, -0.04670458659529686, 0.01840353198349476, -0.04180813953280449, 0.03906696289777756, 0.04833673685789108, 0.02255714312195778, 0.0014869824517518282, -0.014249920845031738, -0.02977626770734787, 0.01316182129085064, -0.03094806708395481, -0.008992516435682774, -0.03237096592783928, 0.04775083810091019, 0.05549308657646179, -0.021270256489515305, 0.023226743564009666, 0.01338153425604105, 0.017200345173478127 ]
42,904
linearmodels.system.model
predict
Predict values for additional data Parameters ---------- params : array_like Model parameters (nvar by 1) equations : dict Dictionary-like structure containing exogenous and endogenous variables. Each key is an equations label and must match the labels used to fir the model. Each value must be a dictionary with keys "exog" and "endog". If predictions are not required for one of more of the model equations, these keys can be omitted. data : DataFrame Values to use when making predictions from a model constructed from a formula eval_env : int Depth to use when evaluating formulas. Returns ------- predictions : DataFrame Fitted values from supplied data and parameters Notes ----- If `data` is not none, then `equations` must be none. Predictions from models constructed using formulas can be computed using either `equations`, which will treat these are arrays of values corresponding to the formula-process data, or using `data` which will be processed using the formula used to construct the values corresponding to the original model specification. When using `exog` and `endog`, the regressor array for a particular equation is assembled as `[equations[eqn]["exog"], equations[eqn]["endog"]]` where `eqn` is an equation label. These must correspond to the columns in the estimated model.
def predict( self, params: ArrayLike, *, equations: Mapping[str, Mapping[str, ArrayLike]] | None = None, data: DataFrame | None = None, eval_env: int = 1, ) -> DataFrame: """ Predict values for additional data Parameters ---------- params : array_like Model parameters (nvar by 1) equations : dict Dictionary-like structure containing exogenous and endogenous variables. Each key is an equations label and must match the labels used to fir the model. Each value must be a dictionary with keys "exog" and "endog". If predictions are not required for one of more of the model equations, these keys can be omitted. data : DataFrame Values to use when making predictions from a model constructed from a formula eval_env : int Depth to use when evaluating formulas. Returns ------- predictions : DataFrame Fitted values from supplied data and parameters Notes ----- If `data` is not none, then `equations` must be none. Predictions from models constructed using formulas can be computed using either `equations`, which will treat these are arrays of values corresponding to the formula-process data, or using `data` which will be processed using the formula used to construct the values corresponding to the original model specification. When using `exog` and `endog`, the regressor array for a particular equation is assembled as `[equations[eqn]["exog"], equations[eqn]["endog"]]` where `eqn` is an equation label. These must correspond to the columns in the estimated model. """ if data is not None: assert self.formula is not None parser = SystemFormulaParser( self.formula, data=data, context=capture_context(eval_env) ) equations_d = parser.data else: if equations is None: raise ValueError("One of equations or data must be provided.") assert equations is not None equations_d = {k: dict(v) for k, v in equations.items()} params = np.atleast_2d(np.asarray(params)) if params.shape[0] == 1: params = params.T nx = int(sum(_x.shape[1] for _x in self._x)) if params.shape[0] != nx: raise ValueError( f"Parameters must have {nx} elements; found {params.shape[0]}." ) loc = 0 out = dict() for i, label in enumerate(self._eq_labels): kx = self._x[i].shape[1] if label in equations_d: b = params[loc : loc + kx] eqn = equations_d[label] exog = eqn.get("exog", None) endog = eqn.get("endog", None) if exog is None and endog is None: loc += kx continue if exog is not None: exog_endog = IVData(exog).pandas if endog is not None: endog_ivd = IVData(endog) exog_endog = concat([exog_endog, endog_ivd.pandas], axis=1) else: exog_endog = IVData(endog).pandas fitted = np.asarray(exog_endog) @ b fitted_df = DataFrame(fitted, index=exog_endog.index, columns=[label]) out[label] = fitted_df loc += kx out_df = reduce( lambda left, right: left.merge( right, how="outer", left_index=True, right_index=True ), [out[key] for key in out], ) return out_df
(self, params: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, equations: Optional[collections.abc.Mapping[str, collections.abc.Mapping[str, Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series]]]] = None, data: Optional[pandas.core.frame.DataFrame] = None, eval_env: int = 1) -> pandas.core.frame.DataFrame
[ 0.0840308889746666, -0.0721551775932312, 0.005213539116084576, -0.016892174258828163, -0.04484104365110397, -0.015530562959611416, -0.05675770714879036, -0.10737280547618866, 0.013595640659332275, 0.02536897361278534, 0.033518169075250626, -0.02643369324505329, -0.026904625818133354, 0.034480512142181396, -0.009490330703556538, -0.0012227630941197276, 0.011455965228378773, -0.025491826236248016, 0.011906423605978489, -0.03640519455075264, -0.010534574277698994, -0.05442351475358009, -0.03343626856803894, 0.03822750225663185, 0.03781799599528313, -0.022092916071414948, 0.0008074971265159547, -0.021888162940740585, 0.03245345130562782, 0.01737334579229355, -0.03349769487977028, -0.06580781936645508, -0.033681970089673996, -0.01184499729424715, 0.027703166007995605, -0.05143411085009575, 0.008154313080012798, -0.003288855077698827, 0.017168590798974037, 0.006925791501998901, 0.010913368314504623, -0.058068130165338516, 0.03892366588115692, -0.021621983498334885, -0.059747107326984406, -0.008021223358809948, -0.052580732852220535, -0.01796713098883629, 0.04836280643939972, -0.025491826236248016, -0.005379901733249426, -0.05741291865706444, 0.026740822941064835, -0.010196730494499207, -0.03118397668004036, 0.0379817970097065, 0.0008753217407502234, 0.04168783873319626, 0.04746188968420029, -0.08321187645196915, 0.029709750786423683, -0.020700592547655106, -0.018970424309372902, 0.02358761802315712, -0.009055228903889656, 0.05552918463945389, -0.01639052852988243, -0.02698652818799019, -0.018745195120573044, -0.0382479764521122, -0.027047954499721527, -0.03140920773148537, -0.009362359531223774, -0.0046427883207798, -0.012315930798649788, 0.04066406935453415, -0.02583990804851055, -0.023997124284505844, -0.028624556958675385, 0.004115547984838486, -0.04123738035559654, -0.016738608479499817, -0.06330981850624084, -0.04185163974761963, -0.021355804055929184, -0.009879362769424915, -0.0010845543583855033, 0.04043884202837944, 0.020004428923130035, -0.028296951204538345, -0.006224510259926319, 0.011824522167444229, 0.023014307022094727, 0.048117101192474365, 0.0845222994685173, -0.025778481736779213, 0.008809524588286877, -0.00294845225289464, 0.01725049316883087, -0.011097646318376064, 0.02817409858107567, 0.057371966540813446, -0.021335327997803688, 0.02081320621073246, -0.028890736401081085, -0.044022031128406525, -0.04179021716117859, 0.006915553938597441, 0.023014307022094727, -0.07563599199056625, -0.09869124740362167, 0.0608527772128582, -0.049509428441524506, -0.039824578911066055, -0.009659252129495144, 0.04344872012734413, -0.05765862017869949, 0.0651935562491417, -0.0640469342470169, 0.013073518872261047, 0.01513129286468029, 0.06380122900009155, -0.06900197267532349, 0.010094353929162025, 0.004783556796610355, -0.020741542801260948, 0.04647907242178917, 0.02913644164800644, -0.0028076840098947287, -0.12514542043209076, 0.01424061506986618, -0.016370052471756935, -0.0002538624976295978, 0.038534633815288544, 0.011189785785973072, 0.03132730349898338, 0.015714840963482857, 0.007094713393598795, -0.028890736401081085, -0.013206608593463898, 0.05507872626185417, 0.0035934261977672577, -0.029013589024543762, 0.00602999422699213, 0.003357959445565939, 0.009756510145962238, 0.06642207503318787, -0.006285936571657658, -0.00585595378652215, 0.006270579993724823, 0.014138237573206425, 0.014957252889871597, -0.0306925680488348, -0.06527545303106308, 0.008763454854488373, -0.03652804717421532, 0.027559837326407433, -0.01639052852988243, 0.014680835418403149, -0.00043542138882912695, -0.03941507264971733, -0.032392024993896484, -0.021621983498334885, -0.00986400619149208, -0.0024250508286058903, 0.027805542573332787, -0.05790432542562485, -0.01681027188897133, 0.03269915282726288, -0.009930551052093506, 0.014465843327343464, -0.012510446831583977, -0.04271160811185837, -0.01863257959485054, -0.0301602091640234, 0.03108160011470318, 0.0290750153362751, -0.011937136761844158, -0.013933484442532063, 0.023137159645557404, 0.034869544208049774, -0.013032568618655205, -0.08136909455060959, -0.03036496229469776, -0.029034065082669258, -0.003529440611600876, -0.017230017110705376, 0.009572232142090797, -0.03388672694563866, 0.02827647514641285, -0.022379571571946144, -0.0570853129029274, 0.0320439413189888, 0.02815362438559532, 0.0011613370152190328, -0.01833568699657917, 0.04852661117911339, 0.041483085602521896, 0.0036471739877015352, 0.02068011648952961, 0.0019464391516521573, -0.01913422718644142, 0.04705238342285156, 0.004629991482943296, -0.09140201658010483, -0.011056696064770222, -0.0117119075730443, -0.0473799891769886, 0.003340043593198061, -0.038370829075574875, -0.01233640592545271, -0.03568855673074722, -0.01521319430321455, 0.01612434908747673, 0.056839607656002045, 0.07952630519866943, 0.021232951432466507, -0.018806621432304382, 0.0039184726774692535, -0.023382864892482758, 0.02999640628695488, -0.061098482459783554, -0.009469855576753616, 0.042629703879356384, 0.03884176164865494, -0.056512001901865005, 0.03828892856836319, 0.04774854704737663, 0.04295730963349342, -0.04093024879693985, 0.007836945354938507, -0.01116931065917015, 0.012326168827712536, -0.1012301966547966, 0.04056169465184212, 0.02444758266210556, -0.04152403399348259, -0.011343350633978844, 0.0234238151460886, 0.03462383896112442, 0.03263772651553154, 0.021069148555397987, -0.011404776945710182, 0.0028691100887954235, 0.009756510145962238, -0.04492294415831566, 0.06875626742839813, 0.047789495438337326, -0.03366149589419365, -0.09435047209262848, 0.04987798258662224, 0.010575524531304836, 0.013380649499595165, 0.04959132894873619, 0.0072585162706673145, 0.0077806380577385426, 0.07952630519866943, 0.043694425374269485, 0.07371130585670471, -0.020823443308472633, -0.008400017395615578, -0.0007204768480733037, -0.03489001840353012, -0.009556875564157963, -0.010647188872098923, 0.00829252228140831, -0.028993112966418266, -0.016666945070028305, 0.01394372247159481, 0.02246147207915783, -0.02283002994954586, 0.08919067680835724, -0.005042057950049639, -0.005973686929792166, 0.03452146053314209, 0.06736394017934799, 0.030979223549365997, -0.07383415848016739, -0.0029228581115603447, 0.0053952583111822605, 0.022911930456757545, -0.051720764487981796, -0.013063281774520874, -0.03267867863178253, 0.018581392243504524, -0.017700951546430588, -0.013288510031998158, 0.0002703387872315943, 0.10843752324581146, -0.03521762415766716, 0.0017532029887661338, 0.04271160811185837, 0.032125845551490784, 0.036589473485946655, -0.019502783194184303, -0.027662215754389763, 0.019574446603655815, 0.015202957205474377, 0.041810691356658936, -0.02659749612212181, 0.005886666942387819, 0.025184696540236473, 0.09271243959665298, 0.003690684214234352, -0.04328491538763046, -0.026884151622653008, 0.06273651123046875, 0.0024212116841226816, 0.010462909936904907, -0.05311309173703194, 0.01645195484161377, 0.06830581277608871, -0.003058507340028882, -0.013913009315729141, -0.03091779723763466, -0.0813281387090683, 0.011885948479175568, 0.013155420310795307, 0.060770876705646515, 0.012019038200378418, 0.025430399924516678, 0.0360775887966156, 0.03746991232037544, -0.06253175437450409, 0.053235944360494614, 0.010544811375439167, 0.06928862631320953, -0.022748127579689026, 0.0576176717877388, -0.010314463637769222, 0.0360775887966156, -0.039988383650779724, 0.049468476325273514, 0.02180626057088375, -0.0014499116223305464, -0.05127030983567238, -0.00189781014341861, 0.0044713071547448635, 0.022359095513820648, 0.05368640273809433, -0.008758336305618286, -0.04533245414495468, -0.02127390168607235, -0.029423097148537636, -0.015141530893743038, -0.03149110823869705, 0.019635872915387154, 0.027150331065058708, -0.025778481736779213, 0.04295730963349342, -0.06171274185180664, 0.051884569227695465, 0.05860048905014992, -0.01235688105225563, -0.004622313193976879, -0.01763952523469925, -0.004110428970307112, 0.027559837326407433, 0.017383582890033722, -0.01988157629966736, 0.008824881166219711, 0.013237321749329567, -0.0543825626373291, 0.009710440412163734, 0.0028051247354596853, -0.05208932235836983, -0.006895078346133232, 0.045045796781778336, 0.05663485452532768, -0.006854127626866102, 0.02190863899886608, -0.0608527772128582, -0.0014000029768794775, 0.04426773265004158, 0.03544285148382187, 0.03085637092590332, -0.03832988068461418, -0.03978363052010536, 0.02358761802315712, -0.027314133942127228, -0.010073878802359104, -0.05573393777012825, 0.006081182509660721, -0.007596359588205814, 0.042670655995607376, -0.0014665478374809027, 0.06175369396805763, 0.010206968523561954, 0.08325282484292984, -0.01982015185058117, -0.005958330351859331, -0.027068428695201874, -0.005886666942387819, 0.02827647514641285, -0.040479790419340134, 0.005466921720653772, 0.001430716016329825, 0.00964901503175497, -0.08484990149736404, -0.002710426226258278, -0.08235190808773041, 0.015643177554011345, 0.04373537376523018, -0.007186852395534515, 0.014220139011740685, -0.02801029570400715, 0.010985031723976135, -0.020854156464338303, -0.006710800342261791, 0.013493264093995094, -0.05294928699731827, 0.017864754423499107, 0.016902411356568336, -0.011988325044512749, -0.054587315768003464, 0.07199137657880783, 0.017700951546430588, 0.0004952478338964283, 0.05937855318188667, -0.008123599924147129, 0.046929530799388885, -0.009331646375358105, -0.005502753891050816, 0.04209734499454498, -0.019840626046061516, 0.07764257490634918, -0.05688055604696274, -0.03423480689525604, -0.024386156350374222, 0.026884151622653008, -0.038698434829711914, -0.07039429992437363, -0.041974492371082306, 0.020393460988998413, -0.008466562256217003, -0.015499849803745747, 0.006040231790393591, 0.006951385643333197, -0.033477216958999634, 0.027007004246115685, -0.011107884347438812, 0.001430716016329825, 0.037347063422203064, -0.002481358125805855, -0.05634819716215134, -0.00497295381501317, 0.024631861597299576, 0.0035678320564329624, -0.06670872867107391, -0.05245788022875786, 0.11613626033067703, 0.018018318340182304, 0.04344872012734413, 0.026474643498659134, -0.003317008726298809, -0.026187989860773087, 0.003206953639164567, -0.05127030983567238, 0.010299107059836388, 0.06175369396805763, -0.01554080005735159, -0.014476081356406212, 0.002876788377761841, 0.010411721654236317, -0.021621983498334885, 0.05020558834075928, 0.017700951546430588, -0.04635621979832649, -0.024898041039705276, -0.00463255075737834, 0.003166002919897437, -0.01116931065917015, 0.0036471739877015352, -0.004146261140704155, -0.05081985145807266, 0.06052517145872116, 0.021069148555397987, -0.007238040678203106, 0.008241333067417145, -0.040786921977996826, -0.019840626046061516, -0.024242829531431198, -0.018427826464176178, 0.028726933524012566, 0.01456822082400322, -0.0037649073638021946, 0.02622894011437893, -0.002028340706601739, -0.0055334665812551975, -0.0021422349382191896, -0.019318504258990288, 0.036261867731809616, 0.05372735112905502, 0.06638112664222717, -0.0022830029483884573, 0.015530562959611416, 0.03583188354969025, 0.00004091073424206115, 0.030651617795228958, -0.08247476071119308, 0.020526550710201263, -0.034767165780067444, -0.014046099036931992, -0.023976650089025497, 0.0044815451838076115, -0.02579895779490471, -0.024529485031962395, 0.054628267884254456, -0.03059019148349762, 0.011937136761844158, -0.06048422306776047, -0.06224510446190834, 0.01731191948056221, 0.016861461102962494, 0.004115547984838486, 0.038104649633169174, 0.02725270763039589, 0.0017314478754997253, -0.030119258910417557, 0.0277236420661211, 0.04250685125589371, 0.01720954291522503, 0.022604800760746002, -0.04093024879693985, 0.026638446375727654, 0.0624498575925827, 0.0234238151460886, -0.01222379133105278, 0.012479733675718307, 0.012408070266246796, -0.045537207275629044, -0.07334274798631668, 0.017946654930710793, 0.05933760106563568, -0.01152762956917286, -0.001627791323699057, 0.06449739634990692, -0.03353864327073097, 0.00804169848561287, 0.00006238587229745463, -0.012858527712523937, 0.0011626166524365544, -0.002451924607157707, -0.041769739240407944, 0.05073794722557068, -0.03978363052010536, 0.016011733561754227, 0.03914889320731163, 0.016963837668299675, 0.00020091449550818652, -0.037408486008644104, -0.0020961652044206858, 0.09271243959665298, 0.056184396147727966, 0.00853822659701109, 0.0018095101695507765, 0.030631141737103462, 0.047953300178050995, -0.03519714996218681, -0.013626353815197945, -0.004619753919541836, -0.017004787921905518, 0.07551313936710358, -0.0406435951590538, 0.02190863899886608, 0.043858226388692856, 0.00286655081436038, 0.023874273523688316, -0.03362054377794266, -0.02197006344795227, -0.04541435465216637, 0.03360006958246231, 0.03009878285229206, -0.010401484556496143, 0.010647188872098923, -0.005113721825182438, -0.0090193971991539, -0.028296951204538345, -0.02805124782025814, -0.011005507782101631, -0.018847571685910225, -0.023239536210894585, -0.05847763642668724, -0.004102750681340694, 0.04582386091351509, 0.007908608764410019, -0.03290390968322754, 0.07354750484228134, -0.012080463580787182, -0.006521402858197689, -0.044881995767354965, 0.04815805330872536, -0.006024875678122044, 0.0231576357036829, 0.020925819873809814, 0.04004980996251106, -0.03871891275048256, 0.0013948840787634254, 0.012889240868389606, -0.051024604588747025, -0.049509428441524506, 0.0026541189290583134, -0.007396725006401539, -0.009321409277617931, -0.016492905095219612, -0.037879422307014465, -0.01638028956949711, 0.07354750484228134, 0.0072892289608716965, -0.05679865553975105, 0.0549149215221405, 0.014906063675880432, -0.026208464056253433, -0.006654493045061827, -0.008911902084946632, 0.008415373973548412, -0.02702747844159603, 0.07772447913885117, 0.007381368428468704, 0.014230377040803432, 0.029218342155218124, -0.02180626057088375, -0.009536400437355042, 0.034214332699775696, -0.04803520068526268, 0.032392024993896484, 0.06548020988702774, -0.05794527754187584, -0.01504939142614603, -0.02633131667971611, 0.034111954271793365, 0.05638914927840233, 0.047257136553525925, 0.01658504456281662, 0.03597521409392357, 0.007744805887341499, 0.04963228106498718, 0.007698736619204283, -0.04353062063455582, -0.009244626387953758, -0.030713044106960297, -0.012285217642784119, 0.009556875564157963, 0.016963837668299675, 0.03669184818863869, 0.01849948987364769, -0.004540411755442619, -0.029689276590943336, 0.053440697491168976, 0.010365652851760387, 0.01737334579229355, -0.05335879698395729, -0.015520324930548668, -0.011240974068641663, 0.039988383650779724, 0.016042446717619896, -0.017260730266571045, 0.007110069505870342, 0.01554080005735159, 0.012111176736652851, -0.02557372860610485, -0.022522898390889168, -0.010176255367696285, -0.034705739468336105, 0.02493899129331112, 0.028256000950932503, -0.020424174144864082, -0.012991617433726788, 0.0185711532831192, 0.04557815566658974, -0.008609890006482601, -0.016277913004159927, -0.043162066489458084, 0.009838411584496498, 0.046765729784965515, -0.04566005989909172, -0.004304945003241301, -0.016267675906419754, -0.015745554119348526, -0.01711740344762802, 0.03333389014005661, 0.03654852136969566, 0.03970173001289368, 0.0037572290748357773, 0.029177391901612282, -0.09811794012784958, 0.0382479764521122, -0.002117920434102416, 0.018581392243504524, -0.02487756498157978, -0.02758031338453293, -0.015714840963482857, 0.0164212416857481, -0.04582386091351509, 0.021929113194346428, -0.09942836314439774, -0.03472621366381645, -0.04353062063455582, -0.009106417186558247, 0.011097646318376064, -0.014117762446403503, 0.01720954291522503, -0.010544811375439167, 0.00986400619149208, 0.018745195120573044, 0.05745386704802513, -0.025082319974899292, 0.021355804055929184, -0.02719128131866455, -0.08910878002643585, -0.012049751356244087, -0.019216127693653107, 0.046397171914577484, -0.034111954271793365, 0.06597162038087845, 0.03925127163529396, 0.011128359474241734, 0.05028749257326126, -0.06969813257455826, 0.0228914562612772, 0.04099167510867119, 0.04056169465184212, 0.06281841546297073, -0.021130574867129326, -0.026413217186927795, -0.021990539506077766, -0.030999699607491493, -0.042302098125219345, 0.049837034195661545, 0.05098365247249603, 0.01513129286468029, 0.04750284180045128, 0.008287402801215649, -0.03888271376490593, -0.06335077434778214, -0.07510363310575485, -0.038309402763843536, -0.07240088284015656, -0.03706040605902672, 0.03095874935388565, 0.01128192525357008, 0.01916494034230709, -0.024959467351436615, -0.03505381941795349, 0.02837885357439518, 0.04586481302976608, 0.011640244163572788, -0.03274010494351387, 0.05237597972154617, -0.033251989632844925, 0.03155253455042839, 0.009756510145962238, 0.02643369324505329, 0.010596000589430332, 0.046069566160440445, 0.032392024993896484, 0.05999281257390976, -0.012479733675718307, -0.0150801045820117, 0.00015428505139425397, -0.010882655158638954, -0.0090193971991539, 0.006552116014063358, 0.011384301818907261, -0.03667137399315834, -0.03118397668004036, 0.024468058720231056, 0.018970424309372902 ]
42,905
linearmodels.system.model
reset_constraints
Remove all model constraints
def reset_constraints(self) -> None: """Remove all model constraints""" self._constraints = None
(self) -> NoneType
[ -0.00015954629634507, 0.04648324102163315, 0.017702339217066765, -0.02938154526054859, -0.07788361608982086, -0.03600532189011574, -0.043146323412656784, -0.05355750024318695, 0.0773497149348259, -0.000437188136857003, -0.032701775431632996, -0.015024463646113873, 0.04261241853237152, -0.003931303974241018, -0.0468503013253212, 0.008071165531873703, 0.008742719888687134, -0.0027863248251378536, 0.018469829112291336, -0.0745467022061348, 0.011929474771022797, -0.023408465087413788, -0.009351707063615322, 0.016350887715816498, -0.007203567307442427, 0.0008582130540162325, -0.016551103442907333, -0.005814576055854559, 0.07074261456727982, 0.02168995328247547, -0.056126926094293594, 0.055025745183229446, 0.014448845759034157, -0.017335278913378716, -0.00516387727111578, -0.026144737377762794, 0.07427974790334702, 0.03350263461470604, 0.021189415827393532, 0.02242407575249672, 0.022741083055734634, -0.025177031755447388, -0.01575024239718914, -0.03430349752306938, 0.04578248783946037, 0.0016830569365993142, 0.0443476140499115, 0.04084385186433792, 0.017185118049383163, 0.01057802326977253, -0.011512359604239464, -0.004579917062073946, 0.036739446222782135, 0.032334715127944946, -0.022090382874011993, -0.006694687530398369, -0.02557746134698391, 0.05115492269396782, 0.02846389263868332, -0.07254455238580704, 0.020505348220467567, -0.0010015962179750204, -0.066604845225811, -0.055025745183229446, 0.043046217411756516, -0.01638425700366497, -0.02736271172761917, 0.01738533191382885, 0.005572649650275707, -0.023975741118192673, -0.09490188956260681, -0.03136701136827469, -0.027012335136532784, 0.01667623780667782, 0.013464455492794514, -0.05592671036720276, 0.006310942117124796, -0.01116198394447565, -0.010227647610008717, -0.07334541529417038, 0.045181840658187866, 0.019571011886000633, -0.033702850341796875, 0.02217380702495575, 0.023508572950959206, -0.02017165720462799, 0.01815282367169857, 0.002604879904538393, 0.07447996735572815, -0.03994288295507431, 0.014256973750889301, 0.011253749020397663, -0.006711372174322605, 0.018436459824442863, 0.057394955307245255, 0.07988576591014862, -0.009176518768072128, -0.04408065974712372, -0.027562925592064857, -0.08075336366891861, 0.005526767112314701, 0.01663452573120594, -0.07221086323261261, 0.038508009165525436, -0.002294129692018032, -0.010436204262077808, 0.029648497700691223, -0.06426899880170822, -0.019687803462147713, 0.07641537487506866, -0.027763141319155693, 0.027562925592064857, -0.009234914556145668, 0.03136701136827469, -0.0011209951480850577, -0.02721254900097847, -0.025644199922680855, -0.03503761813044548, 0.04224535450339317, 0.008642612025141716, -0.013572905212640762, 0.040743742138147354, -0.04624965414404869, -0.05442509800195694, 0.0521559976041317, 0.03467055782675743, 0.03920876234769821, 0.06296760588884354, 0.011579098179936409, -0.04775126650929451, -0.05582660436630249, -0.05939710512757301, -0.023358412086963654, 0.0400763601064682, -0.026294898241758347, -0.036238908767700195, 0.031950969249010086, -0.022474128752946854, -0.0029302292969077826, 0.03593858331441879, -0.03994288295507431, 0.0779503583908081, 0.027663033455610275, 0.00005018408774049021, 0.05829592049121857, -0.0021012143697589636, 0.026912227272987366, -0.05205588787794113, -0.07301171869039536, 0.010494600981473923, -0.054258253425359726, -0.019087160006165504, -0.023358412086963654, -0.05899667367339134, -0.030916526913642883, 0.06860699504613876, -0.02317488193511963, -0.06683842837810516, -0.01630917750298977, 0.000458043854450807, -0.07621516287326813, 0.05782875418663025, -0.014999437145888805, -0.07481365650892258, -0.008071165531873703, -0.021606530994176865, 0.004542376846075058, -0.019354112446308136, -0.02883095294237137, -0.026178104802966118, -0.05886319652199745, -0.041144173592329025, -0.003681035479530692, -0.0006371423951350152, 0.005193075630813837, 0.03190091624855995, 0.038107581436634064, -0.003015737747773528, -0.041277650743722916, 0.02834710106253624, 0.06083197891712189, -0.03246819227933884, -0.01373140886425972, 0.01216305885463953, 0.030916526913642883, 0.02369210310280323, -0.05913015082478523, 0.018803521990776062, -0.03155054152011871, -0.05769527703523636, 0.041911665350198746, 0.01851988397538662, 0.002577767474576831, 0.0015057832933962345, -0.008292236365377903, -0.004876068327575922, 0.033936433494091034, 0.014607349410653114, 0.02027176506817341, -0.0589299350976944, -0.015408209525048733, -0.02998219057917595, 0.040143098682165146, 0.01625077985227108, 0.021890169009566307, 0.03318563103675842, -0.042045142501592636, -0.023158196359872818, 0.01690148003399372, -0.026361636817455292, -0.0008921036496758461, 0.024125901982188225, 0.0383077934384346, -0.07841752469539642, 0.0393422394990921, -0.042912740260362625, -0.007754158228635788, -0.0015360241523012519, 0.006156609859317541, 0.03640575334429741, -0.0019218550296500325, 0.028163570910692215, -0.009660371579229832, -0.057261478155851364, -0.0041836583986878395, 0.01278038788586855, -0.03236808627843857, -0.011370541527867317, 0.02417595684528351, -0.05582660436630249, 0.0503874309360981, -0.06089871749281883, -0.04194503277540207, -0.0663045197725296, 0.062433697283267975, 0.04544879496097565, -0.0005161791923455894, -0.025243768468499184, -0.03250155970454216, -0.039008546620607376, -0.04925287887454033, 0.006352653726935387, -0.033702850341796875, 0.03049941174685955, 0.010986795648932457, 0.03326905146241188, 0.014724141918122768, -0.02632826752960682, 0.0004421413759700954, -0.05542617291212082, -0.04608280956745148, -0.05295685678720474, 0.014040074311196804, 0.00925994198769331, 0.04992026090621948, -0.06036480888724327, -0.017418701201677322, -0.008634270168840885, 0.009685399010777473, 0.05218936502933502, 0.030566150322556496, -0.007015865761786699, -0.03650585934519768, 0.03590521588921547, 0.06240032985806465, 0.0471506230533123, 0.006828164216130972, 0.03246819227933884, -0.00920154619961977, -0.010644761845469475, 0.052723273634910583, -0.024342801421880722, 0.015241364017128944, 0.013831516727805138, 0.022524183616042137, 0.026561850681900978, -0.027295973151922226, 0.03960919380187988, 0.017218485474586487, 0.004550719168037176, 0.07287824153900146, -0.0710095688700676, 0.025377245619893074, 0.02934817597270012, 0.007257792167365551, -0.018119454383850098, -0.04368022829294205, -0.062433697283267975, -0.03740682825446129, -0.011620810255408287, 0.030065612867474556, 0.0037436026614159346, 0.05976416543126106, 0.0089512774720788, 0.03213449940085411, -0.058162443339824677, -0.0018217475153505802, 0.012555146589875221, 0.0016069335397332907, 0.034970879554748535, 0.02959844470024109, 0.04071037471294403, -0.0016861853655427694, 0.03348595276474953, 0.07988576591014862, -0.01632586121559143, -0.019053790718317032, 0.03867485746741295, 0.056760940700769424, 0.034570448100566864, -0.018569936975836754, -0.023091457784175873, -0.016918163746595383, 0.033953119069337845, 0.0773497149348259, -0.030282512307167053, 0.06710538268089294, -0.018436459824442863, -0.00623586168512702, 0.05442509800195694, 0.014899329282343388, -0.010844976641237736, -0.029047854244709015, -0.0015506230993196368, -0.048218436539173126, -0.001271156477741897, 0.022590920329093933, 0.03178412467241287, -0.05232284218072891, 0.0006074229604564607, -0.01468242984265089, 0.00004946717308484949, 0.008492451161146164, 0.00548505550250411, -0.07067587971687317, 0.0023441833909600973, 0.040643636137247086, -0.03587184473872185, -0.011262091808021069, -0.0059730797074735165, 0.026928910985589027, 0.02103925496339798, 0.0007101374212652445, -0.026111368089914322, -0.026294898241758347, 0.030599519610404968, -0.021856799721717834, -0.02899779938161373, 0.007049235049635172, 0.021372945979237556, -0.008934592828154564, 0.0635015070438385, 0.04601607099175453, 0.034837402403354645, 0.03870822489261627, 0.0003274348855484277, -0.027312656864523888, 0.0375736728310585, 0.0425790473818779, -0.036605969071388245, 0.03125021606683731, 0.02369210310280323, -0.044547829777002335, -0.05492563545703888, 0.08642612397670746, 0.005568478722125292, -0.03453708067536354, -0.0253438763320446, 0.021756691858172417, -0.022107068449258804, -0.01828629896044731, -0.0723443403840065, -0.041511233896017075, 0.013122421689331532, 0.006728056818246841, 0.043646860867738724, -0.008421541191637516, 0.060264702886343, -0.004194086417555809, 0.03243482485413551, 0.018369723111391068, -0.04267915338277817, 0.035705000162124634, -0.021890169009566307, -0.021489739418029785, -0.03857474774122238, -0.003935475368052721, -0.004388044588267803, 0.006461103446781635, 0.04194503277540207, 0.07207738608121872, -0.05582660436630249, -0.0054558576084673405, -0.027029018849134445, 0.057261478155851364, 0.05455857515335083, -0.016317518427968025, 0.022374020889401436, 0.0031054173596203327, -0.0012127603404223919, -0.03411996737122536, -0.01688479445874691, -0.025010185316205025, 0.03325236588716507, 0.028914377093315125, 0.023642050102353096, 0.004717565141618252, 0.08602569252252579, 0.039008546620607376, 0.040910590440034866, 0.013848201371729374, 0.021740008145570755, 0.05402467027306557, 0.000827972253318876, 0.0380074717104435, -0.007791698910295963, 0.07875121384859085, -0.02761298045516014, 0.10471241921186447, -0.0003339522809255868, 0.04424750432372093, 0.05579323321580887, 0.036238908767700195, 0.023742156103253365, -0.014148524031043053, -0.017034955322742462, -0.008371488191187382, 0.029264753684401512, -0.035337939858436584, 0.04171144962310791, -0.04801822081208229, 0.0005469413590617478, 0.01586703583598137, -0.025260454043745995, -0.0677727609872818, 0.009752136655151844, 0.01506617572158575, -0.010002405382692814, -0.020004810765385628, 0.022707713767886162, 0.04601607099175453, -0.009451813995838165, 0.032201237976551056, -0.07968555390834808, 0.019087160006165504, 0.05656072497367859, -0.012012897059321404, 0.03997625410556793, -0.06800634413957596, 0.049686677753925323, 0.023091457784175873, 0.020371871069073677, 0.01888694427907467, -0.04561563953757286, 0.0010088956914842129, 0.015449920669198036, 0.011403909884393215, -0.04207850992679596, -0.08716024458408356, -0.02938154526054859, -0.004654997959733009, 0.017985977232456207, -0.03126690164208412, -0.0262281596660614, 0.029765291139483452, 0.06283412873744965, 0.00570612633600831, -0.000989604159258306, -0.03427012637257576, 0.0021669098641723394, -0.017819130793213844, -0.07961881160736084, -0.002154396381229162, -0.028297048062086105, -0.05242294818162918, 0.034603819251060486, 0.02697896584868431, 0.03038262017071247, 0.02028844878077507, 0.004458954092115164, 0.03607206046581268, -0.03537130728363991, 0.02115604653954506, 0.04471467435359955, 0.01900373585522175, 0.005001202691346407, -0.022140437737107277, -0.07407953590154648, -0.0965036079287529, -0.004233712330460548, -0.0567275695502758, -0.029414914548397064, -0.0037456881254911423, 0.021873483434319496, 0.01875346712768078, -0.008726035244762897, -0.02190685272216797, -0.008467424660921097, -0.01890362799167633, -0.02607799880206585, -0.003297290066257119, -0.029164645820856094, -0.06266728043556213, 0.00002650958049343899, 0.0020438609644770622, 0.017301909625530243, 0.0010949255665764213, -0.022123752161860466, -0.05128839984536171, -0.01917058229446411, -0.008792773820459843, -0.029565075412392616, -0.032084446400403976, 0.024876708164811134, 0.01122037973254919, -0.00705757737159729, -0.03141706436872482, -0.04197840392589569, 0.057394955307245255, -0.0074162958189845085, -0.06743907183408737, 0.0037123190704733133, 0.0013858629390597343, 0.04348001629114151, 0.016659552231431007, 0.008859511464834213, -0.007587312720716, -0.04317969083786011, 0.09603644162416458, 0.0024922590237110853, 0.07461343705654144, -0.016818055883049965, 0.005460028536617756, 0.01347279828041792, 0.0040147271938622, -0.004202428739517927, -0.02896443009376526, -0.12913864850997925, 0.005535109434276819, 0.03348595276474953, -0.004972004797309637, 0.021456370130181313, 0.041144173592329025, 0.061199039220809937, -0.013122421689331532, 0.055659759789705276, -0.046182915568351746, -0.0024818312376737595, -0.07641537487506866, 0.030666258186101913, -0.09590296447277069, -0.0005099224508740008, -0.0029156303498893976, -0.019454220309853554, -0.006598751526325941, 0.006102384999394417, 0.03820768743753433, 0.0019458391470834613, 0.06013122573494911, 0.03587184473872185, -0.00633596908301115, -0.02052203379571438, 0.09236583113670349, -0.0383077934384346, -0.0294649675488472, 0.04848538711667061, -0.004742591641843319, -0.014415476471185684, 0.04334653913974762, 0.04634976387023926, 0.003307717852294445, -0.06677168607711792, 0.024993499740958214, -0.010895030573010445, -0.027746455743908882, -0.03617217019200325, -0.012446696870028973, 0.021122677251696587, -0.07821731269359589, -0.004100235644727945, 0.026144737377762794, -0.0003094468265771866, -0.015358155593276024, -0.04444772005081177, -0.025777675211429596, -0.008726035244762897, 0.03970929980278015, 0.0006371423951350152, -0.019587697461247444, -0.0397760383784771, -0.041878294199705124, 0.05519258975982666, 0.010486258193850517, 0.01838640682399273, -0.041144173592329025, 0.0019969355780631304, -0.0489191897213459, -0.0273293424397707, -0.05766190588474274, 0.025877783074975014, 0.049686677753925323, -0.034703925251960754, 0.05359087139368057, 0.034837402403354645, -0.03180081024765968, 0.0380074717104435, -0.028046779334545135, 0.032334715127944946, 0.02584441378712654, 0.013764778152108192, -0.02682880498468876, -0.03265172243118286, 0.02105594053864479, -0.014807564206421375, -0.018936997279524803, -0.07181043177843094, -0.04244557023048401, -0.004800987895578146, 0.003854137845337391, -0.0021815088111907244, -0.024226009845733643, -0.0046049440279603004, -0.008225497789680958, 0.007508060894906521, 0.0015735644847154617, 0.1049126386642456, -0.015600082464516163, -0.02846389263868332, -0.03744019567966461, 0.05015384778380394, 0.02988208271563053, -0.05832929164171219, -0.04381370544433594, 0.025994574651122093, -0.01877015270292759, -0.01437376532703638, -0.02809683233499527, -0.010336097329854965, 0.02659521996974945, -0.0004755105182994157, 0.028163570910692215, -0.029815344139933586, 0.05379108339548111, 0.008776089176535606, -0.02796335518360138, 0.01071984227746725, -0.06240032985806465, -0.062033265829086304, 0.01695987582206726, 0.0026403346564620733, -0.034436970949172974, 0.01442381925880909, -0.011620810255408287, -0.022507498040795326, 0.04591596499085426, 0.03166733309626579, -0.028914377093315125, -0.06303434073925018, 0.02167326956987381, -0.04244557023048401, -0.02244075946509838, -0.023875633254647255, 0.05212262645363808, 0.013856543228030205, 0.06076524034142494, 0.018619991838932037, -0.023742156103253365, 0.0019635665230453014, -0.035738371312618256, 0.021356262266635895, -0.012313219718635082, -0.018619991838932037, -0.0029761118348687887, 0.009410102851688862, 0.0033306593541055918, 0.034837402403354645, 0.00990229845046997, -0.002419264055788517, -0.020972516387701035, -0.014715799130499363, 0.018102768808603287, -0.0026987306773662567, -0.0006538269808515906, -0.0400763601064682, 0.04725072905421257, 0.004127347841858864, -0.033335790038108826, 0.01763560064136982, 0.011745944619178772, 0.017051640897989273, 0.0003506368666421622, -0.022891243919730186, 0.08422376215457916, 0.015892062336206436, -0.01903710514307022, 0.004750933963805437, -0.03493750840425491, -0.048819079995155334, 0.02988208271563053, 0.01185439433902502, 0.039008546620607376, -0.008842826820909977, -0.08816131949424744, 0.014649061486124992, -0.0011209951480850577, 0.07694928348064423, -0.0040355827659368515, -0.02190685272216797, -0.06470280140638351, -0.021873483434319496, 0.05075449123978615, 0.04778463765978813, 0.007211909629404545, -0.014298684895038605, 0.033586058765649796, 0.039008546620607376, 0.026561850681900978, -0.04928625002503395, 0.0010928399860858917, -0.006961640901863575, 0.04004299268126488, 0.03947571665048599, 0.003030336694791913, -0.010227647610008717, 0.04217861592769623, 0.025477353483438492, -0.033853013068437576, -0.025911152362823486, 0.002020919695496559, 0.0029573417268693447, 0.03630564734339714, -0.001997978426516056, 0.012555146589875221, 0.009276626631617546, -0.014532268978655338, 0.0010198449017480016, 0.019487589597702026, -0.0031658990774303675, -0.020705563947558403, 0.012354930862784386, -0.02190685272216797, -0.01594211533665657, -0.002281616209074855, 0.01448221504688263, 0.014273658394813538, 0.01380649022758007, 0.005989764351397753, 0.05342402309179306, 0.02531050704419613, -0.018102768808603287, 0.024509647861123085, 0.03141706436872482, 0.03437023609876633, -0.0380074717104435, 0.002594452118501067, -0.02546066790819168, 0.0471506230533123, 0.023742156103253365, -0.03266840800642967, -0.010319412685930729, -0.008004426956176758, -0.005831260699778795, -0.011237064376473427, 0.0400763601064682, 0.07468017935752869, 0.0019301973516121507, 0.0660041943192482, -0.005372434854507446 ]
42,906
linearmodels.iv.model
IVGMM
Estimation of IV models using the generalized method of moments (GMM) Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- Available GMM weight functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity by not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence The estimator is defined as .. math:: \hat{\beta}_{gmm}=(X'ZW^{-1}Z'X)^{-1}X'ZW^{-1}Z'Y where :math:`W` is a positive definite weight matrix and :math:`Z` contains both the exogenous regressors and the instruments. .. todo:: * VCV: bootstrap See Also -------- IV2SLS, IVLIML, IVGMMCUE
class IVGMM(_IVGMMBase): r""" Estimation of IV models using the generalized method of moments (GMM) Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- Available GMM weight functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity by not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence The estimator is defined as .. math:: \hat{\beta}_{gmm}=(X'ZW^{-1}Z'X)^{-1}X'ZW^{-1}Z'Y where :math:`W` is a positive definite weight matrix and :math:`Z` contains both the exogenous regressors and the instruments. .. todo:: * VCV: bootstrap See Also -------- IV2SLS, IVLIML, IVGMMCUE """ def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ): super().__init__(dependent, exog, endog, instruments, weights=weights) self._method = "IV-GMM" weight_matrix_estimator = WEIGHT_MATRICES[weight_type] self._weight = weight_matrix_estimator(**weight_config) self._weight_type = weight_type self._weight_config = self._weight.config @staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ) -> IVGMM: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Returns ------- IVGMM Model instance Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVGMM >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVGMM.from_formula(formula, data) """ mod = _gmm_model_from_formula( IVGMM, formula, data, weights, weight_type, **weight_config ) assert isinstance(mod, IVGMM) return mod @staticmethod def estimate_parameters( x: Float64Array, y: Float64Array, z: Float64Array, w: Float64Array ) -> Float64Array: """ Parameters ---------- x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) w : ndarray GMM weight matrix (ninstr by ninstr) Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed as a static method to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking. """ xpz = x.T @ z zpy = z.T @ y return inv(xpz @ w @ xpz.T) @ (xpz @ w @ zpy) def fit( self, *, iter_limit: int = 2, tol: float = 1e-4, initial_weight: Float64Array | None = None, cov_type: str = "robust", debiased: bool = False, **cov_config: Any, ) -> OLSResults | IVGMMResults: """ Estimate model parameters Parameters ---------- iter_limit : int Maximum number of iterations. Default is 2, which produces two-step efficient GMM estimates. Larger values can be used to iterate between parameter estimation and optimal weight matrix estimation until convergence. tol : float Convergence criteria. Measured as covariance normalized change in parameters across iterations where the covariance estimator is based on the first step parameter estimates. initial_weight : ndarray Initial weighting matrix to use in the first step. If not specified, uses the average outer-product of the set containing the exogenous variables and instruments. cov_type : str Name of covariance estimator to use. Available covariance functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity but not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional parameters to pass to covariance estimator. Supported parameters depend on specific covariance structure assumed. See :class:`linearmodels.iv.gmm.IVGMMCovariance` for details on the available options. Defaults are used if no covariance configuration is provided. Returns ------- IVGMMResults Results container See also -------- linearmodels.iv.gmm.IVGMMCovariance """ wy, wx, wz = self._wy, self._wx, self._wz nobs = wy.shape[0] weight_matrix = self._weight.weight_matrix k_wz = wz.shape[1] if initial_weight is not None: initial_weight = asarray(initial_weight) if initial_weight.ndim != 2 or initial_weight.shape != (k_wz, k_wz): raise ValueError(f"initial_weight must be a {k_wz} by {k_wz} array") wmat = inv(wz.T @ wz / nobs) if initial_weight is None else initial_weight _params = params = self.estimate_parameters(wx, wy, wz, wmat) iters, norm = 1, 10 * tol + 1 vinv = eye(params.shape[0]) while iters < iter_limit and norm > tol: eps = wy - wx @ params wmat = inv(weight_matrix(wx, wz, eps)) params = self.estimate_parameters(wx, wy, wz, wmat) delta = params - _params if iters == 1: xpz = wx.T @ wz / nobs v = (xpz @ wmat @ xpz.T) / nobs vinv = inv(v) _params = params norm = float(squeeze(d
(dependent: 'IVDataLike', exog: 'IVDataLike | None', endog: 'IVDataLike | None', instruments: 'IVDataLike | None', *, weights: 'IVDataLike | None' = None, weight_type: 'str' = 'robust', **weight_config: 'Any')
[ 0.10855451226234436, -0.04605086147785187, -0.026396557688713074, -0.001538473996333778, 0.020852219313383102, -0.050715312361717224, -0.0486375130712986, -0.05287792161107063, 0.04622047767043114, 0.020343370735645294, -0.018318574875593185, -0.019378677010536194, 0.0232162494212389, 0.03248154744505882, -0.07013639062643051, 0.09303461015224457, 0.002414383925497532, -0.022983025759458542, 0.02067200280725956, 0.008904862217605114, -0.057457566261291504, -0.04134400561451912, -0.04058073088526726, 0.04829827696084976, 0.0218381155282259, 0.007744050119072199, -0.03360525518655777, -0.018254967406392097, 0.05593101680278778, -0.04571162909269333, -0.08468100428581238, -0.059280943125486374, -0.02824113517999649, -0.03746403008699417, 0.016463395208120346, -0.029470855370163918, 0.04859510809183121, -0.0037050589453428984, -0.08540187031030655, 0.022728601470589638, 0.04554201290011406, -0.03383847698569298, 0.08116146177053452, -0.014459800906479359, 0.004667101893573999, 0.020714405924081802, -0.024467170238494873, 0.06500549614429474, 0.0058199637569487095, 0.005501932930201292, 0.03057336062192917, -0.05593101680278778, 0.014809634536504745, -0.027562670409679413, -0.06309731304645538, 0.06606560200452805, 0.03354164958000183, 0.03742162510752678, 0.06759214401245117, -0.04566922411322594, -0.002854326507076621, -0.047238174825906754, 0.025548474863171577, 0.009079779498279095, -0.01064343098551035, 0.026354152709245682, -0.022622590884566307, 0.0010514893801882863, -0.012551615945994854, 0.03498338907957077, -0.0029338342137634754, -0.03458055108785629, 0.014830837026238441, 0.04100477322936058, -0.0014602914452552795, 0.020905224606394768, -0.03765484690666199, -0.039054181426763535, -0.015806131064891815, -0.01630437932908535, 0.06725291162729263, 0.022368166595697403, -0.0234918761998415, -0.08167031407356262, 0.014268982224166393, -0.0026767593808472157, -0.050884928554296494, -0.015138266608119011, 0.05652467533946037, -0.05631265416741371, -0.02370389550924301, 0.012318393215537071, 0.06492068618535995, 0.06072268262505531, 0.039605434983968735, -0.009609830565750599, -0.021509483456611633, -0.0906599834561348, 0.010823648422956467, -0.015424493700265884, -0.02851676195859909, 0.02552727237343788, 0.03349924460053444, 0.01798994280397892, -0.024339957162737846, -0.04223449155688286, -0.048934340476989746, -0.03542863205075264, 0.030424946919083595, -0.07666662335395813, -0.05521014705300331, 0.0375700406730175, -0.01235019601881504, -0.0320575051009655, -0.0036467532627284527, 0.03873615339398384, -0.03693397715687752, 0.053089942783117294, -0.015488100238144398, 0.046008456498384476, -0.013495107181370258, -0.009392510168254375, -0.027753489091992378, 0.009313002228736877, 0.038333311676979065, -0.08077982813119888, 0.019908728078007698, 0.012233585119247437, 0.008062080480158329, -0.039266202598810196, -0.0386725477874279, -0.05559178441762924, -0.03538622707128525, -0.0077758533880114555, 0.0034956885501742363, 0.004789013881236315, 0.0020327467937022448, -0.03572545945644379, 0.005448927637189627, 0.05902651697397232, 0.027371851727366447, 0.05190262943506241, -0.027371851727366447, 0.04210728034377098, 0.0006446749321185052, 0.023301057517528534, 0.08518984913825989, -0.005639746319502592, -0.007208698429167271, -0.05169060826301575, -0.020693205296993256, -0.0223893690854311, -0.003691807622089982, -0.022961825132369995, 0.0020380474161356688, -0.018042948096990585, -0.0019280617125332355, 0.012339595705270767, -0.012943853624165058, -0.027605073526501656, -0.0735287219285965, 0.00006696039054077119, -0.022262156009674072, 0.05389562249183655, 0.03593748062849045, 0.03347804397344589, 0.006042585242539644, 0.04075034707784653, -0.04217088595032692, 0.042319297790527344, -0.012498610652983189, -0.0707724541425705, -0.06347894668579102, -0.04664452001452446, -0.0040999469347298145, 0.09413711726665497, 0.01179894246160984, -0.00047108312719501555, 0.04482114315032959, 0.03275717422366142, 0.05113935470581055, -0.008761748671531677, -0.06258846074342728, -0.019251463934779167, -0.06114672124385834, 0.03112461417913437, 0.021477680653333664, 0.010622228495776653, 0.009805949404835701, -0.037230804562568665, 0.006259906571358442, -0.05177541449666023, 0.03710359334945679, 0.009604530408978462, 0.008592132478952408, 0.026438960805535316, 0.04605086147785187, 0.02359788492321968, -0.018488191068172455, 0.018732015043497086, 0.04876472428441048, -0.03436852991580963, 0.009864255785942078, -0.043252188712358475, -0.023725097998976707, -0.0068588643334805965, -0.06606560200452805, -0.046517305076122284, 0.033690065145492554, -0.006127393338829279, -0.012519813142716885, 0.017735518515110016, 0.0240431297570467, 0.03383847698569298, 0.0301281176507473, 0.00937130767852068, 0.012753034941852093, 0.02703261934220791, -0.0000034215229334222386, -0.011290093883872032, 0.04664452001452446, -0.04251011833548546, -0.10236351191997528, -0.009906659834086895, 0.02448837272822857, -0.041428811848163605, 0.014215976931154728, 0.022452974691987038, -0.008130987174808979, -0.011544518172740936, 0.0696699470281601, -0.03593748062849045, 0.017947537824511528, -0.04626288264989853, -0.015180670656263828, -0.018583599478006363, -0.02487000823020935, 0.0378456674516201, -0.015848536044359207, 0.0024316105991601944, -0.007166294381022453, -0.007457822561264038, -0.027329446747899055, 0.09261056780815125, 0.005144148133695126, -0.02658737450838089, 0.03500458970665932, 0.06233403831720352, -0.004500135779380798, 0.015254877507686615, -0.022177347913384438, -0.03332962840795517, -0.07123889774084091, 0.02735064923763275, -0.024509573355317116, 0.00036639798781834543, -0.0030636966694146395, 0.031697072088718414, 0.060934703797101974, -0.025993717834353447, -0.000386937492294237, -0.019972335547208786, -0.039329808205366135, 0.06839782744646072, -0.0068005588836967945, 0.053132347762584686, 0.04350661486387253, -0.0008759098709560931, 0.004266913514584303, 0.050927333533763885, 0.03176067769527435, 0.06920350342988968, -0.036785561591386795, -0.0024316105991601944, 0.000803027767688036, 0.05406523868441582, -0.042149681597948074, -0.009424312971532345, -0.03886336460709572, 0.0038375717122107744, -0.004227159544825554, -0.03332962840795517, -0.00037070465623401105, -0.01871081255376339, -0.04329459369182587, 0.013728329911828041, -0.031209422275424004, -0.041874054819345474, 0.03631911799311638, 0.025993717834353447, 0.0028781788423657417, -0.013770733959972858, 0.016177166253328323, 0.023470673710107803, 0.04038991406559944, -0.008427816443145275, 0.0033419737592339516, 0.038269706070423126, 0.005003684666007757, 0.018838025629520416, 0.032799575477838516, 0.050164058804512024, 0.01709945686161518, -0.00779175478965044, -0.023788703605532646, 0.04013548791408539, 0.041916459798812866, -0.049443189054727554, -0.0009852328803390265, 0.009869555942714214, -0.028007913380861282, 0.025018423795700073, -0.0019876924343407154, 0.014237179420888424, 0.033520445227622986, -0.02304663322865963, 0.03438973054289818, -0.010813047178089619, 0.06254605948925018, 0.025612080469727516, 0.0436762310564518, 0.022474177181720734, 0.040368709713220596, -0.03742162510752678, -0.01448100246489048, 0.0022275408264249563, 0.013601117767393589, 0.025824101641774178, -0.0030981500167399645, -0.020862821489572525, -0.013685925863683224, 0.010950860567390919, -0.00827410165220499, 0.028728783130645752, 0.013293687254190445, 0.00016829129890538752, 0.030318936333060265, -0.007897765375673771, 0.07255342602729797, 0.00809918437153101, 0.07899884879589081, -0.014290183782577515, -0.058772094547748566, -0.02243177220225334, -0.0009368657483719289, -0.0651751160621643, 0.06373337656259537, -0.006397719494998455, -0.015519903041422367, 0.06186759099364281, -0.039775051176548004, 0.02940724790096283, 0.051308970898389816, 0.07115409523248672, -0.01009747851639986, -0.03956303372979164, -0.009344805032014847, -0.03332962840795517, 0.040156688541173935, 0.040771547704935074, -0.07268063724040985, 0.08489302545785904, -0.017279673367738724, 0.007272304501384497, 0.009016172960400581, -0.044736333191394806, 0.0034108804538846016, -0.023809906095266342, 0.01881682313978672, -0.027287043631076813, 0.021180851384997368, -0.06012902408838272, -0.0491887629032135, -0.007187496405094862, 0.014767230488359928, -0.007346511818468571, -0.06390298902988434, -0.014608214609324932, -0.008035578764975071, 0.009376607835292816, 0.04749260097742081, -0.02961926907300949, 0.03050975501537323, -0.0009540924220345914, 0.043464209884405136, 0.006339414045214653, 0.09201691299676895, 0.04486354440450668, -0.001511971466243267, -0.03309640660881996, -0.025018423795700073, -0.008115085773169994, 0.021170251071453094, 0.01627257652580738, -0.01596514694392681, 0.0018154258141294122, 0.011459710076451302, 0.007081485819071531, -0.037718452513217926, -0.029322439804673195, -0.045626819133758545, 0.0020897274371236563, -0.051266565918922424, 0.049485594034194946, -0.012519813142716885, -0.055125340819358826, -0.014237179420888424, 0.05669429153203964, -0.016007550060749054, 0.015700120478868484, -0.03810008987784386, 0.01503225602209568, -0.02620573900640011, -0.01307106576859951, -0.014162971638143063, -0.005228956695646048, -0.011586922220885754, -0.017597705125808716, 0.01947408728301525, 0.06542953848838806, 0.0480862595140934, 0.01160812471061945, 0.08964228630065918, -0.00435967231169343, -0.021297462284564972, 0.02785949781537056, -0.0519450306892395, -0.04566922411322594, -0.0530475378036499, -0.043973058462142944, -0.006641543470323086, 0.0629701018333435, -0.012233585119247437, -0.03106100857257843, -0.02315264195203781, -0.03322361782193184, -0.045457202941179276, -0.005645046941936016, 0.003116701962426305, 0.04161963239312172, 0.029386047273874283, -0.013526909984648228, 0.014438598416745663, -0.0304037444293499, -0.051817819476127625, 0.0029762382619082928, -0.012731833383440971, 0.016219571232795715, -0.053471580147743225, -0.02188051864504814, 0.06280048191547394, 0.04812866076827049, 0.02620573900640011, -0.008517924696207047, 0.01116288173943758, -0.019654303789138794, 0.005846466403454542, -0.02053418941795826, -0.005295212846249342, -0.01609235815703869, -0.03602229058742523, 0.022283358499407768, -0.055506978183984756, -0.006074388511478901, -0.022198550403118134, 0.08518984913825989, 0.07590335607528687, -0.03318121284246445, -0.012657626532018185, 0.051860224455595016, -0.005528435576707125, 0.01820196397602558, 0.03625551238656044, -0.052199456840753555, -0.0013913847506046295, 0.013982754200696945, -0.053853217512369156, 0.00029749132227152586, 0.03432612493634224, -0.013749531470239162, 0.033138811588287354, -0.01121588610112667, 0.030255330726504326, 0.04227689653635025, 0.0001227400207426399, 0.02425514906644821, 0.03203630447387695, -0.006975475698709488, 0.0077016460709273815, -0.0619099959731102, -0.06174037978053093, 0.07374074310064316, 0.01877441816031933, 0.055082935839891434, 0.016622409224510193, 0.009344805032014847, -0.007828858681023121, -0.012477409094572067, 0.08489302545785904, -0.044693928211927414, 0.03720960393548012, -0.003927680663764477, -0.049612805247306824, -0.0541500449180603, -0.013993355445563793, -0.02658737450838089, -0.018615402281284332, 0.0040177893824875355, -0.015657717362046242, -0.05113935470581055, -0.03417770937085152, -0.022283358499407768, 0.020481184124946594, 0.00796137098222971, -0.005438326857984066, -0.028559166938066483, -0.047110963612794876, 0.04227689653635025, 0.012233585119247437, -0.012180579826235771, 0.02741425484418869, -0.05703352391719818, -0.016760222613811493, -0.023852311074733734, 0.019834522157907486, 0.042870551347732544, -0.07174775004386902, -0.06814339756965637, 0.030912594869732857, 0.024403564631938934, -0.04393065720796585, -0.03394448757171631, 0.0240431297570467, 0.07874442636966705, -0.028771186247467995, -0.05423485487699509, 0.060553066432476044, -0.0635213553905487, -0.08268801122903824, 0.004725407809019089, -0.042849350720644, -0.011364300735294819, -0.022092539817094803, 0.00989075843244791, 0.03106100857257843, 0.06042585149407387, 0.011873150244355202, 0.01716306246817112, -0.03831211104989052, -0.018997039645910263, -0.06445424258708954, -0.005433026235550642, -0.02503962628543377, 0.009896058589220047, 0.03504699468612671, -0.004736008588224649, -0.0031670567113906145, -0.0058782692067325115, 0.01740688644349575, 0.020375173538923264, -0.024848807603120804, 0.004314617719501257, 0.010601026937365532, -0.0740799754858017, 0.01878502033650875, 0.05521014705300331, -0.001578227849677205, 0.002414383925497532, -0.03273596987128258, 0.027371851727366447, 0.015117064118385315, -0.0491887629032135, 0.010696436278522015, -0.009450815618038177, -0.03394448757171631, 0.045414797961711884, -0.015403292141854763, 0.00899497140198946, -0.006874765735119581, -0.055082935839891434, -0.020968832075595856, -0.0065885381773114204, 0.028559166938066483, -0.00207647611387074, 0.03676436096429825, -0.011459710076451302, -0.041471216827631, 0.04719576984643936, 0.003797817975282669, 0.06424222141504288, -0.022177347913384438, 0.06373337656259537, -0.013950951397418976, -0.021021835505962372, 0.01026709470897913, 0.04516037553548813, -0.008088583126664162, 0.019972335547208786, 0.023237450048327446, -0.021233856678009033, -0.001173401135019958, 0.013632920570671558, 0.041640833020210266, 0.04426988959312439, -0.03625551238656044, 0.026650981977581978, -0.030594563111662865, 0.005088492762297392, 0.05554937943816185, -0.02094762958586216, -0.03636152297258377, -0.027499062940478325, -0.014767230488359928, 0.011629326269030571, -0.030467351898550987, 0.021901721134781837, -0.07085726410150528, 0.07776913046836853, 0.06763455271720886, 0.025400061160326004, -0.0014390894211828709, -0.048171065747737885, -0.012307791970670223, -0.023831108585000038, 0.0036971080116927624, -0.015795530751347542, 0.010500317439436913, -0.07102687656879425, -0.0018591551342979074, 0.0017266422510147095, 0.03521661087870598, 0.012806040234863758, 0.06373337656259537, 0.002822523470968008, 0.026099728420376778, 0.009090380743145943, -0.007367713842540979, 0.00016373617108911276, -0.03282077983021736, 0.052369073033332825, 0.000905725231859833, 0.03222712129354477, 0.0056874509900808334, 0.03667955473065376, -0.005629145074635744, -0.006074388511478901, 0.011237088590860367, 0.005597342271357775, 0.031018605455756187, 0.005295212846249342, 0.02641775831580162, -0.014989851973950863, -0.058390457183122635, -0.05207224562764168, -0.03892697021365166, -0.015806131064891815, -0.02730824612081051, 0.024679191410541534, 0.018286772072315216, -0.022855814546346664, -0.0003418831038288772, 0.036170702427625656, -0.00978474784642458, -0.021403472870588303, 0.015848536044359207, 0.03218471631407738, 0.03992346674203873, -0.014396194368600845, 0.02807151898741722, 0.005904771853238344, 0.026672184467315674, -0.0033949788194149733, -0.009387209080159664, 0.0017809724668040872, -0.044354695826768875, -0.025378858670592308, 0.020725008100271225, -0.0029364845249801874, -0.01116288173943758, 0.034792568534612656, 0.09651175141334534, 0.06894908100366592, 0.028495559468865395, -0.017459891736507416, 0.033965691924095154, -0.09294980019330978, -0.031421445310115814, -0.020990032702684402, 0.01415237132459879, -0.033796072006225586, -0.05351398512721062, 0.026396557688713074, 0.049994442611932755, -0.019622500985860825, 0.02559087797999382, -0.0602562353014946, -0.021244456991553307, -0.02923763170838356, -0.017703715711832047, -0.045075565576553345, 0.013579915277659893, -0.020046541467308998, -0.046559710055589676, 0.03303280100226402, -0.0017544699367135763, 0.03106100857257843, -0.029364844784140587, -0.011661130003631115, -0.016495198011398315, -0.058941710740327835, 0.01726907305419445, 0.002719163428992033, 0.024445967748761177, -0.062376443296670914, 0.08251839131116867, 0.03865134343504906, -0.005989580415189266, 0.010394306853413582, -0.006127393338829279, 0.007113289088010788, 0.023470673710107803, 0.02438236214220524, 0.02520924247801304, -0.00844371784478426, -0.04969761520624161, -0.030276533216238022, 0.025357656180858612, -0.003458585124462843, 0.04702615365386009, 0.011099275201559067, 0.03676436096429825, 0.022919420152902603, -0.022198550403118134, 0.002546896692365408, 0.000940178579185158, -0.053853217512369156, -0.055082935839891434, -0.011714134365320206, -0.042870551347732544, 0.06322452425956726, -0.046983752399683, 0.017247870564460754, -0.026332950219511986, -0.01606055535376072, -0.01765071041882038, 0.038884565234184265, 0.014332588762044907, -0.01193675585091114, 0.0367431603372097, -0.023301057517528534, 0.06428463011980057, -0.03820610046386719, 0.004985132720321417, 0.0018220514757558703, 0.0640726089477539, 0.04804385453462601, 0.00827410165220499, -0.017459891736507416, -0.012615221552550793, -0.05953536555171013, -0.04172564297914505, -0.03458055108785629, 0.06704089045524597, -0.006752854213118553, -0.03171827271580696, 0.03275717422366142, 0.013866143301129341, 0.04439710080623627 ]
42,907
linearmodels.iv.model
__init__
null
def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ): super().__init__(dependent, exog, endog, instruments, weights=weights) self._method = "IV-GMM" weight_matrix_estimator = WEIGHT_MATRICES[weight_type] self._weight = weight_matrix_estimator(**weight_config) self._weight_type = weight_type self._weight_config = self._weight.config
(self, dependent: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], endog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], instruments: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, weight_type: str = 'robust', **weight_config: Any)
[ 0.0668303519487381, -0.05315549671649933, -0.01126705389469862, 0.00787591002881527, -0.0027340527158230543, -0.04712679609656334, -0.05440535023808479, -0.014970661140978336, -0.0079264547675848, 0.009962060488760471, -0.004510038066655397, 0.05003086477518082, -0.001946002128534019, 0.03670522943139076, -0.04164950177073479, 0.03771614283323288, 0.013353205285966396, -0.00942903570830822, 0.020567428320646286, -0.018435325473546982, -0.04194358363747597, -0.03782642260193825, -0.053853943943977356, 0.08101985603570938, 0.015154463239014149, 0.05672125518321991, -0.043818362057209015, -0.031117655336856842, 0.054846473038196564, -0.041171617805957794, -0.05815490707755089, -0.046354830265045166, -0.056941814720630646, 0.04157597944140434, 0.05602280795574188, -0.031595539301633835, 0.0013164808042347431, 0.04914861544966698, -0.08337252587080002, 0.04554609954357147, 0.05646393075585365, -0.06227206811308861, 0.0857987105846405, 0.0010436499724164605, -0.028801750391721725, 0.04348751902580261, -0.024353746324777603, 0.025548458099365234, 0.01885807141661644, -0.022901711985468864, 0.017690928652882576, -0.03845134750008583, 0.02356339804828167, 0.004461789969354868, -0.0568682961165905, 0.09373895078897476, 0.04606074467301369, 0.0406937301158905, 0.0707637146115303, -0.025088952854275703, -0.023177415132522583, -0.028452526777982712, 0.03495911508798599, -0.017920680344104767, -0.01473171915858984, 0.043230198323726654, -0.07521171867847443, 0.016284843906760216, 0.019409475848078728, 0.029849421232938766, 0.04539905861020088, -0.03297405317425728, -0.03413200378417969, 0.04819284752011299, 0.011846030130982399, 0.038230787962675095, -0.03532671555876732, -0.008404339663684368, -0.004454897716641426, -0.03310271352529526, 0.036300867795944214, 0.020659329369664192, -0.04808256775140762, -0.05242028832435608, -0.018821310251951218, -0.051758602261543274, -0.03681551292538643, -0.04231118783354759, 0.03302919492125511, -0.05661097168922424, -0.0939595103263855, 0.012084972113370895, 0.015439355745911598, 0.04712679609656334, 0.0815345048904419, -0.008592736907303333, -0.030860332772135735, -0.08969530463218689, 0.018536416813731194, -0.0024238869082182646, -0.0187110286206007, -0.028489287942647934, 0.023471496999263763, -0.013031551614403725, -0.02534627541899681, -0.07432947307825089, -0.0392233170568943, -0.03738529980182648, -0.005615146830677986, -0.07572636753320694, -0.043083157390356064, 0.018674269318580627, -0.045619621872901917, -0.009851779788732529, -0.03670522943139076, 0.055875763297080994, 0.017497936263680458, 0.01990574039518833, 0.01692815124988556, 0.03495911508798599, -0.007747248280793428, 0.006479015573859215, -0.059882644563913345, 0.036594949662685394, 0.02457430772483349, -0.027643799781799316, 0.011294623836874962, -0.00031849415972828865, 0.007269363384693861, -0.08204914629459381, -0.021872421726584435, -0.04550933837890625, -0.04727383702993393, 0.03227560594677925, -0.014639818109571934, 0.014529536478221416, 0.024206705391407013, 0.00218149833381176, 0.011616277508437634, 0.049405939877033234, 0.040877532213926315, 0.021284254267811775, 0.007205032743513584, 0.002722565084695816, 0.014492776244878769, 0.05745645985007286, 0.0013130345614627004, -0.013904610648751259, -0.014786859042942524, -0.01199307106435299, -0.024188324809074402, 0.0308051910251379, -0.005762188229709864, -0.04878101497888565, -0.01898673176765442, 0.0075266859494149685, -0.008091877214610577, 0.015329075045883656, 0.027074012905359268, -0.014501966536045074, -0.05491999536752701, 0.01883969083428383, 0.018591558560729027, -0.0027202675119042397, 0.011193533428013325, 0.0377529002726078, -0.027055634185671806, -0.009952870197594166, -0.029206115752458572, 0.02635718695819378, -0.028526049107313156, -0.11932416260242462, -0.03815726563334465, -0.026026343926787376, 0.009860970079898834, 0.06694063544273376, 0.03826754540205002, 0.032624829560518265, 0.035565659403800964, 0.038965992629528046, 0.06227206811308861, 0.00762777728959918, -0.08785729110240936, -0.022754669189453125, -0.0052659232169389725, 0.01929919421672821, 0.031577158719301224, 0.01023776363581419, 0.01825152523815632, -0.017654169350862503, 0.08094634115695953, -0.021615099161863327, 0.005628931801766157, -0.006120601668953896, 0.03962768241763115, 0.02725781500339508, 0.06833752989768982, -0.020824750885367393, -0.04859721288084984, 0.0719032883644104, 0.05907391756772995, -0.03710959479212761, -0.007057991344481707, -0.01791149191558361, -0.003556565847247839, 0.014768479391932487, -0.021578337997198105, -0.008257298730313778, -0.009245233610272408, -0.017341705039143562, 0.032367508858442307, 0.0030901688151061535, 0.002211366081610322, 0.02916935458779335, 0.04260526970028877, -0.008225132711231709, -0.02562197856605053, 0.04010556638240814, 0.003267077961936593, -0.018325045704841614, 0.06183094531297684, -0.0012176872696727514, -0.056353650987148285, -0.009337134659290314, 0.01974031887948513, -0.017847159877419472, 0.03771614283323288, -0.017792019993066788, -0.04017908498644829, 0.002796085784211755, 0.020585808902978897, -0.029095834121108055, 0.011947120539844036, -0.002311308402568102, 0.002456052228808403, -0.00015307248395401984, -0.03505101427435875, 0.01732332445681095, -0.040142327547073364, 0.0011097036767750978, 0.02133939601480961, 0.015715058892965317, -0.025897681713104248, 0.004413542337715626, 0.009677167981863022, -0.05462591350078583, 0.03826754540205002, 0.04326695576310158, -0.017121143639087677, -0.016680018976330757, 0.0017001671949401498, -0.04782524332404137, -0.05197916552424431, -0.005582981277257204, -0.0245926883071661, 0.03536347672343254, 0.015283124521374702, -0.03128307685256004, 0.03613544628024101, -0.07499115914106369, 0.0007375049754045904, -0.021449677646160126, -0.04021584615111351, 0.06774936616420746, -0.007062586490064859, 0.03721987456083298, 0.022166503593325615, -0.0076691326685249805, 0.019335955381393433, 0.003262483049184084, 0.01791149191558361, 0.053265780210494995, 0.006492800544947386, 0.0022848867811262608, -0.00836757943034172, 0.016983291134238243, -0.02064094878733158, -0.02209298312664032, -0.011726558208465576, 0.030106743797659874, 0.023692060261964798, -0.05080283433198929, 0.019207295030355453, 0.000009333688467449974, -0.04139217734336853, 0.00548189040273428, -0.026890212669968605, -0.03620896488428116, 0.02093503251671791, -0.020071163773536682, -0.006198717746883631, 0.07458679378032684, 0.0035450784489512444, 0.05286141484975815, 0.03988500311970711, -0.055471401661634445, 0.02444564737379551, 0.04727383702993393, 0.029059072956442833, 0.010292904451489449, 0.030290545895695686, -0.013279683887958527, -0.02064094878733158, -0.02431698516011238, -0.048817772418260574, -0.02503381296992302, 0.0983707532286644, -0.039113033562898636, -0.007016635965555906, 0.00407350854948163, 0.033231377601623535, 0.07013878971338272, -0.0209166519343853, 0.034536369144916534, 0.0107432184740901, -0.023214174434542656, 0.029095834121108055, -0.008960340172052383, 0.01986898109316826, 0.07771142572164536, 0.02622852474451065, 0.016238894313573837, -0.010954590514302254, -0.05275113508105278, -0.051648322492837906, 0.010256143286824226, 0.03427904471755028, -0.008592736907303333, 0.012673137709498405, 0.000935666321311146, -0.03948063775897026, -0.0014842000091448426, 0.04392864555120468, -0.02457430772483349, -0.03324975445866585, -0.022350305691361427, 0.035878121852874756, -0.010614557191729546, 0.02654098905622959, 0.007949430495500565, 0.029665619134902954, -0.037495579570531845, -0.03744043782353401, 0.03427904471755028, 0.0069660902954638, -0.07616748660802841, 0.013904610648751259, -0.06576430797576904, 0.026779931038618088, 0.04315667599439621, -0.05852251127362251, 0.03771614283323288, 0.015724249184131622, 0.046318069100379944, 0.01860993728041649, -0.012213633395731449, -0.03859838843345642, 0.005270518362522125, 0.011322194710373878, 0.010063151828944683, -0.04811932519078255, 0.03405848518013954, -0.01496147084981203, 0.03216532617807388, 0.011864409781992435, -0.04414920508861542, 0.041906822472810745, -0.004105674102902412, 0.031540397554636, 0.024408886209130287, 0.008533000946044922, -0.06576430797576904, -0.06962414085865021, 0.06690387427806854, 0.02565873973071575, 0.002460647374391556, -0.0792553648352623, -0.004902914632111788, 0.017736880108714104, -0.021431297063827515, 0.013812709599733353, -0.0022906307131052017, 0.028820130974054337, -0.004893724340945482, -0.027441617101430893, -0.014685768634080887, 0.08013761043548584, 0.053670141845941544, 0.013307254761457443, -0.012130922637879848, 0.002311308402568102, -0.03521643579006195, 0.0005100501584820449, -0.014272213913500309, -0.007986190728843212, -0.006414684932678938, -0.003407226875424385, -0.004227442666888237, -0.050913114100694656, -0.024427266791462898, -0.051795363426208496, -0.027937881648540497, -0.03672361001372337, 0.049442701041698456, -0.018095292150974274, -0.024776490405201912, -0.014538726769387722, 0.07800550758838654, 0.015126893296837807, -0.0011924145510420203, -0.025530077517032623, 0.04194358363747597, -0.0216518584638834, -0.007329098880290985, -0.03834106773138046, -0.03034568764269352, 0.05054550990462303, -0.02988618239760399, 0.006442255340516567, 0.04091429337859154, 0.051354240626096725, 0.05256733298301697, 0.08226971328258514, 0.006322783883661032, 0.014483586885035038, 0.015200413763523102, -0.035455379635095596, -0.036594949662685394, -0.007600206881761551, -0.03712797537446022, -0.06249263137578964, 0.10653156042098999, -0.02711077407002449, -0.00993449054658413, 0.017442796379327774, -0.005270518362522125, -0.026853451505303383, -0.015338265337049961, 0.024868391454219818, 0.004907509777694941, -0.0045697735622525215, -0.03962768241763115, 0.013849469833076, -0.02045714668929577, -0.06205150857567787, -0.03604354336857796, -0.03034568764269352, 0.030419208109378815, -0.031319838017225266, -0.04139217734336853, 0.06888893991708755, -0.007894289679825306, 0.031595539301633835, 0.015825340524315834, -0.017709309235215187, -0.02047552727162838, 0.0021849446929991245, -0.030603010207414627, 0.047935523092746735, -0.014161933213472366, -0.0436345599591732, -0.003676037071272731, -0.05168508365750313, -0.03744043782353401, -0.04697975516319275, 0.07646157592535019, 0.0748441144824028, -0.04091429337859154, -0.00923144817352295, 0.028930412605404854, 0.03859838843345642, 0.024831630289554596, 0.06609515100717545, -0.04878101497888565, -0.001045373035594821, 0.02565873973071575, -0.011404905468225479, -0.00710394186899066, 0.05157480016350746, -0.04992058500647545, 0.05697857588529587, 0.01898673176765442, 0.030547868460416794, 0.03222046419978142, -0.01851803809404373, 0.008312438614666462, 0.003999988082796335, -0.03005160391330719, 0.020383626222610474, -0.01479604933410883, -0.06256615370512009, 0.07330018281936646, 0.04900157451629639, 0.041759781539440155, 0.05852251127362251, 0.046906232833862305, 0.011781699024140835, -0.015926431864500046, 0.0712416023015976, 0.0046088313683867455, 0.03387468308210373, -0.03231236711144447, -0.048670731484889984, -0.058853354305028915, -0.021541578695178032, -0.04253175109624863, -0.04672243073582649, 0.01974031887948513, -0.042789071798324585, 0.0028650115709751844, -0.007172867655754089, 0.006524966098368168, 0.01280179899185896, 0.01900511234998703, 0.006097626872360706, -0.03598840534687042, -0.04907509684562683, 0.04164950177073479, -0.006240073125809431, -0.01273746881633997, 0.03433418646454811, 0.01245257630944252, 0.0031590943690389395, -0.018233144655823708, 0.035731080919504166, -0.011616277508437634, -0.04466385021805763, -0.05050875246524811, 0.0645512118935585, 0.027901122346520424, -0.01696491241455078, -0.03538185730576515, -0.004045938607305288, 0.07219737023115158, -0.02295685186982155, -0.006331974174827337, 0.05646393075585365, -0.017654169350862503, -0.016808679327368736, -0.03488559275865555, -0.025971202179789543, -0.04315667599439621, -0.01648702658712864, -0.012351484969258308, 0.015126893296837807, 0.02858118899166584, 0.0002933650102932006, 0.05804462730884552, -0.03819402679800987, -0.03405848518013954, -0.08653391152620316, -0.02253410778939724, -0.047678202390670776, 0.0400320440530777, 0.03944388031959534, -0.008018355816602707, 0.006272238213568926, -0.008969530463218689, 0.01833423599600792, 0.03962768241763115, -0.020990172401070595, -0.014336545020341873, 0.02178052067756653, -0.0008236620924435556, 0.026320425793528557, 0.027441617101430893, 0.012728278525173664, -0.01155194640159607, -0.036760371178388596, 0.002642151666805148, -0.0036990123335272074, -0.03977472335100174, 0.021559957414865494, 0.021578337997198105, -0.04006880521774292, 0.026926971971988678, -0.007990785874426365, 0.015071752481162548, -0.01339915581047535, -0.06429389119148254, -0.04164950177073479, 0.016036711633205414, 0.002867308910936117, -0.010127482004463673, 0.04142893850803375, -0.017350895330309868, -0.028526049107313156, 0.04065697267651558, -0.017654169350862503, 0.038524869829416275, -0.022221645340323448, -0.0024101019371300936, -0.03062138892710209, -0.0011476128129288554, -0.003402631962671876, 0.028764991089701653, -0.05054550990462303, -0.04433300718665123, 0.04025260731577873, 0.009530126117169857, -0.030419208109378815, 0.022166503593325615, 0.028783371672034264, 0.024960292503237724, -0.006442255340516567, -0.00905224122107029, -0.042936112731695175, 0.04201710596680641, -0.0023400273639708757, -0.030970612540841103, 0.023048752918839455, 0.01001720130443573, -0.00287190405651927, -0.001656514243222773, -0.012213633395731449, -0.021468056365847588, -0.06712444126605988, 0.05984588339924812, 0.06263967603445053, 0.003914979752153158, -0.00039402523543685675, -0.015568017028272152, -0.0002339165803277865, 0.016101043671369553, -0.0072463881224393845, 0.0014371008146554232, 0.002497407840564847, -0.10836957395076752, -0.003721987595781684, 0.0059368000365793705, 0.03018026426434517, -0.006603081710636616, 0.03685227409005165, -0.019115393981337547, 0.04153921827673912, -0.008703017607331276, 0.020677709951996803, 0.025585219264030457, 0.009704737924039364, 0.0328453928232193, -0.017837969586253166, 0.03589650243520737, 0.04672243073582649, 0.00359332631342113, 0.013049932196736336, -0.006138982251286507, -0.016707587987184525, -0.0010539888171479106, -0.009998820722103119, 0.013371584936976433, 0.00005991509897285141, -0.011588707566261292, -0.05771378427743912, -0.038230787962675095, -0.02163347788155079, 0.020696088671684265, -0.03444446995854378, 0.010789168998599052, 0.03981148079037666, -0.011303814128041267, -0.04914861544966698, 0.06660979241132736, 0.07466031610965729, 0.029426677152514458, 0.037477198988199234, 0.009998820722103119, 0.017396846786141396, -0.05639040842652321, 0.017939060926437378, -0.025144094601273537, 0.004574368707835674, -0.00012105075438739732, 0.0034049295354634523, 0.02121073380112648, -0.031742580235004425, -0.008454885333776474, 0.00782076921314001, 0.0007708190241828561, 0.007954025641083717, 0.02192756161093712, 0.09851779788732529, 0.04153921827673912, 0.03703607618808746, -0.05025142803788185, 0.03981148079037666, -0.061941225081682205, -0.054589152336120605, 0.023324456065893173, 0.004390567075461149, -0.03966443985700607, -0.055397879332304, -0.009805829264223576, 0.03582298383116722, -0.0524570494890213, 0.03297405317425728, -0.08697503805160522, -0.06962414085865021, -0.08351956307888031, 0.010228573344647884, -0.023618537932634354, 0.0178104005753994, 0.005426750052720308, -0.044259488582611084, 0.046906232833862305, 0.018279094249010086, 0.011524376459419727, -0.03966443985700607, -0.0005646163481287658, 0.021982701495289803, -0.07333694398403168, 0.03341517597436905, 0.027698939666152, 0.004202169831842184, -0.0462445467710495, 0.06300728023052216, 0.06069137528538704, 0.006368734408169985, 0.031540397554636, -0.07392510771751404, 0.006318188738077879, 0.005210782866925001, -0.01118434313684702, 0.06142657995223999, -0.03433418646454811, -0.030860332772135735, -0.027790840715169907, 0.029849421232938766, 0.007705892901867628, 0.050582271069288254, -0.010219383053481579, 0.02578740008175373, -0.008211348205804825, -0.03359897807240486, -0.017792019993066788, -0.008739778771996498, -0.03948063775897026, -0.03977472335100174, 0.011156773194670677, 0.022626008838415146, 0.05675801262259483, -0.03106251358985901, 0.022037843242287636, -0.018674269318580627, 0.003696714760735631, 0.007113131694495678, 0.035731080919504166, -0.00031705820583738387, -0.0023457712959498167, 0.05260409042239189, -0.0108259292319417, 0.03870867192745209, 0.0036415744107216597, 0.040436409413814545, -0.0015531256794929504, 0.07186652719974518, -0.0033658714964985847, 0.043818362057209015, -0.0359516441822052, -0.02503381296992302, -0.07322666049003601, -0.013491055928170681, -0.05109691619873047, 0.06263967603445053, -0.026835070922970772, -0.02238706685602665, 0.04223766550421715, 0.053706903010606766, 0.038230787962675095 ]
42,910
linearmodels.iv.model
_gmm_post_estimation
GMM-specific post-estimation results
def _gmm_post_estimation( self, params: Float64Array, weight_mat: Float64Array, iters: int ) -> dict[str, Any]: """GMM-specific post-estimation results""" instr = self._instr_columns gmm_specific = { "weight_mat": DataFrame(weight_mat, columns=instr, index=instr), "weight_type": self._weight_type, "weight_config": self._weight_type, "iterations": iters, "j_stat": self._j_statistic(params, weight_mat), } return gmm_specific
(self, params: numpy.ndarray, weight_mat: numpy.ndarray, iters: int) -> dict[str, typing.Any]
[ 0.11923440545797348, 0.0219858530908823, -0.021039264276623726, 0.031201694160699844, -0.04704365134239197, -0.038577936589717865, -0.04950835555791855, -0.0005533857620321214, 0.016368834301829338, 0.04636496677994728, -0.015109692700207233, 0.02866555191576481, -0.035756032913923264, 0.030451565980911255, -0.007577171549201012, -0.008947938680648804, -0.02084280177950859, 0.02561146393418312, 0.00320143299177289, -0.04782949760556221, -0.03704196587204933, -0.04057827591896057, 0.015252573415637016, 0.07565562427043915, -0.009135469794273376, -0.008688965812325478, -0.01688677817583084, -0.09587331861257553, 0.07451257109642029, 0.03121955320239067, -0.058581314980983734, -0.10301738232374191, 0.004067650530487299, -0.017708344385027885, 0.027183158323168755, -0.017610114067792892, -0.03020152449607849, 0.025057800114154816, -0.0842285007238388, -0.007648611906915903, 0.03200539946556091, -0.06647550314664841, 0.04311441630125046, -0.008300507441163063, 0.02468273602426052, 0.027272459119558334, 0.0238075889647007, -0.02791542373597622, 0.04772233963012695, -0.021575069054961205, 0.019771194085478783, -0.07879900932312012, 0.016395622864365578, 0.023325365036725998, -0.027790402993559837, 0.028504809364676476, 0.024254092946648598, 0.01199309527873993, 0.02066420018672943, -0.05661669746041298, 0.03541668877005577, -0.019235389307141304, 0.01176984328776598, 0.001975779887288809, 0.005536648444831371, 0.0062689147889614105, -0.006380540784448385, -0.02857625111937523, -0.01243066880851984, 0.017502954229712486, 0.03616681694984436, -0.06493952870368958, -0.009135469794273376, 0.038613658398389816, -0.020682061091065407, 0.018556702882051468, -0.02959427982568741, -0.040828317403793335, -0.008331762626767159, 0.04329301789402962, 0.022950300946831703, 0.024057630449533463, -0.050329919904470444, -0.03872082009911537, 0.005777760408818722, -0.04164988547563553, -0.035970356315374374, 0.019681893289089203, -0.017502954229712486, -0.09401586651802063, 0.006184079218655825, 0.011939514428377151, 0.07715587317943573, 0.02128930576145649, 0.04050683602690697, -0.008081721141934395, -0.05458064004778862, 0.02561146393418312, -0.008988123387098312, -0.0038756539579480886, 0.005688460078090429, 0.017735134810209274, 0.036720480769872665, -0.029201356694102287, 0.023128902539610863, -0.009912386536598206, 0.012546760030090809, -0.0719049870967865, -0.007228898350149393, -0.03409503772854805, -0.04247145354747772, -0.017878016456961632, -0.07544130086898804, -0.055938009172677994, 0.043900266289711, 0.01832452043890953, 0.009233701042830944, 0.010439261794090271, 0.0022526122629642487, 0.05100860819220543, -0.021610789000988007, 0.009090819396078587, -0.02866555191576481, 0.009135469794273376, -0.030237244442105293, -0.07937053591012955, 0.058581314980983734, 0.010903625749051571, 0.025557883083820343, -0.0692974105477333, -0.03682764247059822, -0.01220741681754589, -0.028022585436701775, 0.018485261127352715, -0.019949795678257942, 0.010939345695078373, -0.004808847326785326, 0.0021990318782627583, 0.03900658339262009, 0.013377257622778416, 0.014582817442715168, 0.018967486917972565, -0.054080553352832794, 0.036720480769872665, 0.002254844643175602, -0.03939950466156006, 0.031862519681453705, 0.08072790503501892, -0.001188816619105637, -0.05715250223875046, -0.006005477625876665, 0.020646341145038605, -0.0003650169528555125, -0.03604179620742798, 0.018467402085661888, -0.016350973397493362, 0.04075687751173973, 0.058581314980983734, -0.0215036291629076, 0.0004674337978940457, -0.014386355876922607, -0.05340186879038811, -0.00007234758959384635, 0.004465039353817701, 0.03600607439875603, 0.0560808926820755, -0.008599665015935898, 0.043614502996206284, -0.014020223170518875, -0.006367145571857691, -0.004465039353817701, -0.006728813983500004, -0.041042640805244446, -0.06540389358997345, 0.004938333295285702, 0.07322663813829422, 0.01921752840280533, 0.017011798918247223, -0.006067987997084856, 0.0219501331448555, 0.06976176798343658, -0.004413691349327564, -0.038756538182497025, -0.012037745676934719, -0.03943522647023201, -0.02036057785153389, 0.0037059825845062733, -0.025950808078050613, -0.03704196587204933, 0.02234305627644062, 0.03143387660384178, -0.0014321613125503063, 0.004590060096234083, 0.02225375548005104, 0.03620253875851631, 0.02693311683833599, 0.045114755630493164, 0.006023337598890066, 0.056330934166908264, 0.03779209032654762, -0.018395960330963135, -0.06279630959033966, -0.027540361508727074, 0.02641517110168934, -0.03395215794444084, -0.027879703789949417, -0.040471114218235016, 0.012350298464298248, -0.04089975729584694, 0.013707670383155346, -0.02764752134680748, -0.034559402614831924, 0.051687292754650116, 0.03414861857891083, 0.05443775653839111, -0.02561146393418312, 0.029951483011245728, 0.04668644815683365, 0.00029106473084539175, -0.059545762836933136, -0.013011123985052109, -0.019896214827895164, -0.030183663591742516, 0.008309437893331051, 0.040828317403793335, -0.021074984222650528, 0.010430331341922283, 0.01594911888241768, 0.0005034331697970629, 0.011841284111142159, 0.022271614521741867, -0.0080683259293437, -0.012600340880453587, -0.04800809919834137, 0.011207248084247112, -0.04404314607381821, -0.0261472687125206, -0.03418434038758278, 0.06090313196182251, 0.018244149163365364, 0.04054255411028862, 0.009104214608669281, -0.011984164826571941, 0.02441483363509178, 0.018270939588546753, -0.06133177876472473, 0.06590397655963898, 0.027451060712337494, -0.0003036226553376764, 0.01619023270905018, 0.04164988547563553, -0.01293968316167593, -0.003154550213366747, 0.023218203336000443, -0.0052196308970451355, 0.07158350944519043, -0.0020204302854835987, 0.08301400393247604, 0.04490043222904205, -0.03957810625433922, 0.04772233963012695, 0.006974391173571348, -0.023736147210001945, -0.01349334791302681, 0.0035898913629353046, 0.044543229043483734, 0.03395215794444084, 0.03452368080615997, -0.028022585436701775, 0.013529068790376186, -0.0020438716746866703, 0.015484755858778954, -0.04450751096010208, -0.057831186801195145, 0.002187869278714061, 0.05547364428639412, 0.0056616696529090405, -0.020503459498286247, -0.06483236700296402, -0.018717443570494652, 0.025415003299713135, -0.07247651368379593, 0.03377355635166168, -0.023307504132390022, -0.03939950466156006, 0.04200708866119385, 0.02048559859395027, 0.03170177713036537, 0.07601282745599747, -0.01996765471994877, -0.03136243298649788, -0.0052196308970451355, -0.012135975994169712, 0.01199309527873993, -0.012037745676934719, -0.0701904147863388, 0.011957374401390553, 0.0008695663418620825, 0.0018206196837127209, 0.039720989763736725, 0.029487118124961853, -0.03207683935761452, 0.027147438377141953, 0.019664032384753227, -0.030719468370079994, 0.06576109677553177, 0.04143556207418442, -0.023039601743221283, -0.025825785472989082, -0.05022276192903519, -0.0010314240353181958, 0.04654356837272644, -0.0025093520525842905, 0.00394486216828227, -0.005969757214188576, -0.04654356837272644, 0.013654089532792568, 0.0327555276453495, 0.026468751952052116, 0.06386791914701462, 0.024718455970287323, 0.024986358359456062, 0.02114642597734928, 0.0022113106679171324, 0.03850649669766426, -0.014957881532609463, 0.0011798866325989366, 0.0025294446386396885, 0.01136798970401287, 0.01247531920671463, -0.004777591675519943, -0.017627974972128868, 0.026111548766493797, 0.0048802876845002174, 0.017279701307415962, 0.02495063841342926, -0.004536479711532593, -0.017627974972128868, -0.019949795678257942, 0.006523421965539455, 0.0029513908084481955, -0.09673060476779938, 0.0056214844807982445, 0.016208091750741005, 0.03986386954784393, -0.02923707664012909, 0.0012044443283230066, 0.033987876027822495, -0.027879703789949417, 0.01808340847492218, -0.06590397655963898, 0.07937053591012955, 0.022468077018857002, 0.05211593583226204, 0.03170177713036537, -0.00625998480245471, -0.0019813610706478357, -0.019271109253168106, -0.01247531920671463, 0.031290993094444275, 0.014707839116454124, 0.06704702973365784, 0.03157675638794899, 0.01907464675605297, 0.04154272377490997, -0.023503966629505157, 0.033005569130182266, 0.018342381343245506, 0.05947432294487953, -0.04822242259979248, 0.034112900495529175, -0.03939950466156006, -0.05368763208389282, 0.07486977428197861, -0.0036657971795648336, 0.012260997667908669, -0.058045510202646255, -0.01718147099018097, -0.014484587125480175, -0.012903963215649128, -0.015413315035402775, -0.03355923295021057, 0.017627974972128868, 0.000901379797141999, 0.0514015294611454, -0.007862933911383152, 0.08051358908414841, 0.019003206863999367, -0.02459343522787094, -0.05850987136363983, -0.044757552444934845, -0.022986020892858505, -0.058795634657144547, 0.033148448914289474, -0.024807756766676903, 0.0130736343562603, -0.03295198827981949, -0.01637776382267475, -0.10030263662338257, -0.01234136801213026, -0.05340186879038811, -0.04315013810992241, -0.06869015842676163, 0.01880674436688423, -0.02398619055747986, -0.06333211809396744, -0.06422512233257294, 0.010921485722064972, 0.027093857526779175, -0.007086017169058323, -0.023736147210001945, -0.0014913231134414673, 0.007541451137512922, -0.006103708408772945, -0.0003279013035353273, 0.008456784300506115, 0.020985683426260948, -0.0247720368206501, 0.04236429184675217, 0.008827382698655128, 0.06368932127952576, 0.04061399772763252, 0.07558418065309525, 0.020128397271037102, -0.015788378193974495, -0.019842633977532387, -0.09808798134326935, -0.055795129388570786, -0.1047319546341896, 0.002067313063889742, -0.023468244820833206, -0.018270939588546753, -0.0031366900075227022, 0.022932440042495728, 0.007184247951954603, -0.008988123387098312, -0.035791754722595215, -0.014609607867896557, 0.026290150359272957, -0.0068404399789869785, -0.03722056746482849, -0.000406876701163128, -0.013546928763389587, -0.041221242398023605, 0.013770180754363537, -0.05311610549688339, 0.022682398557662964, -0.04125696048140526, -0.05772402510046959, -0.021575069054961205, 0.035756032913923264, -0.01382376067340374, 0.051115766167640686, -0.016368834301829338, 0.0541519932448864, 0.008287112228572369, 0.03739916905760765, -0.04482899233698845, 0.013520138338208199, 0.06186758354306221, 0.0006491050589829683, -0.005532183684408665, -0.06790431588888168, 0.04332873970270157, -0.013466558419167995, 0.06601113826036453, 0.01889604516327381, -0.022057292982935905, -0.02464701607823372, 0.05554508790373802, 0.02164650894701481, 0.02759394235908985, -0.02080708183348179, -0.04897255077958107, -0.07351240515708923, 0.000015400895790662616, -0.04536479711532593, -0.019574731588363647, 0.007880793884396553, 0.012002024799585342, 0.01413631346076727, -0.0019545708782970905, 0.04147128388285637, 0.03566673398017883, -0.0034715679939836264, -0.013975572772324085, 0.003393429797142744, -0.03480944409966469, 0.024236232042312622, -0.04432890936732292, -0.0256650447845459, -0.00788972433656454, 0.10437475144863129, 0.06961888819932938, -0.006835974752902985, 0.06129605695605278, 0.04693648964166641, -0.0018485261825844646, 0.06015300750732422, -0.04093547910451889, 0.043257299810647964, -0.018467402085661888, -0.0588313564658165, 0.0013517906190827489, -0.01619023270905018, -0.046043481677770615, -0.012162766419351101, 0.059902966022491455, -0.01349334791302681, 0.011734122410416603, -0.023378944024443626, -0.04872250556945801, -0.03218400105834007, 0.04504331573843956, -0.029772881418466568, -0.038613658398389816, -0.005491998046636581, -0.025218540802598, 0.010867904871702194, 0.014127383939921856, 0.06501097232103348, -0.002775021828711033, -0.03139815479516983, -0.039113741368055344, 0.0012725361157208681, 0.05847415328025818, -0.014118453487753868, 0.019628312438726425, 0.04450751096010208, 0.029844321310520172, -0.04315013810992241, 0.011537660844624043, 0.04597204178571701, 0.029862182214856148, 0.014288125559687614, -0.01106436736881733, 0.14845362305641174, -0.05686673894524574, -0.021253585815429688, -0.015511546283960342, 0.002926833229139447, -0.05311610549688339, 0.01243066880851984, -0.04611492529511452, 0.052794624119997025, 0.028951313346624374, -0.012359227985143661, 0.004795452114194632, 0.009948107413947582, -0.039328064769506454, -0.035756032913923264, 0.002665628446266055, -0.03629183769226074, 0.0224323570728302, 0.021485768258571625, 0.06458232551813126, 0.014966811053454876, 0.020146256312727928, 0.05007987841963768, 0.0018686188850551844, -0.017565464600920677, -0.04265005514025688, 0.03904230147600174, 0.01201095525175333, -0.0429358147084713, 0.016270602121949196, -0.019771194085478783, 0.03145173564553261, -0.09330146014690399, 0.008144231513142586, 0.0007211038027890027, -0.011823423206806183, 0.0392923429608345, -0.05122292786836624, 0.0031634801998734474, -0.019110366702079773, -0.015163272619247437, -0.012180626392364502, 0.011689472012221813, -0.047936659306287766, 0.0161366518586874, 0.06526101380586624, 0.013618369586765766, 0.038220733404159546, 0.009180120192468166, -0.0014198824064806104, -0.11466220766305923, -0.0027638592291623354, 0.00402523297816515, 0.018699584528803825, -0.05068712309002876, 0.01912822760641575, -0.009028309024870396, -0.037827812135219574, 0.032737668603658676, 0.04540051892399788, -0.026968836784362793, 0.008349623531103134, -0.023825448006391525, -0.0006602676585316658, 0.015279363840818405, 0.004547642543911934, 0.008956868201494217, -0.010421400889754295, 0.03604179620742798, -0.032701946794986725, -0.0072199683636426926, 0.0681186392903328, 0.005081214476376772, -0.01916394755244255, -0.017011798918247223, -0.015163272619247437, 0.004103370942175388, 0.007237828336656094, -0.01685105822980404, -0.029254935681819916, -0.02027127705514431, 0.0494726337492466, 0.055759407579898834, -0.01808340847492218, -0.006572537589818239, -0.02927279658615589, -0.006318030413240194, 0.006487702019512653, 0.05554508790373802, -0.021253585815429688, 0.005532183684408665, -0.03254120424389839, 0.014332775957882404, -0.023861169815063477, -0.009787365794181824, 0.02954069897532463, 0.09430162608623505, -0.05154441297054291, 0.03463084250688553, 0.008599665015935898, 0.017985178157687187, -0.024182651191949844, -0.03961382806301117, -0.00019115948816761374, 0.03184466063976288, 0.02030699886381626, -0.0007473359000869095, -0.030362265184521675, -0.03016580455005169, -0.0130914943292737, 0.02089638262987137, 0.003560868790373206, 0.03254120424389839, 0.03368425369262695, 0.015350804664194584, -0.027808263897895813, -0.027969004586338997, -0.03534524887800217, -0.004277507308870554, -0.02441483363509178, -0.044936154037714005, 0.05272318050265312, -0.05293750390410423, -0.02716529741883278, -0.045329079031944275, -0.008394273929297924, 0.015931259840726852, -0.045329079031944275, 0.01367194950580597, 0.0247720368206501, -0.042864374816417694, -0.025093520060181618, 0.056902457028627396, -0.033237751573324203, 0.015993770211935043, -0.000711615604814142, -0.02186083234846592, -0.01256462000310421, 0.004532014485448599, -0.003085342003032565, 0.030755190178751945, -0.003971652127802372, -0.04782949760556221, 0.008751477114856243, 0.07394104450941086, 0.04225713014602661, -0.002471399260684848, 0.06315351277589798, 0.04315013810992241, -0.01744937337934971, 0.003712679957970977, -0.00132165162358433, -0.033237751573324203, 0.0411497987806797, -0.015350804664194584, -0.05590229108929634, 0.09087247401475906, 0.018842464312911034, 0.0022950300481170416, 0.011323339305818081, -0.01889604516327381, -0.0054696728475391865, -0.0058090160600841045, -0.01837810128927231, -0.0458291620016098, 0.0015158808091655374, -0.014886440709233284, -0.014600678347051144, 0.0327555276453495, 0.010314240120351315, -0.018003037199378014, 0.0401853509247303, 0.007983489893376827, -0.059510041028261185, -0.02486133761703968, 0.0016855522990226746, 0.025897227227687836, 0.03464870527386665, 0.02645089104771614, 0.024754177778959274, 0.01711896061897278, 0.04404314607381821, -0.018226290121674538, -0.040292512625455856, -0.0005910595646128058, 0.022271614521741867, 0.0336485356092453, -0.0023106576409190893, -0.04936547204852104, -0.030612308531999588, 0.005581298843026161, -0.08158519864082336, 0.059724364429712296, 0.018788885325193405, -0.010582142509520054, -0.004826707299798727, 0.004750801715999842, -0.022396637126803398, -0.046972211450338364, -0.06422512233257294, 0.03993530943989754, -0.020110536366701126, -0.0066930935718119144, 0.07379816472530365, -0.049972716718912125, 0.04154272377490997, -0.028451228514313698, 0.016931427642703056, -0.03925662487745285, 0.042149968445301056, 0.005965292453765869, -0.019681893289089203, -0.00607245322316885, -0.007751307915896177, 0.10958991944789886, -0.00855948030948639, 0.005960827227681875, -0.0015348572051152587, 0.03209470212459564, 0.04854390397667885, 0.06622546166181564, -0.07115486264228821, 0.017654765397310257, -0.020324857905507088, -0.023593267425894737, -0.010769674554467201, 0.01298433355987072, -0.01709217019379139, -0.050008438527584076, 0.0066707683727145195, 0.01106436736881733, 0.041757047176361084 ]
42,911
linearmodels.iv.model
_j_statistic
J stat and test
def _j_statistic( self, params: Float64Array, weight_mat: Float64Array ) -> WaldTestStatistic: """J stat and test""" y, x, z = self._wy, self._wx, self._wz nobs, nvar, ninstr = y.shape[0], x.shape[1], z.shape[1] eps = y - x @ params g_bar = (z * eps).mean(0) stat = float(nobs * g_bar.T @ weight_mat @ g_bar.T) null = "Expected moment conditions are equal to 0" return WaldTestStatistic(stat, null, ninstr - nvar)
(self, params: numpy.ndarray, weight_mat: numpy.ndarray) -> linearmodels.shared.hypotheses.WaldTestStatistic
[ 0.10121874511241913, -0.0067999763414263725, 0.0552070327103138, 0.04724009335041046, 0.03962412104010582, -0.05103053152561188, -0.06384081393480301, 0.036325033754110336, -0.01048512477427721, 0.07166736572980881, -0.01134499255567789, 0.04825789853930473, 0.01414395123720169, -0.02458520419895649, -0.04302849620580673, 0.019531287252902985, 0.0105377696454525, 0.015424978919327259, -0.028814351186156273, 0.048749249428510666, -0.06468313187360764, -0.06338455528020859, 0.0529959462583065, 0.09679656475782394, 0.002199024660512805, -0.04825789853930473, 0.013705242425203323, -0.057558510452508926, 0.06036624312400818, -0.052364204078912735, -0.0731414258480072, -0.05141659453511238, -0.024655397981405258, -0.0001907009573187679, 0.0302182175219059, -0.0026190876960754395, 0.015609236434102058, 0.02253205142915249, -0.08009056001901627, -0.009037387557327747, 0.04611700028181076, -0.030007638037204742, 0.021198377013206482, -0.011309896595776081, 0.0015256076585501432, 0.007673005573451519, 0.036395229399204254, 0.02011038176715374, -0.0007469006231985986, -0.041203469038009644, 0.03167472779750824, -0.03829044848680496, -0.011423960328102112, 0.008949646726250648, -0.027708806097507477, 0.07152697443962097, 0.056961867958307266, 0.011941635981202126, 0.03309614211320877, -0.03972940891981125, 0.012634795159101486, -0.016820071265101433, 0.027884289622306824, 0.03365768864750862, -0.04495881125330925, 0.0008812550222501159, -0.028744157403707504, 0.01474059373140335, 0.026515521109104156, -0.0012185118393972516, 0.04632757976651192, 0.005909398663789034, 0.04453765228390694, 0.01858367770910263, -0.022847920656204224, 0.03130621463060379, -0.051802657544612885, -0.07707224786281586, -0.02507655881345272, -0.01812742091715336, 0.02402365766465664, 0.021321216598153114, -0.02018057554960251, -0.020356059074401855, 0.02488352730870247, 0.0028998609632253647, -0.019110126420855522, 0.005172369070351124, -0.018144968897104263, -0.007137781474739313, -0.03909767046570778, 0.025655653327703476, 0.04204579070210457, -0.05215362459421158, 0.048714153468608856, 0.05317142978310585, -0.012748858891427517, -0.0014543174766004086, -0.03713225945830345, 0.03597406670451164, 0.019303157925605774, -0.002167218364775181, 0.02193540707230568, 0.03727264329791069, -0.005132885184139013, -0.007800230756402016, -0.011669636704027653, -0.028305450454354286, 0.0020059929229319096, -0.026585714891552925, -0.013055955059826374, 0.023567402735352516, -0.0451342947781086, -0.04899492487311363, 0.06222636252641678, 0.023602498695254326, 0.02727009914815426, 0.010248222388327122, -0.016047943383455276, 0.055908966809511185, 0.041168373078107834, 0.02018057554960251, -0.008423196151852608, 0.011204605922102928, 0.05875179544091225, -0.036360133439302444, 0.004075598903000355, -0.014100080356001854, 0.020882507786154747, -0.014995045028626919, -0.01891709491610527, -0.014714271761476994, 0.012003054842352867, 0.02011038176715374, -0.017565874382853508, 0.025725845247507095, -0.054680585861206055, -0.03527213633060455, 0.05194304510951042, -0.00019974930910393596, 0.04022076353430748, -0.0028428288642317057, -0.05264497920870781, -0.017732582986354828, 0.007848489098250866, -0.027480678632855415, 0.012871697545051575, 0.0537329763174057, 0.01805722713470459, 0.006598170846700668, -0.010722027160227299, -0.03346465900540352, -0.012845374643802643, -0.0720183327794075, -0.003492116928100586, -0.062331654131412506, 0.057558510452508926, 0.014951174147427082, 0.04260733723640442, -0.008037133142352104, 0.007980101741850376, -0.07272026687860489, -0.029375897720456123, 0.05211852863430977, -0.0038255350664258003, 0.06794711947441101, -0.02690158411860466, 0.07047408074140549, -0.0638057142496109, -0.039834700524806976, -0.0063261715695261955, -0.01583736389875412, -0.02362004667520523, -0.008809260092675686, 0.0078353276476264, 0.045274682343006134, -0.011757378466427326, 0.01238911785185337, 0.026182102039456367, -0.04548526182770729, -0.002327346708625555, 0.01283660065382719, -0.055838774889707565, -0.028358094394207, -0.009072484448552132, 0.01096770353615284, 0.03790438547730446, -0.009809514507651329, -0.02051399275660515, 0.023567402735352516, -0.00796694029122591, -0.014187822118401527, 0.012178538367152214, 0.027638614177703857, 0.025585459545254707, 0.03944863751530647, 0.057032059878110886, 0.007028104737401009, -0.014336982741951942, 0.0365707129240036, -0.013143695890903473, -0.05313633009791374, -0.0001368906523566693, 0.007379071321338415, 0.03500891104340553, 0.001743864850141108, -0.016214653849601746, -0.012046925723552704, 0.007673005573451519, -0.060541726648807526, -0.028147514909505844, -0.00805029459297657, -0.038676511496305466, 0.03948373347520828, 0.017881743609905243, -0.041203469038009644, 0.032815370708703995, 0.019759414717555046, 0.028112418949604034, -0.03969431295990944, -0.021917859092354774, -0.0347105897963047, 0.007659844122827053, 0.019390899688005447, 0.00949364434927702, 0.0015990912215784192, 0.058295540511608124, 0.03951882943511009, -0.05257478356361389, -0.019759414717555046, 0.008550422266125679, -0.027550872415304184, 0.09609463065862656, -0.06103307753801346, -0.044713135808706284, -0.03653561323881149, -0.06506919115781784, 0.011564346961677074, -0.004422178026288748, 0.005518948659300804, -0.016688458621501923, -0.050609372556209564, 0.025655653327703476, 0.04123856499791145, 0.009370805695652962, -0.08086268603801727, 0.03786928951740265, -0.005080240312963724, 0.004847724922001362, -0.008379325270652771, -0.03383317217230797, 0.013731565326452255, 0.004610822536051273, -0.030007638037204742, -0.016758650541305542, 0.025796039029955864, 0.07938862591981888, 0.040466438978910446, 0.016311168670654297, -0.0578392818570137, -0.010213125497102737, -0.02965667098760605, 0.02951628528535366, 0.0004022405482828617, -0.05689167231321335, 0.032517049461603165, 0.03041124902665615, 0.036991871893405914, 0.001613349188119173, 0.030288411304354668, -0.027077067643404007, -0.0031959889456629753, -0.04387081414461136, -0.04969685897231102, -0.03741303086280823, -0.009581386111676693, 0.02895473875105381, -0.04201069101691246, -0.004553790669888258, 0.007993262261152267, -0.04373043030500412, -0.05875179544091225, 0.010300867259502411, 0.0466434508562088, -0.06310378015041351, 0.03514929860830307, 0.019899802282452583, 0.0008801582152955234, 0.017706261947751045, -0.003347343299537897, -0.03518439456820488, -0.015951428562402725, 0.017943164333701134, 0.0009794159559533, 0.0004995788913220167, -0.0485035739839077, -0.0005939011462032795, 0.0068131377920508385, 0.06250713765621185, 0.016548071056604385, 0.008633776567876339, -0.021444054320454597, 0.01134499255567789, -0.025462621822953224, -0.06506919115781784, 0.016548071056604385, -0.00949364434927702, -0.04745067283511162, 0.010414931923151016, 0.008633776567876339, 0.005663722287863493, 0.027410484850406647, -0.014714271761476994, 0.011625765822827816, -0.014644077979028225, -0.04429197683930397, -0.05018821358680725, -0.032288920134305954, 0.06577112525701523, 0.08114346116781235, 0.07040388137102127, -0.01093260757625103, 0.07840592414140701, 0.000004515609361988027, -0.051206015050411224, -0.044713135808706284, 0.018267806619405746, 0.03077976405620575, 0.017434261739253998, -0.022742630913853645, -0.015512720681726933, -0.025796039029955864, 0.06422687321901321, -0.028831899166107178, 0.00856358278542757, 0.046503063291311264, 0.020198123529553413, -0.046959321945905685, -0.012766406871378422, 0.003560116747394204, 0.010792220942676067, -0.07019330561161041, -0.03660580888390541, 0.049942534416913986, 0.02477823570370674, -0.04092269763350487, 0.016162008047103882, -0.013828081078827381, 0.022110890597105026, -0.005562819540500641, 0.005343465134501457, 0.06552544981241226, 0.024357076734304428, 0.026708552613854408, 0.004729273729026318, 0.037553418427705765, -0.00604539830237627, -0.01593388058245182, 0.000883448519743979, 0.03518439456820488, -0.0701231136918068, 0.039238058030605316, -0.009423451498150826, -0.01785542257130146, 0.017039423808455467, -0.04260733723640442, 0.08388099819421768, -0.010327190160751343, 0.003272762754932046, -0.060576822608709335, 0.01518807653337717, -0.05432961881160736, -0.05724263936281204, 0.022145988419651985, -0.009458547458052635, 0.05050408095121384, -0.01825025863945484, -0.024760687723755836, 0.01686394214630127, -0.07503664493560791, -0.01759219728410244, -0.041063081473112106, -0.03051653876900673, 0.006957911420613527, -0.02869151346385479, 0.0000419171919929795, -0.02358495071530342, 0.005948882550001144, -0.0765107050538063, -0.01270498801022768, -0.023690240457654, -0.0402909554541111, -0.00465469341725111, 0.028042225167155266, -0.008339841850101948, 0.06756105273962021, 0.056505609303712845, -0.0032530210446566343, -0.06289320439100266, 0.060541726648807526, -0.02190031111240387, -0.09307631850242615, -0.03776399791240692, 0.03313123807311058, -0.06447254866361618, -0.03720245137810707, -0.048187702894210815, 0.03892218694090843, -0.0447833277285099, 0.007172878365963697, -0.030235765501856804, 0.007558941375464201, -0.052855558693408966, 0.034008655697107315, -0.04692422226071358, 0.036325033754110336, -0.00973932072520256, -0.02600661851465702, 0.02981460653245449, 0.028972286731004715, 0.022777726873755455, -0.04667854681611061, 0.08402138203382492, 0.019934898242354393, 0.004422178026288748, -0.012046925723552704, -0.040501534938812256, -0.053417105227708817, -0.05320652574300766, 0.02216353639960289, -0.008677647449076176, 0.021022895351052284, -0.030990343540906906, -0.029446091502904892, 0.01795193739235401, -0.00979196559637785, -0.03481587767601013, 0.0009273193427361548, 0.030569184571504593, 0.016872715204954147, -0.0032025694381445646, 0.06356003880500793, 0.014696722850203514, 0.032517049461603165, -0.06401629000902176, -0.0006942556356079876, 0.03944863751530647, -0.035096652805805206, -0.07510683685541153, -0.023339273408055305, 0.033412013202905655, 0.016126912087202072, 0.05980469658970833, -0.026357585564255714, -0.024725591763854027, -0.017881743609905243, 0.005167982075363398, -0.041063081473112106, 0.02077721804380417, 0.004117276053875685, 0.026708552613854408, -0.0221986323595047, -0.052294012159109116, -0.014582659117877483, -0.0742645189166069, -0.010379835031926632, 0.030323507264256477, -0.04576603323221207, 0.010020093992352486, 0.06317397207021713, 0.02981460653245449, 0.04001018404960632, -0.022339019924402237, -0.02223372831940651, -0.0030490215867757797, 0.01444227248430252, -0.08423196524381638, -0.005290820263326168, 0.05103053152561188, 0.01888199895620346, -0.08851375430822372, 0.010625511407852173, 0.03534232825040817, 0.02891964092850685, 0.013942144811153412, -0.029235512018203735, -0.011643314734101295, -0.07103562355041504, 0.08739066123962402, -0.0757385790348053, -0.02011038176715374, 0.04495881125330925, 0.08900511264801025, 0.03309614211320877, -0.02600661851465702, 0.04843337833881378, 0.018794257193803787, 0.0031389568466693163, 0.013740339316427708, 0.02130366861820221, 0.048222798854112625, 0.016846392303705215, -0.06542015820741653, -0.027972031384706497, -0.013301631435751915, -0.1003764271736145, 0.04892473295331001, -0.03892218694090843, -0.02160198986530304, 0.014784464612603188, -0.011011574417352676, 0.03560555353760719, -0.0608224980533123, 0.011371315456926823, -0.015653107315301895, -0.06363023072481155, -0.01884690299630165, 0.009774417616426945, 0.0402909554541111, -0.014214144088327885, 0.02388327196240425, -0.016653360798954964, 0.0034986974205821753, 0.007462425623089075, 0.015416204929351807, 0.029095124453306198, -0.022145988419651985, 0.02137386053800583, 0.03428943082690239, 0.07854630798101425, -0.035693295300006866, -0.029709316790103912, -0.05092524364590645, 0.04257223755121231, -0.00038633737131021917, -0.04162462800741196, 0.06636776775121689, -0.028235256671905518, -0.049380987882614136, 0.006334945559501648, 0.006949136964976788, -0.03528968244791031, 0.03913276642560959, -0.05015311762690544, 0.035237040370702744, 0.07110581547021866, -0.02418159320950508, 0.029235512018203735, -0.009809514507651329, -0.04264243319630623, 0.023146241903305054, -0.004738048184663057, -0.05987488850951195, 0.06671873480081558, 0.02216353639960289, 0.027621066197752953, -0.006501654628664255, -0.0248133335262537, 0.02719990536570549, 0.02040870301425457, 0.007440490182489157, -0.026919132098555565, 0.012064474634826183, 0.028270352631807327, -0.042396754026412964, 0.004553790669888258, 0.07398374378681183, 0.013950918801128864, -0.07040388137102127, 0.028252804651856422, -0.00901106558740139, 0.044081393629312515, 0.017671164125204086, -0.00975686963647604, 0.00465469341725111, -0.04390591010451317, 0.04134385660290718, 0.03607935830950737, 0.010607963427901268, 0.009906030260026455, -0.013143695890903473, -0.009993772022426128, -0.004536242224276066, 0.032517049461603165, 0.014854658395051956, 0.031218472868204117, -0.04692422226071358, 0.007475587073713541, -0.006041011307388544, -0.003996631130576134, -0.001476252917200327, 0.010976477526128292, -0.0007052233559079468, -0.015960203483700752, -0.002904247958213091, 0.021321216598153114, -0.03741303086280823, 0.004808241501450539, 0.06338455528020859, 0.028112418949604034, -0.007778295315802097, -0.050574276596307755, -0.020847411826252937, -0.017285101115703583, 0.008958420716226101, -0.012196086347103119, 0.00622965581715107, 0.03797457739710808, 0.001853541936725378, -0.005189917515963316, 0.0298497024923563, -0.035237040370702744, 0.0068482342176139355, 0.008835582062602043, 0.006769266910851002, 0.011002800427377224, -0.014301885850727558, 0.03467549383640289, 0.058190248906612396, 0.008023971691727638, -0.011274799704551697, 0.04039624705910683, 0.032815370708703995, 0.023040952160954475, 0.03906257450580597, -0.03853612393140793, 0.020584186539053917, -0.05162717401981354, 0.044011201709508896, -0.03857121989130974, -0.015986524522304535, 0.02130366861820221, 0.04597661271691322, -0.03551781177520752, -0.021444054320454597, -0.03458775207400322, 0.004615209996700287, -0.07615973800420761, 0.002237411681562662, 0.06534996628761292, -0.0018217356409877539, 0.025287138298153877, 0.05131130665540695, 0.028200160712003708, -0.014995045028626919, 0.0034789557103067636, 0.006606944836676121, 0.017715035006403923, -0.010142932645976543, 0.0003572729474399239, -0.0026783132925629616, 0.025918876752257347, -0.013363050296902657, 0.02574339509010315, 0.02846338413655758, -0.01209079660475254, -0.030498990789055824, 0.012503182515501976, 0.00840126071125269, 0.011810023337602615, -0.018004583194851875, 0.006387590896338224, -0.006541138514876366, -0.0012876084074378014, 0.02362004667520523, -0.009669127874076366, 0.008282809518277645, -0.010757124051451683, 0.02004018798470497, -0.04383571818470955, 0.014995045028626919, 0.03614955022931099, 0.04597661271691322, -0.04555545374751091, -0.028112418949604034, 0.008107326924800873, 0.022181084379553795, 0.05903257057070732, 0.017504455521702766, -0.013538533821702003, 0.09946390986442566, 0.038150060921907425, 0.017381617799401283, -0.008493389934301376, 0.05959411710500717, -0.017943164333701134, -0.03332427144050598, -0.017776453867554665, -0.006334945559501648, -0.013871951960027218, -0.10276299715042114, -0.0225671473890543, 0.039904892444610596, 0.0244448184967041, 0.04853866994380951, -0.02626984380185604, -0.010713253170251846, 0.08037133514881134, 0.008023971691727638, -0.029147770255804062, -0.030604280531406403, -0.0021266378462314606, -0.02925305999815464, 0.01313492190092802, 0.06598170846700668, 0.014907303266227245, 0.013240211643278599, 0.0052644978277385235, 0.0518728531897068, -0.09532250463962555, -0.012503182515501976, 0.016144460067152977, 0.01356485579162836, -0.02716480940580368, 0.02249695360660553, 0.08928588032722473, -0.019952446222305298, -0.008431971073150635, 0.016609489917755127, 0.023216435685753822, 0.0013216083170846105, 0.010985252447426319, 0.013126147910952568, 0.028533577919006348, -0.0361846499145031, -0.0014938012463971972, -0.006413913331925869, -0.042396754026412964, 0.016311168670654297, -0.004029534291476011, -0.05331181362271309, -0.004558177664875984, -0.025006365031003952, 0.004299339838325977, -0.02242676168680191, -0.006159462500363588, -0.00014559626288246363, -0.006606944836676121, 0.033078595995903015, 0.09335709363222122, -0.026620810851454735, 0.05401374772191048, -0.03972940891981125, -0.03611445426940918, 0.01096770353615284, 0.026287391781806946, -0.005580367520451546, -0.013257760554552078, 0.006356881000101566, -0.06092778965830803, 0.06794711947441101, -0.07229910045862198, -0.001585930003784597, -0.007980101741850376, 0.07159717381000519, 0.030656926333904266, 0.013652597554028034, -0.041203469038009644, -0.028831899166107178, -0.037553418427705765, -0.028831899166107178, 0.0038321157917380333, 0.0036149551160633564, 0.03857121989130974, -0.11104580760002136, 0.046467967331409454, -0.012713762000203133, 0.02712971158325672 ]
42,914
linearmodels.iv.model
estimate_parameters
Parameters ---------- x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) w : ndarray GMM weight matrix (ninstr by ninstr) Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed as a static method to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking.
@staticmethod def estimate_parameters( x: Float64Array, y: Float64Array, z: Float64Array, w: Float64Array ) -> Float64Array: """ Parameters ---------- x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) w : ndarray GMM weight matrix (ninstr by ninstr) Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed as a static method to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking. """ xpz = x.T @ z zpy = z.T @ y return inv(xpz @ w @ xpz.T) @ (xpz @ w @ zpy)
(x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, w: numpy.ndarray) -> numpy.ndarray
[ 0.03233296051621437, 0.010165287181735039, 0.03783483803272247, 0.031014015898108482, 0.022874251008033752, -0.024268561974167824, -0.06538192182779312, -0.05622468143701553, -0.0004124642873648554, 0.05385058373212814, -0.006467534229159355, -0.011898755095899105, -0.0073295580223202705, 0.03819283843040466, -0.07943809032440186, 0.03429253399372101, -0.023910563439130783, -0.01090954802930355, -0.02756592072546482, -0.01594037562608719, -0.05008217319846153, -0.0693010687828064, -0.007390794809907675, 0.11403209716081619, -0.0017958830576390028, 0.003968607168644667, 0.008554290980100632, -0.05241858586668968, 0.020632047206163406, -0.008902869187295437, -0.041377145797014236, -0.04390197992324829, -0.03139085695147514, -0.016109954565763474, 0.03329390659928322, -0.02960086241364479, 0.027396343648433685, 0.010438496246933937, -0.09473783522844315, -0.0504213310778141, 0.03881462663412094, -0.06504276394844055, 0.08531680703163147, -0.007800609339028597, -0.012840857729315758, 0.006053009070456028, -0.014197485521435738, -0.03027917630970478, -0.02349603734910488, 0.010843600146472454, 0.05954088270664215, -0.07548125833272934, 0.025399085134267807, -0.014508379623293877, -0.035856422036886215, 0.0618772953748703, 0.05102427676320076, 0.03338811546564102, 0.06643707305192947, -0.09217531234025955, 0.02176256850361824, -0.06410066038370132, -0.02078278362751007, 0.022327831014990807, 0.010655179619789124, 0.021536463871598244, -0.04047272726893425, -0.009486973285675049, 0.030769070610404015, 0.04239461570978165, 0.03600715845823288, -0.00510619580745697, 0.004710512701421976, -0.027678973972797394, 0.004244172014296055, 0.07529284060001373, -0.03904072940349579, -0.07220274209976196, -0.0042983428575098515, -0.027471711859107018, 0.00020976502855774015, 0.03564916178584099, -0.030090756714344025, -0.00044749872176907957, 0.0011370000429451466, -0.03634631633758545, -0.0011169803328812122, -0.021216150373220444, 0.00021800842660013586, -0.06131203472614288, -0.04525860771536827, 0.024965718388557434, 0.05121269449591637, 0.019614575430750847, 0.00833289697766304, -0.01909641921520233, -0.020500151440501213, -0.023307617753744125, -0.011474809609353542, 0.018889157101511955, -0.012454596348106861, 0.011361757293343544, 0.01120159961283207, 0.049516912549734116, -0.005082643590867519, -0.04484408348798752, 0.012652437202632427, -0.04525860771536827, 0.003563503036275506, -0.03770294412970543, -0.02720792219042778, 0.008879316970705986, -0.027641288936138153, -0.06021919474005699, 0.007871267385780811, 0.01978415437042713, -0.05283311381936073, 0.06131203472614288, -0.005205116700381041, 0.005214537959545851, 0.03638400137424469, 0.04819796606898308, -0.03331274539232254, 0.017070898786187172, 0.019633417949080467, -0.06734149158000946, 0.04480639845132828, -0.000397743919165805, 0.02622813545167446, -0.05174027383327484, -0.025964347645640373, -0.03027917630970478, -0.0415278822183609, 0.02178141102194786, 0.018502894788980484, 0.04043504223227501, 0.027320975437760353, -0.012134280987083912, 0.048047229647636414, -0.04902701824903488, 0.018239105120301247, 0.10272686183452606, -0.03195611760020256, 0.03595063462853432, -0.02419319376349449, 0.0028333733789622784, 0.06903727352619171, -0.0023057961370795965, 0.016439689323306084, 0.00800787191838026, -0.016091112047433853, -0.012294438667595387, -0.007103453390300274, -0.049516912549734116, -0.004729354754090309, -0.0374014712870121, 0.02554982155561447, 0.0035564370919018984, 0.020895835012197495, -0.025757083669304848, -0.07310716062784195, 0.009684814140200615, -0.04454261064529419, -0.014621431939303875, 0.025041086599230766, 0.05991772189736366, -0.022158252075314522, 0.0434497706592083, -0.0012082465691491961, -0.026962975040078163, 0.003320911666378379, -0.042356930673122406, -0.06575875729322433, -0.05682762712240219, -0.017466582357883453, 0.03024149313569069, -0.03027917630970478, -0.02409898303449154, 0.009114841930568218, 0.019539207220077515, 0.06624865531921387, -0.0281877089291811, -0.020179837942123413, -0.033463481813669205, -0.003558792406693101, 0.0038343574851751328, 0.031824223697185516, -0.025757083669304848, -0.013980802148580551, -0.010645759291946888, -0.017466582357883453, -0.03579989820718765, -0.002336414298042655, 0.006867927964776754, 0.004121698904782534, 0.027113711461424828, 0.03097633272409439, 0.020876992493867874, 0.03694926202297211, 0.007367242127656937, 0.01360396109521389, -0.03468821570277214, 0.016072269529104233, 0.005238090176135302, 0.0033868588507175446, -0.013293066993355751, 0.01204949151724577, -0.03578105568885803, -0.009449289180338383, 0.03495200723409653, 0.03647821024060249, 0.0023905853740870953, 0.01157844066619873, 0.013283646665513515, 0.04650218412280083, 0.05339837446808815, 0.015827322378754616, 0.01869131438434124, 0.07114758342504501, -0.03595063462853432, 0.033162008970975876, -0.026378871873021126, -0.03953062370419502, -0.004359579645097256, 0.04126409441232681, -0.059314776211977005, 0.031786542385816574, 0.02521066553890705, -0.02110309712588787, -0.06225413829088211, 0.016194744035601616, -0.02686876617372036, 0.003250253852456808, -0.05204174667596817, 0.025738243013620377, -0.05841035768389702, -0.06764296442270279, -0.022365514189004898, 0.04352513700723648, -0.020274046808481216, -0.016505636274814606, 0.02379751019179821, -0.04054809361696243, 0.06440213322639465, -0.012878541834652424, -0.016157058998942375, 0.029751598834991455, 0.045409344136714935, 0.011154494248330593, -0.0190681554377079, -0.0016345479525625706, -0.013142330572009087, -0.017108581960201263, 0.035159267485141754, -0.04073651507496834, 0.054227422922849655, 0.07589578628540039, 0.04966764897108078, 0.03811746835708618, -0.07404926419258118, -0.003335043089464307, -0.01225675456225872, -0.0340099036693573, -0.0007053993176668882, -0.006236718967556953, 0.017457161098718643, 0.014385906048119068, 0.03024149313569069, -0.020274046808481216, 0.03578105568885803, 0.03512158244848251, 0.10626917332410812, -0.05603625997900963, -0.051137328147888184, 0.030090756714344025, 0.05735520273447037, 0.07156211137771606, -0.044015031307935715, 0.019190629944205284, 0.0058504571206867695, -0.02308151312172413, -0.0633469745516777, -0.010381970554590225, 0.008097372017800808, 0.014348221942782402, -0.005690299440175295, -0.009731919504702091, 0.00042424057028256357, 0.03088212199509144, -0.02615276724100113, 0.02345835417509079, 0.0048424070701003075, 0.03255906328558922, -0.02485266514122486, 0.053888268768787384, -0.015507007949054241, 0.0033326877746731043, 0.006604139227420092, 0.03088212199509144, 0.05498110502958298, 0.01004281360656023, 0.05893793702125549, 0.014753325842320919, 0.011710334569215775, -0.034122955054044724, 0.012605332769453526, 0.027961604297161102, -0.025059929117560387, -0.020537836477160454, -0.0054924581199884415, -0.007414347026497126, 0.03870157524943352, -0.022535093128681183, 0.0009362144046463072, -0.02656729333102703, -0.05174027383327484, -0.016844794154167175, 0.04921543970704079, 0.026002030819654465, 0.05581015720963478, 0.07212737202644348, 0.028508024290204048, 0.06832128018140793, -0.023985931649804115, -0.00013653127825818956, -0.01771152764558792, -0.02238435670733452, 0.0024212035350501537, 0.00919963140040636, -0.009571761824190617, -0.029676230624318123, -0.006415718700736761, -0.0035941211972385645, 0.02180025354027748, -0.007508557289838791, 0.03907841444015503, 0.034122955054044724, 0.025681715458631516, 0.027792025357484818, 0.028150025755167007, -0.011229862459003925, -0.010127603076398373, -0.06477897614240646, 0.008262239396572113, -0.029318232089281082, -0.04872554540634155, 0.0214045699685812, 0.017070898786187172, -0.009307973086833954, 0.06293245404958725, -0.055923208594322205, 0.02481498196721077, 0.08908522129058838, 0.04733123257756233, -0.0035917661152780056, 0.051551852375268936, -0.02377866953611374, -0.006170772016048431, 0.04454261064529419, 0.018757261335849762, -0.06587181240320206, 0.0822267159819603, -0.016778847202658653, -0.0034268980380147696, 0.018625367432832718, -0.05121269449591637, 0.004062817431986332, 0.0020914676133543253, -0.005751536227762699, -0.0361202135682106, -0.00724005838856101, -0.06500507891178131, -0.039266835898160934, 0.05309690162539482, 0.00919963140040636, 0.019284838810563087, -0.08403555303812027, -0.037646420300006866, 0.017871685326099396, 0.0072965845465660095, 0.0016604558331891894, -0.03783483803272247, 0.05893793702125549, 0.01769268698990345, 0.015252640470862389, 0.010956652462482452, -0.0010545661207288504, 0.007084611337631941, -0.019595732912421227, -0.02924286387860775, -0.008427107706665993, -0.004039264749735594, -0.021574148908257484, 0.03830588981509209, -0.032144539058208466, 0.008827500976622105, 0.015337429940700531, 0.03915378451347351, -0.08117155730724335, -0.0033326877746731043, -0.06368613243103027, -0.03059949167072773, -0.027057185769081116, 0.034914322197437286, -0.02112193964421749, -0.05618699640035629, -0.017626740038394928, 0.04220619425177574, 0.014159801416099072, 0.021630674600601196, -0.06662549078464508, 0.01740063540637493, 0.05339837446808815, -0.019633417949080467, -0.007395504973828793, 0.02144225500524044, 0.009882655926048756, 0.00835173949599266, 0.02485266514122486, 0.033162008970975876, 0.09865698218345642, -0.042997561395168304, 0.0489516481757164, 0.056300051510334015, 0.016854215413331985, -0.013961960561573505, -0.048122599720954895, -0.08599512279033661, -0.01255822740495205, -0.02521066553890705, -0.030109597370028496, -0.033124327659606934, -0.03221990913152695, -0.01175743993371725, 0.03184306621551514, 0.017438318580389023, 0.02317572385072708, 0.04220619425177574, -0.03504621610045433, -0.006034167017787695, 0.0035611477214843035, 0.028489181771874428, -0.00441139517351985, -0.03297359123826027, -0.1203630268573761, -0.02383519522845745, 0.05245627090334892, -0.030053071677684784, -0.09971213340759277, -0.058636464178562164, 0.05128806456923485, 0.0374956838786602, 0.062103401869535446, -0.011295809410512447, 0.04589923843741417, -0.025926662608981133, 0.023269932717084885, -0.037250734865665436, -0.0001293183013331145, 0.028131183236837387, 0.03323737904429436, -0.02310035564005375, -0.03742031380534172, -0.01740063540637493, -0.019444996491074562, 0.0599554069340229, 0.0037165945395827293, -0.002470663981512189, 0.015751954168081284, 0.019256576895713806, 0.020990045741200447, 0.037571050226688385, -0.0281877089291811, -0.011616124771535397, 0.03093864768743515, 0.035894107073545456, -0.011917597614228725, 0.07118526846170425, 0.02172488532960415, -0.03732610493898392, -0.04589923843741417, -0.010815337300300598, -0.002236315980553627, 0.058372676372528076, 0.007550952024757862, -0.002969978377223015, 0.009722498245537281, -0.010099339298903942, 0.029337074607610703, -0.018606524914503098, 0.02172488532960415, 0.06662549078464508, 0.05988004058599472, 0.056902993470430374, -0.050195224583148956, 0.007103453390300274, 0.017070898786187172, -0.020255206152796745, 0.04175398498773575, 0.007762925233691931, 0.01661868952214718, -0.04081188514828682, -0.0563754178583622, -0.043713558465242386, -0.006764296442270279, -0.013566276989877224, -0.0599554069340229, 0.04107567295432091, -0.008083240129053593, 0.03088212199509144, -0.05238090455532074, -0.025738243013620377, -0.032483696937561035, 0.021687200292944908, 0.00015036840341053903, 0.011126231402158737, 0.009788446128368378, 0.021329201757907867, 0.030674859881401062, 0.006750165019184351, 0.023401828482747078, -0.001964283874258399, -0.007560373283922672, -0.02997770346701145, 0.0374956838786602, 0.0504213310778141, -0.049177754670381546, -0.028055815026164055, 0.03851315379142761, 0.061387404799461365, -0.042620718479156494, -0.02620929293334484, -0.002139750402420759, 0.01188933476805687, 0.01448011677712202, -0.02210172638297081, 0.027415184304118156, -0.06410066038370132, -0.01464027352631092, 0.023533722385764122, 0.005633773282170296, -0.03734494745731354, 0.017834002152085304, -0.035234637558460236, 0.009114841930568218, 0.043374400585889816, -0.017871685326099396, 0.03664778918027878, 0.006750165019184351, 0.0062272981740534306, -0.031409699469804764, -0.02960086241364479, 0.018615946173667908, 0.03495200723409653, -0.006453402806073427, -0.000283661182038486, -0.03677968308329582, -0.036572422832250595, -0.03668547421693802, 0.027038343250751495, -0.016251269727945328, -0.04763270542025566, 0.06583412736654282, 0.03027917630970478, -0.04718049615621567, 0.0333692729473114, 0.042017776519060135, 0.0019925469532608986, -0.05147648602724075, 0.024230878800153732, -0.042997561395168304, 0.03668547421693802, 0.019444996491074562, 0.024381615221500397, -0.028319602832198143, 0.019162366166710854, 0.05272005870938301, -0.04891396686434746, -0.014734484255313873, -0.02078278362751007, 0.04412808269262314, 0.002842794405296445, -0.009722498245537281, -0.041301775723695755, 0.032106854021549225, -0.012228491716086864, -0.06862275302410126, 0.006575875915586948, -0.020556678995490074, 0.027773184701800346, -0.04054809361696243, 0.08674880117177963, -0.032841697335243225, -0.0052004060707986355, 0.028413813561201096, 0.010570391081273556, -0.04989375174045563, 0.013180014677345753, 0.010193550027906895, -0.026774555444717407, -0.03768410161137581, -0.006948006339371204, 0.010918968357145786, -0.010127603076398373, 0.003780186641961336, -0.04593691974878311, -0.0517025887966156, -0.008639080449938774, 0.0026920579839497805, -0.07529284060001373, 0.009128973819315434, -0.0746145248413086, -0.0009644774836488068, -0.018201421946287155, -0.00602945638820529, 0.012501700781285763, -0.0489516481757164, 0.044731028378009796, 0.05550868436694145, -0.002534255851060152, -0.0012683055829256773, 0.00028174754697829485, -0.02208288386464119, 0.007466163020581007, 0.022177094593644142, 0.012322701513767242, 0.016232427209615707, -0.0684720128774643, 0.012407490983605385, -0.016562163829803467, 0.02244088239967823, 0.031786542385816574, 0.10076729208230972, -0.002842794405296445, 0.017193371430039406, -0.02317572385072708, 0.005831615068018436, -0.01274664793163538, -0.048084914684295654, -0.013481487520039082, 0.014555484987795353, 0.06877348572015762, 0.012106018140912056, 0.0035870554856956005, 0.03129664808511734, 0.017240477725863457, -0.00680669117718935, -0.026962975040078163, 0.017881106585264206, 0.013330751098692417, -0.01771152764558792, -0.015525850467383862, -0.04228156432509422, 0.03319969400763512, 0.044316504150629044, -0.005803351756185293, -0.07442609965801239, 0.027942761778831482, 0.023646773770451546, -0.01593095436692238, 0.012332122772932053, 0.010118181817233562, -0.031032858416438103, -0.03461284935474396, -0.035234637558460236, 0.02824423462152481, -0.04751965403556824, 0.00903005339205265, 0.014150380156934261, -0.05603625997900963, 0.02411782555282116, 0.028018129989504814, 0.0227800402790308, -0.024965718388557434, 0.017428897321224213, -0.0373072624206543, -0.013029278255999088, -0.028639918193221092, 0.006750165019184351, -0.005228669382631779, 0.08184987306594849, 0.00903005339205265, 0.05332300439476967, 0.0012706608977168798, 0.04488176479935646, -0.06734149158000946, -0.029054442420601845, -0.009703656658530235, 0.014159801416099072, 0.05162722244858742, -0.05241858586668968, -0.03457516431808472, 0.03564916178584099, 0.00245888764038682, 0.03561147674918175, -0.07785535603761673, -0.005459484178572893, -0.029393600299954414, 0.02170604281127453, -0.04789649322628975, -0.046803656965494156, -0.01770210638642311, -0.04529629275202751, 0.042959876358509064, 0.0027886235620826483, 0.02210172638297081, 0.001131111872382462, -0.003346819430589676, 0.0251164548099041, -0.05735520273447037, -0.025323716923594475, -0.030411070212721825, 0.024739613756537437, -0.03476358577609062, 0.053549110889434814, 0.062103401869535446, 0.032464854419231415, 0.010268918238580227, -0.008445949293673038, 0.06813285499811172, 0.02381635271012783, 0.0733332633972168, 0.03480127081274986, 0.005775088910013437, -0.06357308477163315, 0.0032667405903339386, 0.020500151440501213, -0.03191843628883362, 0.015365692786872387, -0.010089918971061707, 0.0204436257481575, -0.004724644590169191, 0.032427169382572174, 0.030486438423395157, -0.02686876617372036, 0.024607719853520393, 0.0027956892736256123, -0.06410066038370132, -0.017259318381547928, 0.0462007112801075, -0.015431639738380909, 0.03815515339374542, 0.0028639917727559805, -0.010966073721647263, -0.024325087666511536, 0.040887251496315, 0.003514042589813471, -0.05038364604115486, 0.02992117777466774, -0.06349771469831467, 0.07378547638654709, -0.03056180663406849, 0.007466163020581007, -0.016760004684329033, 0.058674149215221405, 0.021687200292944908, 0.049177754670381546, -0.062442559748888016, -0.04115103930234909, -0.02896023355424404, -0.05927709490060806, 0.033124327659606934, 0.010570391081273556, 0.025229506194591522, -0.07009243220090866, -0.030863279476761818, 0.035554949194192886, 0.039643675088882446 ]
42,915
linearmodels.iv.model
fit
Estimate model parameters Parameters ---------- iter_limit : int Maximum number of iterations. Default is 2, which produces two-step efficient GMM estimates. Larger values can be used to iterate between parameter estimation and optimal weight matrix estimation until convergence. tol : float Convergence criteria. Measured as covariance normalized change in parameters across iterations where the covariance estimator is based on the first step parameter estimates. initial_weight : ndarray Initial weighting matrix to use in the first step. If not specified, uses the average outer-product of the set containing the exogenous variables and instruments. cov_type : str Name of covariance estimator to use. Available covariance functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity but not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional parameters to pass to covariance estimator. Supported parameters depend on specific covariance structure assumed. See :class:`linearmodels.iv.gmm.IVGMMCovariance` for details on the available options. Defaults are used if no covariance configuration is provided. Returns ------- IVGMMResults Results container See also -------- linearmodels.iv.gmm.IVGMMCovariance
def fit( self, *, iter_limit: int = 2, tol: float = 1e-4, initial_weight: Float64Array | None = None, cov_type: str = "robust", debiased: bool = False, **cov_config: Any, ) -> OLSResults | IVGMMResults: """ Estimate model parameters Parameters ---------- iter_limit : int Maximum number of iterations. Default is 2, which produces two-step efficient GMM estimates. Larger values can be used to iterate between parameter estimation and optimal weight matrix estimation until convergence. tol : float Convergence criteria. Measured as covariance normalized change in parameters across iterations where the covariance estimator is based on the first step parameter estimates. initial_weight : ndarray Initial weighting matrix to use in the first step. If not specified, uses the average outer-product of the set containing the exogenous variables and instruments. cov_type : str Name of covariance estimator to use. Available covariance functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity but not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. **cov_config Additional parameters to pass to covariance estimator. Supported parameters depend on specific covariance structure assumed. See :class:`linearmodels.iv.gmm.IVGMMCovariance` for details on the available options. Defaults are used if no covariance configuration is provided. Returns ------- IVGMMResults Results container See also -------- linearmodels.iv.gmm.IVGMMCovariance """ wy, wx, wz = self._wy, self._wx, self._wz nobs = wy.shape[0] weight_matrix = self._weight.weight_matrix k_wz = wz.shape[1] if initial_weight is not None: initial_weight = asarray(initial_weight) if initial_weight.ndim != 2 or initial_weight.shape != (k_wz, k_wz): raise ValueError(f"initial_weight must be a {k_wz} by {k_wz} array") wmat = inv(wz.T @ wz / nobs) if initial_weight is None else initial_weight _params = params = self.estimate_parameters(wx, wy, wz, wmat) iters, norm = 1, 10 * tol + 1 vinv = eye(params.shape[0]) while iters < iter_limit and norm > tol: eps = wy - wx @ params wmat = inv(weight_matrix(wx, wz, eps)) params = self.estimate_parameters(wx, wy, wz, wmat) delta = params - _params if iters == 1: xpz = wx.T @ wz / nobs v = (xpz @ wmat @ xpz.T) / nobs vinv = inv(v) _params = params norm = float(squeeze(delta.T @ vinv @ delta)) iters += 1 cov_config["debiased"] = debiased cov_estimator = IVGMMCovariance( wx, wy, wz, params, wmat, cov_type, **cov_config ) results = self._post_estimation(params, cov_estimator, cov_type) gmm_pe = self._gmm_post_estimation(params, wmat, iters) results.update(gmm_pe) return IVGMMResults(results, self)
(self, *, iter_limit: int = 2, tol: float = 0.0001, initial_weight: Optional[numpy.ndarray] = None, cov_type: str = 'robust', debiased: bool = False, **cov_config: Any) -> linearmodels.iv.results.OLSResults | linearmodels.iv.results.IVGMMResults
[ 0.09244108200073242, -0.017875459045171738, -0.028892911970615387, -0.03573063015937805, -0.013208767399191856, -0.021852293983101845, -0.028710301965475082, -0.09820343554019928, 0.036501649767160416, 0.03195669502019882, -0.029603060334920883, -0.031246546655893326, 0.012863838113844395, 0.02735087461769581, -0.04532778263092041, 0.12490502744913101, -0.02670159563422203, -0.03828716650605202, 0.022298673167824745, 0.05141477286815643, -0.043745167553424835, -0.047356780618429184, -0.04516546428203583, 0.0634264349937439, 0.021710263565182686, -0.010581216774880886, -0.03540598973631859, -0.00552901579067111, 0.05539160594344139, -0.0314900279045105, -0.06809312850236893, -0.017733430489897728, 0.007629027124494314, -0.006021047476679087, 0.049142297357320786, -0.036136429756879807, 0.055797405540943146, -0.013573987409472466, -0.050400275737047195, 0.01856531947851181, 0.022643601521849632, -0.030232049524784088, 0.06914820522069931, 0.006680471356958151, 0.008917439728975296, 0.010327592492103577, -0.00575220538303256, 0.06427861005067825, -0.00011904503480764106, 0.006979748141020536, 0.008405118249356747, -0.02351607009768486, -0.006675398908555508, -0.040559642016887665, -0.02373925969004631, 0.017358066514134407, 0.021121853962540627, -0.0005475120269693434, 0.08375697582960129, -0.04889881610870361, 0.007441345136612654, -0.07738593220710754, 0.020543590188026428, -0.002417042152956128, -0.025991445407271385, -0.001403811969794333, -0.012184124439954758, -0.0110174510627985, 0.0033579892478883266, 0.062006134539842606, 0.015947913751006126, -0.002595847472548485, -0.0004118228971492499, 0.036724839359521866, -0.002565412549301982, 0.024956658482551575, -0.021629104390740395, -0.05437710881233215, -0.055269867181777954, -0.04325820878148079, 0.06529311090707779, 0.06399454921483994, -0.028000153601169586, -0.06813370436429977, -0.015704434365034103, 0.005955105181783438, -0.04760025814175606, -0.053727827966213226, 0.0702032819390297, -0.03629874810576439, -0.012620358727872372, 0.021203014999628067, 0.08132218569517136, 0.03165234625339508, 0.02950160950422287, 0.016982700675725937, -0.03217988461256027, -0.07117719948291779, -0.009206571616232395, -0.007613809779286385, -0.026275506243109703, 0.051293034106492996, 0.06667282432317734, 0.019204452633857727, -0.005711625330150127, -0.03333641216158867, -0.000003294147290944238, -0.037678465247154236, 0.02566680684685707, -0.061640914529561996, -0.039606012403964996, 0.020797215402126312, -0.013300072401762009, 0.0005433906335383654, -0.012904418632388115, 0.05324086919426918, -0.035913240164518356, 0.04256834834814072, -0.01945807784795761, 0.03112480789422989, -0.033721923828125, -0.0034645115956664085, -0.02284650132060051, -0.02536245808005333, 0.02004648558795452, -0.06744384765625, 0.04110747203230858, 0.006112352013587952, 0.024510279297828674, -0.03495961055159569, -0.022298673167824745, -0.04873649775981903, -0.04480024427175522, -0.03875383362174034, 0.01988416723906994, 0.013858046382665634, -0.0036598024889826775, -0.0397886224091053, -0.02980596013367176, 0.025829127058386803, 0.030658138915896416, 0.08286421746015549, -0.033458154648542404, 0.044394444674253464, -0.005478290840983391, 0.03090161830186844, 0.0723540186882019, -0.011747890152037144, 0.021121853962540627, -0.027188554406166077, -0.02382042072713375, -0.03002914972603321, -0.005130825098603964, -0.011159481480717659, -0.030942197889089584, -0.05242926999926567, -0.010966726578772068, 0.0192247424274683, -0.02536245808005333, -0.009044252336025238, -0.0741395354270935, -0.0011077052913606167, -0.018139230087399483, 0.06314237415790558, 0.024226218461990356, 0.03159147500991821, -0.03408714383840561, 0.0588814802467823, -0.033904533833265305, 0.022968241944909096, -0.0030612486880272627, -0.05701480433344841, -0.022075483575463295, -0.06456267088651657, 0.00012308717123232782, 0.08197145909070969, 0.01915372721850872, -0.0063253967091441154, 0.015562403947114944, 0.014426165260374546, 0.03422917053103447, -0.0244899895042181, -0.017702994868159294, -0.06679456681013107, -0.06780906766653061, 0.009018889628350735, -0.0007469243719242513, 0.03232191503047943, -0.01810879446566105, -0.05267275124788284, 0.017134876921772957, -0.05421479046344757, 0.035223379731178284, 0.007426127325743437, -0.017875459045171738, 0.01160586066544056, 0.07097429782152176, 0.05332202836871147, 0.012153689749538898, 0.03402627259492874, 0.004524662159383297, -0.017571110278367996, 0.003971760626882315, -0.08343233913183212, -0.015866752713918686, 0.02240012213587761, -0.06614528596401215, -0.04155385121703148, 0.05259159207344055, 0.018301548436284065, -0.020726200193166733, 0.03045523911714554, 0.0022141425870358944, 0.015592838637530804, 0.029907409101724625, 0.029319001361727715, 0.020655184984207153, 0.0066297464072704315, 0.012681229040026665, -0.01657690294086933, 0.027776964008808136, -0.05924670025706291, -0.06480614840984344, -0.012458039447665215, 0.04459734633564949, -0.03351902216672897, 0.01626240834593773, -0.0003347844467498362, -0.004222848918288946, -0.02152765356004238, 0.059206120669841766, -0.06188439577817917, 0.02262331172823906, -0.04613938182592392, -0.05145535245537758, -0.023049401119351387, -0.036643676459789276, 0.035081349313259125, -0.039748042821884155, 0.015268199145793915, -0.0066551086492836475, -0.02402331866323948, -0.05251043289899826, 0.07564099133014679, -0.020087067037820816, -0.010946436785161495, 0.020716054365038872, 0.04991331696510315, 0.02048272080719471, 0.04007268324494362, -0.012153689749538898, -0.000054093365179141983, -0.07166416198015213, 0.020533446222543716, -0.010581216774880886, 0.014963849447667599, -0.0044663287699222565, 0.002223019488155842, 0.06306121498346329, -0.007816709578037262, 0.006604383699595928, 0.0009523602784611285, -0.037820495665073395, 0.05555392801761627, -0.03917992487549782, 0.03733353689312935, 0.017114585265517235, -0.00026868353597819805, 0.012082674540579319, 0.08708453178405762, -0.02639724500477314, 0.0643191933631897, -0.003954007290303707, 0.0014494644710794091, -0.0012789019383490086, 0.0863540917634964, -0.0404987707734108, -0.02300882153213024, -0.031003067269921303, -0.001337869674898684, -0.004149298183619976, -0.037171218544244766, -0.0037434985861182213, -0.019133437424898148, -0.06573949009180069, 0.01234644465148449, -0.0037511074915528297, 0.03151031583547592, 0.03972775489091873, 0.021487073972821236, 0.015004429966211319, -0.015704434365034103, 0.028365371748805046, -0.026295796036720276, 0.03291032463312149, -0.05871916189789772, 0.023942159488797188, 0.014030511491000652, 0.016130521893501282, 0.021710263565182686, 0.0077051143161952496, 0.007182647939771414, -0.006863080896437168, 0.0015521823661401868, 0.04638286307454109, 0.052388690412044525, 0.007355112582445145, -0.08400046080350876, 0.011940645053982735, -0.00005655035420204513, -0.04516546428203583, 0.05072491616010666, 0.017936330288648605, -0.0058638001792132854, 0.021994322538375854, -0.028000153601169586, 0.020584169775247574, -0.027391454204916954, 0.04427270591259003, 0.030008859932422638, 0.029258130118250847, 0.036643676459789276, 0.04220312833786011, -0.05056259408593178, -0.033397283405065536, 0.03031320869922638, -0.027391454204916954, 0.0827018991112709, -0.01512616965919733, -0.0357712097465992, -0.022034902125597, 0.011555135250091553, 0.009074687026441097, 0.023637810721993446, -0.022420411929488182, 0.01319862250238657, 0.04966983571648598, -0.005696407984942198, 0.06663224846124649, 0.011747890152037144, 0.0723540186882019, -0.02950160950422287, -0.030516108497977257, -0.04153355956077576, -0.03995094448328018, -0.024388538673520088, 0.057704661041498184, 0.0026478406507521868, 0.012397169135510921, 0.05080607533454895, -0.05543218553066254, 0.06180323660373688, 0.05559450760483742, 0.05884090065956116, -0.023171141743659973, -0.014801530167460442, -0.007608737330883741, -0.017358066514134407, 0.03956543281674385, 0.013026158325374126, -0.08943817019462585, 0.08375697582960129, -0.030211759731173515, 0.02128417417407036, 0.029623350128531456, -0.037536438554525375, 0.009485558606684208, -0.0316726379096508, 0.014629065059125423, -0.017774010077118874, 0.01275224331766367, -0.05393072962760925, -0.043136466294527054, -0.0007279025157913566, 0.01542037446051836, 0.00916599202901125, -0.07791347056627274, -0.02128417417407036, 0.015785593539476395, 0.03171321749687195, 0.02432766929268837, -0.0445161834359169, 0.018991408869624138, -0.0037536437157541513, 0.033316124230623245, -0.01620153710246086, 0.06078873574733734, 0.03587266057729721, 0.013330507092177868, -0.025768255814909935, -0.013371087610721588, -0.015105879865586758, 0.001408884534612298, 0.017327630892395973, 0.008968165144324303, 0.02536245808005333, 0.02343491092324257, -0.022663891315460205, -0.051130712032318115, -0.009242079220712185, -0.05324086919426918, 0.029846539720892906, -0.04256834834814072, 0.06480614840984344, -0.026437824591994286, -0.07008153945207596, -0.031084228307008743, 0.021689973771572113, -0.009901503100991249, 0.03920021280646324, -0.015095734968781471, 0.010358027182519436, -0.015400083735585213, 0.001197107951156795, -0.02869001217186451, 0.04342052713036537, -0.04910171777009964, -0.005635538138449192, 0.05044085532426834, 0.050400275737047195, 0.05746118351817131, -0.0022154105827212334, 0.09731067717075348, 0.01759140007197857, -0.003971760626882315, 0.010844986885786057, -0.028974071145057678, -0.07592505216598511, -0.04837127774953842, -0.05612204596400261, 0.01198122464120388, 0.030495818704366684, 0.006056554615497589, -0.013665292412042618, -0.030942197889089584, -0.009054397232830524, -0.06452208757400513, 0.011544990353286266, -0.010966726578772068, 0.02919726073741913, 0.019336337223649025, -0.02270447090268135, -0.020574025809764862, -0.02211606316268444, -0.05324086919426918, 0.003284438280388713, 0.023901579901576042, -0.017702994868159294, -0.10932233929634094, 0.0033453081268817186, 0.051658254116773605, 0.012873983010649681, 0.006457281764596701, -0.023982739076018333, 0.04845243692398071, -0.023313170298933983, -0.003396033076569438, -0.008557292632758617, -0.012630503624677658, -0.00794859416782856, 0.012731953524053097, 0.015176894143223763, -0.022805921733379364, -0.009221789427101612, -0.01738850027322769, 0.07840042561292648, 0.057055383920669556, 0.02091895416378975, -0.0021190333645790815, 0.01716531068086624, -0.018463868647813797, -0.002593311248347163, 0.025971155613660812, -0.030150888487696648, -0.02144649438560009, 0.014121816493570805, -0.06358875334262848, 0.029907409101724625, 0.06366991251707077, -0.014152251183986664, 0.030800167471170425, 0.01619139313697815, 0.05863800272345543, 0.04678866267204285, -0.00480872206389904, 0.0009910380467772484, 0.006132642272859812, 0.0024829846806824207, 0.005229738540947437, -0.016465308144688606, -0.04390748590230942, 0.05600030720233917, 0.020016051828861237, 0.051942311227321625, 0.01150441076606512, -0.007365257479250431, 0.020797215402126312, -0.00602611992508173, 0.06825544685125351, -0.0562032051384449, 0.09601211547851562, -0.025261007249355316, -0.02507839724421501, -0.04626112058758736, -0.0353248305618763, -0.031104518100619316, -0.015045009553432465, -0.018169663846492767, -0.003048567334190011, -0.03232191503047943, -0.012102964334189892, -0.007801491767168045, 0.0021317144855856895, 0.010418897494673729, 0.0011394084431231022, -0.021771132946014404, -0.03816542401909828, 0.03114509768784046, 0.017926184460520744, -0.0049253893084824085, 0.014973994344472885, -0.06005829945206642, -0.017124731093645096, -0.014882690273225307, 0.01982329599559307, 0.03213930502533913, -0.03360018506646156, -0.048330698162317276, 0.04305530712008476, 0.018595753237605095, -0.03617700934410095, -0.030516108497977257, 0.01781458966434002, 0.04435386508703232, -0.003378279274329543, -0.08984396606683731, 0.05169883370399475, -0.07900912314653397, -0.055797405540943146, -0.019346483051776886, -0.03721179813146591, 0.011666730046272278, -0.00460074981674552, 0.002340954728424549, 0.05681190267205238, 0.0418379083275795, 0.019803006201982498, 0.004385168664157391, -0.032646555453538895, -0.031246546655893326, -0.061113376170396805, -0.007319604977965355, -0.02380012907087803, 0.051658254116773605, -0.004385168664157391, 0.02091895416378975, -0.007973956875503063, -0.00371559988707304, 0.03305235505104065, 0.018433433026075363, -0.04646402224898338, 0.022014612331986427, 0.0060159750282764435, -0.04163501039147377, 0.03437120094895363, 0.04435386508703232, 0.008521785959601402, 0.0029750161338597536, -0.016739221289753914, 0.021832002326846123, 0.021487073972821236, -0.04342052713036537, -0.027168264612555504, 0.01545080915093422, -0.029014650732278824, 0.044921983033418655, 0.0019491048296913505, 0.0014608774799853563, -0.0028228415176272392, -0.037455275654792786, 0.0022318961564451456, -0.01223484892398119, 0.04141182079911232, -0.00419748667627573, 0.0314900279045105, -0.013675437308847904, -0.07438301295042038, -0.01396964117884636, -0.0011977420654147863, 0.05806988105177879, -0.019113147631287575, 0.07442359626293182, -0.04768142104148865, -0.036643676459789276, 0.017652269452810287, 0.022197222337126732, -0.016729077324271202, -0.016313131898641586, -0.00976454559713602, -0.020837794989347458, 0.006918878294527531, 0.01678994670510292, 0.03469584137201309, 0.060382939875125885, -0.04120891913771629, 0.021872583776712418, -0.0628988966345787, 0.03451323136687279, 0.07032502442598343, 0.02351607009768486, -0.03187553584575653, -0.043582845479249954, 0.011666730046272278, 0.007202937733381987, -0.02631608583033085, 0.027614643797278404, -0.04597706347703934, 0.03075958788394928, 0.09065556526184082, 0.02343491092324257, 0.02838566154241562, -0.05389015004038811, 0.004664156120270491, -0.009566718712449074, -0.011849340051412582, -0.005635538138449192, 0.017023282125592232, -0.0813627615571022, -0.0010829769307747483, 0.017581256106495857, 0.017337774857878685, 0.028974071145057678, 0.06480614840984344, -0.0002437966177240014, 0.022521862760186195, 0.013087027706205845, 0.009485558606684208, 0.0059753949753940105, -0.020503010600805283, -0.0044714012183249, 0.018585609272122383, 0.058962639421224594, 0.057785823941230774, 0.05847568064928055, -0.022034902125597, -0.008866715244948864, 0.03932195529341698, 0.035081349313259125, 0.033011775463819504, 0.0025857025757431984, 0.028974071145057678, -0.029298709705471992, -0.03171321749687195, -0.029887119308114052, -0.028791461139917374, -0.044475603848695755, 0.013279782608151436, 0.03682628646492958, 0.028345081955194473, -0.04149297997355461, -0.0012243726523593068, 0.02211606316268444, 0.010510202497243881, -0.037678465247154236, -0.0040960367769002914, 0.03780020773410797, 0.016688497737050056, -0.011747890152037144, -0.025017527863383293, -0.030658138915896416, 0.009272513911128044, 0.025605937466025352, -0.028811750933527946, 0.004900026600807905, -0.03986978158354759, -0.014720370061695576, -0.01128122117370367, -0.03631903976202011, -0.04593648388981819, 0.03512193262577057, 0.10234259068965912, 0.05133361369371414, -0.017560966312885284, 0.02765522338449955, 0.06196555495262146, -0.06805254518985748, -0.04975099489092827, -0.026356665417551994, 0.018737783655524254, 0.004085891880095005, -0.026600144803524017, 0.019863877445459366, 0.03986978158354759, -0.022663891315460205, 0.013259492814540863, -0.04297414794564247, -0.03201756626367569, -0.047519098967313766, 0.010418897494673729, -0.0314900279045105, 0.03676541894674301, -0.005029375199228525, -0.024388538673520088, 0.029988570138812065, -0.00787757895886898, 0.006497861351817846, -0.025545066222548485, 0.004484082572162151, 0.012620358727872372, -0.041594430804252625, 0.02298853173851967, 0.004339516628533602, -0.003160162130370736, -0.05494522675871849, 0.05506696552038193, 0.027330584824085236, -0.00008433016773778945, 0.005341333337128162, -0.0051688686944544315, 0.0002678909513633698, 0.03747556731104851, 0.009206571616232395, -0.028933491557836533, -0.03351902216672897, -0.008958020247519016, -0.022359542548656464, 0.006031192373484373, 0.012163834646344185, 0.03293061628937721, 0.02197403274476528, 0.05182057246565819, 0.005919597577303648, -0.02335374988615513, 0.009678313508629799, 0.0020378734916448593, -0.026600144803524017, -0.06415687501430511, 0.011950789950788021, -0.02528129704296589, 0.0476408414542675, -0.02919726073741913, 0.053727827966213226, -0.021913163363933563, -0.02077692560851574, -0.06269599497318268, 0.025768255814909935, 0.024165349081158638, -0.03031320869922638, 0.038855284452438354, -0.022887080907821655, 0.03980891406536102, -0.04731620103120804, 0.03284945338964462, 0.014020366594195366, 0.04922345653176308, 0.03806397691369057, -0.03360018506646156, -0.04062051326036453, -0.011250786483287811, -0.037536438554525375, -0.025403037667274475, -0.02034069038927555, 0.06744384765625, 0.0026174054946750402, -0.061924975365400314, 0.03384366258978844, 0.03727266564965248, 0.02003634162247181 ]
42,916
linearmodels.iv.model
from_formula
Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Returns ------- IVGMM Model instance Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVGMM >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVGMM.from_formula(formula, data)
@staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ) -> IVGMM: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Returns ------- IVGMM Model instance Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVGMM >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVGMM.from_formula(formula, data) """ mod = _gmm_model_from_formula( IVGMM, formula, data, weights, weight_type, **weight_config ) assert isinstance(mod, IVGMM) return mod
(formula: str, data: pandas.core.frame.DataFrame, *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, weight_type: str = 'robust', **weight_config: Any) -> linearmodels.iv.model.IVGMM
[ 0.12828747928142548, -0.04526030272245407, 0.029074497520923615, -0.037204865366220474, 0.006036892533302307, -0.04499803110957146, -0.006102459970861673, -0.03578111529350281, 0.019407976418733597, 0.04409882053732872, 0.008017967455089092, -0.00001955682091647759, -0.011745947413146496, 0.02085046097636223, -0.05893580615520477, 0.045934710651636124, -0.006360046565532684, -0.030891655012965202, 0.006022842135280371, 0.0005947907920926809, -0.04421121999621391, -0.01731918379664421, -0.031734663993120193, 0.07306091487407684, 0.044286154210567474, 0.012523390352725983, -0.05672524496912956, 0.014246879145503044, 0.05777432397007942, -0.05204185098409653, -0.01909887231886387, -0.04458589106798172, -0.02973017282783985, -0.00832707155495882, 0.013834740035235882, -0.017300451174378395, 0.026376863941550255, 0.0019178490620106459, -0.058448731899261475, 0.022236745804548264, 0.06035955622792244, -0.004603774286806583, 0.06871473044157028, 0.03495683893561363, -0.03844128176569939, -0.01907077245414257, -0.05455215275287628, 0.00846757274121046, 0.04409882053732872, 0.004217394627630711, 0.027351010590791702, -0.01370360516011715, 0.02776314876973629, -0.04533523693680763, -0.07632055878639221, 0.05773685872554779, 0.007765064015984535, 0.048632342368364334, 0.07186196744441986, -0.005479568615555763, -0.0023873590398579836, -0.00008935033838497475, 0.004531181883066893, -0.03218426927924156, 0.00403240043669939, 0.040052369236946106, -0.004364921245723963, 0.005943224765360355, -0.012635791674256325, -0.009666521102190018, -0.048220206052064896, -0.017656387761235237, 0.006814335472881794, 0.04522283375263214, 0.003976199775934219, -0.0034446348436176777, -0.029599038884043694, -0.0106219332665205, 0.009137297980487347, 0.056650310754776, 0.014012709259986877, -0.01615770347416401, -0.01927684247493744, -0.0787559226155281, -0.0009811706840991974, -0.028493758291006088, -0.02148740366101265, -0.0093386834487319, 0.057512056082487106, -0.06549255549907684, -0.062270380556583405, -0.028306420892477036, -0.008402005769312382, 0.056238170713186264, 0.007249890826642513, -0.007544944528490305, 0.013947141356766224, -0.07238651067018509, 0.018742935732007027, 0.016953879967331886, -0.034863170236349106, 0.04687138646841049, -0.010565732605755329, -0.021093998104333878, -0.025533853098750114, -0.044323623180389404, -0.0439489521086216, -0.03220300376415253, 0.030404580757021904, -0.10265995562076569, -0.06002235412597656, 0.024728309363126755, -0.01319779921323061, -0.011717846617102623, 0.019201908260583878, 0.05129250884056091, -0.0006123534985817969, 0.045447636395692825, -0.0039855665527284145, 0.0014998563565313816, -0.004627191461622715, -0.012907428666949272, -0.05110517516732216, 0.01414384413510561, 0.056650310754776, -0.0467589870095253, 0.036961331963539124, -0.05533896014094353, 0.024615908041596413, -0.050955306738615036, -0.01815282739698887, -0.04645925015211105, -0.015483294613659382, 0.03877848759293556, -0.013872207142412663, 0.004093284718692303, -0.005306283012032509, -0.034863170236349106, 0.027744414284825325, 0.07598335295915604, 0.002678900258615613, 0.03495683893561363, -0.02152487076818943, 0.02249901555478573, -0.013019829988479614, 0.04391148313879967, 0.07025088369846344, 0.0406518429517746, -0.03964022919535637, -0.06680390238761902, -0.001601720112375915, -0.0036015284713357687, 0.00851908978074789, -0.025365252047777176, 0.027088738977909088, 0.006294479127973318, -0.009113880805671215, 0.013956508599221706, 0.006378780119121075, -0.03505050763487816, -0.008968695998191833, 0.053053464740514755, -0.022424081340432167, 0.02306102216243744, 0.03364548832178116, 0.005905757192522287, 0.002451755804941058, 0.004573332145810127, -0.03971516340970993, 0.042712535709142685, -0.04364921525120735, -0.03441356495022774, -0.044323623180389404, -0.021262599155306816, 0.022199278697371483, 0.039977435022592545, 0.014012709259986877, 0.028549958020448685, 0.046571649610996246, 0.036474257707595825, 0.01931430958211422, 0.038703553378582, -0.06103396415710449, -0.00015074668044690043, -0.04964395612478256, 0.02688267081975937, -0.01020042784512043, 0.024316171184182167, -0.0274072103202343, -0.04072677716612816, 0.03194073587656021, -0.05560123175382614, 0.04807033762335777, -0.019426710903644562, -0.00012352447083685547, 0.0013874549185857177, 0.028980830684304237, 0.009334000758826733, -0.10783042013645172, 0.04469829425215721, 0.08902191370725632, -0.02450350672006607, 0.005474885459989309, 0.008992113173007965, -0.03690512850880623, 0.002990345936268568, -0.073622927069664, -0.002237490611150861, 0.034057628363370895, -0.0420006588101387, -0.004594407510012388, 0.02639559842646122, -0.01241098903119564, 0.0816783607006073, 0.0005669831298291683, 0.012823127210140228, 0.0054421015083789825, 0.03484443575143814, 0.016242003068327904, -0.0035921616945415735, 0.03634312376379967, -0.037635739892721176, -0.10798028856515884, 0.006734717637300491, 0.016607308760285378, -0.02618952840566635, -0.02120639942586422, 0.012111252173781395, -0.031135190278291702, -0.014274979010224342, 0.02716367319226265, -0.053015999495983124, 0.049756359308958054, -0.045934710651636124, -0.016672875732183456, -0.0024868811015039682, -0.029318034648895264, 0.03327081725001335, -0.0010280045680701733, 0.028119085356593132, 0.0006357704987749457, -0.0015677654882892966, -0.016804011538624763, 0.08804777264595032, 0.013263366185128689, -0.036399323493242264, 0.04837007448077202, 0.002512639854103327, -0.03937796130776405, -0.03855368494987488, -0.03445103392004967, 0.012195552699267864, -0.03578111529350281, 0.06095902994275093, 0.01875230111181736, 0.04533523693680763, 0.0031566063407808542, 0.01496812142431736, 0.047096189111471176, -0.04563497379422188, 0.001636845525354147, -0.06706617772579193, -0.005371850915253162, -0.014022075571119785, 0.010696867480874062, 0.00969462189823389, -0.0032900830265134573, 0.04567243903875351, 0.0485948771238327, 0.019614046439528465, 0.016176436096429825, 0.04848247393965721, 0.01742221787571907, -0.004903511609882116, 0.033177148550748825, 0.008973379619419575, -0.0006673833704553545, -0.024615908041596413, -0.029748907312750816, -0.03250274062156677, -0.012382888235151768, -0.0019307284383103251, 0.027894282713532448, -0.014827619306743145, -0.04694632068276405, 0.022836219519376755, -0.0074559603817760944, -0.021243866533041, 0.05294106528162956, 0.02341696061193943, -0.0008002746035344899, 0.006645733490586281, -0.018405731767416, 0.04391148313879967, 0.02233041264116764, 0.016916412860155106, 0.047133658081293106, 0.016804011538624763, -0.026339396834373474, -0.022986087948083878, 0.006917370017617941, 0.029243100434541702, 0.04316214099526405, -0.0014260929310694337, -0.06197064369916916, 0.01102470513433218, 0.01020042784512043, -0.049793824553489685, -0.003987908363342285, -0.03741093724966049, 0.00800860021263361, 0.0787559226155281, -0.004465614445507526, -0.015998467803001404, 0.02184334024786949, 0.010172327980399132, 0.01847129873931408, -0.003617920447140932, 0.08767309784889221, -0.009006163105368614, 0.04743339493870735, 0.0467589870095253, 0.03658665716648102, -0.028418824076652527, -0.03975263237953186, 0.010191061533987522, 0.005807406269013882, -0.006603582762181759, 0.009540069848299026, 0.013253999873995781, -0.02015732042491436, 0.03295234590768814, 0.029599038884043694, -0.006378780119121075, -0.04687138646841049, -0.038403816521167755, 0.032128069549798965, -0.013244632631540298, 0.011333809234201908, 0.02184334024786949, 0.0737353265285492, -0.04458589106798172, 0.008954646065831184, -0.035031773149967194, 0.03683019429445267, -0.053615473210811615, -0.0004659975238610059, -0.00918413233011961, -0.014153210446238518, 0.05923554301261902, -0.052866131067276, 0.0027983267791569233, 0.010996604338288307, 0.005976008251309395, -0.03364548832178116, -0.06893952935934067, 0.01508988905698061, -0.03435736522078514, 0.003194073447957635, 0.016082769259810448, -0.03564998134970665, 0.07159969955682755, -0.01875230111181736, -0.026058394461870193, 0.011418109759688377, -0.041138917207717896, 0.02632066421210766, 0.01468711718916893, 0.06155850738286972, 0.024316171184182167, 0.03525657579302788, -0.02534651756286621, -0.038328882306814194, 0.035406444221735, 0.01857433281838894, -0.00880009401589632, -0.01917380653321743, -0.049793824553489685, -0.056762710213661194, -0.011717846617102623, 0.0009109197417274117, -0.03851621598005295, 0.014762051403522491, -0.008238086476922035, 0.04237532988190651, 0.008711108937859535, 0.06024715676903725, 0.07317331433296204, -0.009226282127201557, -0.014293712563812733, -0.022986087948083878, -0.018977105617523193, 0.05462708696722984, 0.0021239183843135834, -0.026789002120494843, -0.016279470175504684, -0.008640858344733715, -0.011315075680613518, -0.018696101382374763, -0.043274544179439545, -0.029243100434541702, 0.010696867480874062, -0.038478750735521317, 0.01458408311009407, -0.041138917207717896, 0.004898827988654375, -0.056912582367658615, 0.013375767506659031, -0.021093998104333878, -0.07141236215829849, 0.011474310420453548, 0.026339396834373474, -0.008523773401975632, -0.034788236021995544, 0.008992113173007965, 0.02611459419131279, 0.057999126613140106, -0.0787559226155281, -0.037598270922899246, 0.05267879366874695, 0.034469764679670334, -0.01636377163231373, 0.07673269510269165, -0.010996604338288307, -0.00416353577747941, 0.04844500869512558, -0.021262599155306816, -0.049756359308958054, -0.044960565865039825, 0.00620549451559782, -0.026433065533638, 0.060134753584861755, 0.01363803818821907, -0.004301695618778467, -0.028325155377388, -0.04372414946556091, -0.026020925492048264, -0.011699113063514233, 0.011286974884569645, 0.03742966800928116, 0.019445443525910378, -0.026845203712582588, 0.02043832279741764, 0.011137106455862522, -0.10932910442352295, -0.04267507046461105, -0.015895431861281395, -0.007615195587277412, -0.03143492713570595, -0.038815952837467194, 0.02965523861348629, 0.04031464084982872, 0.06283238530158997, 0.016869578510522842, 0.025608787313103676, -0.00012769561726599932, 0.0001883601798908785, -0.048107802867889404, 0.04181332513689995, 0.030123578384518623, -0.017394118010997772, 0.04994369298219681, -0.019688980653882027, -0.002430680440738797, -0.020944129675626755, 0.06384400278329849, 0.0872984305024147, -0.046571649610996246, -0.0008517919341102242, 0.04076424613595009, 0.011614812538027763, -0.003931707702577114, 0.0581115297973156, -0.040614377707242966, -0.005076797213405371, 0.009146664291620255, -0.018237128853797913, -0.0014963437570258975, 0.023829098790884018, -0.03915315866470337, 0.03606211766600609, -0.0025805491022765636, 0.0006673833704553545, 0.06369413435459137, -0.03960276395082474, 0.044810693711042404, 0.017085013911128044, -0.028119085356593132, -0.004449222702533007, -0.06474321335554123, -0.05919807776808739, 0.10131113976240158, 0.056837648153305054, 0.03712993115186691, 0.06223291531205177, 0.004959712270647287, 0.007174956612288952, -0.011418109759688377, 0.08257757127285004, -0.0472460575401783, 0.016916412860155106, -0.010247262194752693, -0.053578004240989685, -0.048669811338186264, -0.004662316758185625, 0.004240811336785555, -0.00019377534044906497, -0.002749151084572077, -0.022517750039696693, -0.07785671204328537, -0.04237532988190651, -0.002196510788053274, -0.012991729192435741, 0.06822765618562698, -0.013919041492044926, -0.009193498641252518, -0.04173839092254639, 0.0186773668974638, -0.013928407803177834, -0.012204919941723347, 0.001865160884335637, -0.04698378965258598, -0.008069484494626522, -0.06830258667469025, 0.0002862723486032337, 0.03298981487751007, -0.028137819841504097, -0.06871473044157028, 0.013488168828189373, 0.002012687735259533, 0.00030646947561763227, -0.019482910633087158, 0.04840753972530365, 0.07242397218942642, -0.05391521006822586, 0.0020560091361403465, 0.05672524496912956, -0.045372702181339264, -0.08190315961837769, 0.014921287074685097, -0.052004385739564896, 0.005891707260161638, -0.049906227737665176, 0.009113880805671215, 0.07212423533201218, 0.05496428906917572, 0.009956891648471355, 0.02317342348396778, -0.05807406082749367, -0.015942266210913658, -0.0594603456556797, -0.0004891217686235905, -0.057961661368608475, 0.000941361824516207, 0.03201567009091377, -0.004702125675976276, -0.004456247668713331, 0.006987621076405048, -0.0017387092811986804, -0.030367113649845123, -0.032090604305267334, -0.05942288041114807, 0.023248357698321342, -0.018564965575933456, -0.018171561881899834, 0.04312467575073242, -0.006570799276232719, -0.004095626529306173, -0.03488190472126007, -0.001958828652277589, 0.0028943363577127457, -0.051891982555389404, 0.09261876344680786, -0.012682626023888588, -0.01693514548242092, 0.031359992921352386, -0.030329646542668343, -0.04522283375263214, -0.0011726042721420527, -0.05511415749788284, -0.030760519206523895, -0.015249124728143215, -0.04023970663547516, 0.02615206129848957, 0.043237075209617615, -0.006748768035322428, -0.03179086372256279, 0.05533896014094353, -0.011268241330981255, 0.07231157273054123, -0.005498302169144154, 0.03782307356595993, 0.019258107990026474, 0.024915646761655807, 0.008598707616329193, 0.02152487076818943, 0.02446603961288929, -0.011212040670216084, 0.026489265263080597, 0.004978445824235678, -0.016326304525136948, 0.03428243100643158, 0.0013839423190802336, 0.03557504713535309, -0.018911536782979965, 0.023285824805498123, -0.015239757485687733, 0.012026950716972351, 0.0750841423869133, -0.05949781462550163, -0.018949003890156746, 0.005517035722732544, -0.013253999873995781, 0.06039702519774437, -0.019052039831876755, 0.027351010590791702, -0.049756359308958054, 0.039527829736471176, 0.04125131666660309, 0.05496428906917572, -0.022424081340432167, -0.050880372524261475, 0.010771801695227623, -0.031528595834970474, 0.019651513546705246, 0.020382123067975044, -0.000646893517114222, -0.057324718683958054, -0.03662412613630295, -0.00278193480335176, 0.033495619893074036, 0.025983458384871483, 0.05275372788310051, 0.030292179435491562, 0.036361854523420334, 0.0238665658980608, 0.010191061533987522, 0.01671971008181572, -0.0035593779757618904, 0.056912582367658615, -0.044361088424921036, -0.018340162932872772, 0.020063651725649834, 0.007591778412461281, 0.038965821266174316, -0.008617441169917583, 0.005760572385042906, -0.02470957674086094, -0.02257394976913929, 0.017862457782030106, 0.020906662568449974, -0.028737293556332588, -0.028100352734327316, -0.017188049852848053, -0.014293712563812733, 0.016316937282681465, -0.044885627925395966, -0.05987248569726944, 0.013787906616926193, -0.03907822445034981, -0.04027717188000679, 0.04668405279517174, -0.029805107042193413, 0.022405346855521202, 0.027182407677173615, 0.024334905669093132, 0.021955741569399834, 0.02092539519071579, 0.03705499693751335, -0.013909674249589443, 0.03197820112109184, 0.02877476066350937, -0.03712993115186691, 0.008247453719377518, -0.015239757485687733, -0.0062710619531571865, 0.04687138646841049, -0.018096627667546272, -0.021955741569399834, 0.03862861916422844, 0.07148730009794235, 0.03207186982035637, 0.06815271824598312, -0.03323335200548172, -0.0008517919341102242, -0.060172222554683685, -0.0013043247163295746, -0.013769173063337803, 0.0415135882794857, -0.042187996208667755, -0.049831293523311615, 0.04683392122387886, 0.01689767837524414, -0.012626425363123417, 0.03611832112073898, -0.05162971466779709, -0.049156881868839264, -0.013122864998877048, -0.024803243577480316, -0.015745563432574272, 0.03834761306643486, 0.00002153262721549254, -0.013881574384868145, 0.03364548832178116, 0.009526019915938377, -0.06324452906847, -0.0013043247163295746, -0.009497919119894505, -0.029430435970425606, -0.004926928319036961, 0.044361088424921036, -0.002386188367381692, 0.02100032940506935, -0.03769193962216377, 0.13106004893779755, 0.03771067410707474, -0.06414373964071274, 0.014246879145503044, -0.05222918838262558, -0.022798752412199974, 0.03332701697945595, -0.04304974153637886, 0.06346932798624039, -0.027219874784350395, -0.03662412613630295, -0.04844500869512558, 0.008069484494626522, 0.00416353577747941, 0.04196319356560707, -0.005769939161837101, 0.034301161766052246, 0.031247591599822044, -0.03505050763487816, -0.023529361933469772, 0.02337949350476265, -0.030329646542668343, -0.06212051212787628, -0.004596749320626259, -0.041063982993364334, 0.060134753584861755, -0.02401643432676792, 0.024653375148773193, -0.007793164346367121, 0.018096627667546272, -0.006837752647697926, 0.021862074732780457, -0.009521336294710636, 0.004390680231153965, 0.02615206129848957, -0.000046907098294468597, 0.014958754181861877, -0.03926555812358856, 0.02096286229789257, 0.000511367863509804, 0.06691630929708481, 0.017010079696774483, 0.03621198609471321, 0.01913633942604065, 0.007793164346367121, -0.025177916511893272, -0.009259066544473171, -0.0013429627288132906, 0.0787559226155281, -0.02249901555478573, -0.07770684361457825, -0.0299737099558115, -0.0066878837533295155, 0.03077925369143486 ]
42,920
linearmodels.iv.model
IVGMMCUE
Estimation of IV models using continuously updating GMM Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- Available weight functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity by not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence In most circumstances, the ``center`` weight option should be ``True`` to avoid starting value dependence. .. math:: \hat{\beta}_{cue} & =\min_{\beta}\bar{g}(\beta)'W(\beta)^{-1}g(\beta)\\ g(\beta) & =n^{-1}\sum_{i=1}^{n}z_{i}(y_{i}-x_{i}\beta) where :math:`W(\beta)` is a weight matrix that depends on :math:`\beta` through :math:`\epsilon_i = y_i - x_i\beta`. See Also -------- IV2SLS, IVLIML, IVGMM
class IVGMMCUE(_IVGMMBase): r""" Estimation of IV models using continuously updating GMM Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- Available weight functions are: * "unadjusted", "homoskedastic" - Assumes moment conditions are homoskedastic * "robust", "heteroskedastic" - Allows for heteroskedasticity by not autocorrelation * "kernel" - Allows for heteroskedasticity and autocorrelation * "cluster" - Allows for one-way cluster dependence In most circumstances, the ``center`` weight option should be ``True`` to avoid starting value dependence. .. math:: \hat{\beta}_{cue} & =\min_{\beta}\bar{g}(\beta)'W(\beta)^{-1}g(\beta)\\ g(\beta) & =n^{-1}\sum_{i=1}^{n}z_{i}(y_{i}-x_{i}\beta) where :math:`W(\beta)` is a weight matrix that depends on :math:`\beta` through :math:`\epsilon_i = y_i - x_i\beta`. See Also -------- IV2SLS, IVLIML, IVGMM """ def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ) -> None: self._method = "IV-GMM-CUE" super().__init__( dependent, exog, endog, instruments, weights=weights, weight_type=weight_type, **weight_config, ) if "center" not in weight_config: weight_config["center"] = True @staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ) -> IVGMMCUE: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Returns ------- IVGMMCUE Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVGMMCUE >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVGMMCUE.from_formula(formula, data) """ mod = _gmm_model_from_formula( IVGMMCUE, formula, data, weights, weight_type, **weight_config ) assert isinstance(mod, IVGMMCUE) return mod def j( self, params: Float64Array, x: Float64Array, y: Float64Array, z: Float64Array ) -> float: r""" Optimization target Parameters ---------- params : ndarray Parameter vector (nvar) x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) Returns ------- float GMM objective function, also known as the J statistic Notes ----- The GMM objective function is defined as .. math:: J(\beta) = \bar{g}(\beta)'W(\beta)^{-1}\bar{g}(\beta) where :math:`\bar{g}(\beta)` is the average of the moment conditions, :math:`z_i \hat{\epsilon}_i`, where :math:`\hat{\epsilon}_i = y_i - x_i\beta`. The weighting matrix is some estimator of the long-run variance of the moment conditions. Unlike tradition GMM, the weighting matrix is simultaneously computed with the moment conditions, and so has explicit dependence on :math:`\beta`. """ nobs = y.shape[0] weight_matrix = self._weight.weight_matrix eps = y - x @ params[:, None] w = inv(weight_matrix(x, z, eps)) g_bar = (z * eps).mean(0) return nobs * float(g_bar.T @ w @ g_bar.T) def estimate_parameters( self, starting: Float64Array, x: Float64Array, y: Float64Array, z: Float64Array, display: bool = False, opt_options: dict[str, Any] | None = None, ) -> tuple[Float64Array, int]: r""" Parameters ---------- starting : ndarray Starting values for the optimization x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) display : bool Flag indicating whether to display iterative optimizer output opt_options : dict Dictionary containing additional keyword arguments to pass to scipy.optimize.minimize. Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking. See Also -------- scipy.optimize.minimize """ args = (x, y, z) if opt_options is None: opt_options = {} assert opt_options is not None options = {"disp": display} if "options" in opt_options: opt_options = opt_options.copy() options.update(opt_options.pop("options")) res = minimize(self.j, starting, args=args, options=options, **opt_options) return res.x[:, None], res.nit def fit( self, *, starting: Float64Array | Series | None = None, display: bool = False, cov_type: str = "robust", debiased: bool = False, opt_options: dict[str, Any] | None = None, **cov_config: Any, ) -> OLSResults | IVGMMResults: r""" Estimate model parameters Parameters ---------- starting : ndarray Starting values to use in optimization. If not provided, 2SLS estimates are used. display : bool Flag indicating whether to display optimization output cov_type : str Name of covariance estimator to use debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. opt_options : dict Additional options to pass to scipy.optimize.minimize when optimizing the objective function. If not provided, defers to scipy to choose an appropriate optimizer.
(dependent: 'IVDataLike', exog: 'IVDataLike | None', endog: 'IVDataLike | None', instruments: 'IVDataLike | None', *, weights: 'IVDataLike | None' = None, weight_type: 'str' = 'robust', **weight_config: 'Any') -> 'None'
[ 0.09566296637058258, -0.04360593482851982, -0.02581070549786091, 0.007852117531001568, 0.038182418793439865, -0.0407525971531868, -0.05406090244650841, -0.03445783630013466, 0.027923479676246643, 0.0034958801697939634, -0.01679329387843609, -0.014691409654915333, 0.014593394473195076, 0.04310496523976326, -0.057633016258478165, 0.06743454933166504, 0.003144658636301756, -0.04430292919278145, 0.03031940944492817, 0.008314967155456543, -0.057545892894268036, -0.05907057598233223, -0.004734685178846121, 0.07540646195411682, 0.009839650243520737, 0.006463566794991493, 0.008527333848178387, -0.019897112622857094, 0.045653365552425385, -0.05301540344953537, -0.0734897181391716, -0.028184853494167328, -0.06281694024801254, -0.048179980367422104, 0.020942609757184982, -0.01966840960085392, 0.06538711488246918, 0.011260872706770897, -0.07418671995401382, 0.018797162920236588, 0.01627054624259472, -0.01412509847432375, 0.06055169552564621, -0.019200114533305168, 0.005586874205619097, 0.02247818373143673, -0.027553198859095573, 0.06477724760770798, 0.03038475289940834, -0.009502042084932327, 0.053189653903245926, -0.07954488694667816, 0.0019085763487964869, -0.0355033315718174, -0.05114222317934036, 0.08446743339300156, 0.045435551553964615, 0.03319452702999115, 0.0629911869764328, -0.03585183247923851, -0.012132120318710804, -0.012262807227671146, 0.023305868729948997, 0.019102100282907486, -0.01378749031573534, 0.031974781304597855, -0.0014947338495403528, 0.0038852188736200333, 0.002677724463865161, 0.043867308646440506, -0.0019957011099904776, -0.034131117165088654, 0.015954717993736267, 0.024307802319526672, 0.01874271035194397, 0.015050798654556274, -0.03746363893151283, -0.039227914065122604, -0.013841942884027958, -0.027596762403845787, 0.07205215841531754, 0.016281435266137123, -0.032497528940439224, -0.08224575221538544, 0.03424002230167389, 0.004699290730059147, -0.031147094443440437, 0.009414917789399624, 0.0067086052149534225, -0.047657232731580734, -0.026050297543406487, -0.004127534572035074, 0.02914322540163994, 0.07192147523164749, 0.029600631445646286, -0.0053527262061834335, -0.04175453260540962, -0.06983047723770142, 0.016194311901926994, -0.016815075650811195, 0.02084459364414215, 0.029448162764310837, 0.021084187552332878, 0.012175682932138443, -0.02111685834825039, -0.0639059990644455, -0.04918191581964493, -0.0031119869090616703, 0.031234219670295715, -0.07283628731966019, -0.03731117025017738, 0.030711472034454346, -0.021007953211665154, -0.05602120980620384, -0.025113707408308983, 0.03846557438373566, -0.03927147760987282, 0.057633016258478165, -0.017272479832172394, 0.0318005308508873, -0.039968475699424744, -0.03439249098300934, -0.03748542070388794, 0.026355234906077385, 0.04574048891663551, -0.07802020758390427, 0.006828401703387499, 0.03164806216955185, 0.018383320420980453, -0.05227484554052353, -0.02957884967327118, -0.046088989824056625, -0.028794726356863976, -0.01611807756125927, -0.011522247456014156, -0.0020664900075644255, -0.005281937308609486, -0.037158701568841934, 0.027466075494885445, 0.07684402167797089, 0.030406534671783447, 0.04783148318529129, -0.054148025810718536, 0.02522261254489422, 0.0017152683576568961, 0.015824031084775925, 0.10062907636165619, 0.02417711541056633, -0.019319910556077957, -0.01849222555756569, -0.013547897338867188, 0.006289317272603512, 0.01212122943252325, -0.02544042468070984, 0.005870029330253601, -0.028337322175502777, 0.003038475289940834, 0.016836855560541153, -0.006262090988457203, -0.003482267027720809, -0.05140359699726105, -0.005516085308045149, -0.008244178257882595, 0.06281694024801254, 0.03637458011507988, 0.0422990620136261, -0.010601991787552834, 0.053407467901706696, -0.040404099971055984, 0.03733295202255249, -0.020332736894488335, -0.04922547936439514, -0.0629911869764328, -0.01769721321761608, 0.005284660030156374, 0.0883009284734726, 0.010819803923368454, 0.008826825767755508, 0.04556623846292496, 0.009736189618706703, 0.042756468057632446, 0.0015001791762188077, -0.06926416605710983, -0.013874614611268044, -0.051360033452510834, 0.020615892484784126, 0.03659239038825035, -0.010667335242033005, 0.014996346086263657, -0.06142294406890869, 0.024373145774006844, -0.03474099189043045, 0.019461488351225853, 0.008206062018871307, 0.004511428065598011, 0.04147137701511383, 0.0568053312599659, 0.022249480709433556, -0.009115425869822502, 0.018753601238131523, 0.03624389320611954, -0.026224547997117043, 0.006343770306557417, -0.0333469957113266, -0.013667693361639977, -0.031604498624801636, -0.04197234287858009, -0.04748298227787018, 0.049356166273355484, -0.0157477967441082, -0.015922047197818756, 0.013558788225054741, -0.025309737771749496, 0.0407525971531868, 0.02957884967327118, 0.00453865434974432, 0.02126932702958584, 0.021203983575105667, -0.00009112362749874592, -0.005167586263269186, 0.013079602271318436, -0.038552697747945786, -0.08864942193031311, -0.002907788148149848, -0.00426911236718297, -0.04613254964351654, 0.019897112622857094, 0.03112531453371048, -0.008380310609936714, -0.04822354391217232, 0.03526373952627182, -0.055846959352493286, 0.016619045287370682, -0.016324998810887337, -0.0009508848888799548, -0.0157477967441082, -0.028707602992653847, 0.04504349082708359, -0.027487855404615402, 0.0026518593076616526, -0.019962456077337265, -0.030036253854632378, -0.004108475986868143, 0.09278784692287445, 0.015323064289987087, -0.01874271035194397, 0.05833001434803009, 0.07213928550481796, -0.019058536738157272, 0.0216178260743618, -0.00678483908995986, -0.03728938847780228, -0.051795657724142075, 0.028446227312088013, -0.051795657724142075, -0.00909364502876997, 0.014658737927675247, 0.04652461037039757, 0.05236196890473366, -0.04552267864346504, -0.027335386723279953, -0.04486924037337303, -0.029252132400870323, 0.07135516405105591, 0.018601132556796074, 0.05471433699131012, 0.046088989824056625, 0.009670846164226532, 0.013079602271318436, 0.04282180964946747, 0.03295493498444557, 0.07126803696155548, -0.040709033608436584, -0.011326216161251068, 0.0019167442806065083, 0.04286537319421768, -0.04029519110918045, -0.02868582122027874, -0.0057556782849133015, -0.002265243325382471, 0.004511428065598011, -0.039968475699424744, 0.0008127104956656694, -0.014135989360511303, -0.03454495966434479, 0.0025797090493142605, -0.021378234028816223, -0.057545892894268036, 0.038182418793439865, 0.009621839039027691, -0.018579350784420967, 0.006855627987533808, 0.009872321970760822, 0.02387217991054058, 0.08512087166309357, 0.014462706632912159, -0.004930716007947922, 0.045871175825595856, -0.004187433049082756, 0.03031940944492817, 0.033085621893405914, 0.022804901003837585, 0.006507128942757845, -0.006926416885107756, -0.07296697050333023, 0.02297915145754814, 0.04595830291509628, -0.05654395744204521, -0.008162499405443668, -0.0021985385101288557, -0.01812194660305977, 0.02247818373143673, 0.00487081753090024, 0.012709321454167366, -0.007144229020923376, -0.02204255945980549, 0.02544042468070984, -0.0005649494705721736, 0.07335903495550156, 0.029600631445646286, 0.04345346614718437, -0.00426911236718297, 0.03291137143969536, -0.020648563280701637, -0.009131762199103832, 0.01007924322038889, 0.00918621476739645, 0.030188722535967827, -0.00036789782461710274, -0.03254109248518944, -0.014876550063490868, -0.01722891815006733, -0.005164863541722298, 0.019929785281419754, 0.008805043995380402, -0.03709335997700691, 0.03894475847482681, -0.03959819674491882, 0.0642109364271164, -0.0006211040890775621, 0.06769592314958572, -0.0030248621478676796, -0.06486436724662781, -0.006022497545927763, 0.009044636972248554, -0.06848004460334778, 0.0895642340183258, -0.03689732775092125, -0.013613240793347359, 0.06233775243163109, -0.047352295368909836, 0.043584153056144714, 0.04345346614718437, 0.05427871271967888, -0.004560435656458139, -0.02986200526356697, -0.007078885100781918, -0.056674644351005554, 0.03641814365983009, 0.02868582122027874, -0.05140359699726105, 0.0521877184510231, -0.0225435271859169, 0.005886365193873644, 0.01734871417284012, -0.037594325840473175, -0.01707644946873188, -0.02875116467475891, 0.03563401848077774, -0.017871461808681488, 0.021465357393026352, -0.01945059932768345, -0.05192634463310242, 0.025614673271775246, -0.0038089847657829523, -0.010362398810684681, -0.06612768024206161, -0.010318836197257042, -0.018938740715384483, -0.02263065241277218, 0.04761367291212082, -0.058504264801740646, -0.02276133932173252, -0.0003801497514359653, 0.029557067900896072, 0.03502414748072624, 0.0716601014137268, 0.027858136221766472, -0.005287382751703262, -0.0453919917345047, -0.012088557705283165, -0.014462706632912159, 0.03779035806655884, 0.03371727466583252, -0.013972630724310875, -0.006703159771859646, 0.04761367291212082, 0.006071505602449179, -0.021171312779188156, -0.03195299953222275, -0.06460299342870712, -0.012339041568338871, -0.01908031851053238, 0.036331016570329666, -0.014484488405287266, -0.07013541460037231, 0.009948556311428547, 0.034043993800878525, -0.011870745569467545, 0.02689976431429386, -0.054148025810718536, 0.013177617453038692, -0.04116643965244293, -0.01803482137620449, -0.028816508129239082, -0.008167944848537445, -0.009964892640709877, -0.04560980200767517, 0.007705094292759895, 0.058896325528621674, 0.01886250637471676, -0.005428960546851158, 0.09130673110485077, 0.006278426852077246, -0.04020806774497032, 0.012284589000046253, -0.04678598791360855, -0.03779035806655884, -0.03576470538973808, -0.03698445111513138, -0.02594139240682125, 0.06787016987800598, -0.020202049985527992, -0.029448162764310837, -0.038705166429281235, -0.04560980200767517, -0.028119510039687157, -0.01389639638364315, 0.03417468070983887, 0.03681020438671112, 0.019319910556077957, 0.0038035395555198193, 0.010847030207514763, -0.006349215749651194, -0.048179980367422104, 0.015508203767240047, -0.020300064235925674, 0.010019345209002495, -0.05088084936141968, 0.005831912159919739, 0.0450870543718338, 0.059985384345054626, 0.030863938853144646, -0.009790643118321896, 0.00927878450602293, -0.03874872997403145, -0.03010159730911255, -0.03964175656437874, -0.00041180054540745914, -0.01738138683140278, -0.02350189909338951, 0.005012395326048136, -0.04621967673301697, 0.02337121218442917, -0.05475790053606033, 0.09130673110485077, 0.05567270889878273, -0.036788422614336014, -0.03275890275835991, 0.06046457216143608, -0.006071505602449179, 0.012698431499302387, 0.041449595242738724, -0.06956910341978073, -0.02365436777472496, 0.020016908645629883, -0.0463068000972271, 0.009839650243520737, 0.03652704879641533, -0.01976642571389675, 0.023392993956804276, -0.036788422614336014, 0.031234219670295715, 0.043649494647979736, -0.0024694418534636497, 0.05366884171962738, 0.03746363893151283, -0.03386974334716797, 0.01293802447617054, -0.08285562694072723, -0.06961266696453094, 0.05885276198387146, 0.03356480598449707, 0.047570109367370605, 0.023022713139653206, 0.03125600144267082, 0.006403668317943811, -0.03763788938522339, 0.06146650388836861, -0.017740774899721146, 0.03321630880236626, 0.031386688351631165, -0.05893988907337189, -0.060377445071935654, -0.00257834792137146, -0.07788951694965363, -0.019940674304962158, 0.005973489955067635, -0.034632083028554916, -0.04552267864346504, -0.02350189909338951, -0.018111055716872215, 0.033020276576280594, -0.0012510567903518677, -0.020016908645629883, -0.024220678955316544, -0.01766454055905342, 0.03424002230167389, 0.01223013550043106, -0.0294917244464159, 0.016205202788114548, -0.03792104497551918, 0.010307946242392063, -0.011772730387747288, 0.02374149113893509, 0.06063881888985634, -0.04547911509871483, -0.0719650387763977, 0.020735688507556915, 0.03184409439563751, -0.04212481155991554, -0.02875116467475891, 0.005260156467556953, 0.0849030613899231, -0.052492655813694, -0.03188765421509743, 0.05623902007937431, -0.04349702596664429, -0.07484015077352524, 0.005377230234444141, -0.03694089129567146, -0.011347997933626175, 0.026355234906077385, 0.014321129769086838, 0.017185354605317116, 0.06338325142860413, 0.019494161009788513, 0.03384796157479286, -0.03591717407107353, -0.03513305261731148, -0.049573976546525955, 0.012001433409750462, -0.02713935635983944, 0.0006653471500612795, 0.04652461037039757, 0.014364691451191902, -0.007645196281373501, 0.01645568571984768, 0.01871003769338131, 0.010683671571314335, -0.024503832682967186, 0.018013039603829384, 0.021051514893770218, -0.0669989287853241, 0.007612524088472128, 0.04406333714723587, 0.024286022409796715, -0.008946621790528297, -0.023915741592645645, 0.02853335253894329, -0.013537006452679634, -0.007705094292759895, 0.011402450501918793, -0.015943827107548714, -0.03208368644118309, 0.011173748411238194, 0.01738138683140278, 0.007182345725595951, -0.04166740924119949, -0.06813155114650726, -0.022184137254953384, -0.01393995899707079, 0.028119510039687157, -0.017991259694099426, 0.04678598791360855, 0.0069863153621554375, -0.05924482271075249, 0.04123178496956825, 0.000815433100797236, 0.04110109806060791, 0.020953500643372536, 0.06682467460632324, -0.029252132400870323, -0.031103532761335373, 0.010520312935113907, 0.06712961196899414, -0.017468510195612907, 0.023697929456830025, 0.04865916818380356, 0.016041843220591545, -0.028119510039687157, 0.014876550063490868, 0.018274415284395218, 0.04648105055093765, -0.012469728477299213, 0.01722891815006733, -0.002191731706261635, -0.01367858424782753, 0.05144716054201126, -0.038487356156110764, -0.016771512106060982, -0.02572358027100563, -0.04582761228084564, 0.013373647816479206, -0.0595933236181736, 0.01710912026464939, -0.03269355744123459, 0.04556623846292496, 0.07161653786897659, 0.036113206297159195, -0.017120011150836945, -0.010449524037539959, -0.00223529408685863, -0.015039908699691296, 0.04458608478307724, -0.023981085047125816, -0.0081842802464962, -0.056674644351005554, 0.011957870796322823, -0.007209572475403547, 0.022739557549357414, 0.026355234906077385, 0.05493215098977089, -0.004639392253011465, 0.02507014386355877, 0.009050082415342331, -0.013841942884027958, -0.01139155961573124, -0.04648105055093765, 0.062207065522670746, 0.005951709114015102, 0.027858136221766472, 0.011533137410879135, 0.047134485095739365, -0.0004723794700112194, 0.005336390342563391, 0.03001447394490242, 0.014092426747083664, 0.025767141953110695, 0.004764634184539318, 0.01445181667804718, 0.00480275135487318, -0.059114135801792145, -0.050227414816617966, -0.03400043025612831, -0.008516443893313408, -0.04330099746584892, 0.009327792562544346, 0.022892026230692863, -0.02676907740533352, -0.008658020757138729, 0.036788422614336014, 0.01182718388736248, -0.00809171050786972, -0.006349215749651194, 0.004631224554032087, 0.05510639771819115, -0.02899075858294964, 0.010351507924497128, 0.04236440733075142, 0.012480619363486767, -0.043279215693473816, 0.015802249312400818, -0.021040625870227814, -0.03726760670542717, -0.023175181820988655, 0.03125600144267082, 0.030929282307624817, 0.004819087218493223, 0.016128968447446823, 0.09322347491979599, 0.07083241641521454, 0.023523680865764618, -0.009104535914957523, 0.02899075858294964, -0.08533868193626404, -0.040338754653930664, -0.042103029787540436, 0.021606935188174248, -0.025004800409078598, -0.049356166273355484, 0.038487356156110764, 0.017686322331428528, -0.0242424588650465, 0.01871003769338131, -0.06002894788980484, -0.025919610634446144, 0.013090492226183414, -0.015834921970963478, -0.04504349082708359, 0.012034105136990547, -0.009981228038668633, -0.03696267306804657, 0.06852360814809799, 0.015911156311631203, 0.05353815481066704, -0.012556853704154491, -0.02343655563890934, -0.0032481192611157894, -0.059985384345054626, 0.03748542070388794, 0.014909221790730953, 0.016619045287370682, -0.04626323655247688, 0.0768875852227211, 0.011587590910494328, -0.022249480709433556, 0.007220462895929813, -0.014626066200435162, 0.03535086289048195, 0.0069427527487277985, 0.007814000360667706, 0.036113206297159195, -0.014658737927675247, -0.05427871271967888, -0.014353801496326923, 0.010493085719645023, -0.011064842343330383, 0.03948928788304329, 0.011587590910494328, 0.025113707408308983, 0.03646170347929001, -0.029687754809856415, 0.012317260727286339, 0.011522247456014156, -0.07375109195709229, -0.03687554597854614, -0.011249981820583344, -0.035525113344192505, 0.05702314153313637, -0.05606476962566376, -0.005407179240137339, -0.012132120318710804, -0.02247818373143673, -0.009442144073545933, 0.05833001434803009, -0.017686322331428528, 0.01038962509483099, 0.017098231241106987, -0.01679329387843609, 0.06930772960186005, -0.045871175825595856, 0.0044542523100972176, -0.0014811205910518765, 0.060508131980895996, 0.012404385022819042, -0.0030439207330346107, 0.004889876116067171, -0.020637672394514084, -0.05092441290616989, -0.0456969253718853, -0.023349430412054062, 0.0629911869764328, 0.008587232790887356, -0.032127249985933304, 0.04312674701213837, -0.005946263670921326, 0.030188722535967827 ]
42,921
linearmodels.iv.model
__init__
null
def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ) -> None: self._method = "IV-GMM-CUE" super().__init__( dependent, exog, endog, instruments, weights=weights, weight_type=weight_type, **weight_config, ) if "center" not in weight_config: weight_config["center"] = True
(self, dependent: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], endog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], instruments: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, weight_type: str = 'robust', **weight_config: Any) -> NoneType
[ 0.04583005979657173, -0.06779104471206665, 0.004043431952595711, 0.00467571010813117, -0.009423423558473587, -0.0418698824942112, -0.04907020553946495, -0.017937805503606796, 0.02143896371126175, -0.006336284801363945, 0.00048349046846851707, 0.04745013266801834, 0.001869834028184414, 0.02399507910013199, -0.05231035128235817, 0.03630763292312622, 0.013482606038451195, -0.02484111674129963, 0.033391501754522324, -0.04471401125192642, -0.03902575373649597, -0.028045261278748512, -0.05691855773329735, 0.05195033550262451, 0.014850667677819729, 0.07524338364601135, -0.045038025826215744, -0.01595771685242653, 0.04078983515501022, -0.06091473624110222, -0.056594543159008026, -0.012384556233882904, -0.06235480308532715, 0.03596561774611473, 0.0690511018037796, -0.01846883073449135, 0.0389537513256073, 0.034057531505823135, -0.08136365562677383, 0.07099518924951553, 0.049538224935531616, -0.04914220795035362, 0.10706881433725357, 0.0054137432016432285, -0.014922671020030975, 0.05825061723589897, -0.029287315905094147, 0.03970978409051895, 0.022158995270729065, -0.017730796709656715, 0.02271702140569687, -0.04813416302204132, 0.03079938516020775, -0.003937677014619112, -0.05321039259433746, 0.08129165321588516, 0.035677604377269745, 0.05979868769645691, 0.03690166026353836, 0.01309558842331171, -0.021240955218672752, -0.012195548042654991, 0.036451637744903564, -0.028819294646382332, -0.036541640758514404, 0.045722056180238724, -0.053534407168626785, 0.023257045075297356, 0.015237685292959213, 0.03587561100721359, 0.0503302626311779, -0.02075493335723877, -0.04089783877134323, 0.05429043993353844, 0.04543404281139374, -0.0013388101942837238, -0.033139489591121674, 0.021834980696439743, 0.0036564143374562263, -0.03299548476934433, 0.039601780474185944, -0.011097499169409275, -0.030061351135373116, -0.03682965412735939, 0.024769112467765808, -0.037981707602739334, -0.034993574023246765, -0.03913375735282898, 0.017748797312378883, -0.012690570205450058, -0.08129165321588516, -0.014355645515024662, -0.00367891532368958, 0.050042249262332916, 0.08834797143936157, 0.011556519195437431, -0.028423277661204338, -0.08914000540971756, 0.02422908879816532, -0.0026483689434826374, 0.01395062729716301, -0.013842621818184853, 0.043741967529058456, -0.0448940172791481, -0.01655174419283867, -0.07495536655187607, -0.055406488478183746, -0.009423423558473587, -0.006547794211655855, -0.05861063301563263, -0.027163220569491386, -0.0013478106120601296, -0.018027810379862785, -0.031753428280353546, -0.06199478730559349, 0.022501010447740555, 0.009891444817185402, 0.023095037788152695, 0.003969178535044193, 0.032869476824998856, -0.02212299406528473, -0.021294957026839256, -0.050726279616355896, 0.01433764398097992, 0.025075126439332962, -0.02669519931077957, -0.004473200999200344, 0.01487766858190298, -0.00030854513170197606, -0.06321883946657181, -0.012042541056871414, -0.04543404281139374, -0.03240145742893219, -0.009243415668606758, -0.010728482156991959, -0.001595321693457663, 0.03834172338247299, -0.008878898806869984, 0.015147680416703224, 0.09216414391994476, 0.03765769302845001, 0.03769369423389435, 0.0055802506394684315, 0.017001764848828316, 0.0036001617554575205, 0.085755854845047, 0.005490246694535017, -0.0350295752286911, -0.026137175038456917, 0.002884629648178816, -0.03726167604327202, 0.05699056014418602, -0.011601521633565426, -0.023689065128564835, 0.0010693605290725827, -0.0045654550194740295, -0.00796985812485218, 0.02415708638727665, 0.001146426540799439, 0.006984313949942589, -0.03675765171647072, 0.032779473811388016, 0.022303001955151558, 0.0038634235970675945, 0.019458875060081482, 0.007960857823491096, -0.01675875298678875, -0.018180817365646362, -0.016605746001005173, 0.02422908879816532, -0.03403953090310097, -0.11520517617464066, -0.05623452737927437, 0.0010164831764996052, 0.034831564873456955, 0.048854194581508636, 0.03394952416419983, 0.0025876162108033895, 0.024175086989998817, 0.01357260998338461, 0.05148231238126755, 0.019188862293958664, -0.06480291485786438, 0.005301238037645817, 0.011601521633565426, 0.0014569404302164912, 0.058466628193855286, 0.014688660390675068, 0.03103339485824108, -0.061958786100149155, 0.07319129258394241, -0.012096543796360493, -0.004448449704796076, -0.002109469845890999, 0.05990669131278992, 0.014571654610335827, 0.08035561442375183, -0.02057492546737194, -0.076899453997612, 0.03862973675131798, 0.050294261425733566, -0.04269791767001152, -0.0040321811102330685, -0.02543514408171177, 0.01846883073449135, 0.012006539851427078, 0.005274237133562565, -0.013320598751306534, -0.005904265213757753, -0.02815326489508152, 0.05306638404726982, 0.021294957026839256, 0.010926490649580956, 0.023941075429320335, 0.01509367860853672, -0.01963888294994831, -0.026245180517435074, 0.030133353546261787, -0.023023035377264023, 0.006835807114839554, 0.0462980791926384, 0.000029005210308241658, -0.02422908879816532, -0.015498696826398373, 0.007002314552664757, -0.01305058691650629, 0.038449726998806, -0.008019360713660717, -0.02244700863957405, -0.014166636392474174, 0.0038971751928329468, -0.01787480339407921, -0.02082693576812744, 0.03634363412857056, -0.009738437831401825, 0.0069483122788369656, -0.029539328068494797, 0.02408508211374283, -0.06329084187746048, -0.0024143585469573736, 0.014067632146179676, 0.016722751781344414, -0.0011199878063052893, 0.024193087592720985, -0.001936212065629661, -0.059330668300390244, 0.05519048124551773, 0.059078656136989594, -0.04212189465761185, -0.0010181707330048084, 0.0023851071018725634, -0.07725947350263596, -0.05781859904527664, 0.0026303681079298258, -0.036865655332803726, -0.012312553822994232, 0.002488611964508891, -0.020970942452549934, 0.03726167604327202, -0.07754748314619064, -0.03583960980176926, -0.02397707849740982, -0.03956577926874161, 0.08906800299882889, 0.022321002557873726, 0.02525513432919979, 0.019332868978381157, -0.016173727810382843, -0.010809485800564289, 0.017568789422512054, 0.011619522236287594, 0.031933434307575226, 0.014958672225475311, 0.008896899409592152, -0.01846883073449135, 0.019674884155392647, -0.029359320178627968, -0.01904485560953617, -0.013923625461757183, 0.024301093071699142, 0.04651409015059471, -0.038161713629961014, 0.0005889639724045992, -0.004425948951393366, -0.031267404556274414, -0.02185298129916191, -0.03283347561955452, -0.06959112733602524, 0.013419602997601032, -0.006808806210756302, -0.03191543370485306, 0.061886779963970184, -0.00794735737144947, 0.06131075695157051, 0.05724257230758667, -0.033895522356033325, 0.03675765171647072, 0.04269791767001152, 0.02696521207690239, -0.0036654146388173103, 0.02363506145775318, -0.018990853801369667, -0.028027258813381195, -0.02253701351583004, -0.054902467876672745, -0.026263181120157242, 0.09353220462799072, -0.04615407437086105, -0.016218729317188263, 0.004290943033993244, 0.019008854404091835, 0.05857463181018829, -0.015192682854831219, 0.03834172338247299, -0.010224459692835808, 0.00584576278924942, 0.048602186143398285, -0.005436244420707226, 0.03418353572487831, 0.08265971392393112, 0.022843027487397194, -0.025273136794567108, -0.022591015323996544, -0.028297271579504013, -0.032545462250709534, 0.014184637926518917, 0.01828882284462452, 0.004488951526582241, 0.022429008036851883, 0.005098729394376278, -0.06811506301164627, 0.01206954289227724, 0.02712721936404705, -0.024535102769732475, -0.059078656136989594, -0.04770214483141899, 0.029539328068494797, -0.030331363901495934, 0.029989348724484444, -0.011583521030843258, 0.03758569061756134, -0.01513868011534214, -0.04309393838047981, 0.02100694365799427, 0.0040029301308095455, -0.0690511018037796, 0.031591419130563736, -0.07509937882423401, 0.0443899966776371, 0.04863818734884262, -0.044425997883081436, 0.021060947328805923, 0.009076908230781555, 0.05555049702525139, 0.036199625581502914, -0.01471566129475832, -0.030655378475785255, -0.021996987983584404, 0.024301093071699142, -0.0018900849390774965, -0.00799235887825489, 0.024031080305576324, -0.011277507059276104, 0.04269791767001152, 0.0077943503856658936, -0.04078983515501022, 0.037549689412117004, 0.0008173492387868464, 0.050042249262332916, 0.03178942948579788, -0.000006143830887594959, -0.04867418855428696, -0.042661916464567184, 0.049538224935531616, 0.014742662198841572, -0.021150950342416763, -0.07783550024032593, -0.007312828674912453, 0.006543294060975313, -0.01990889571607113, 0.009927446022629738, -0.013041586615145206, -0.02415708638727665, -0.004531703889369965, -0.024967122822999954, -0.004635208286345005, 0.05321039259433746, 0.05738658085465431, 0.013419602997601032, -0.005386742297559977, 0.02874729223549366, -0.03259946405887604, 0.021042944863438606, -0.02916130982339382, -0.008473880589008331, -0.00714632123708725, 0.005836762487888336, -0.022501010447740555, -0.03555159643292427, -0.021870983764529228, -0.04849417880177498, -0.034651558846235275, -0.012267551384866238, 0.038161713629961014, -0.0072813271544873714, -0.03981779143214226, 0.011502517387270927, 0.05792660266160965, 0.03546159341931343, -0.0008404127438552678, -0.04262591525912285, 0.047594137489795685, -0.04280592501163483, -0.012690570205450058, -0.0493222177028656, -0.053462401032447815, 0.015183682553470135, -0.04723412171006203, -0.007875354029238224, 0.027865251526236534, 0.046046070754528046, 0.036451637744903564, 0.07261526584625244, 0.0028373776003718376, 0.014832667075097561, 0.017892803996801376, -0.005085228476673365, -0.024283090606331825, 0.00826687179505825, -0.03733367845416069, -0.057638589292764664, 0.1183733195066452, -0.03880974277853966, -0.02016090601682663, 0.013680614531040192, 0.010107453912496567, -0.013725616969168186, -0.018846847116947174, 0.03493957221508026, 0.016605746001005173, -0.032023441046476364, -0.029827341437339783, -0.012978583574295044, -0.02338305115699768, -0.0423739030957222, -0.0078033506870269775, -0.04907020553946495, 0.004331444855779409, -0.012474561110138893, -0.03607362136244774, 0.05936666950583458, 0.01744278334081173, 0.0032873977907001972, 0.014247640036046505, -0.015705706551671028, -0.025633152574300766, -0.013329599052667618, -0.021042944863438606, 0.04269791767001152, -0.03114140033721924, -0.048602186143398285, -0.010539473965764046, -0.044966019690036774, -0.026479190215468407, -0.034651558846235275, 0.07913155853748322, 0.06966312974691391, -0.05414643511176109, -0.014724661596119404, 0.0369376614689827, 0.022086992859840393, 0.008509882725775242, 0.06919510662555695, -0.03558759763836861, 0.019800890237092972, 0.028279270976781845, -0.014661658555269241, -0.01846883073449135, 0.032293450087308884, -0.05058227479457855, 0.06429889053106308, 0.007137320935726166, 0.02178097888827324, 0.0207369327545166, -0.016911759972572327, 0.01940487138926983, 0.0030983893666416407, -0.032959479838609695, 0.0047297123819589615, -0.028585284948349, -0.05893464758992195, 0.061778776347637177, 0.008757393807172775, 0.041797880083322525, 0.056774552911520004, 0.03801770880818367, 0.0014186888001859188, -0.037117667496204376, 0.04525403305888176, 0.013347599655389786, 0.026389185339212418, -0.012960582971572876, -0.02109694853425026, -0.0887799933552742, -0.025201132521033287, -0.04662209376692772, -0.04194188490509987, 0.02899930253624916, -0.030565373599529266, 0.005076228175312281, 0.013896624557673931, 0.0012915580300614238, 0.02952132746577263, -0.00512573029845953, 0.0231490395963192, -0.02107894793152809, -0.04662209376692772, 0.04330994561314583, 0.0032311452087014914, -0.020268911495804787, 0.03146541491150856, 0.008248871192336082, 0.01126850675791502, 0.006453290116041899, 0.04763014242053032, 0.006093273870646954, -0.047846149653196335, -0.06847507506608963, 0.03740568086504936, 0.03112339973449707, -0.03445354849100113, -0.03682965412735939, -0.015678703784942627, 0.07139120995998383, -0.035677604377269745, 0.010638478212058544, 0.009315419010818005, 0.0019485875964164734, -0.035515595227479935, -0.039421770721673965, -0.039601780474185944, -0.022645017132163048, 0.024301093071699142, -0.011880533769726753, 0.01972888596355915, 0.012852577492594719, 0.005665754433721304, 0.03342750295996666, -0.0413658581674099, -0.014850667677819729, -0.09598031640052795, -0.003417903557419777, -0.04114985093474388, 0.04006979987025261, 0.0527423694729805, 0.002727122511714697, 0.0123305544257164, -0.019530877470970154, 0.00722732488065958, 0.0448940172791481, -0.026335183531045914, -0.009396422654390335, 0.019854892045259476, -0.018486831337213516, 0.031177401542663574, 0.03178942948579788, 0.03569560497999191, -0.0063992878422141075, -0.01803681068122387, 0.0028958802577108145, -0.031411413103342056, -0.0226990208029747, 0.005809761118143797, 0.024193087592720985, -0.050402265042066574, 0.020052900537848473, 0.001590821542777121, 0.020538922399282455, -0.01395062729716301, -0.0981404110789299, -0.06527093052864075, -0.0064082881435751915, 0.015759708359837532, -0.021492965519428253, 0.046910107135772705, -0.00796985812485218, -0.01904485560953617, 0.045542046427726746, -0.005931266583502293, 0.026317182928323746, -0.009603431448340416, -0.026083173230290413, -0.04143786057829857, -0.006052772048860788, -0.01687575876712799, 0.03132140636444092, -0.04892620071768761, -0.021996987983584404, 0.04057382419705391, 0.03427353873848915, -0.03484956547617912, 0.009243415668606758, 0.032779473811388016, 0.04727012291550636, -0.013419602997601032, -0.00011637241550488397, -0.017226774245500565, 0.02329304628074169, -0.0030601376201957464, -0.029305316507816315, 0.03146541491150856, 0.028693290427327156, -0.027793249115347862, 0.010386466979980469, -0.005971768405288458, -0.034651558846235275, -0.06141876056790352, 0.023455053567886353, 0.06948312371969223, 0.04032181203365326, -0.02413908578455448, 0.0036564143374562263, -0.019242864102125168, 0.019926896318793297, -0.013851622119545937, 0.033211492002010345, 0.0011903034755960107, -0.07373131066560745, -0.008878898806869984, 0.007330829277634621, 0.03400352969765663, -0.0035574098583310843, 0.030061351135373116, -0.012177547439932823, 0.009810441173613071, 0.008217369206249714, 0.003892675042152405, 0.030151356011629105, 0.01999889872968197, 0.03596561774611473, 0.01593971624970436, 0.0399617962539196, 0.04204988852143288, 0.02066492848098278, 0.0004789902886841446, 0.010107453912496567, -0.023077037185430527, -0.014481650665402412, -0.030835386365652084, -0.0038971751928329468, 0.005895264912396669, -0.0077943503856658936, -0.03740568086504936, -0.0369376614689827, -0.021456964313983917, 0.011835532262921333, -0.026389185339212418, 0.008698890917003155, 0.054902467876672745, -0.020088903605937958, -0.04550604522228241, 0.06073473021388054, 0.07805150747299194, 0.04064582660794258, 0.0615987703204155, -0.01837882585823536, 0.05580250918865204, -0.08309173583984375, -0.008325373753905296, -0.021672973409295082, 0.03319349139928818, -0.02041291818022728, -0.015444694086909294, 0.003186143236234784, -0.026929210871458054, -0.003960177768021822, 0.004250441212207079, 0.018738841637969017, 0.045218031853437424, 0.018810845911502838, 0.10368466377258301, 0.02950332686305046, 0.034237537533044815, -0.04799015820026398, 0.039673782885074615, -0.05310238525271416, -0.05997869744896889, 0.006606297101825476, -0.014958672225475311, -0.07308328151702881, -0.03587561100721359, -0.017208773642778397, -0.00576475914567709, -0.06264281272888184, 0.04215789586305618, -0.08719591796398163, -0.06275082379579544, -0.0626068115234375, 0.004362945910543203, -0.00724982563406229, 0.03367951512336731, 0.0021274706814438105, -0.05429043993353844, 0.0527423694729805, 0.006048271898180246, 0.03191543370485306, 0.008793395012617111, -0.04093383997678757, 0.030979393050074577, -0.04917820915579796, 0.038485728204250336, 0.044786013662815094, 0.0008235370041802526, -0.04284192621707916, 0.03902575373649597, 0.05875464156270027, -0.032527461647987366, 0.04284192621707916, -0.06642298400402069, 0.00908590853214264, -0.0027878752443939447, -0.0006317158695310354, 0.05457845330238342, -0.02890929952263832, -0.008500882424414158, -0.019008854404091835, 0.03315749019384384, 0.03403953090310097, 0.042481910437345505, 0.0006401537684723735, 0.026083173230290413, 0.0028553784359246492, -0.04446199908852577, 0.001759579055942595, 0.005040226504206657, -0.03196943551301956, -0.05825061723589897, 0.010197458788752556, -0.010350464843213558, 0.032293450087308884, -0.05519048124551773, -0.0030083851888775826, -0.018774844706058502, -0.005989769008010626, 0.011493516154587269, 0.05270636826753616, -0.005917766131460667, 0.008559384383261204, 0.06329084187746048, -0.0010446094674989581, 0.03231145069003105, 0.030979393050074577, 0.02413908578455448, -0.005791760515421629, 0.06998714804649353, -0.03281547501683235, 0.03970978409051895, -0.014067632146179676, -0.02788325399160385, -0.05648653954267502, -0.008172367699444294, -0.058394625782966614, 0.07581941038370132, -0.017118768766522408, 0.017415782436728477, 0.05619852617383003, 0.05735057592391968, 0.03769369423389435 ]
42,928
linearmodels.iv.model
estimate_parameters
Parameters ---------- starting : ndarray Starting values for the optimization x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) display : bool Flag indicating whether to display iterative optimizer output opt_options : dict Dictionary containing additional keyword arguments to pass to scipy.optimize.minimize. Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking. See Also -------- scipy.optimize.minimize
def estimate_parameters( self, starting: Float64Array, x: Float64Array, y: Float64Array, z: Float64Array, display: bool = False, opt_options: dict[str, Any] | None = None, ) -> tuple[Float64Array, int]: r""" Parameters ---------- starting : ndarray Starting values for the optimization x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) display : bool Flag indicating whether to display iterative optimizer output opt_options : dict Dictionary containing additional keyword arguments to pass to scipy.optimize.minimize. Returns ------- ndarray Estimated parameters (nvar by 1) Notes ----- Exposed to facilitate estimation with other data, e.g., bootstrapped samples. Performs no error checking. See Also -------- scipy.optimize.minimize """ args = (x, y, z) if opt_options is None: opt_options = {} assert opt_options is not None options = {"disp": display} if "options" in opt_options: opt_options = opt_options.copy() options.update(opt_options.pop("options")) res = minimize(self.j, starting, args=args, options=options, **opt_options) return res.x[:, None], res.nit
(self, starting: numpy.ndarray, x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray, display: bool = False, opt_options: Optional[dict[str, Any]] = None) -> tuple[numpy.ndarray, int]
[ 0.010257923975586891, 0.02344927005469799, 0.0732269138097763, -0.007673072163015604, 0.06602010875940323, 0.023757098242640495, -0.06174672767519951, -0.03205035626888275, -0.025604069232940674, 0.0014621842419728637, -0.026382694020867348, 0.011561667546629906, -0.0389312207698822, 0.020715031772851944, -0.042081933468580246, 0.03802584484219551, -0.04248030111193657, -0.052656739950180054, -0.037808552384376526, 0.030402569100260735, -0.02136690355837345, -0.009615106508135796, -0.019302643835544586, 0.11509155482053757, 0.024101141840219498, -0.010149278677999973, 0.059501394629478455, -0.07297340780496597, 0.035581327974796295, 0.037808552384376526, -0.027306178584694862, -0.009194105863571167, -0.05287403240799904, -0.025604069232940674, 0.018170921131968498, 0.006794856395572424, 0.06754114478826523, 0.05881330743432045, 0.010511429980397224, -0.012267861515283585, -0.06142079457640648, -0.0625796765089035, 0.017356082797050476, -0.005006736144423485, -0.013191347010433674, 0.01099127996712923, 0.0035717133432626724, -0.01435928326100111, -0.01295594871044159, -0.04841957613825798, 0.0886545404791832, -0.053996700793504715, -0.0021412172354757786, -0.04946981370449066, -0.009080933406949043, 0.03498377650976181, 0.05102706328034401, 0.024825444445014, 0.03492945432662964, -0.09524568915367126, 0.00722491042688489, 0.010484268888831139, -0.01590747758746147, -0.01141680683940649, -0.010040633380413055, 0.036486703902482986, -0.04950602725148201, -0.010520483367145061, -0.004071934148669243, 0.05392426997423172, 0.007704760413616896, 0.022616323083639145, 0.000007157254913181532, -0.034675948321819305, -0.003938390873372555, 0.052041083574295044, -0.03366192802786827, -0.03610644489526749, -0.05602474510669708, -0.05837872624397278, -0.03494756296277046, 0.06678062677383423, -0.02953340671956539, -0.021131504327058792, 0.022815506905317307, 0.004574418533593416, 0.0001669289340497926, 0.011045602150261402, -0.023557916283607483, -0.021131504327058792, -0.046970970928668976, 0.015463843941688538, 0.06152943894267082, 0.030583644285798073, -0.006740533746778965, 0.025097057223320007, -0.033535175025463104, -0.050157900899648666, 0.018243351951241493, -0.024753013625741005, 0.013055539689958096, -0.015916531905531883, 0.03911229595541954, 0.01717500574886799, -0.006500608753412962, -0.06656333804130554, 0.01732891984283924, -0.018243351951241493, -0.013426744379103184, -0.018596448004245758, -0.0063466946594417095, 0.0003573410795070231, -0.06022569537162781, -0.03038446046411991, 0.007405986078083515, 0.04751419648528099, -0.04570344462990761, 0.0366496704518795, -0.041937075555324554, -0.010737773962318897, -0.0301852785050869, 0.022127419710159302, -0.03762747719883919, 0.02643701620399952, -0.01274771150201559, -0.045920733362436295, 0.028935857117176056, 0.01722932979464531, 0.011226678267121315, -0.07319069653749466, 0.00825704075396061, -0.047441769391298294, -0.05526422709226608, 0.06261589378118515, 0.005346252582967281, 0.052004870027303696, 0.010411838069558144, -0.002931158756837249, 0.015871264040470123, 0.019863976165652275, 0.03085525706410408, 0.0688086748123169, -0.04983196407556534, 0.018107544630765915, -0.05392426997423172, -0.011380592361092567, 0.08329470455646515, 0.0031144977547228336, -0.01416915375739336, 0.025042735040187836, -0.004112676251679659, -0.01535519864410162, -0.039184726774692535, -0.0679757222533226, -0.03000420145690441, -0.05243945121765137, 0.007324501872062683, 0.005645027384161949, 0.01728365197777748, -0.03308248519897461, -0.07670356333255768, -0.0011600146535784006, -0.016206253319978714, 0.008075965568423271, 0.01207773294299841, 0.036052122712135315, -0.061493221670389175, 0.04447213187813759, -0.022471463307738304, -0.05182379484176636, -0.011045602150261402, -0.033824894577264786, 0.024372756481170654, -0.032303862273693085, -0.03326356038451195, -0.006536823697388172, -0.005092747043818235, -0.01310080848634243, 0.05044762045145035, 0.008080491796135902, 0.03570807725191116, -0.04450834542512894, -0.01671326346695423, -0.06558553129434586, -0.00973280519247055, -0.043023526668548584, 0.03715668246150017, -0.030293922871351242, -0.03885878995060921, -0.023032797500491142, 0.01961047202348709, -0.041756000369787216, -0.0294247604906559, 0.00391802005469799, -0.031199300661683083, 0.02947908267378807, 0.06732385605573654, 0.016984878107905388, 0.05482964590191841, -0.0015165068907663226, -0.020515847951173782, -0.02102285996079445, 0.021131504327058792, -0.02705267257988453, 0.03579861670732498, 0.03578050807118416, -0.020352881401777267, -0.03655913472175598, 0.03295573219656944, 0.04928873851895332, 0.0046491120010614395, -0.03737397491931915, -0.005214972887188196, -0.004368445370346308, -0.010493322275578976, 0.059175457805395126, 0.017410404980182648, 0.015491005033254623, 0.05989975854754448, -0.039474450051784515, 0.05330861359834671, -0.04921630769968033, 0.004037982784211636, 0.01704825460910797, 0.03791720047593117, -0.016025178134441376, 0.05059248208999634, 0.02801237255334854, -0.043458107858896255, -0.07098157703876495, 0.010927903465926647, -0.059501394629478455, 0.02011748217046261, -0.016351113095879555, 0.06815680116415024, -0.03645048663020134, 0.00015674343740101904, 0.004289224743843079, -0.006577565800398588, -0.007568954024463892, -0.03071039728820324, 0.057219844311475754, 0.004644585307687521, -0.031126869842410088, -0.07051078230142593, -0.02564028464257717, 0.014042401686310768, 0.03907608240842819, -0.008343051187694073, -0.03699371591210365, 0.043784044682979584, 0.010792097076773643, -0.012132055126130581, -0.012123001739382744, -0.03252115100622177, 0.07887646555900574, 0.04918009415268898, 0.041031695902347565, 0.04157492518424988, -0.039365801960229874, 0.027269963175058365, -0.023702776059508324, -0.050628695636987686, 0.015835048630833626, 0.04968710243701935, 0.041176557540893555, -0.018306728452444077, -0.00411946652457118, 0.01196003332734108, 0.04305974394083023, -0.028302092105150223, 0.0977083146572113, -0.013888486661016941, -0.01766391098499298, 0.016070445999503136, 0.05895816534757614, 0.022181741893291473, -0.06547687947750092, -0.01207773294299841, -0.005454897880554199, 0.010411838069558144, -0.0290445014834404, -0.02526002563536167, -0.03503809869289398, 0.05863223224878311, -0.014314014464616776, 0.004563101567327976, 0.04780391976237297, 0.006428178399801254, -0.012657173909246922, 0.05678526312112808, 0.0565679706633091, 0.011335323564708233, -0.05305510759353638, 0.057690639048814774, 0.045305076986551285, -0.008637298829853535, 0.0010581596288830042, 0.016957715153694153, 0.08003535121679306, -0.0016873968997970223, -0.046065595000982285, -0.00617014616727829, 0.0063874367624521255, -0.03473027050495148, 0.030547428876161575, 0.027885619550943375, -0.029352329671382904, 0.023087119683623314, -0.0015006627654656768, 0.02060638554394245, 0.04563101381063461, 0.014793864451348782, -0.059175457805395126, -0.04367540031671524, -0.02529624104499817, -0.013155131600797176, 0.0339878611266613, 0.006708845496177673, 0.048383358865976334, 0.0397641696035862, 0.036052122712135315, 0.03610644489526749, -0.005029370542615652, 0.027740759775042534, 0.03849663957953453, -0.04954224452376366, 0.05406912788748741, -0.009696590714156628, -0.014685219153761864, -0.0005867976578883827, -0.030112847685813904, -0.03369814157485962, 0.04918009415268898, -0.003940654452890158, 0.03387921676039696, 0.007559900172054768, -0.0009710171143524349, 0.0549745075404644, 0.03478459268808365, -0.0008844403782859445, -0.015626810491085052, -0.05334482714533806, -0.009986311197280884, -0.016079500317573547, -0.010067795403301716, 0.08568490296602249, -0.05562637746334076, -0.011543559841811657, 0.02719753235578537, -0.10372001677751541, 0.045739658176898956, 0.04961467534303665, -0.005192338488996029, 0.02064260095357895, 0.024952197447419167, -0.016686102375388145, -0.020914213731884956, 0.04983196407556534, 0.009968203492462635, -0.02198255993425846, 0.036052122712135315, -0.004241692367941141, 0.0015119799645617604, 0.01234029233455658, -0.03715668246150017, -0.018026061356067657, -0.006075081415474415, -0.02420978806912899, -0.029261792078614235, 0.0198458693921566, -0.06634604185819626, -0.0580165758728981, 0.04657260701060295, 0.02415546588599682, 0.03308248519897461, -0.03578050807118416, -0.03784476965665817, 0.007252071984112263, -0.02259821631014347, -0.007030254229903221, -0.030982010066509247, 0.017627695575356483, 0.04476185142993927, -0.06094999611377716, 0.030293922871351242, -0.03503809869289398, -0.02795805037021637, 0.004812079947441816, 0.009058299474418163, -0.0005259676254354417, -0.016695156693458557, -0.00031744790612719953, 0.035907261073589325, 0.05287403240799904, 0.0015923322644084692, 0.09140688925981522, -0.002516948850825429, -0.04048847034573555, -0.00999536458402872, -0.05479343235492706, -0.02866424433887005, -0.01037562359124422, 0.07311826944351196, 0.04675368219614029, -0.07576196640729904, 0.03554511070251465, -0.017790663987398148, -0.010104009881615639, 0.028772888705134392, -0.034820809960365295, -0.024282218888401985, 0.021529871970415115, -0.0162334144115448, -0.01827956736087799, 0.06323155015707016, -0.03853285685181618, 0.032539259642362595, 0.023811422288417816, 0.013979025185108185, 0.06406449526548386, -0.04472563788294792, 0.05779928341507912, 0.032539259642362595, 0.008103126659989357, 0.017528103664517403, -0.03393353894352913, -0.10060551762580872, -0.012213539332151413, -0.03473027050495148, -0.033770572394132614, 0.003451750846579671, 0.017437566071748734, 0.016450705006718636, -0.007568954024463892, -0.032159000635147095, 0.0053326720371842384, 0.010973172262310982, 0.00474870391190052, -0.023576023057103157, 0.009886719286441803, 0.009651321917772293, 0.012802034616470337, 0.00014981164713390172, -0.1406594067811966, 0.023702776059508324, 0.06080513820052147, -0.02497030422091484, -0.06732385605573654, -0.011208570562303066, 0.0191215667873621, -0.016206253319978714, 0.0679757222533226, -0.02781318873167038, 0.04642774537205696, -0.06453529000282288, -0.04505157098174095, -0.01955614797770977, -0.052765388041734695, 0.04251651465892792, 0.046645037829875946, -0.047876350581645966, -0.04646395891904831, 0.0005570899229496717, -0.05044762045145035, 0.03150712698698044, 0.014703326858580112, 0.028736673295497894, -0.04845578968524933, -0.004870929755270481, -0.03659534826874733, 0.015463843941688538, -0.03525539115071297, -0.020244235172867775, -0.005228553432971239, 0.05939274653792381, 0.007673072163015604, 0.0732269138097763, 0.033969756215810776, -0.012041517533361912, -0.028609922155737877, -0.0198458693921566, -0.0191215667873621, 0.059356532990932465, 0.02187391370534897, -0.013236615806818008, -0.005635973531752825, 0.016577458009123802, -0.007922050543129444, -0.02833830751478672, 0.04765905812382698, 0.03295573219656944, 0.04990439489483833, 0.01728365197777748, -0.03150712698698044, 0.022417141124606133, 0.07409607619047165, -0.046355314552783966, 0.030493106693029404, 0.030167169868946075, 0.007057415787130594, -0.029352329671382904, 0.02069692313671112, 0.008252513594925404, 0.014386444352567196, 0.00391802005469799, -0.03737397491931915, 0.018161866813898087, -0.04048847034573555, 0.034820809960365295, -0.009108095429837704, -0.02857370674610138, 0.01134437695145607, -0.00391802005469799, -0.023231979459524155, -0.02046152576804161, 0.02449950762093067, 0.004200950264930725, 0.0007090235594660044, -0.002589378971606493, 0.0065051354467868805, 0.0021242413204163313, 0.05066491290926933, 0.006038866471499205, 0.05638689547777176, 0.047296907752752304, -0.009814289398491383, -0.03393353894352913, 0.014033347368240356, 0.023757098242640495, 0.0023245560005307198, -0.011516398750245571, 0.01760958693921566, 0.013064594008028507, -0.0062063611112535, 0.014114831574261189, 0.03565375506877899, -0.03241250663995743, -0.00045042517012916505, -0.0016047811368480325, 0.04878172650933266, 0.010457106865942478, -0.0221636351197958, 0.005789887625724077, 0.05251188203692436, 0.010592914186418056, -0.018632663413882256, 0.04552236944437027, 0.0665271207690239, -0.012421775609254837, -0.006550404243171215, -0.025042735040187836, 0.03639616444706917, 0.0558074526488781, -0.05359833315014839, -0.00846980419009924, 0.00669526495039463, 0.04921630769968033, -0.012159216217696667, 0.022580109536647797, 0.007781717460602522, -0.0048890369944274426, 0.02046152576804161, 0.023666560649871826, -0.015201284550130367, 0.01693960838019848, 0.03958309441804886, -0.021620409563183784, -0.02140311896800995, 0.005807994864881039, -0.02069692313671112, 0.11574342846870422, -0.03612455353140831, 0.04494292661547661, -0.01618814468383789, -0.007220383733510971, 0.06594768166542053, 0.0030398040544241667, -0.04968710243701935, 0.01570829562842846, 0.023811422288417816, -0.005545435473322868, 0.018723201006650925, -0.04309595748782158, 0.0027681910432875156, 0.034621626138687134, -0.08937884122133255, -0.021131504327058792, -0.018442533910274506, -0.007301867473870516, -0.02221795730292797, 0.07116265594959259, -0.046970970928668976, -0.020588278770446777, -0.007890363223850727, 0.058125220239162445, -0.00958794541656971, -0.0027591371908783913, 0.03802584484219551, -0.03677642345428467, -0.11552613973617554, -0.029678266495466232, -0.02994987927377224, 0.009524568915367126, 0.03167009726166725, -0.01364403497427702, -0.011389645747840405, 0.023087119683623314, -0.029515298083424568, -0.04798499494791031, 0.05776306986808777, -0.06978648155927658, -0.006826544646173716, -0.04005388915538788, -0.053236182779073715, -0.0044499291107058525, 0.03882257640361786, 0.029207469895482063, 0.035527002066373825, -0.01979154720902443, -0.022562000900506973, 0.01894049160182476, 0.001879789517261088, 0.03650481253862381, 0.019447503611445427, 0.032539259642362595, 0.004060617182403803, -0.04059711471199989, 0.024517616257071495, -0.020497741177678108, 0.013535389676690102, 0.031923603266477585, 0.02953340671956539, 0.029913663864135742, 0.01879563182592392, -0.048528220504522324, 0.017573373392224312, -0.0006258420180529356, -0.05595231428742409, -0.029587728902697563, 0.037518832832574844, 0.04581208899617195, 0.022145528346300125, 0.008094072341918945, 0.07297340780496597, -0.017500942572951317, 0.015436681918799877, -0.011208570562303066, 0.03521917387843132, 0.01509263925254345, -0.022199850529432297, 0.01348106749355793, -0.056133389472961426, 0.016930554062128067, 0.012430829927325249, -0.05131678283214569, -0.04874551296234131, 0.03925715759396553, 0.04012631997466087, -0.021529871970415115, 0.02306901291012764, 0.012448937632143497, -0.009488353505730629, -0.050013039261102676, -0.007686652708798647, 0.04327703267335892, -0.038134489208459854, -0.011824226938188076, -0.011172355152666569, 0.015491005033254623, 0.011896656826138496, 0.003347632475197315, 0.06261589378118515, -0.002140085445716977, 0.01642354391515255, -0.025712713599205017, -0.05595231428742409, -0.016351113095879555, 0.008908912539482117, -0.03134416043758392, 0.05026654526591301, -0.018904276192188263, 0.04215436428785324, -0.03451298177242279, -0.0062652104534208775, -0.06515094637870789, -0.008573922328650951, -0.06717899441719055, 0.05059248208999634, 0.08945127576589584, -0.04925252124667168, 0.005242134444415569, -0.0028542017098516226, -0.005391521379351616, 0.028555598109960556, -0.08061479032039642, -0.052004870027303696, -0.0019737223628908396, 0.06518716365098953, -0.06428178399801254, -0.026400800794363022, 0.033589497208595276, -0.018958600237965584, 0.04563101381063461, -0.026274047791957855, 0.03521917387843132, -0.020914213731884956, -0.01699393056333065, 0.033535175025463104, -0.05501072108745575, -0.013472013175487518, -0.014422659762203693, -0.04048847034573555, -0.013960917480289936, 0.007220383733510971, 0.04997682571411133, 0.06228995695710182, -0.003263884922489524, 0.016541242599487305, 0.0809045135974884, 0.018777525052428246, 0.03076471947133541, -0.00009442801820114255, -0.0032005086541175842, -0.04168356955051422, 0.010239817202091217, -0.027233747765421867, -0.02420978806912899, -0.024988412857055664, -0.014766703359782696, -0.0047849188558757305, 0.042407870292663574, 0.01561775803565979, 0.006826544646173716, -0.03418704494833946, -0.0017745394725352526, 0.012711497023701668, -0.039800383150577545, 0.006138457916676998, 0.023702776059508324, -0.02102285996079445, 0.02611107937991619, 0.0244451854377985, -0.0018198082689195871, -0.01903102919459343, 0.03990903124213219, -0.029261792078614235, -0.043023526668548584, 0.0012709232978522778, -0.010031579993665218, 0.024934088811278343, -0.04642774537205696, 0.03961930796504021, -0.009624159894883633, 0.033480849117040634, 0.00466269301250577, -0.005377940833568573, -0.007057415787130594, -0.022199850529432297, -0.03688506782054901, -0.06667198240756989, -0.009298224002122879, 0.034241367131471634, 0.027650222182273865, -0.07040213793516159, -0.00559070473536849, 0.004857348743826151, 0.010429945774376392 ]
42,929
linearmodels.iv.model
fit
Estimate model parameters Parameters ---------- starting : ndarray Starting values to use in optimization. If not provided, 2SLS estimates are used. display : bool Flag indicating whether to display optimization output cov_type : str Name of covariance estimator to use debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. opt_options : dict Additional options to pass to scipy.optimize.minimize when optimizing the objective function. If not provided, defers to scipy to choose an appropriate optimizer. All minimize inputs except ``fun``, ``x0``, and ``args`` can be overridden. **cov_config Additional parameters to pass to covariance estimator. Supported parameters depend on specific covariance structure assumed. See :class:`linearmodels.iv.gmm.IVGMMCovariance` for details on the available options. Defaults are used if no covariance configuration is provided. Returns ------- IVGMMResults Results container Notes ----- Starting values are computed by IVGMM. See also -------- linearmodels.iv.gmm.IVGMMCovariance
def fit( self, *, starting: Float64Array | Series | None = None, display: bool = False, cov_type: str = "robust", debiased: bool = False, opt_options: dict[str, Any] | None = None, **cov_config: Any, ) -> OLSResults | IVGMMResults: r""" Estimate model parameters Parameters ---------- starting : ndarray Starting values to use in optimization. If not provided, 2SLS estimates are used. display : bool Flag indicating whether to display optimization output cov_type : str Name of covariance estimator to use debiased : bool Flag indicating whether to debiased the covariance estimator using a degree of freedom adjustment. opt_options : dict Additional options to pass to scipy.optimize.minimize when optimizing the objective function. If not provided, defers to scipy to choose an appropriate optimizer. All minimize inputs except ``fun``, ``x0``, and ``args`` can be overridden. **cov_config Additional parameters to pass to covariance estimator. Supported parameters depend on specific covariance structure assumed. See :class:`linearmodels.iv.gmm.IVGMMCovariance` for details on the available options. Defaults are used if no covariance configuration is provided. Returns ------- IVGMMResults Results container Notes ----- Starting values are computed by IVGMM. See also -------- linearmodels.iv.gmm.IVGMMCovariance """ wy, wx, wz = self._wy, self._wx, self._wz weight_matrix = self._weight.weight_matrix if starting is None: exog = None if self.exog.shape[1] == 0 else self.exog endog = None if self.endog.shape[1] == 0 else self.endog instr = None if self.instruments.shape[1] == 0 else self.instruments res = IVGMM( self.dependent, exog, endog, instr, weights=self.weights, weight_type=self._weight_type, **self._weight_config, ).fit() starting = asarray(res.params) else: starting = asarray(starting) if len(starting) != self.exog.shape[1] + self.endog.shape[1]: raise ValueError( "starting does not have the correct number " "of values" ) params, iters = self.estimate_parameters( starting, wx, wy, wz, display, opt_options=opt_options ) eps = wy - wx @ params wmat = inv(weight_matrix(wx, wz, eps)) cov_config["debiased"] = debiased cov_estimator = IVGMMCovariance( wx, wy, wz, params, wmat, cov_type, **cov_config ) results = self._post_estimation(params, cov_estimator, cov_type) gmm_pe = self._gmm_post_estimation(params, wmat, iters) results.update(gmm_pe) return IVGMMResults(results, self)
(self, *, starting: Union[numpy.ndarray, pandas.core.series.Series, NoneType] = None, display: bool = False, cov_type: str = 'robust', debiased: bool = False, opt_options: Optional[dict[str, Any]] = None, **cov_config: Any) -> linearmodels.iv.results.OLSResults | linearmodels.iv.results.IVGMMResults
[ 0.07209722697734833, -0.02565036714076996, 0.04642655327916145, -0.031174436211586, 0.04059784859418869, 0.005529146641492844, -0.03133690729737282, -0.10390124469995499, -0.0119315842166543, 0.008118554018437862, -0.013688319362699986, -0.003523625200614333, 0.005351442378014326, 0.011566020548343658, -0.028432710096240044, 0.12112334370613098, -0.036596961319446564, -0.07851489633321762, 0.05487513169646263, 0.057230982929468155, -0.026970457285642624, -0.004602544941008091, -0.037856124341487885, 0.03984641283750534, 0.013637546449899673, -0.02368038520216942, 0.014785009436309338, -0.031072890385985374, 0.039358995854854584, -0.02016691491007805, -0.02959032729268074, -0.01628788188099861, -0.006001332774758339, -0.03759210556745529, 0.04654840752482414, -0.029346618801355362, 0.0720566138625145, 0.023761622607707977, 0.02114175073802471, 0.04780757054686546, -0.06389236450195312, -0.01988258771598339, 0.06291752308607101, -0.004099895246326923, -0.012733791954815388, 0.0000705264465068467, -0.0429333932697773, 0.057352837175130844, 0.008626281283795834, -0.01657220907509327, 0.04516739025712013, -0.058490145951509476, -0.011880811303853989, -0.06531399488449097, -0.04435502737760544, 0.04013073816895485, 0.019222542643547058, 0.012165138497948647, 0.06803541630506516, -0.029366927221417427, 0.002331736031919718, -0.0003696886997204274, -0.005092501640319824, -0.03814044967293739, 0.002934661926701665, 0.04268968477845192, -0.01601370796561241, -0.0016412273980677128, -0.03314441815018654, 0.05239742249250412, -0.0181156974285841, 0.018796052783727646, -0.020349696278572083, 0.035175323486328125, 0.01897883415222168, 0.019242852926254272, -0.04918858781456947, -0.029529400169849396, -0.053128551691770554, -0.06023672595620155, 0.04301463067531586, 0.07091930508613586, -0.027843747287988663, -0.07400628179311752, 0.005092501640319824, 0.047401390969753265, -0.02766096591949463, -0.026462730020284653, 0.033286578953266144, -0.0025564052630215883, -0.015079490840435028, 0.011525401845574379, 0.06502967327833176, 0.04776695370674133, 0.013343065045773983, 0.02603623829782009, -0.021730713546276093, -0.0768495574593544, -0.0032672230154275894, -0.013921873643994331, 0.017943071201443672, 0.03113381750881672, 0.06551709026098251, 0.033083491027355194, -0.021730713546276093, -0.04027290269732475, 0.005112810526043177, -0.009357407689094543, 0.01339383702725172, -0.0496353879570961, -0.02181195095181465, -0.00367340468801558, -0.041796084493398666, -0.01590200886130333, -0.02845301851630211, 0.04821375384926796, -0.041572682559490204, 0.03962301090359688, -0.04983847960829735, 0.019120996817946434, -0.0746561735868454, 0.0164097361266613, -0.05272236838936806, -0.02193380519747734, 0.02193380519747734, -0.07957097142934799, 0.027559420093894005, 0.016470663249492645, 0.008189636282622814, -0.058612000197172165, -0.011190302670001984, -0.07741820812225342, -0.05771840363740921, 0.01637927256524563, -0.007884999737143517, 0.024716148152947426, 0.005458064842969179, -0.04991971701383591, -0.011251229792833328, 0.0846482440829277, -0.0023190430365502834, 0.07457493990659714, -0.03359121456742287, 0.007697140797972679, -0.023639768362045288, 0.044436264783144, 0.09179703891277313, -0.004262367729097605, -0.0235179141163826, -0.00028369243955239654, -0.028818583115935326, -0.027803128585219383, -0.001408942393027246, -0.03633294254541397, -0.03499254211783409, -0.07859613746404648, -0.011494938284158707, 0.018968679010868073, -0.011962047778069973, 0.00871767196804285, -0.09334052354097366, 0.003759718267247081, 0.012916574254631996, 0.0481325164437294, 0.01142385695129633, 0.029021672904491425, -0.055606257170438766, 0.06056167185306549, -0.02015676163136959, -0.005023958161473274, -0.03160092607140541, -0.04837622493505478, -0.008357185870409012, -0.06210516393184662, -0.011708184145390987, 0.05552501976490021, 0.017628280445933342, 0.004970646928995848, 0.03089010901749134, -0.000694316637236625, 0.033164724707603455, -0.010438866913318634, -0.057352837175130844, -0.057271603494882584, -0.058571383357048035, 0.01948656141757965, -0.0021616476587951183, 0.008539967238903046, -0.014236664399504662, -0.06466411054134369, 0.030707327648997307, -0.04289277270436287, -0.0006575064035132527, -0.019506869837641716, -0.014622536487877369, 0.022218132391572, 0.05621552839875221, 0.027173547074198723, -0.02548789419233799, 0.005625614896416664, 0.019506869837641716, -0.007732681930065155, 0.0077936090528965, -0.06608574092388153, -0.017587661743164062, 0.05930250883102417, -0.0649484321475029, -0.04427378997206688, 0.07039126753807068, 0.010905975475907326, -0.017415035516023636, -0.0024447054602205753, -0.024513058364391327, -0.005610383115708828, 0.010692729614675045, 0.010601338930428028, 0.008682130835950375, 0.024330276995897293, -0.001036397647112608, -0.006011487450450659, 0.04366451874375343, -0.07266588509082794, -0.06482657790184021, 0.010281471535563469, 0.03905436024069786, -0.000831402896437794, 0.006092723459005356, -0.01759781688451767, -0.020644178614020348, -0.05491574853658676, 0.025975311174988747, -0.06998508423566818, 0.024675531312823296, -0.025264494121074677, -0.03401770815253258, 0.025345729663968086, 0.003988195210695267, 0.0668574869632721, -0.05048837140202522, 0.022218132391572, -0.007951004430651665, 0.019192079082131386, -0.01834925264120102, 0.03275854513049126, -0.048782408237457275, -0.03145876154303551, 0.011474629864096642, 0.05365658551454544, -0.018136007711291313, -0.0017046933062374592, 0.0541440024971962, -0.014439755119383335, -0.01843048818409443, 0.012764256447553635, 0.015241963788866997, 0.023111730813980103, -0.004511154256761074, -0.017110398039221764, 0.07100053876638412, -0.03198679909110069, -0.009910830296576023, 0.00012018849520245567, -0.01952718012034893, 0.047523245215415955, -0.012936883606016636, 0.04224288463592529, 0.013860946521162987, -0.0074686636216938496, 0.026259638369083405, 0.06393297761678696, -0.09691492468118668, 0.09520895779132843, 0.005361596588045359, 0.0041658999398350716, 0.026543965563178062, 0.09480278193950653, -0.043583281338214874, -0.04390822723507881, -0.011180147528648376, 0.032250817865133286, 0.013170437887310982, -0.01565830036997795, -0.00020198013226035982, -0.009646812453866005, -0.012144829146564007, -0.014724082313477993, -0.002279694192111492, 0.020766032859683037, 0.03251483663916588, 0.024533366784453392, 0.02959032729268074, 0.04549233615398407, 0.020725414156913757, -0.0326773077249527, 0.04736077040433884, 0.0021921112202107906, 0.021101132035255432, 0.02548789419233799, 0.012286992743611336, 0.051463205367326736, 0.011515247635543346, 0.01724240742623806, -0.013495382852852345, 0.009570653550326824, 0.03901373967528343, 0.03891219571232796, 0.020309079438447952, -0.10097674280405045, 0.03139783442020416, 0.0024535905104130507, -0.0470358282327652, 0.07156919687986374, 0.025162948295474052, -0.038993433117866516, -0.044720590114593506, -0.0057627009227871895, 0.008189636282622814, -0.005275283008813858, 0.042121030390262604, 0.04557357355952263, 0.037104688584804535, 0.01724240742623806, 0.03633294254541397, -0.0359673798084259, 0.014896709471940994, 0.06096785515546799, -0.030280835926532745, 0.07957097142934799, -0.017963379621505737, -0.03820137679576874, -0.0035947069991379976, -0.020623870193958282, 0.0026021006051450968, 0.027315711602568626, -0.031743090599775314, -0.019740425050258636, 0.0283717829734087, -0.025833148509263992, 0.06226763501763344, 0.03690159693360329, 0.06251134723424911, -0.012002665549516678, -0.04537048190832138, -0.047320153564214706, -0.013261828571557999, -0.03962301090359688, 0.07554977387189865, -0.057352837175130844, -0.009357407689094543, 0.05475327745079994, -0.08708532899618149, 0.058693237602710724, 0.041369594633579254, 0.006635991390794516, 0.015993399545550346, -0.02745787426829338, 0.005039190407842398, -0.02619871124625206, 0.032372672110795975, -0.0032392980065196753, -0.0374702513217926, 0.06726367026567459, -0.04825437068939209, 0.004752324428409338, 0.014866245910525322, -0.03483007103204727, -0.01515057310461998, -0.047482624650001526, 0.021994732320308685, -0.008057626895606518, 0.01385079137980938, -0.0466296449303627, -0.05385967716574669, 0.01525211799889803, 0.02615809440612793, 0.012551010586321354, -0.036556340754032135, -0.03353028744459152, 0.002675721189007163, 0.01573953591287136, -0.011007520370185375, -0.03694221377372742, -0.0014305207878351212, 0.009692507795989513, 0.027559420093894005, 0.025873767212033272, 0.03182432800531387, 0.01878589764237404, 0.013972646556794643, -0.031174436211586, 0.024533366784453392, 0.0007254148949868977, 0.014713927172124386, 0.01542474515736103, 0.04569542780518532, 0.0051965853199362755, 0.047604478895664215, -0.023802239447832108, -0.019009297713637352, -0.024513058364391327, -0.05105702579021454, 0.0031986800022423267, -0.011505093425512314, 0.07754006236791611, -0.008225176483392715, -0.09212198108434677, -0.024167804047465324, -0.026015929877758026, -0.02331482246518135, 0.021690096706151962, 0.021446386352181435, -0.03409894183278084, -0.027904674410820007, -0.014114810153841972, -0.02477707527577877, 0.044923681765794754, -0.035053469240665436, -0.005711928475648165, 0.023375749588012695, 0.0567435659468174, 0.05251927673816681, -0.007417891174554825, 0.0850544199347496, 0.03332719951868057, 0.01142385695129633, 0.026300257071852684, -0.04297401010990143, -0.07290959358215332, -0.022075967863202095, -0.05081331357359886, 0.023111730813980103, 0.05503760278224945, 0.01562783680856228, 0.02485831268131733, -0.06649192422628403, -0.04260844737291336, -0.03669850528240204, -0.009062926284968853, -0.0017161171417683363, 0.04118681326508522, 0.015099800191819668, -0.006245041731745005, 0.01024085283279419, -0.010621648281812668, -0.07559039443731308, 0.00441976310685277, 0.02418811246752739, -0.003066670848056674, -0.061130326241254807, -0.004112588241696358, 0.0440300814807415, 0.0189382154494524, 0.0418367013335228, -0.01818677969276905, 0.06271443516016006, -0.057190366089344025, -0.03105258196592331, -0.030626090243458748, -0.04021197557449341, 0.013353219255805016, 0.00045854091877117753, -0.00869736261665821, -0.08334846049547195, 0.015211500227451324, 0.004691397305577993, 0.08570431172847748, 0.06576079875230789, 0.013251674361526966, -0.02347729541361332, 0.018136007711291313, -0.03135721758008003, -0.014033573679625988, 0.0593431293964386, -0.03761241212487221, -0.011322311125695705, 0.03381461650133133, -0.04301463067531586, 0.04130866751074791, 0.03302256390452385, 0.01024085283279419, 0.027518801391124725, -0.028473328799009323, -0.005300669465214014, 0.07672770321369171, 0.021060515195131302, 0.028818583115935326, -0.011809729039669037, -0.007478818297386169, -0.010063148103654385, 0.0007996700005605817, 0.008605971932411194, 0.05272236838936806, 0.006133341696113348, 0.03145876154303551, 0.012226065620779991, 0.03286008909344673, 0.03816075995564461, -0.047442007809877396, 0.05186938866972923, -0.038485705852508545, 0.04541109874844551, -0.02197442390024662, -0.009453875944018364, -0.011129375547170639, 0.000549614429473877, -0.024431820958852768, 0.004181131720542908, 0.008489195257425308, -0.04557357355952263, -0.05089455097913742, -0.030158981680870056, -0.010047916322946548, 0.03913559392094612, -0.006681686732918024, -0.008971535600721836, -0.009484339505434036, -0.024675531312823296, 0.017770443111658096, 0.012815028429031372, -0.0032824547961354256, -0.00502141984179616, -0.05942436307668686, 0.03084949031472206, -0.015241963788866997, 0.04951353371143341, 0.018806206062436104, -0.039155904203653336, -0.031032271683216095, 0.028676418587565422, 0.009778821840882301, -0.010367784649133682, -0.03223050758242607, 0.013261828571557999, 0.06482657790184021, 0.002921968698501587, -0.035886142402887344, 0.04577666521072388, -0.05479389429092407, -0.041755467653274536, -0.016937771812081337, -0.007377272937446833, 0.0018493954557925463, -0.02532542124390602, 0.039115287363529205, 0.0836734026670456, 0.018836671486496925, 0.04232412204146385, 0.0007266842294484377, 0.016501126810908318, -0.025548821315169334, -0.0668574869632721, -0.00209564296528697, 0.00756513187661767, 0.06060229241847992, -0.002812807448208332, 0.0425272099673748, -0.009225399233400822, 0.040029194205999374, 0.021121442317962646, 0.007742836140096188, -0.016206644475460052, 0.02833116427063942, 0.013698473572731018, -0.05889632925391197, -0.007275727577507496, 0.05889632925391197, 0.00702186394482851, 0.012307302094995975, 0.012479929253458977, -0.005074731074273586, 0.012835337780416012, 0.005105194635689259, -0.054428331553936005, 0.023030495271086693, -0.030829181894659996, 0.05515945702791214, 0.013739091344177723, 0.04971662536263466, -0.06251134723424911, -0.03332719951868057, -0.018796052783727646, -0.009083235636353493, 0.0023063498083502054, 0.005310824140906334, 0.010601338930428028, -0.009753434918820858, -0.08667914569377899, -0.019984133541584015, 0.0024193190038204193, 0.02284771390259266, -0.014236664399504662, 0.05796211212873459, -0.050407133996486664, -0.00047567670117132366, 0.004186208825558424, 0.04817313328385353, 0.0019407863728702068, -0.0283717829734087, 0.011647257022559643, -0.02770158275961876, -0.025812838226556778, -0.003950115758925676, 0.04386761039495468, 0.025630056858062744, 0.01748611591756344, 0.013515692204236984, -0.01669406332075596, 0.07522482424974442, 0.028859201818704605, -0.02745787426829338, 0.00929140392690897, -0.004968108609318733, -0.02670643851161003, 0.028737345710396767, -0.03314441815018654, 0.011494938284158707, -0.011180147528648376, 0.00640243710950017, 0.0697413757443428, 0.025548821315169334, 0.018095389008522034, -0.030544854700565338, 0.020786341279745102, -0.014967790804803371, -0.004985878709703684, 0.022563386708498, 0.01313997432589531, -0.08074890077114105, 0.018755434080958366, -0.032250817865133286, 0.018014153465628624, 0.021730713546276093, 0.044720590114593506, 0.003823184175416827, 0.052844222635030746, -0.02690953016281128, 0.005783010274171829, 0.018369561061263084, -0.023700695484876633, 0.03097134456038475, 0.006311046425253153, 0.027173547074198723, 0.05085393413901329, 0.03223050758242607, 0.017607972025871277, -0.019506869837641716, 0.0073112682439386845, 0.040618158876895905, 0.01215498335659504, 0.0031225208658725023, 0.044761210680007935, 0.0042572906240820885, -0.04411131888628006, -0.04301463067531586, -0.005178815219551325, -0.03180401772260666, 0.016267571598291397, 0.002103259088471532, 0.028067147359251976, -0.024756766855716705, 0.018440643325448036, 0.0283717829734087, -0.0008447307627648115, -0.026462730020284653, 0.03834354132413864, 0.04232412204146385, 0.013657855801284313, -0.005105194635689259, 0.00024323294928763062, 0.003175832098349929, 0.017181480303406715, 0.006311046425253153, -0.01775013469159603, 0.01345476508140564, -0.041877321898937225, -0.0440300814807415, -0.017851680517196655, -0.00781391840428114, -0.04045568406581879, 0.0004420398036018014, 0.06637006998062134, 0.043380193412303925, 0.03619077801704407, -0.02359914965927601, 0.018328944221138954, -0.11202488094568253, -0.010936439037322998, -0.07217846810817719, 0.026259638369083405, -0.0037267159204930067, -0.0212636049836874, 0.02627994865179062, 0.001939516980201006, -0.04004950448870659, 0.03468790650367737, -0.06791356205940247, -0.032413288950920105, -0.03202741593122482, 0.002637641504406929, -0.03675943240523338, 0.03338812664151192, 0.021771332249045372, -0.016308190301060677, 0.06868530809879303, -0.03127598017454147, 0.04557357355952263, -0.025081712752580643, -0.00703201862052083, -0.007179259322583675, -0.043461427092552185, 0.039826102554798126, -0.005031574051827192, -0.012764256447553635, -0.01311966497451067, 0.054225239902734756, -0.028676418587565422, -0.011230920441448689, 0.03645479679107666, 0.01605432666838169, 0.011576174758374691, 0.044923681765794754, -0.006539523601531982, -0.0015168343670666218, -0.03736870363354683, -0.017536889761686325, -0.03160092607140541, -0.003206295892596245, 0.019496716558933258, 0.04423317313194275, -0.025102021172642708, 0.015008409507572651, 0.008636435493826866, -0.02615809440612793, -0.013992954976856709, -0.006047028116881847, -0.018014153465628624, -0.08684162050485611, -0.004836099222302437, -0.010530257597565651, -0.004099895246326923, -0.04679211601614952, 0.03824199363589287, -0.000584837980568409, -0.037389013916254044, -0.07002570480108261, 0.04557357355952263, 0.011850347742438316, -0.02950909174978733, 0.012226065620779991, 0.005605305545032024, 0.03619077801704407, -0.04979786276817322, 0.04289277270436287, 0.010347475297749043, 0.0645422488451004, 0.0332256518304348, -0.03342874348163605, 0.004224288277328014, 0.007179259322583675, -0.04955415055155754, -0.03251483663916588, -0.04240535572171211, 0.055687494575977325, 0.005940405651926994, -0.05666232854127884, 0.035175323486328125, -0.017587661743164062, 0.0028305777814239264 ]
42,930
linearmodels.iv.model
from_formula
Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Returns ------- IVGMMCUE Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVGMMCUE >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVGMMCUE.from_formula(formula, data)
@staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None, weight_type: str = "robust", **weight_config: Any, ) -> IVGMMCUE: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Returns ------- IVGMMCUE Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using "1 +" if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVGMMCUE >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVGMMCUE.from_formula(formula, data) """ mod = _gmm_model_from_formula( IVGMMCUE, formula, data, weights, weight_type, **weight_config ) assert isinstance(mod, IVGMMCUE) return mod
(formula: str, data: pandas.core.frame.DataFrame, *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, weight_type: str = 'robust', **weight_config: Any) -> linearmodels.iv.model.IVGMMCUE
[ 0.11215412616729736, -0.05607706308364868, 0.01669955812394619, -0.04239045828580856, -0.0029226604383438826, -0.04489966854453087, 0.008725211024284363, -0.028684843331575394, 0.020777026191353798, 0.0440252460539341, 0.0005393853061832488, 0.015825137495994568, -0.00584056880325079, 0.02250686101615429, -0.04854942858219147, 0.046800583600997925, 0.005270293448120356, -0.032847851514816284, 0.021879559382796288, -0.018762053921818733, -0.040945760905742645, -0.025111118331551552, -0.03197342902421951, 0.07603669166564941, 0.030053503811359406, 0.01456102728843689, -0.04702869430184364, 0.023951558396220207, 0.05394803360104561, -0.06018304452300072, -0.024578861892223358, -0.004479036666452885, -0.05094458535313606, 0.00037454013363458216, 0.0007098737987689674, -0.01511229295283556, 0.04820726439356804, -0.018781064078211784, -0.05102062225341797, 0.021689467132091522, 0.05333974212408066, 0.01589166931807995, 0.08272792398929596, 0.0361364372074604, -0.03193541243672371, -0.009751706384122372, -0.04512777924537659, 0.02007368765771389, 0.02583346702158451, 0.0015539999585598707, 0.02571941167116165, -0.01732686161994934, 0.027753394097089767, -0.026650860905647278, -0.04759896919131279, 0.04364506155252457, 0.004343596287071705, 0.040185391902923584, 0.0721968412399292, 0.026213649660348892, -0.02225974202156067, 0.015758605673909187, -0.0028323668520897627, -0.015501980669796467, -0.010673650540411472, 0.02347632870078087, 0.01168113760650158, 0.01786862313747406, 0.002694550435990095, -0.006163724698126316, -0.04543192312121391, -0.01138649508357048, 0.016072256490588188, 0.04124990478157997, 0.04444344714283943, -0.02592851221561432, -0.0076606967486441135, -0.017631009221076965, 0.017773577943444252, 0.05238928273320198, 0.023533357307314873, -0.013914715498685837, -0.027943484485149384, -0.07291918992996216, 0.019636476412415504, -0.012137357145547867, -0.018809577450156212, -0.002209816360846162, 0.047560952603816986, -0.03866465762257576, -0.05949871242046356, -0.051096659153699875, -0.03991926461458206, 0.06938348710536957, 0.005308311898261309, 0.0071949721314013, -0.0065106418915092945, -0.051476843655109406, 0.01505526527762413, 0.008501852862536907, 0.004060834646224976, 0.06721644103527069, -0.003238687990233302, -0.014332916587591171, -0.025035081431269646, -0.05615309998393059, -0.05250333622097969, -0.002062495332211256, 0.028855925425887108, -0.09603434801101685, -0.04626832902431488, 0.017611999064683914, 0.0034097705502063036, -0.013097320683300495, 0.0022216972429305315, 0.02716410905122757, -0.005921357776969671, 0.03961511701345444, -0.006548660341650248, -0.01151005458086729, -0.024274714291095734, -0.05284550413489342, -0.0538719967007637, 0.001619343995116651, 0.044367410242557526, -0.04573607072234154, 0.023761466145515442, -0.04604021832346916, 0.03670671582221985, -0.03908286243677139, -0.022297760471701622, -0.0440632626414299, -0.012688623741269112, -0.001104908180423081, -0.041668109595775604, 0.001742903608828783, 0.01995963230729103, -0.04554598033428192, 0.03638355806469917, 0.0844007283449173, 0.008782237768173218, 0.05946069583296776, -0.029065025970339775, 0.038132403045892715, -0.014608549885451794, 0.04444344714283943, 0.05581093207001686, 0.0562671534717083, -0.037866272032260895, -0.03573724627494812, -0.02459787018597126, 0.02130928263068199, 0.021632440388202667, -0.005431871395558119, 0.04835933819413185, -0.005460385233163834, -0.0075513944029808044, 0.0336652472615242, -0.008140678517520428, 0.0022454585414379835, 0.010379008948802948, 0.06390884518623352, -0.0005096834502182901, 0.03931096941232681, 0.04797915369272232, 0.0021314036566764116, 0.005199009086936712, 0.004395871423184872, -0.04432939365506172, 0.03969115391373634, -0.042276401072740555, -0.01635739393532276, -0.06295838207006454, -0.001255793496966362, 0.03710590675473213, 0.021993614733219147, 0.010939779691398144, 0.01419985294342041, 0.032106492668390274, 0.0010009517427533865, 0.00997031107544899, 0.043150823563337326, -0.04725680500268936, 0.01156708225607872, -0.04391119256615639, 0.017117761075496674, -0.004728531930595636, 0.03155522793531418, -0.020016659051179886, -0.07352748513221741, 0.027259154245257378, -0.04223838448524475, 0.03533805534243584, -0.009138660505414009, 0.013591558672487736, 0.0018973530968651175, 0.027867447584867477, 0.019066201522946358, -0.09276476502418518, 0.028912952169775963, 0.07208278775215149, -0.022734971717000008, 0.008316513150930405, 0.004635862074792385, -0.030452696606516838, -0.02106216363608837, -0.05003214627504349, 0.003980045672506094, 0.022582897916436195, -0.048891592770814896, -0.0016692430945113301, 0.038588620722293854, -0.01181420125067234, 0.08493299037218094, -0.0065248990431427956, -0.007969596423208714, -0.0030842383857816458, 0.020510898903012276, 0.00034869954106397927, 0.006420348305255175, 0.002487825695425272, -0.03573724627494812, -0.09268873184919357, 0.018039705231785774, -0.007760494947433472, -0.029711337760090828, -0.03271478787064552, 0.01633838377892971, -0.02743023820221424, -0.03438759595155716, 0.009343008510768414, -0.05702752247452736, 0.02864682488143444, -0.01852444000542164, -0.025985540822148323, -0.006957357749342918, -0.03575625643134117, 0.05288352072238922, 0.00694785313680768, 0.032505687326192856, -0.010730678215622902, -0.02397056855261326, -0.0032315594144165516, 0.10683155804872513, 0.036763742566108704, -0.016148293390870094, 0.05862428992986679, 0.010445540770888329, -0.044747594743967056, -0.01609126478433609, -0.02362840250134468, 0.007461100816726685, -0.023077135905623436, 0.06926942616701126, -0.002017348539084196, 0.010996807366609573, -0.005674238316714764, 0.02851376123726368, 0.05531669408082962, -0.0525793731212616, -0.0113199632614851, -0.08614957332611084, 0.010835228487849236, 0.010493063367903233, 0.01842939294874668, -0.0010847109369933605, -0.002689798129722476, 0.0538339801132679, 0.038588620722293854, 0.012945246882736683, 0.003431155811995268, 0.0514388233423233, 0.029312144964933395, -0.010759192518889904, 0.025244181975722313, 0.0007324471953324974, -0.014912696555256844, -0.029920438304543495, 0.0017631008522585034, -0.0186575036495924, -0.007190220057964325, -0.01505526527762413, 0.023799484595656395, 0.01020792592316866, -0.04505174234509468, 0.014656072482466698, -0.0036022383719682693, -0.051819007843732834, 0.05394803360104561, 0.03172631189227104, -0.02558634802699089, -0.008316513150930405, -0.026498787105083466, 0.042048290371894836, 0.0360984206199646, 0.029293136671185493, 0.03801834583282471, 0.01584414578974247, -0.030775852501392365, -0.015093283727765083, -0.012745650485157967, 0.0171272661536932, 0.02425570599734783, 0.005588696803897619, -0.08006663620471954, 0.0030723577365279198, 0.011823706328868866, -0.059042494744062424, -0.005332073196768761, -0.046192292124032974, 0.0035737245343625546, 0.07915420085191727, -0.003839852986857295, 0.003740054788067937, 0.02571941167116165, 0.015739595517516136, 0.02828565053641796, -0.007731981575489044, 0.09960807114839554, 0.0048901098780334, 0.04748491570353508, 0.018391374498605728, 0.014893687330186367, 0.0004535469925031066, -0.031175045296549797, 0.0022787246853113174, -0.00214090826921165, -0.02583346702158451, 0.015197833999991417, 0.0029749355744570494, -0.038246456533670425, 0.02583346702158451, 0.031251080334186554, -0.0054461280815303326, -0.04919574037194252, -0.06417497247457504, 0.03216352313756943, -0.033475153148174286, 0.005721761379390955, 0.008577889762818813, 0.09010348469018936, -0.03402642160654068, 0.008582642301917076, -0.04201027378439903, 0.03647860512137413, -0.048283301293849945, 0.015121798031032085, -0.009314495138823986, -0.005484146531671286, 0.07170259952545166, -0.03950106352567673, 0.0005432465113699436, 0.02239280566573143, 0.013971742242574692, -0.0149982376024127, -0.0538339801132679, 0.006434605456888676, -0.05288352072238922, -0.001956756692379713, -0.005061192438006401, -0.01187122892588377, 0.053415779024362564, -0.01577761396765709, -0.03069981560111046, 0.009143412113189697, -0.04737086221575737, -0.0008233348489739001, 0.0023238714784383774, 0.08006663620471954, 0.03870267793536186, 0.029331155121326447, 0.012289430946111679, -0.02262091636657715, 0.042048290371894836, 0.010512072592973709, -0.030452696606516838, -0.02752528339624405, -0.03758113458752632, -0.05619111657142639, -0.015254861675202847, 0.00990377925336361, -0.045469943434000015, -0.03229658678174019, -0.011899742297828197, 0.041554052382707596, 0.010226935148239136, 0.05079251155257225, 0.08166340738534927, -0.015368917025625706, -0.020624952390789986, -0.020282788202166557, -0.018191779032349586, 0.06835699081420898, 0.012460513040423393, -0.033094972372055054, -0.01620532013475895, -0.002796724671497941, -0.005621963180601597, -0.011909247376024723, -0.05638120695948601, -0.03716293349862099, 0.00626827497035265, -0.018885614350438118, 0.010977798141539097, -0.0526173934340477, 0.006049669347703457, -0.060411155223846436, 0.010740183293819427, 0.0006403715233318508, -0.07113232463598251, 0.0033218530006706715, 0.03512895107269287, -0.013506017625331879, -0.044633541256189346, -0.002487825695425272, 0.005061192438006401, 0.05668535456061363, -0.08774634450674057, -0.04543192312121391, 0.044747594743967056, 0.016851631924510002, -0.037885282188653946, 0.07641687989234924, -0.00798860564827919, -0.01719379797577858, 0.03779023885726929, -0.008088403381407261, -0.034197501838207245, -0.024160658940672874, -0.003191164927557111, -0.04615427181124687, 0.06577174365520477, -0.0007692775106988847, -0.013277907855808735, -0.03908286243677139, -0.03830348327755928, -0.027335191145539284, 0.002392779802903533, 0.018686017021536827, 0.04379713535308838, -0.011158385314047337, -0.02657482400536537, 0.005821559578180313, 0.00017137957911472768, -0.09945599734783173, -0.023552365601062775, -0.034919850528240204, -0.00905787106603384, -0.046306345611810684, -0.021746493875980377, 0.027962494641542435, 0.054784439504146576, 0.04296073317527771, 0.010359999723732471, 0.034558676183223724, -0.0045075505040585995, -0.02081504464149475, -0.041439998894929886, 0.05774986743927002, 0.026631852611899376, -0.009818238206207752, 0.04995610937476158, -0.02165144868195057, 0.015311889350414276, -0.03756212815642357, 0.07398370653390884, 0.07310928404331207, -0.05007016286253929, 0.0010306535987183452, 0.041173871606588364, 0.009770715609192848, -0.011101357638835907, 0.07310928404331207, -0.03721996024250984, -0.007503871340304613, 0.011338972486555576, -0.00716170622035861, -0.013467999175190926, 0.013829173520207405, -0.043150823563337326, 0.04512777924537659, -0.012736146338284016, 0.0009540229220874608, 0.041782163083553314, -0.05531669408082962, 0.06451713293790817, 0.009932293556630611, -0.03071882389485836, -0.0026137614622712135, -0.07542840391397476, -0.08234774321317673, 0.08105511963367462, 0.04258054867386818, 0.0391588993370533, 0.061741795390844345, -0.006610440090298653, 0.02225974202156067, -0.018781064078211784, 0.06945952028036118, -0.049119703471660614, 0.03172631189227104, 0.021841540932655334, -0.046458419412374496, -0.0746300145983696, -0.006063926499336958, -0.021841540932655334, 0.004512302577495575, 0.0037305504083633423, -0.022563889622688293, -0.10242142528295517, -0.030908916145563126, -0.0027230640407651663, -0.0039158896543085575, 0.05349181592464447, -0.01852444000542164, -0.0008975894306786358, -0.027563301846385002, 0.010283962823450565, -0.005736018065363169, -0.0177355594933033, -0.004650119226425886, -0.03033864125609398, 0.0011613416718319058, -0.04543192312121391, -0.0035119447857141495, 0.05322568491101265, -0.03319001570343971, -0.07014384865760803, 0.010169907473027706, 0.005707504227757454, -0.007137944456189871, -0.013572550378739834, 0.038607630878686905, 0.07010583579540253, -0.06261621415615082, -0.004733284004032612, 0.034558676183223724, -0.019370347261428833, -0.08424865454435349, 0.014180843718349934, -0.05740770325064659, 0.0030343392863869667, -0.02425570599734783, 0.019655484706163406, 0.05345379561185837, 0.05105863884091377, 0.024806970730423927, 0.02813357673585415, -0.06919339299201965, -0.0262896865606308, -0.05189504474401474, 0.03275280445814133, -0.0710182711482048, -0.010854237712919712, 0.037619154900312424, 0.021841540932655334, -0.0077890087850391865, 0.00929548591375351, -0.004659623838961124, -0.039843227714300156, -0.03923493251204491, -0.055734895169734955, 0.043264880776405334, -0.013734128326177597, 0.0031151282601058483, 0.042884696274995804, -0.0010959976352751255, -0.013658091425895691, -0.03649761155247688, -0.00626827497035265, -0.022677944973111153, -0.030870897695422173, 0.09861959517002106, 0.0015599402831867337, -0.030186567455530167, 0.017155779525637627, -0.01627185195684433, -0.05326370522379875, -0.002341692568734288, -0.07196873426437378, -0.04003331810235977, -0.035680219531059265, -0.028000513091683388, 0.00959963258355856, 0.048929613083601, -0.014399449340999126, -0.017659522593021393, 0.05067845806479454, -0.00860640313476324, 0.07071412354707718, 0.015131302177906036, 0.031156035140156746, 0.005973632913082838, 0.02165144868195057, 0.018457908183336258, 0.022963082417845726, 0.008725211024284363, 0.009827742353081703, 0.023894531652331352, 0.03980521112680435, -0.017678530886769295, 0.0379423089325428, 0.01786862313747406, 0.04820726439356804, -0.008264238014817238, 0.032258566468954086, -0.010417027398943901, -0.0073850639164447784, 0.08333621919155121, -0.058814384043216705, -0.015017246827483177, 0.015026751905679703, -0.02167045697569847, 0.07945834845304489, -0.0078032659366726875, 0.007993357256054878, -0.032505687326192856, -0.007394568528980017, 0.03969115391373634, 0.07147449254989624, -0.023438310250639915, -0.03803735598921776, -0.006349063944071531, -0.02961629256606102, 0.034463632851839066, 0.022316770628094673, -0.011538567952811718, -0.03718194365501404, -0.039729174226522446, -0.004875853192061186, 0.031764328479766846, 0.029939448460936546, 0.03197342902421951, 0.013097320683300495, 0.0232672281563282, 0.04870150238275528, 0.01903768815100193, 0.00617798138409853, 0.003485807217657566, 0.05740770325064659, -0.021385319530963898, -0.01627185195684433, 0.042276401072740555, 0.027848439291119576, 0.025301210582256317, 0.004633486270904541, 0.021594421938061714, -0.030015485361218452, -0.023837503045797348, 0.019655484706163406, 0.01822979748249054, -0.009742201305925846, -0.020872073248028755, -0.03153621777892113, 0.006772018037736416, 0.0018712155288085341, -0.042770639061927795, -0.06573372334241867, 0.02570040337741375, -0.04695265740156174, -0.04010935500264168, 0.039843227714300156, -0.0012688622809946537, 0.02079603634774685, 0.016737576574087143, 0.00465249503031373, 0.0575597770512104, 0.009865760803222656, -0.002825238509103656, -0.004894862417131662, 0.018201284110546112, -0.004866348579525948, -0.043378934264183044, -0.005688495002686977, -0.02216469682753086, 0.007836531847715378, 0.04638238251209259, 0.0011744104558601975, -0.01577761396765709, 0.037372034043073654, 0.07630281895399094, 0.055506788194179535, 0.03607941046357155, -0.021594421938061714, 0.0113199632614851, -0.05786392465233803, -0.014770127832889557, -0.02461688034236431, 0.028095558285713196, -0.0685090646147728, -0.03625049442052841, 0.033836327493190765, -0.00891054980456829, -0.025909503921866417, 0.00882025621831417, -0.04075566679239273, -0.05189504474401474, -0.0001237081305589527, -0.02592851221561432, 0.012793174013495445, 0.04440543055534363, 0.006577174179255962, -0.019484402611851692, 0.047180768102407455, 0.02119522914290428, -0.05448029190301895, 0.01748844049870968, -0.010540586896240711, -0.010455045849084854, 0.00046720984391868114, 0.0526554100215435, 0.0028323668520897627, 0.015102788805961609, -0.0373530276119709, 0.11565180867910385, 0.022449834272265434, -0.10188917070627213, 0.021746493875980377, -0.048397354781627655, -0.02703104540705681, 0.038493577390909195, -0.046306345611810684, 0.0697256475687027, -0.030927926301956177, -0.025111118331551552, -0.041059814393520355, -0.007228238042443991, 0.0053605870343744755, 0.038588620722293854, -0.009547357447445393, 0.0440252460539341, 0.03204946592450142, -0.04113585129380226, 0.0015837018145248294, 0.03083287924528122, -0.03965313732624054, -0.0599929504096508, 0.004291321150958538, -0.036915816366672516, 0.04220036417245865, -0.051210712641477585, 0.009609137661755085, -0.00578354112803936, 0.010607118718326092, -0.023571375757455826, 0.04786510020494461, -0.022925063967704773, 0.020263779908418655, 0.03558517247438431, -0.006330054719001055, 0.011472036130726337, -0.043264880776405334, 0.0038517338689416647, 0.01290722843259573, 0.05105863884091377, -0.013353944756090641, 0.020244769752025604, 0.02693599835038185, 0.007884054444730282, -0.025130126625299454, 0.00441725691780448, 0.006600935477763414, 0.08097907900810242, -0.012755155563354492, -0.07006781548261642, -0.01841038465499878, 0.010863742791116238, 0.026745907962322235 ]
42,931
linearmodels.iv.model
j
Optimization target Parameters ---------- params : ndarray Parameter vector (nvar) x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) Returns ------- float GMM objective function, also known as the J statistic Notes ----- The GMM objective function is defined as .. math:: J(\beta) = \bar{g}(\beta)'W(\beta)^{-1}\bar{g}(\beta) where :math:`\bar{g}(\beta)` is the average of the moment conditions, :math:`z_i \hat{\epsilon}_i`, where :math:`\hat{\epsilon}_i = y_i - x_i\beta`. The weighting matrix is some estimator of the long-run variance of the moment conditions. Unlike tradition GMM, the weighting matrix is simultaneously computed with the moment conditions, and so has explicit dependence on :math:`\beta`.
def j( self, params: Float64Array, x: Float64Array, y: Float64Array, z: Float64Array ) -> float: r""" Optimization target Parameters ---------- params : ndarray Parameter vector (nvar) x : ndarray Regressor matrix (nobs by nvar) y : ndarray Regressand matrix (nobs by 1) z : ndarray Instrument matrix (nobs by ninstr) Returns ------- float GMM objective function, also known as the J statistic Notes ----- The GMM objective function is defined as .. math:: J(\beta) = \bar{g}(\beta)'W(\beta)^{-1}\bar{g}(\beta) where :math:`\bar{g}(\beta)` is the average of the moment conditions, :math:`z_i \hat{\epsilon}_i`, where :math:`\hat{\epsilon}_i = y_i - x_i\beta`. The weighting matrix is some estimator of the long-run variance of the moment conditions. Unlike tradition GMM, the weighting matrix is simultaneously computed with the moment conditions, and so has explicit dependence on :math:`\beta`. """ nobs = y.shape[0] weight_matrix = self._weight.weight_matrix eps = y - x @ params[:, None] w = inv(weight_matrix(x, z, eps)) g_bar = (z * eps).mean(0) return nobs * float(g_bar.T @ w @ g_bar.T)
(self, params: numpy.ndarray, x: numpy.ndarray, y: numpy.ndarray, z: numpy.ndarray) -> float
[ 0.06515800207853317, 0.04742420092225075, 0.023072220385074615, 0.026527568697929382, 0.02815469168126583, -0.028721440583467484, -0.09989430755376816, 0.007998491637408733, -0.014580107294023037, 0.002294424455612898, 0.029196780174970627, 0.0191049687564373, -0.019360920414328575, -0.005553238559514284, -0.025814561173319817, 0.007550576236099005, -0.012660469859838486, -0.023913204669952393, 0.007070666644722223, 0.026692109182476997, -0.04588849097490311, -0.08161203563213348, 0.0730559378862381, 0.10274633765220642, 0.02638131007552147, -0.054261766374111176, 0.05162912234663963, -0.03239617496728897, 0.016161523759365082, -0.014634954743087292, -0.04102540761232376, -0.04625413566827774, -0.051263477653265, 0.006005724426358938, 0.03623545169830322, 0.03433409705758095, 0.013318631798028946, 0.04109853506088257, -0.05539526790380478, -0.05053218454122543, 0.008240731433033943, -0.015128576196730137, 0.02007392980158329, -0.019562024623155594, 0.027789045125246048, -0.004735107067972422, 0.0032656698022037745, 0.051190346479415894, 0.005845754873007536, -0.04164700210094452, 0.04354836046695709, -0.07649300247430801, 0.005621796939522028, -0.04855769872665405, -0.01985454186797142, 0.08329400420188904, 0.09367833286523819, 0.017697233706712723, 0.042707376182079315, -0.05053218454122543, 0.031061571091413498, -0.057004109025001526, 0.0007689978228881955, 0.055249009281396866, 0.009817576967179775, 0.04921586066484451, -0.02771591581404209, -0.023858357220888138, 0.002152736997231841, 0.02616192400455475, 0.048374876379966736, -0.0371129997074604, 0.03033027984201908, -0.03400501608848572, 0.006540481001138687, 0.059490494430065155, -0.0343889445066452, -0.045815359801054, -0.05276262015104294, -0.026582416146993637, 0.028721440583467484, -0.012532494030892849, -0.05576091259717941, -0.058942027390003204, 0.013665994629263878, -0.023255042731761932, -0.030714208260178566, -0.015823302790522575, -0.05100752413272858, -0.04676603898406029, -0.034078143537044525, 0.005379557143896818, 0.030037764459848404, 0.02466277778148651, 0.005832043010741472, -0.012002307921648026, -0.026326464489102364, -0.001315180561505258, -0.004250627011060715, 0.032780103385448456, 0.04983745887875557, 0.020860066637396812, -0.0332554429769516, -0.013611147180199623, 0.02343786507844925, -0.052945446223020554, -0.010621996596455574, -0.022395776584744453, 0.013812252320349216, -0.05630938336253166, -0.02466277778148651, 0.017231035977602005, -0.039635952562093735, -0.08344026654958725, 0.014479555189609528, 0.05912484973669052, -0.040184423327445984, 0.05682128667831421, -0.037021588534116745, 0.038100242614746094, 0.02846548892557621, 0.020860066637396812, -0.0062936702743172646, 0.030823901295661926, 0.029745247215032578, -0.038356196135282516, 0.017514411360025406, 0.019050121307373047, 0.016764838248491287, -0.055687785148620605, -0.029708683490753174, -0.010393468663096428, -0.004097512923181057, -0.0020464712288230658, 0.016006125137209892, 0.014534401707351208, -0.06117246299982071, -0.017907479777932167, 0.05389612168073654, -0.01647232286632061, 0.04877708852291107, 0.019251227378845215, -0.04102540761232376, -0.022286083549261093, 0.011600098572671413, -0.028849417343735695, 0.08270897716283798, 0.032999493181705475, 0.008647512644529343, 0.009890706278383732, 0.01406820397824049, 0.0272771418094635, 0.0414276160299778, -0.09309330582618713, -0.019891105592250824, -0.016636863350868225, 0.021975284442305565, 0.01939748413860798, 0.024607930332422256, -0.0027674781158566475, -0.015475939027965069, -0.006709591951221228, -0.05817417427897453, 0.03698502480983734, 0.028410643339157104, 0.036253735423088074, -0.01875760592520237, 0.08716984838247299, -0.05930767208337784, 0.0001705392642179504, -0.04698542505502701, -0.02912365086376667, -0.021755898371338844, -0.01112475898116827, 0.013784829527139664, 0.04983745887875557, -0.02519296295940876, 0.01249592937529087, 0.026472723111510277, 0.026436157524585724, 0.03850245475769043, -0.00949763786047697, -0.01800803281366825, -0.054554283618927, 0.009835859760642052, 0.012797586619853973, 0.025777995586395264, -0.00955248437821865, -0.03795398399233818, -0.0018053738167509437, 0.026783520355820656, -0.04555941000580788, 0.00915941596031189, -0.003690732643008232, -0.00518302246928215, 0.027021190151572227, 0.06742499768733978, 0.027094319462776184, 0.014845200814306736, 0.02868487685918808, 0.00648563401773572, -0.02422400377690792, 0.016198087483644485, -0.0005453257472254336, 0.0019904817454516888, -0.025156399235129356, 0.0036016064696013927, -0.0480092316865921, 0.03327372670173645, -0.043146148324012756, 0.016591157764196396, 0.01570446789264679, -0.0687778890132904, 0.034187838435173035, 0.028282666578888893, 0.02117086574435234, 0.028849417343735695, 0.03252415359020233, 0.06822942197322845, -0.012879856862127781, -0.021774180233478546, -0.030567949637770653, -0.04409682750701904, 0.03897779434919357, 0.018721040338277817, -0.06007552891969681, 0.04274393990635872, 0.0556512214243412, -0.03181114420294762, -0.07367753237485886, 0.023401301354169846, -0.06566990166902542, 0.06852193921804428, -0.05506618693470955, 0.03700330853462219, -0.031152982264757156, -0.042524553835392, 0.00033279438503086567, 0.001908211619593203, 0.0030577091965824366, 0.013327772729098797, -0.02956242486834526, 0.0040312400087714195, 0.026417875662446022, 0.036253735423088074, -0.01585986651480198, 0.049691200256347656, 0.04757045954465866, 0.024351978674530983, 0.010046105831861496, -0.018190855160355568, 0.031902555376291275, -0.017715517431497574, -0.014324155636131763, -0.03181114420294762, 0.0480092316865921, 0.09068004041910172, 0.021445099264383316, 0.016810543835163116, -0.023821793496608734, -0.05042249336838722, 0.005937166046351194, -0.018245702609419823, 0.01844680681824684, -0.010329480282962322, 0.0588688999414444, 0.02148166298866272, 0.009387943893671036, 0.001111219055019319, 0.0365096852183342, -0.010119234211742878, 0.025156399235129356, -0.02431541495025158, -0.049800895154476166, 0.006673027295619249, -0.006974685005843639, 0.018903864547610283, -0.018346253782510757, 0.01575017347931862, -0.014040781185030937, -0.03274353966116905, -0.04413339123129845, 0.0037227266002446413, -0.03729582577943802, -0.047826409339904785, 0.02638131007552147, 0.018830735236406326, -0.0013037541648373008, -0.004561425652354956, -0.011005925014615059, -0.006846708711236715, 0.005425262730568647, 0.02171933278441429, 0.0182548426091671, 0.052945446223020554, -0.029087087139487267, 0.005768055096268654, 0.049142733216285706, 0.05495649576187134, 0.03652796894311905, 0.004538572859019041, 0.039635952562093735, 0.012569058686494827, -0.029160214588046074, -0.07067923992872238, 0.020019082352519035, 0.025576891377568245, -0.054042380303144455, -0.003016574075445533, 0.020476138219237328, 0.005219587124884129, -0.007865944877266884, -0.028447207063436508, 0.001593985129147768, -0.04844800755381584, -0.01472636591643095, -0.03879496827721596, 0.004019813612103462, 0.05331109091639519, 0.006115418393164873, 0.07038673013448715, 0.011106477119028568, 0.05616312474012375, -0.017276741564273834, -0.04504750669002533, -0.03263384476304054, -0.022212954238057137, 0.0589054636657238, -0.02597910165786743, -0.03568698465824127, 0.05550496280193329, -0.03181114420294762, 0.02018362283706665, -0.011801202781498432, -0.0003782144049182534, 0.016134100034832954, 0.038465891033411026, -0.01467151939868927, 0.03389532119035721, 0.029580706730484962, -0.0013094673631712794, -0.02934303879737854, -0.051519427448511124, 0.042524553835392, -0.016124960035085678, -0.005909742787480354, 0.04427964985370636, -0.018437666818499565, 0.008569812402129173, -0.004698542412370443, -0.011536110192537308, 0.08036884665489197, 0.03274353966116905, 0.012578199617564678, -0.02442510798573494, -0.054700542241334915, 0.002381265163421631, -0.019379202276468277, 0.024479955434799194, 0.03338341787457466, -0.09806607663631439, 0.03411471098661423, -0.003254243405535817, 0.022176390513777733, 0.04274393990635872, -0.023858357220888138, 0.027204012498259544, 0.006860420573502779, -0.01838281936943531, -0.08029571920633316, 0.011563533917069435, -0.050129976123571396, -0.05331109091639519, 0.04965463653206825, -0.012943845242261887, 0.04632726311683655, -0.043255843222141266, -0.04332897067070007, 0.028831135481595993, -0.033200595527887344, -0.01974484883248806, -0.05517588183283806, 0.01291642151772976, -0.00015111436368897557, -0.009634754620492458, 0.06486548483371735, 0.000859837862662971, -0.023053938522934914, -0.0034027867950499058, -0.009063433855772018, 0.01106991246342659, -0.013848816975951195, 0.022212954238057137, 0.03632686287164688, -0.04406026378273964, 0.04453560337424278, 0.07715116441249847, 0.0042917621321976185, -0.06899727135896683, 0.04047693684697151, -0.07287311553955078, -0.02453480288386345, -0.011691509746015072, 0.022743139415979385, -0.04212234169244766, -0.048155490309000015, -0.004081516060978174, 0.039087485522031784, -0.018849017098546028, 0.03742380067706108, -0.051190346479415894, -0.02332817204296589, -0.018510794267058372, 0.008505824953317642, -0.022414058446884155, 0.03380391001701355, 0.008880611509084702, -0.04201265051960945, 0.015503361821174622, 0.02826438471674919, 0.03427924960851669, -0.018922146409749985, 0.0926545262336731, -0.003114841179922223, -0.02901395782828331, -0.011627521365880966, -0.040842585265636444, -0.055139318108558655, -0.037478648126125336, -0.011600098572671413, -0.02235921286046505, -0.023474430665373802, 0.0075048706494271755, -0.0228893980383873, 0.02049442194402218, -0.01401335746049881, 0.018565641716122627, -0.016600297763943672, 0.04153731092810631, 0.020238468423485756, 0.013812252320349216, 0.05751601234078407, -0.031902555376291275, 0.00782938115298748, -0.08022258430719376, 0.012697034515440464, 0.04307302087545395, -0.014644095674157143, -0.07097175717353821, -0.011801202781498432, 0.04120822995901108, 0.03758833929896355, 0.07298281043767929, -0.01866619475185871, 0.001009523868560791, -0.04047693684697151, -0.031555190682411194, -0.05166568607091904, 0.002591511234641075, 0.01411390956491232, 0.02029331587255001, -0.033749066293239594, 0.004831089172512293, 0.019031839445233345, -0.10413578897714615, 0.035833243280649185, -0.0075048706494271755, -0.014799495227634907, -0.0008084189612418413, 0.043255843222141266, -0.006005724426358938, 0.020914914086461067, -0.052945446223020554, -0.03283495083451271, -0.0447549894452095, 0.03358452394604683, -0.060148656368255615, 0.02475418895483017, 0.06267160922288895, -0.011133900843560696, -0.052067894488573074, -0.01428759191185236, -0.002845177659764886, 0.06804659962654114, 0.04058663174510002, 0.02433369681239128, 0.03978221118450165, -0.04069632664322853, 0.09199636429548264, -0.06460952758789062, -0.02826438471674919, 0.05356704071164131, 0.07700490951538086, 0.011289299465715885, -0.033749066293239594, 0.03261556476354599, -0.020421292632818222, -0.017029931768774986, 0.004241486079990864, 0.02062239684164524, 0.007655699271708727, 0.03140893578529358, -0.10457456856966019, -0.025138117372989655, -0.02976353093981743, -0.05912484973669052, -0.002564087975770235, 0.01325464341789484, -0.03956282511353493, 0.031025007367134094, -0.06051430478692055, -0.0009912416571751237, -0.04427964985370636, 0.04994715377688408, -0.042378295212984085, -0.04175669699907303, -0.000011122902833449189, 0.02051270380616188, 0.009470214135944843, -0.016225511208176613, 0.03700330853462219, -0.012952986173331738, 0.00572691997513175, -0.0069426908157765865, 0.026655545458197594, 0.04427964985370636, -0.016198087483644485, -0.016965944319963455, 0.004648266360163689, 0.04621757194399834, -0.03171973302960396, -0.01144469901919365, -0.05031279847025871, 0.04446247220039368, -0.06351259350776672, -0.02170105092227459, 0.0653773844242096, -0.03270697593688965, -0.04844800755381584, -0.011207029223442078, 0.01618894748389721, 0.0005918883834965527, 0.04888677969574928, -0.024278849363327026, -0.006156553514301777, 0.04000160098075867, -0.00537041574716568, 0.037442080676555634, 0.01581416092813015, 0.002465820638462901, -0.05093439668416977, -0.008341284468770027, -0.03831963241100311, 0.05433489754796028, 0.034626614302396774, -0.02597910165786743, -0.010201504454016685, 0.017413858324289322, 0.014954893849790096, 0.02594253607094288, 0.010128376074135303, 0.013949370011687279, 0.04091571271419525, 0.0025023852940648794, -0.034626614302396774, 0.04950837790966034, 0.05444458872079849, -0.01325464341789484, -0.008706929162144661, 0.012066296301782131, -0.021975284442305565, 0.022615164518356323, 0.0182548426091671, -0.004008387215435505, 0.020640678703784943, -0.000727291451767087, 0.04289019852876663, 0.015192563645541668, -0.038027115166187286, 0.010036964900791645, -0.004817377310246229, -0.008085332810878754, 0.002909165807068348, 0.025485480204224586, 0.05170224979519844, 0.023419583216309547, -0.07949129492044449, 0.013812252320349216, 0.00021953003306407481, 0.008766346611082554, 0.015192563645541668, 0.08365965634584427, -0.03828306496143341, -0.0063805109821259975, -0.014196179807186127, 0.025540325790643692, -0.03555900976061821, 0.039197180420160294, 0.03731410577893257, -0.011709791608154774, -0.04135448858141899, -0.04014785960316658, -0.021573074162006378, -0.009835859760642052, -0.017121342942118645, -0.001952774589881301, -0.03459005057811737, -0.0012500500306487083, 0.012888997793197632, -0.0665108859539032, 0.0014385858085006475, -0.06790033727884293, -0.05864951014518738, -0.019050121307373047, -0.058064479380846024, 0.040842585265636444, 0.0033639371395111084, 0.0764198750257492, 0.03480943664908409, -0.016042688861489296, -0.0256317388266325, -0.003519336460158229, 0.028447207063436508, 0.03208537772297859, 0.046290699392557144, 0.0009980974718928337, -0.029160214588046074, -0.03076905570924282, 0.02638131007552147, 0.005969160236418247, -0.01623465307056904, 0.026015665382146835, 0.048703957349061966, 0.039087485522031784, 0.004931641276925802, -0.05257979780435562, -0.005164740141481161, -0.05279918760061264, -0.03989190608263016, 0.0021950146183371544, -0.01587814837694168, 0.05192163586616516, 0.016444899141788483, 0.014315014705061913, -0.020750373601913452, -0.001514000236056745, 0.02837407775223255, 0.03731410577893257, 0.015622196719050407, -0.025064988061785698, -0.0063530877232551575, 0.011307582259178162, -0.03588809072971344, 0.024735907092690468, 0.024790754541754723, 0.010548868216574192, -0.03733238950371742, 0.012623905204236507, 0.0032862373627722263, -0.016984226182103157, 0.027002908289432526, 0.008131038397550583, -0.03471802547574043, -0.013985933735966682, -0.04442590847611427, -0.02256031706929207, -0.022962527349591255, -0.04961807280778885, 0.008981163613498211, -0.00391469057649374, 0.009570766240358353, -0.02747824788093567, 0.06556020677089691, -0.0392337441444397, 0.007998491637408733, -0.05919798091053963, 0.05320139601826668, 0.057625703513622284, 0.0007301480509340763, -0.01074083149433136, 0.0884130448102951, 0.013885381631553173, 0.06303725391626358, 0.01002782303839922, 0.03413299098610878, -0.054152075201272964, -0.037698034197092056, 0.0015654191374778748, 0.045230329036712646, 0.028812851756811142, -0.0817582979798317, 0.03393188863992691, 0.02793530374765396, 0.024827318266034126, 0.03683876618742943, -0.017688093706965446, -0.009145704098045826, 0.06449984014034271, 0.0005204732879064977, -0.03455348312854767, -0.04965463653206825, 0.00915941596031189, -0.03144549950957298, 0.046510085463523865, 0.03674735501408577, 0.03296292573213577, -0.000024727480194997042, -0.001670542173087597, 0.012907280586659908, -0.1090354397892952, 0.00678729172796011, -0.03588809072971344, 0.010676844045519829, -0.00811732653528452, 0.04939868301153183, 0.036381710320711136, 0.02226780168712139, -0.002845177659764886, 0.011225312016904354, 0.09250827133655548, -0.028538618236780167, 0.02826438471674919, 0.01030205748975277, -0.0016248364700004458, -0.03053138591349125, -0.008217878639698029, 0.012331388890743256, -0.06248878687620163, 0.015092011541128159, 0.01129844132810831, -0.001908211619593203, 0.037478648126125336, 0.013720841147005558, -0.016728274524211884, -0.016856249421834946, -0.03588809072971344, -0.004072375129908323, -0.05356704071164131, 0.01069512590765953, 0.08468346297740936, -0.059380803257226944, 0.027222294360399246, 0.0012157707242295146, -0.028209537267684937, -0.008766346611082554, 0.03643655776977539, -0.03305433690547943, -0.02488216571509838, -0.0018967852229252458, 0.0025229528546333313, 0.04939868301153183, -0.05901515856385231, 0.022414058446884155, -0.02356584183871746, 0.060916513204574585, 0.047277942299842834, -0.008300148881971836, -0.04022098705172539, -0.05170224979519844, -0.014698942191898823, -0.06636463105678558, -0.002637217054143548, 0.0025960819330066442, 0.005777196492999792, -0.0719955638051033, -0.0007775676785968244, 0.010201504454016685, 0.03766147047281265 ]
42,935
linearmodels.iv.model
IVLIML
Limited information ML and k-class estimation of IV models Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation fuller : float Fuller's alpha to modify LIML estimator. Default returns unmodified LIML estimator. kappa : float Parameter value for k-class estimation. If None, computed to produce LIML parameter estimate. Notes ----- ``kappa`` and ``fuller`` should not be used simultaneously since Fuller's alpha applies an adjustment to ``kappa``, and so the same result can be computed using only ``kappa``. Fuller's alpha is used to adjust the LIML estimate of :math:`\kappa`, which is computed whenever ``kappa`` is not provided. The LIML estimator is defined as .. math:: \hat{\beta}_{\kappa} & =(X(I-\kappa M_{z})X)^{-1}X(I-\kappa M_{z})Y\\ M_{z} & =I-P_{z}\\ P_{z} & =Z(Z'Z)^{-1}Z' where :math:`Z` contains both the exogenous regressors and the instruments. :math:`\kappa` is estimated as part of the LIML estimator. When using Fuller's :math:`\alpha`, the value used is modified to .. math:: \kappa-\alpha/(n-n_{instr}) .. todo:: * VCV: bootstrap See Also -------- IV2SLS, IVGMM, IVGMMCUE
class IVLIML(_IVLSModelBase): r""" Limited information ML and k-class estimation of IV models Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) endog : array_like Endogenous regressors (nobs by nendog) instruments : array_like Instrumental variables (nobs by ninstr) weights : array_like Observation weights used in estimation fuller : float Fuller's alpha to modify LIML estimator. Default returns unmodified LIML estimator. kappa : float Parameter value for k-class estimation. If None, computed to produce LIML parameter estimate. Notes ----- ``kappa`` and ``fuller`` should not be used simultaneously since Fuller's alpha applies an adjustment to ``kappa``, and so the same result can be computed using only ``kappa``. Fuller's alpha is used to adjust the LIML estimate of :math:`\kappa`, which is computed whenever ``kappa`` is not provided. The LIML estimator is defined as .. math:: \hat{\beta}_{\kappa} & =(X(I-\kappa M_{z})X)^{-1}X(I-\kappa M_{z})Y\\ M_{z} & =I-P_{z}\\ P_{z} & =Z(Z'Z)^{-1}Z' where :math:`Z` contains both the exogenous regressors and the instruments. :math:`\kappa` is estimated as part of the LIML estimator. When using Fuller's :math:`\alpha`, the value used is modified to .. math:: \kappa-\alpha/(n-n_{instr}) .. todo:: * VCV: bootstrap See Also -------- IV2SLS, IVGMM, IVGMMCUE """ def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, fuller: Numeric = 0, kappa: OptionalNumeric = None, ): super().__init__( dependent, exog, endog, instruments, weights=weights, fuller=fuller, kappa=kappa, ) @staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None, fuller: float = 0, kappa: OptionalNumeric = None, ) -> IVLIML: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation fuller : float Fuller's alpha to modify LIML estimator. Default returns unmodified LIML estimator. kappa : float Parameter value for k-class estimation. If not provided, computed to produce LIML parameter estimate. Returns ------- IVLIML Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using '1 +' if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVLIML >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVLIML.from_formula(formula, data) """ parser = IVFormulaParser(formula, data) dep, exog, endog, instr = parser.data mod: IVLIML = IVLIML( dep, exog, endog, instr, weights=weights, fuller=fuller, kappa=kappa ) mod.formula = formula return mod
(dependent: 'IVDataLike', exog: 'IVDataLike | None', endog: 'IVDataLike | None', instruments: 'IVDataLike | None', *, weights: 'IVDataLike | None' = None, fuller: 'Numeric' = 0, kappa: 'OptionalNumeric' = None)
[ 0.07856566458940506, -0.08348563313484192, 0.0055109355598688126, 0.023562012240290642, 0.024138571694493294, -0.036726757884025574, -0.01784447766840458, -0.05308179557323456, 0.00721178250387311, 0.05027587711811066, -0.024792004376649857, -0.019948914647102356, -0.0005053892964497209, 0.03993626683950424, -0.03228726238012314, 0.03576582670211792, -0.01875736005604267, -0.017930960282683372, 0.014529267325997353, -0.00017311761621385813, -0.023312170058488846, 0.004477935377508402, -0.028481977060437202, 0.07157009094953537, 0.03338272124528885, 0.003043747041374445, 0.0009819506667554379, 0.007168540731072426, 0.05066024884581566, -0.031518515199422836, -0.06734199821949005, 0.003682765644043684, -0.05385053902864456, -0.04216562584042549, 0.003480970161035657, -0.06203766539692879, 0.01795978844165802, -0.01893993839621544, -0.016431909054517746, 0.005222656764090061, 0.03470880538225174, -0.017719555646181107, 0.052466798573732376, -0.04178125411272049, -0.06015424057841301, 0.027655575424432755, -0.02926993928849697, 0.006510303355753422, 0.06088455021381378, -0.020967500284314156, 0.003584270365536213, -0.009268173016607761, 0.014125676825642586, -0.03799518570303917, -0.06203766539692879, 0.051967114210128784, 0.0019434817368164659, 0.0031806796323508024, 0.038706276565790176, -0.033363502472639084, -0.0075048659928143024, -0.043011244386434555, 0.045624975115060806, 0.01709495112299919, -0.020929062739014626, 0.05984674394130707, -0.022812487557530403, 0.04697027802467346, -0.009181689471006393, 0.004739789292216301, -0.03459349274635315, -0.059154875576496124, -0.017027685418725014, 0.04647059366106987, 0.009666959755122662, 0.01287646684795618, -0.028443539515137672, -0.0000745847137295641, -0.0073991636745631695, -0.028751036152243614, -0.0007813565316610038, -0.02434997633099556, -0.017969397827982903, -0.03540067374706268, -0.009402703493833542, -0.047854334115982056, -0.015432542189955711, -0.04397217556834221, 0.07933440804481506, -0.003872549394145608, -0.08133314549922943, 0.031364768743515015, 0.0024263490922749043, 0.03868705779314041, 0.01062789000570774, -0.0006984762731008232, 0.002035971265286207, -0.08925121277570724, 0.05023743957281113, -0.03709191083908081, 0.016643313691020012, 0.008360094390809536, 0.005943354219198227, 0.006865847390145063, -0.040435951203107834, -0.06757262349128723, -0.06780324876308441, -0.007942089810967445, 0.017027685418725014, -0.09171119332313538, -0.04858464002609253, 0.045163728296756744, -0.03912908583879471, 0.03497786447405815, -0.056810203939676285, 0.05538802593946457, -0.025118719786405563, 0.02923150174319744, -0.011819443665444851, 0.02208217978477478, -0.028289789333939552, -0.03286381810903549, -0.08456186950206757, 0.011502336710691452, 0.026521679013967514, -0.06476670503616333, 0.011617648415267467, -0.009782271459698677, 0.0029572632629424334, -0.04869995266199112, -0.008191931061446667, -0.008417749777436256, -0.03978251665830612, 0.036688320338726044, 0.01377974171191454, -0.011223666369915009, 0.021909212693572044, 0.007725880015641451, -0.00688987085595727, 0.10685545951128006, 0.014855983667075634, 0.027059799060225487, 0.010157033801078796, 0.05834769085049629, -0.03415146470069885, 0.01618206687271595, 0.029327595606446266, -0.00107083679176867, -0.018882282078266144, -0.042819056659936905, 0.008360094390809536, -0.02473434805870056, 0.04808495566248894, -0.02329295314848423, 0.01727752760052681, 0.008513842709362507, -0.0018642048817127943, -0.0049343775026500225, 0.023888729512691498, -0.07391476631164551, -0.043011244386434555, -0.017152607440948486, -0.021447965875267982, 0.02302389219403267, 0.010051331482827663, 0.005664684344083071, -0.019795166328549385, -0.021198123693466187, -0.008307242766022682, 0.057040825486183167, -0.0019074467709288, -0.058616753667593, -0.04262687265872955, 0.008023768663406372, -0.047508396208286285, 0.06080767512321472, 0.002144075930118561, 0.01996813341975212, 0.0642285868525505, 0.045240603387355804, -0.0008270007092505693, 0.02877025492489338, -0.07483725994825363, -0.0396287702023983, -0.038283467292785645, 0.015086607076227665, -0.010608671233057976, 0.015230746008455753, -0.033325064927339554, -0.017536979168653488, 0.033747874200344086, -0.052582111209630966, 0.045240603387355804, 0.002534453757107258, -0.07145478576421738, 0.04393373802304268, 0.03330584615468979, 0.03766847029328346, -0.004525981843471527, 0.018622830510139465, 0.044971540570259094, 0.02340826392173767, 0.0017729165265336633, -0.016345426440238953, -0.05804019421339035, 0.01644151844084263, -0.08648373186588287, -0.04900744929909706, 0.003108609700575471, -0.006467061582952738, 0.027175111696124077, 0.04462560638785362, -0.011579210869967937, 0.056656453758478165, 0.026175742968916893, 0.04151219129562378, -0.04181969165802002, 0.03951345756649971, -0.003471361007541418, -0.031518515199422836, 0.04424123466014862, -0.031672265380620956, -0.097861148416996, -0.0021356677170842886, -0.010272345505654812, -0.02688683196902275, 0.08202501386404037, 0.018555564805865288, -0.015672774985432625, 0.010743201710283756, 0.004204070195555687, -0.05327397957444191, 0.02654089778661728, -0.015509416349232197, -0.012376783415675163, 0.010224299505352974, -0.04401060938835144, 0.03388240560889244, -0.05142899230122566, -0.011781006120145321, -0.004081551916897297, -0.025022627785801888, -0.015816913917660713, 0.04846932739019394, -0.017681118100881577, -0.0015975467395037413, 0.008513842709362507, 0.04474091902375221, -0.017027685418725014, -0.02673308365046978, 0.015134653076529503, -0.029615873470902443, -0.024100134149193764, 0.05711770057678223, 0.004439498297870159, 0.019276263192296028, 0.005237070377916098, -0.003754835342988372, 0.04600934684276581, -0.07087822258472443, 0.0023182444274425507, -0.047469958662986755, -0.010551015846431255, 0.061691731214523315, 0.010820075869560242, 0.05996205657720566, 0.045509662479162216, -0.006298898719251156, 0.09124995023012161, 0.002988493535667658, 0.03830268606543541, 0.04862307757139206, -0.03789909556508064, 0.014279425144195557, 0.008139080367982388, 0.047085586935281754, -0.022178273648023605, -0.020967500284314156, -0.03278694301843643, 0.006135540548712015, 0.014164113439619541, -0.04374155029654503, -0.038360338658094406, -0.028270572423934937, 0.0019963327795267105, 0.01053179707378149, -0.06468982994556427, -0.03901377320289612, 0.01819041185081005, 0.00010367538197897375, 0.03322897106409073, 0.04189656302332878, 0.011387025006115437, 0.012415220029652119, 0.05350460484623909, 0.045586537569761276, -0.02582980878651142, 0.05142899230122566, 0.05757894739508629, -0.016662532463669777, -0.015153871849179268, -0.014077629894018173, 0.07526006549596786, -0.04900744929909706, -0.04431810975074768, -0.03814893588423729, 0.022139836102724075, -0.020775314420461655, -0.018670877441763878, 0.005674293730407953, 0.023350607603788376, 0.07049385458230972, -0.007802754640579224, -0.03311366215348244, 0.00230142823420465, -0.03974407911300659, 0.007005182560533285, 0.0036971797235310078, 0.0602695532143116, 0.019718291237950325, 0.03103805147111416, 0.01690276525914669, -0.03028852492570877, -0.01803666353225708, 0.03309444338083267, -0.02809760347008705, 0.08679123222827911, -0.004420279525220394, 0.006082689389586449, -0.03392084315419197, 0.022062961012125015, 0.00047325820196419954, -0.018046272918581963, -0.012886076234281063, -0.04431810975074768, -0.01973751001060009, 0.022408897057175636, 0.02900087833404541, 0.05361991375684738, 0.02181311883032322, 0.05800175666809082, -0.03891767933964729, -0.06953292340040207, 0.01645112782716751, 0.0034569469280540943, -0.04316499084234238, 0.05819394439458847, -0.0343436524271965, -0.007019596174359322, 0.07103197276592255, -0.045586537569761276, -0.05142899230122566, 0.02454216219484806, 0.022504989057779312, -0.003920596092939377, -0.04681652784347534, -0.03868705779314041, -0.012030848301947117, 0.028943222016096115, -0.028347445651888847, -0.02442684955894947, -0.015432542189955711, -0.03641926124691963, 0.042703744024038315, 0.02650246024131775, -0.03303678706288338, 0.032421790063381195, -0.02771323174238205, 0.011608039028942585, 0.03565051779150963, 0.009090401232242584, -0.06741887331008911, -0.02461903542280197, 0.0012612211285158992, 0.038783151656389236, -0.0112140579149127, -0.028155259788036346, -0.007817168720066547, -0.02982727810740471, 0.004158426076173782, 0.02071765810251236, -0.009537233971059322, 0.06453608721494675, 0.008124666288495064, 0.03624629229307175, 0.032421790063381195, 0.05123680830001831, 0.027251984924077988, 0.024945752695202827, -0.002743456279858947, -0.0024575793650001287, -0.004355417098850012, 0.02696370705962181, -0.008710834197700024, -0.03705347701907158, -0.007821973413228989, -0.002496016677469015, -0.023523574694991112, 0.018363378942012787, -0.05335085466504097, -0.026982923969626427, 0.005914526525884867, 0.01610519364476204, 0.007082056719809771, -0.008489820174872875, 0.02348513901233673, 0.014692625030875206, 0.07956503331661224, -0.049314945936203, -0.028827911242842674, -0.0036995818372815847, 0.027770888060331345, -0.027386516332626343, -0.05604146048426628, 0.0034737633541226387, 0.006471866276115179, 0.06911011040210724, 0.012347955256700516, -0.028981659561395645, 0.03146085888147354, 0.052005551755428314, -0.01035882905125618, 0.07783535867929459, 0.02000657096505165, -0.07176227867603302, 0.047047149389982224, -0.026233399286866188, -0.04193500056862831, -0.009878364391624928, -0.0363808237016201, -0.024253882467746735, 0.03647691756486893, 0.0125497505068779, -0.006265265867114067, -0.04620153084397316, -0.04804651811718941, -0.04262687265872955, -0.021717026829719543, 0.009186494164168835, -0.009277782402932644, 0.025022627785801888, -0.029500562697649002, 0.03426677733659744, 0.044971540570259094, -0.027328860014677048, -0.004838284570723772, -0.023831073194742203, 0.034689586609601974, 0.008307242766022682, -0.010791247710585594, 0.03549676761031151, 0.004619672894477844, 0.048161830753088, 0.05269742012023926, -0.030634460970759392, -0.026560114696621895, -0.004816663451492786, -0.03438208997249603, 0.043088119477033615, 0.037034258246421814, -0.021082812920212746, 0.019391575828194618, 0.018401816487312317, 0.0013693257933482528, -0.00916727539151907, 0.03603488951921463, 0.06238359957933426, -0.05500365421175957, -0.044933103024959564, 0.0008960675913840532, 0.02813604101538658, 0.0039830561727285385, 0.08648373186588287, -0.026521679013967514, 0.005842456594109535, 0.03543911129236221, 0.024868877604603767, -0.021947650238871574, 0.004963205195963383, -0.0558108352124691, 0.013866225257515907, -0.022447332739830017, -0.01033961120992899, 0.019631806761026382, -0.018987983465194702, 0.017556197941303253, -0.010272345505654812, 0.023946383967995644, 0.0012444048188626766, -0.05354303866624832, -0.0755675658583641, 0.08717560023069382, 0.03645769879221916, 0.04635528102517128, 0.027655575424432755, -0.005256289150565863, 0.037264879792928696, -0.033248189836740494, 0.04462560638785362, -0.015980271622538567, 0.017450494691729546, -0.04597090929746628, -0.006620810367166996, -0.036649882793426514, 0.039340488612651825, -0.007725880015641451, -0.030153995379805565, -0.014961685985326767, -0.002145277103409171, -0.054503969848155975, -0.021505622193217278, -0.03743784874677658, 0.07625943422317505, -0.023581231012940407, -0.02090984582901001, -0.018728533759713173, -0.026041213423013687, 0.07825817167758942, 0.016662532463669777, -0.008970284834504128, 0.025003409013152122, -0.06445921212434769, -0.013866225257515907, -0.059193309396505356, 0.025041844695806503, 0.038629401475191116, -0.02219749242067337, -0.054696157574653625, 0.0005495320656336844, 0.027194330468773842, -0.03413224592804909, -0.042857494205236435, 0.004610063508152962, 0.04827714338898659, -0.077720046043396, 0.027655575424432755, 0.018959157168865204, -0.025541529059410095, -0.020371723920106888, 0.0040022749453783035, -0.034728024154901505, 0.014144894666969776, -0.03895611688494682, 0.01465418841689825, 0.02744417078793049, 0.010954606346786022, -0.06980197876691818, 0.06376733630895615, -0.06641950458288193, 0.014183332212269306, -0.04823870584368706, 0.010935387574136257, -0.019180169329047203, -0.015086607076227665, 0.021390309557318687, 0.014135286211967468, 0.004571626428514719, 0.007932480424642563, 0.003689972683787346, 0.030576804652810097, -0.024849658831954002, -0.0008828548016026616, 0.03432443365454674, -0.06741887331008911, 0.08878996968269348, 0.025618404150009155, 0.03814893588423729, -0.040243763476610184, -0.019381966441869736, 0.005189023911952972, 0.0010077757760882378, -0.023869510740041733, 0.05650270730257034, -0.0010642303386703134, -0.04170437902212143, 0.03939814493060112, -0.0016600071685388684, -0.004929572809487581, -0.009277782402932644, -0.07656693458557129, -0.026483241468667984, 0.030826646834611893, 0.009537233971059322, -0.02552231028676033, 0.05523427948355675, -0.03211429342627525, -0.023389045149087906, 0.0990142673254013, -0.03420912101864815, 0.07468350976705551, -0.003613098291680217, 0.015797695145010948, -0.020294848829507828, 0.0058664800599217415, 0.014644579030573368, 0.04873839020729065, -0.009647740982472897, -0.0006528320955112576, 0.059116438031196594, 0.008581108413636684, -0.020102662965655327, 0.002846756251528859, -0.018161583691835403, 0.029923371970653534, -0.025695277377963066, 0.038206592202186584, -0.0031182190869003534, -0.016153238713741302, 0.021390309557318687, -0.006020228844136, 0.01887267269194126, 0.007634591776877642, 0.005342772696167231, -0.009282587096095085, 0.0020071433391422033, 0.023465920239686966, -0.0021512829698622227, 0.07687442749738693, 0.07560600340366364, -0.010829685255885124, -0.00892704352736473, -0.04639371857047081, -0.001410165335983038, -0.020121881738305092, -0.012213424779474735, -0.007115689571946859, -0.004088758956640959, -0.04604778438806534, 0.019449230283498764, -0.000978947849944234, 0.045432787388563156, 0.03009633906185627, 0.044933103024959564, 0.04197343811392784, 0.04239624738693237, 0.04608622193336487, 0.04843088984489441, -0.00017582022701390088, -0.012165378779172897, 0.04804651811718941, -0.04231937229633331, -0.01940118335187435, -0.003086988814175129, 0.020121881738305092, 0.052120864391326904, -0.022216709330677986, 0.01644151844084263, 0.00047656139940954745, 0.01645112782716751, 0.01893993839621544, -0.02094828151166439, -0.010128206573426723, -0.059462372213602066, -0.04597090929746628, -0.08379312604665756, -0.027328860014677048, 0.00223536416888237, 0.027540264651179314, 0.027578702196478844, -0.03009633906185627, -0.045163728296756744, 0.004963205195963383, -0.00884536374360323, -0.002656972501426935, 0.05150586739182472, 0.04201187565922737, 0.06492045521736145, 0.0007609367603436112, 0.05042962729930878, 0.010723982937633991, -0.0013933490263298154, -0.019756728783249855, 0.009090401232242584, 0.018661268055438995, -0.00988797377794981, -0.026982923969626427, -0.003485774854198098, 0.007019596174359322, 0.012540141120553017, 0.01043570414185524, 0.031057270243763924, 0.03509317710995674, 0.015000123530626297, -0.03422833979129791, -0.0027314445469528437, -0.05312022939324379, -0.001154918223619461, 0.007634591776877642, 0.035861920565366745, -0.04889213666319847, -0.06484358012676239, 0.027232766151428223, 0.020198756828904152, -0.02869338169693947, 0.04185812547802925, -0.09739990532398224, -0.034016937017440796, -0.028712600469589233, 0.01149272732436657, -0.04439498484134674, 0.04258843511343002, 0.016739407554268837, -0.028309008106589317, 0.012886076234281063, 0.01977594755589962, 0.0400131419301033, -0.02052547223865986, -0.045394349843263626, -0.034766461700201035, -0.05534958839416504, 0.019987352192401886, 0.040628135204315186, 0.010570233687758446, -0.08902058750391006, 0.10178174823522568, 0.033555690199136734, 0.004100770223885775, -0.03895611688494682, -0.04912276193499565, 0.021467184647917747, 0.056848641484975815, -0.04600934684276581, 0.045009978115558624, -0.015115434303879738, -0.0656123235821724, -0.014212160371243954, -0.009974457323551178, 0.059423934668302536, 0.0165664404630661, 0.031364768743515015, 0.024888096377253532, 0.059385497123003006, -0.023811854422092438, -0.015759257599711418, -0.0006618407787755132, -0.07164696604013443, -0.0642285868525505, -0.013510680757462978, -0.00042761402437463403, 0.02231280319392681, 0.018728533759713173, -0.011521555483341217, -0.02438841201364994, 0.022101398557424545, -0.015288402326405048, 0.05992361903190613, -0.007841192185878754, 0.015499806962907314, 0.05865519121289253, -0.0065247174352407455, 0.02865494415163994, -0.012069285847246647, -0.020506253466010094, -0.011146792210638523, 0.06319078058004379, 0.018545955419540405, 0.05611833557486534, -0.015153871849179268, -0.02775166928768158, -0.058616753667593, 0.007898847572505474, -0.059231746941804886, 0.09255681186914444, 0.010272345505654812, -0.019103296101093292, 0.005256289150565863, -0.0073559219017624855, 0.028597287833690643 ]
42,936
linearmodels.iv.model
__init__
null
def __init__( self, dependent: IVDataLike, exog: IVDataLike | None, endog: IVDataLike | None, instruments: IVDataLike | None, *, weights: IVDataLike | None = None, fuller: Numeric = 0, kappa: OptionalNumeric = None, ): super().__init__( dependent, exog, endog, instruments, weights=weights, fuller=fuller, kappa=kappa, )
(self, dependent: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], endog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], instruments: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType], *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, fuller: Union[int, float] = 0, kappa: Union[int, float, NoneType] = None)
[ 0.030252724885940552, -0.07375799119472504, 0.004478616174310446, 0.014565120451152325, -0.0028175225015729666, -0.03541252389550209, -0.0385989286005497, -0.030379455536603928, 0.020639201626181602, 0.02561795525252819, -0.0296371690928936, 0.048665065318346024, -0.018611490726470947, 0.03419951722025871, -0.03275115415453911, 0.03530389815568924, 0.024821355938911438, 0.04207500442862511, 0.02188841626048088, 0.031266581267118454, -0.022268611937761307, -0.009948457591235638, -0.07024570554494858, 0.05880361795425415, -0.0012367679737508297, 0.060614075511693954, -0.01664714515209198, -0.028587104752659798, 0.016819138079881668, -0.03381932154297829, -0.041604284197092056, -0.03706004098057747, -0.031520042568445206, 0.057101789861917496, 0.06952152401208878, -0.04355957731604576, 0.006798263173550367, 0.06448845565319061, -0.0813981145620346, 0.06691446155309677, 0.048375390470027924, -0.06608165055513382, 0.05051172897219658, -0.021834103390574455, -0.026812857016921043, 0.060360610485076904, 0.020494364202022552, 0.0003881165466737002, 0.01622168719768524, -0.016239792108535767, 0.01564234122633934, -0.004670977126806974, 0.03438056260347366, -0.016475152224302292, -0.04953408241271973, 0.10978607088327408, 0.04388545826077461, 0.045768335461616516, 0.026505079120397568, -0.0015411508502438664, -0.011288194917142391, -0.028532790020108223, 0.0600709393620491, -0.0146013293415308, -0.019498614594340324, 0.061157211661338806, -0.07368557155132294, 0.01668335497379303, 0.011523554101586342, 0.04685460776090622, 0.05163421109318733, -0.02569037489593029, -0.05880361795425415, 0.04685460776090622, 0.031701087951660156, 0.01765194907784462, -0.05156179517507553, -0.015732865780591965, 0.0012401625281199813, -0.06724034249782562, 0.006476907059550285, -0.04725290834903717, -0.07386661320924759, -0.000848651397973299, 0.0077442266047000885, -0.030868278816342354, -0.03403657674789429, -0.041712913662195206, 0.020367633551359177, -0.00888028834015131, -0.10029927641153336, 0.03088638372719288, -0.009550157003104687, 0.04431996867060661, 0.09124699234962463, -0.0025029557291418314, -0.028931090608239174, -0.10898946970701218, 0.016873452812433243, -0.0062053389847278595, 0.005196009296923876, -0.02970958687365055, 0.04645630717277527, -0.008703768253326416, -0.01556992344558239, -0.07553223520517349, -0.03620912507176399, -0.0037363290321081877, 0.009939405135810375, -0.07046295702457428, -0.05894845724105835, 0.04605800658464432, -0.04384925216436386, 0.007060779258608818, -0.07292518019676208, 0.023119525983929634, 0.02529207430779934, 0.03610049933195114, 0.011143358424305916, 0.044682059437036514, 0.00544494716450572, 0.020729724317789078, -0.06539367884397507, 0.044863104820251465, 0.03695141151547432, -0.03474265709519386, -0.008405042812228203, 0.011378717608749866, -0.015778126195073128, -0.06680583953857422, 0.008812395855784416, -0.01693681813776493, -0.05409643426537514, 0.020838351920247078, -0.0032384535297751427, 0.00008677460573380813, 0.06912322342395782, 0.024296322837471962, -0.008459356613457203, 0.049027156084775925, 0.026577498763799667, -0.002822048729285598, 0.017163125798106194, 0.0072327726520597935, -0.012790873646736145, 0.04642009735107422, -0.011713651940226555, -0.03423572704195976, -0.004824866075068712, 0.003009883454069495, -0.013189174234867096, 0.04812192916870117, -0.014682800509035587, -0.02185220643877983, 0.005517365410923958, -0.010826528072357178, 0.013677997514605522, -0.014628486707806587, 0.025817105546593666, -0.032950304448604584, -0.048665065318346024, -0.025092924013733864, 0.027935341000556946, 0.0011541658313944936, -0.017344171181321144, 0.035032328218221664, -0.0380919985473156, 0.0016656197840347886, -0.0009872644441202283, 0.02521965652704239, -0.008011269383132458, -0.10080620646476746, -0.040952522307634354, -0.0003346515295561403, 0.0007722727605141699, 0.06293146312236786, 0.007513393647968769, 0.009667836129665375, 0.035177163779735565, 0.017887307330965996, 0.025998152792453766, -0.026577498763799667, -0.05616035312414169, -0.034145206212997437, 0.030832070857286453, -0.020041750743985176, 0.020077960565686226, 0.023554036393761635, 0.021327175199985504, -0.015950119122862816, 0.061157211661338806, -0.022503972053527832, -0.009830777533352375, 0.011034730821847916, 0.02360834926366806, 0.003960372880101204, 0.06173655763268471, -0.015841491520404816, -0.021689265966415405, 0.027862921357154846, 0.024133382365107536, -0.029944946989417076, 0.012528357096016407, -0.024368740618228912, -0.0008379017817787826, 0.03827304393053055, -0.016493257135152817, -0.010926103219389915, -0.028043966740369797, -0.026142988353967667, 0.045080360025167465, 0.0030234619043767452, 0.0201684832572937, -0.005042120814323425, 0.02181599847972393, -0.018883058801293373, -0.023155735805630684, 0.00038981385296210647, 0.016058746725320816, 0.005345372017472982, 0.08443967998027802, -0.041133567690849304, -0.015135413967072964, 0.014411231502890587, 0.028894882649183273, 0.002758682705461979, 0.06579197943210602, -0.02382560446858406, -0.05568963289260864, -0.017851099371910095, -0.014058193191885948, -0.023409198969602585, -0.03494180738925934, -0.01293571013957262, -0.00916996132582426, 0.02558174729347229, -0.03264252468943596, -0.011089044623076916, -0.0588398277759552, -0.030180305242538452, 0.015325511805713177, 0.015289302915334702, -0.019027896225452423, -0.012392573058605194, -0.024875668808817863, -0.041459448635578156, 0.02339109405875206, 0.056486234068870544, -0.029329391196370125, -0.01202142983675003, 0.017534269019961357, -0.0597088485956192, -0.04761499911546707, 0.012048586271703243, 0.00578440772369504, 0.013786624185740948, 0.014936264604330063, -0.03066912852227688, 0.037150561809539795, -0.08371549844741821, -0.012971919029951096, -0.02141769789159298, -0.04649251699447632, 0.09899574518203735, -0.02368076704442501, 0.04384925216436386, 0.011949011124670506, -0.05036689341068268, 0.01401293184608221, -0.006151025183498859, 0.06785590201616287, 0.06582818925380707, 0.001073826919309795, -0.012618879787623882, -0.02400664985179901, 0.022341029718518257, -0.004598558880388737, -0.009486790746450424, -0.03253389894962311, 0.031773507595062256, 0.05043931305408478, -0.05192388594150543, -0.0012944762129336596, -0.003684278577566147, 0.015189727768301964, 0.004489931743592024, -0.022377239540219307, -0.029401808977127075, 0.010156659409403801, -0.025780897587537766, 0.02744651772081852, 0.09667836129665375, 0.04975133761763573, 0.048990946263074875, 0.049063365906476974, -0.003958110231906176, 0.008133474737405777, 0.04663735255599022, 0.04428375884890556, -0.003430814715102315, 0.037802327424287796, -0.04279918596148491, 0.029293183237314224, -0.031375207006931305, -0.0584053173661232, -0.03448919206857681, 0.08567079156637192, 0.00398979289457202, -0.002075235592201352, -0.011939958669245243, 0.03559356927871704, 0.053227413445711136, -0.022775540128350258, 0.029655274003744125, -0.012863291427493095, -0.05836911126971245, 0.016710510477423668, -0.041857749223709106, 0.014664695598185062, 0.08443967998027802, 0.0034421300515532494, 0.0077170697040855885, -0.023662663996219635, -0.045225195586681366, -0.04772362858057022, -0.01366894505918026, 0.033312395215034485, -0.014040088281035423, -0.015886753797531128, 0.005494734738022089, -0.02112802490592003, -0.008305467665195465, 0.02339109405875206, 0.003754433710128069, -0.061229631304740906, -0.003080038819462061, 0.01933567225933075, -0.005775355268269777, 0.030976906418800354, 0.008029373362660408, 0.02364455908536911, -0.03226232901215553, -0.0385989286005497, 0.04413892328739166, 0.01646609976887703, -0.06749381124973297, 0.024640310555696487, -0.09711287170648575, 0.05478440597653389, 0.0378747433423996, -0.041857749223709106, 0.031194161623716354, 0.01248309575021267, 0.04200258478522301, 0.0787186399102211, -0.0017844309331849217, -0.03541252389550209, 0.026486974209547043, -0.0013623683480545878, -0.027319785207509995, -0.008681138046085835, 0.0013668944593518972, -0.02185220643877983, 0.05253944173455238, 0.02572658285498619, -0.023481618613004684, 0.04442859813570976, -0.008463882841169834, -0.005567152984440327, 0.0299992598593235, -0.004802235402166843, -0.08682948350906372, -0.05109107494354248, 0.0389610193669796, 0.022159984335303307, -0.01728985644876957, -0.07310622185468674, -0.009704045951366425, 0.01110714953392744, -0.02127286046743393, -0.006268704775720835, 0.0033289764542132616, 0.03372880071401596, 0.013877146877348423, -0.04660114273428917, -0.007024570368230343, 0.024712728336453438, 0.02163495309650898, 0.03642638027667999, 0.028080176562070847, 0.015198780223727226, -0.0395403653383255, 0.01266414113342762, 0.0010444069048389792, -0.0076401252299547195, -0.004833918064832687, 0.013143912889063358, -0.04051801189780235, -0.05996230989694595, -0.02590762823820114, -0.020077960565686226, -0.06724034249782562, 0.009088490158319473, 0.041604284197092056, 0.007649177685379982, -0.05395159497857094, 0.02177978865802288, 0.028043966740369797, 0.0050194901414215565, 0.018756326287984848, -0.02572658285498619, 0.021001292392611504, -0.0149815259501338, 0.01998743787407875, -0.015325511805713177, -0.033131349831819534, 0.0396852008998394, -0.019426194950938225, 0.014456492848694324, 0.019498614594340324, 0.052394602447748184, 0.024785146117210388, 0.06619028002023697, 0.05112728476524353, 0.020639201626181602, 0.014845740981400013, -0.02788102626800537, -0.04316127672791481, 0.03190023824572563, -0.04804950952529907, -0.05945538356900215, 0.04663735255599022, -0.02302900329232216, -0.03935931995511055, 0.01797783002257347, 0.012655089609324932, -0.013641787692904472, -0.031085534021258354, 0.04406650364398956, 0.0200960636138916, -0.013216330669820309, -0.026034360751509666, 0.04001108184456825, -0.018919268622994423, -0.057065580040216446, -0.01922704465687275, -0.007033622357994318, 0.04670977219939232, -0.008871235884726048, -0.04236467555165291, 0.06731276214122772, -0.035249583423137665, 0.026631811633706093, 0.015216885134577751, -0.023481618613004684, -0.026559393852949142, -0.014085349626839161, -0.014737114310264587, 0.03403657674789429, -0.020385736599564552, -0.013334010727703571, 0.011396822519600391, -0.024060964584350586, -0.05004101246595383, -0.02561795525252819, 0.0399748757481575, 0.06767485290765762, -0.060903750360012054, -0.03264252468943596, -0.0035417049657553434, 0.045551080256700516, 0.025020506232976913, 0.053698133677244186, -0.04638389125466347, 0.02668612450361252, 0.014646591618657112, 0.013116755522787571, -0.026921484619379044, 0.029619064182043076, -0.05750009045004845, 0.021254757419228554, 0.000891083967871964, 0.0074907629750669, 0.02407906763255596, -0.002966885222122073, 0.010554959997534752, -0.04403029754757881, -0.020602991804480553, 0.008174209855496883, 0.006992887239903212, -0.04670977219939232, 0.05623277276754379, 0.017778679728507996, 0.029256973415613174, 0.03447108715772629, 0.04388545826077461, 0.04370441287755966, 0.022685017436742783, 0.07198373973369598, 0.0192632544785738, 0.020675409585237503, -0.025780897587537766, -0.048918526619672775, -0.06383668631315231, -0.022341029718518257, -0.060179565101861954, -0.06336596608161926, -0.0022709909826517105, -0.03211749345064163, 0.024332532659173012, 0.018140772357583046, -0.015660446137189865, 0.030379455536603928, -0.0016599621158093214, 0.02368076704442501, -0.023916127160191536, -0.04967891797423363, 0.049135781824588776, 0.0014064982533454895, -0.006712266709655523, 0.02909403294324875, 0.03003546968102455, 0.006676057353615761, -0.003446656046435237, 0.018919268622994423, -0.01747090369462967, -0.022974690422415733, -0.0583329014480114, 0.041531868278980255, 0.029112135991454124, -0.04225604981184006, -0.048809900879859924, -0.016529465094208717, 0.06622648984193802, -0.04348715767264366, 0.02105560712516308, 0.030741548165678978, -0.014049140736460686, -0.022612597793340683, -0.028695732355117798, -0.007762331049889326, 0.01847570575773716, 0.00649501197040081, -0.05938296392560005, 0.01277276873588562, 0.013877146877348423, -0.06865250319242477, 0.07328727096319199, -0.01469185296446085, -0.009405320510268211, -0.0802394226193428, -0.030053574591875076, -0.004455985501408577, 0.053408458828926086, 0.008871235884726048, -0.0016803296748548746, -0.010907999239861965, -0.013162016868591309, 0.019679659977555275, 0.05902087315917015, 0.005770829506218433, -0.018348975107073784, 0.04196637496352196, -0.006164603400975466, 0.04587696120142937, 0.012365416623651981, 0.032841674983501434, -0.027174947783350945, -0.03213559836149216, 0.00294651766307652, -0.026287825778126717, -0.017018288373947144, 0.02302900329232216, 0.029256973415613174, -0.0592743381857872, 0.010328653268516064, -0.015941066667437553, 0.0008395991171710193, -0.03791095316410065, -0.09494032710790634, -0.03820062801241875, 0.011188619770109653, -0.008011269383132458, -0.03841788321733475, 0.044645849615335464, 0.01708165556192398, -0.03515905886888504, 0.04732532799243927, -0.015651393681764603, 0.03412710130214691, -0.00456461263820529, -0.025346387177705765, -0.04815813526511192, 0.004901810549199581, -0.017959726974368095, 0.023626454174518585, -0.04754258319735527, -0.0383092537522316, 0.07241825014352798, -0.005440420936793089, -0.05091002956032753, 0.01833087019622326, -0.005816090852022171, 0.002869573188945651, 0.006463328842073679, -0.002328699454665184, -0.026613706722855568, 0.05235839635133743, -0.004159523174166679, -0.02342730388045311, 0.04399408772587776, 0.02310142107307911, -0.003390079364180565, -0.02196083404123783, -0.020186588168144226, -0.0023264363408088684, -0.04623905196785927, 0.044501014053821564, 0.05402401462197304, 0.0029578329995274544, -0.01747090369462967, 0.006033345591276884, -0.005404212046414614, 0.02704821713268757, -0.03099501132965088, -0.008463882841169834, 0.008848604746162891, -0.09798189252614975, -0.014021983370184898, -0.02221429906785488, 0.04001108184456825, -0.01700018346309662, 0.024785146117210388, 0.013587473891675472, 0.018792536109685898, 0.000006966013188502984, 0.03110363893210888, 0.01110714953392744, 0.003467023838311434, 0.02601625584065914, -0.007142249960452318, 0.04326990619301796, 0.0299992598593235, 0.029112135991454124, 0.025853315368294716, -0.03226232901215553, -0.06282283365726471, -0.009649732150137424, -0.00407126359641552, -0.0034081838093698025, -0.010772215202450752, 0.007223720662295818, -0.05478440597653389, -0.00555357476696372, -0.020222796127200127, 0.016656197607517242, -0.008042952045798302, 0.004347357898950577, 0.052684277296066284, -0.003417236264795065, -0.027645668014883995, 0.03637206554412842, 0.040590427815914154, 0.03870755434036255, 0.05232218652963638, -0.006218917202204466, 0.013415480963885784, -0.09392647445201874, 0.0052095879800617695, 0.024024754762649536, -0.003620912553742528, 0.023626454174518585, 0.0008820316870696843, 0.007250877097249031, 0.006463328842073679, -0.02759135328233242, 0.0031954552978277206, 0.03095880150794983, 0.020946979522705078, -0.018285607919096947, 0.10182005912065506, 0.0075812856666743755, 0.06800073385238647, -0.06673341989517212, -0.0005799117498099804, -0.033239975571632385, -0.06673341989517212, 0.03559356927871704, 0.004204784519970417, -0.06763864308595657, -0.04562349617481232, -0.05065656453371048, 0.02393423207104206, -0.03200886771082878, 0.020421946421265602, -0.08784333616495132, -0.06666100025177002, -0.07263550162315369, 0.01980639062821865, -0.03358396515250206, 0.024423055350780487, 0.04352336749434471, -0.03505043312907219, 0.03950415551662445, 0.004756974056363106, 0.04725290834903717, -0.020946979522705078, -0.02733789011836052, 0.025708479806780815, -0.05391538888216019, 0.033891741186380386, 0.04768741875886917, -0.028568999841809273, -0.06771106272935867, 0.02719305269420147, 0.07194752991199493, 0.020494364202022552, 0.024948086589574814, -0.06781969219446182, 0.023662663996219635, -0.001998291118070483, -0.04384925216436386, 0.04786846414208412, 0.00022531693684868515, -0.013352114707231522, -0.004612137097865343, 0.016022538766264915, 0.010645482689142227, 0.03935931995511055, 0.009047755040228367, 0.03957657516002655, 0.015515610575675964, -0.0031026694923639297, -0.028424162417650223, 0.0015196517342701554, -0.03385553136467934, -0.00487012742087245, 0.0005736883031204343, 0.029220763593912125, 0.02558174729347229, -0.0200598556548357, 0.0077713835053145885, -0.025310179218649864, 0.01966155506670475, 0.030433770269155502, 0.01987881027162075, -0.001957555767148733, -0.012102900072932243, 0.0393955297768116, -0.016384629532694817, 0.016846295446157455, 0.045044150203466415, 0.018032144755125046, 0.008509144186973572, 0.06361943483352661, -0.006811841856688261, 0.05467578023672104, -0.030325142666697502, -0.036824680864810944, -0.08617772161960602, -0.037005726248025894, -0.056667279452085495, 0.06553851813077927, -0.016556622460484505, 0.010120450519025326, 0.05087381973862648, 0.07183890789747238, 0.024314427748322487 ]
42,944
linearmodels.iv.model
from_formula
Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation fuller : float Fuller's alpha to modify LIML estimator. Default returns unmodified LIML estimator. kappa : float Parameter value for k-class estimation. If not provided, computed to produce LIML parameter estimate. Returns ------- IVLIML Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using '1 +' if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVLIML >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVLIML.from_formula(formula, data)
@staticmethod def from_formula( formula: str, data: DataFrame, *, weights: IVDataLike | None = None, fuller: float = 0, kappa: OptionalNumeric = None, ) -> IVLIML: """ Parameters ---------- formula : str Formula modified for the IV syntax described in the notes section data : DataFrame DataFrame containing the variables used in the formula weights : array_like Observation weights used in estimation fuller : float Fuller's alpha to modify LIML estimator. Default returns unmodified LIML estimator. kappa : float Parameter value for k-class estimation. If not provided, computed to produce LIML parameter estimate. Returns ------- IVLIML Model instance Notes ----- The IV formula modifies the standard formula syntax to include a block of the form [endog ~ instruments] which is used to indicate the list of endogenous variables and instruments. The general structure is `dependent ~ exog [endog ~ instruments]` and it must be the case that the formula expressions constructed from blocks `dependent ~ exog endog` and `dependent ~ exog instruments` are both valid formulas. A constant must be explicitly included using '1 +' if required. Examples -------- >>> import numpy as np >>> from linearmodels.datasets import wage >>> from linearmodels.iv import IVLIML >>> data = wage.load() >>> formula = "np.log(wage) ~ 1 + exper + exper ** 2 + brthord + [educ ~ sibs]" >>> mod = IVLIML.from_formula(formula, data) """ parser = IVFormulaParser(formula, data) dep, exog, endog, instr = parser.data mod: IVLIML = IVLIML( dep, exog, endog, instr, weights=weights, fuller=fuller, kappa=kappa ) mod.formula = formula return mod
(formula: str, data: pandas.core.frame.DataFrame, *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, fuller: float = 0, kappa: Union[int, float, NoneType] = None) -> linearmodels.iv.model.IVLIML
[ 0.08556488901376724, -0.07109435647726059, 0.04581718519330025, -0.02181682549417019, -0.001553222886286676, -0.030717497691512108, 0.0006574885919690132, -0.04137609899044037, 0.011213737539947033, 0.07116837054491043, -0.0006748366286046803, -0.0048574358224868774, -0.025221657007932663, 0.029829280450940132, -0.04596522077918053, 0.028793027624487877, -0.016154443845152855, 0.0024333440233021975, -0.0043046134524047375, 0.007753392681479454, -0.031217120587825775, -0.0029075222555547953, -0.033067572861909866, 0.07771897315979004, 0.05318198353052139, -0.007707131095230579, -0.02144673466682434, 0.017560787498950958, 0.04707549139857292, -0.04122806340456009, -0.02777528017759323, -0.020410481840372086, -0.03204982355237007, -0.0037795475218445063, 0.014128198847174644, -0.061212942004203796, 0.009164362214505672, -0.015118190087378025, -0.006300787907093763, 0.007364797871559858, 0.04689044505357742, -0.008896046318113804, 0.04877790808677673, 0.004265291150659323, -0.07720084488391876, -0.002384769730269909, -0.0429304800927639, -0.010381033644080162, 0.05033228546380997, -0.01506267674267292, 0.012240737676620483, 0.010566079057753086, 0.029163118451833725, -0.04285646229982376, -0.07057622820138931, 0.03878546878695488, 0.00437631830573082, 0.05836324766278267, 0.057364001870155334, -0.018125174567103386, -0.0013473600847646594, -0.024296430870890617, 0.006194387096911669, -0.00966861005872488, -0.010307015851140022, 0.06106490641832352, -0.005861305631697178, 0.03290103003382683, 0.004496597684919834, -0.02775677479803562, -0.04677942022681236, -0.02148374356329441, 0.011028692126274109, 0.029015082865953445, 0.010519817471504211, -0.006842045113444328, -0.027183135971426964, -0.028867047280073166, 0.004330057185143232, 0.018930120393633842, -0.044188786298036575, -0.04352262243628502, -0.020817581564188004, -0.031032074242830276, -0.004290734883397818, -0.03632436692714691, 0.00749432947486639, -0.03027338907122612, 0.06239723041653633, -0.010501313023269176, -0.07934737205505371, -0.004029358737170696, -0.04115404561161995, 0.030773011967539787, 0.002488857600837946, -0.00535705778747797, 0.03650941327214241, -0.07383302599191666, 0.04792669788002968, -0.01289764791727066, -0.004598372615873814, 0.046224284917116165, -0.03245692327618599, -0.005676260683685541, -0.0351770855486393, -0.042042262852191925, -0.04663138464093208, -0.009344780817627907, 0.04951808601617813, -0.1073262020945549, -0.05995463579893112, 0.05584663152694702, -0.01072336733341217, 0.024185404181480408, -0.025184648111462593, 0.03465896099805832, 0.0026276414282619953, 0.04100601002573967, -0.006643121596425772, -0.010445799678564072, 0.016506029292941093, -0.026331927627325058, -0.08645310252904892, 0.012148215435445309, 0.04178319871425629, -0.052515819668769836, 0.013850631192326546, -0.03410382568836212, 0.031494688242673874, -0.046557363122701645, 0.013397269882261753, -0.010584583505988121, -0.020206931978464127, 0.046187274158000946, 0.0031388287898153067, -0.0003246964479330927, 0.018708067014813423, -0.004471153952181339, -0.003557493444532156, 0.08349238336086273, 0.01522921770811081, 0.011759620159864426, 0.0051812645979225636, 0.046668391674757004, -0.05184965580701828, 0.0431155227124691, 0.019688805565238, 0.037601176649332047, -0.031013570725917816, -0.046742409467697144, 0.018263958394527435, -0.010399538092315197, 0.01965179666876793, -0.024796051904559135, 0.0477786622941494, 0.002919087652117014, -0.0008130422211252153, 0.0016654065111652017, 0.033641211688518524, -0.07927335053682327, 0.0015127442311495543, 0.025240160524845123, -0.033271122723817825, 0.024925583973526955, 0.011222989298403263, -0.002463413868099451, -0.011565322987735271, -0.031291138380765915, -0.027053603902459145, 0.048703890293836594, -0.0283674243837595, -0.0511464849114418, -0.033567193895578384, 0.03210533782839775, -0.023130645975470543, 0.03439989686012268, -0.0008540991111658514, 0.01204644050449133, 0.039969757199287415, 0.04363365098834038, -0.029329659417271614, 0.035288114100694656, -0.035639699548482895, -0.019836843013763428, -0.029144614934921265, 0.018217697739601135, -0.027072107419371605, 0.029366668313741684, -0.0436706617474556, -0.026887062937021255, 0.018189940601587296, -0.05462533235549927, 0.048518843948841095, -0.009312397800385952, -0.044447850435972214, -0.004945332184433937, 0.024296430870890617, 0.042264316231012344, -0.07623860985040665, 0.009335529059171677, 0.06424768269062042, 0.03164272382855415, 0.021206175908446312, 0.016811354085803032, -0.06058378890156746, 0.029126109555363655, -0.08682319521903992, -0.01519220881164074, 0.008035586215555668, -0.028385929763317108, 0.04108002781867981, 0.03160571679472923, -0.018254706636071205, 0.0830482691526413, -0.009261510334908962, 0.037545666098594666, -0.017810598015785217, 0.037804726511240005, 0.029218632727861404, -0.01739424653351307, 0.03478849306702614, -0.04548410326242447, -0.08245612680912018, 0.009548330679535866, 0.014868379570543766, -0.02135421335697174, 0.0384523868560791, 0.006254526786506176, -0.03258645534515381, -0.0021314891055226326, -0.028996577486395836, -0.06069481745362282, 0.04152413457632065, -0.03208683058619499, 0.005195143166929483, 0.007549842819571495, -0.04100601002573967, 0.0382673405110836, -0.022797564044594765, 0.012694098986685276, -0.0026808418333530426, -0.019004138186573982, -0.006023220252245665, 0.048962950706481934, -0.020003382116556168, 0.004991593305021524, 0.037564169615507126, 0.012481296434998512, -0.04970313236117363, -0.05666083097457886, -0.009585339576005936, 0.00031139631755650043, -0.016765091568231583, 0.08104978501796722, 0.017671814188361168, 0.024796051904559135, 0.015997154638171196, 0.011389530263841152, 0.046483345329761505, -0.0726117268204689, 0.009414172731339931, -0.07956942170858383, 0.017718074843287468, -0.01288839615881443, 0.006370179820805788, 0.011861395090818405, -0.0007338197319768369, 0.01305493712425232, 0.10170082747936249, 0.0014051867183297873, 0.017773589119315147, 0.0390075221657753, 0.010344024747610092, 0.007693252991884947, 0.02129869908094406, 0.025221657007932663, 0.009909168817102909, -0.016246965155005455, -0.02128019370138645, 0.00018244297825731337, 0.01719994843006134, -0.014294739812612534, -0.016718830913305283, -0.00642569363117218, -0.0003351052291691303, 0.02140972577035427, -0.019873851910233498, 0.0002230661630164832, 0.04344860464334488, 0.005773409269750118, 0.031383659690618515, 0.039673686027526855, 0.006259152665734291, 0.018717318773269653, 0.04041386395692825, 0.07109435647726059, 0.01721845380961895, 0.007586852181702852, 0.029496200382709503, -0.0556245781481266, -0.01737574115395546, -0.023167654871940613, 0.08467666804790497, -0.05048032104969025, -0.07020613551139832, -0.027479207143187523, -0.007522086147218943, -0.02139122225344181, -0.005144255701452494, -0.03823033347725868, 0.037619683891534805, 0.0948171466588974, -0.017699571326375008, -0.039969757199287415, 0.003992349375039339, -0.013721099123358727, -0.003550554160028696, -0.02616538666188717, 0.08282621949911118, -0.012573819607496262, 0.029070595279335976, 0.04108002781867981, 0.012879143469035625, -0.029163118451833725, -0.008331658318638802, -0.027238648384809494, 0.05318198353052139, -0.02403736673295498, -0.0010009787511080503, -0.004471153952181339, 0.005574485752731562, 0.022316448390483856, 0.014729595743119717, -0.007101108320057392, -0.06680130958557129, -0.02623940445482731, 0.02833041548728943, 0.012194477021694183, 0.004959210753440857, 0.03240140900015831, 0.07065024226903915, -0.05351506173610687, -0.006310040131211281, -0.008465816266834736, 0.015793604776263237, -0.033493176102638245, 0.016246965155005455, -0.02566576562821865, -0.0011224146001040936, 0.06639420986175537, -0.03221636265516281, -0.06706036627292633, 0.016459768638014793, 0.015608560293912888, -0.010260754264891148, -0.05233077332377434, -0.011111962608993053, -0.01696864143013954, 0.014202216640114784, -0.052774883806705475, -0.03495503216981888, -0.010741871781647205, -0.03686099871993065, 0.015423514880239964, 0.02142823114991188, -0.04133909195661545, 0.030698994174599648, 0.0008436903008259833, 0.0386374332010746, 0.03934060409665108, 0.01915217563509941, -0.0608428530395031, -0.006874428130686283, 0.004769539460539818, 0.03486251085996628, -0.01957777887582779, 0.0006545973010361195, -0.04529905691742897, -0.06254526972770691, -0.02592482790350914, -0.009576087817549706, -0.010806637816131115, 0.046039238572120667, 0.0032799255568534136, 0.03029189445078373, 0.008558339439332485, 0.011334016919136047, 0.05403319001197815, 0.02814537100493908, 0.012351765297353268, -0.0032660472206771374, -0.002266803290694952, 0.06321143358945847, -0.006078733596950769, -0.03885948657989502, -0.004145011771470308, -0.007864419370889664, -0.02581380121409893, 0.012361017055809498, -0.03856341168284416, -0.02159477211534977, -0.013545306399464607, 0.013304747641086578, 0.011990927159786224, -0.022445978596806526, 0.044040750712156296, -0.006962324492633343, 0.03523259982466698, -0.03612081706523895, -0.06909586489200592, 0.028700506314635277, 0.0283674243837595, -0.0076516177505254745, -0.04670540243387222, 0.0007667809259146452, 0.04696446284651756, 0.09067213535308838, -0.02405587211251259, -0.04981416091322899, 0.033456165343523026, 0.04070993885397911, -0.04119105637073517, 0.06698635220527649, 0.029033586382865906, -0.03439989686012268, 0.06391460448503494, -0.00431849155575037, -0.05107246711850166, -0.01418371219187975, 0.009094970300793648, -0.046335309743881226, 0.012296251952648163, 0.023260178044438362, -0.011111962608993053, -0.044373832643032074, -0.05595766007900238, -0.029126109555363655, -0.007461946457624435, 0.006587608251720667, 0.011759620159864426, 0.03162422031164169, -0.02577679231762886, 0.0474085733294487, 0.03469596803188324, -0.10244100540876389, -0.016681822016835213, -0.008391798473894596, 0.01729247160255909, -0.02598034217953682, -0.04145011678338051, 0.029181623831391335, 0.015617812052369118, 0.06054677814245224, 0.04959210380911827, -0.0015034920070320368, -0.011815134435892105, 0.001478048274293542, -0.04378168657422066, 0.06987305730581284, 0.059066418558359146, 0.014211469329893589, 0.042079269886016846, 0.035713717341423035, -0.010593836195766926, -0.01918918453156948, 0.013536053709685802, 0.06783755868673325, -0.05199769139289856, -0.03253094106912613, -0.002879765350371599, 0.029829280450940132, -0.02363026887178421, 0.07109435647726059, -0.020558519288897514, 0.01719994843006134, 0.02994030900299549, 0.029033586382865906, -0.01696864143013954, 0.004343935288488865, -0.050850413739681244, -0.01751452498137951, -0.0278122890740633, -0.03317859768867493, 0.041894227266311646, -0.022186916321516037, 0.020447490736842155, -0.024462971836328506, -0.0033053692895919085, -0.016820605844259262, -0.05003621429204941, -0.059658560901880264, 0.1026630625128746, 0.04474392160773277, 0.03310457989573479, 0.06069481745362282, -0.018597040325403214, 0.059362489730119705, -0.009622348472476006, 0.044410839676856995, -0.03623184561729431, -0.0002852297911886126, -0.050702378153800964, -0.024907080456614494, -0.035935770720243454, 0.028830038383603096, -0.002080601640045643, -0.01709817349910736, -0.010168232023715973, -0.014442775398492813, -0.07531338185071945, -0.03056946210563183, -0.02374129556119442, 0.02770126238465309, 0.039858728647232056, -0.012536810711026192, -0.003464970737695694, -0.033807750791311264, 0.05854829028248787, -0.020503005012869835, -0.004121880978345871, 0.007327788509428501, -0.04985116794705391, 0.0005933010834269226, -0.07338891178369522, 0.008100352250039577, 0.04529905691742897, -0.0018250079592689872, -0.050554338842630386, -0.0015462837181985378, -0.00702246418222785, -0.02144673466682434, -0.043892715126276016, 0.033863265067338943, 0.04670540243387222, -0.06765251606702805, 0.04825977981090546, 0.0280898567289114, -0.037397630512714386, -0.0740920826792717, 0.006555225234478712, -0.03745314106345177, 0.04515102133154869, -0.06358151882886887, -0.02179832011461258, 0.06313741207122803, 0.02801583893597126, -0.06787456572055817, 0.05233077332377434, -0.0561797134578228, -0.006124995183199644, -0.03291953727602959, 0.024814557284116745, -0.03023638017475605, 0.00008594480459578335, 0.009992439299821854, 0.009677862748503685, -0.005773409269750118, 0.0035413019359111786, -0.020873095840215683, -0.008937682025134563, -0.024722034111618996, -0.059325482696294785, 0.0338817723095417, -0.023167654871940613, 0.04800071567296982, 0.02796032465994358, 0.03297504782676697, -0.033308129757642746, -0.03695352002978325, -0.022501492872834206, -0.007609982509166002, -0.01411894615739584, 0.11495006084442139, 0.006518216338008642, -0.03390027582645416, 0.022297943010926247, -0.01165784616023302, -0.06406264007091522, 0.010371781885623932, -0.07020613551139832, -0.023260178044438362, -0.018735824152827263, -0.055106449872255325, -0.020465996116399765, 0.05233077332377434, 0.007360171526670456, -0.022834574803709984, 0.10947272181510925, -0.022223925217986107, 0.05436627194285393, -0.007901429198682308, 0.006680130492895842, -0.013230729848146439, 0.031365156173706055, 0.003513545263558626, 0.03478849306702614, 0.015821361914277077, -0.013776612468063831, 0.06032472476363182, 0.005398693028837442, -0.05817820131778717, 0.008317780680954456, -0.029033586382865906, 0.022908592596650124, -0.016672570258378983, 0.027386685833334923, -0.0028589479625225067, -0.0046469466760754585, 0.0518866665661335, -0.04718651995062828, 0.02770126238465309, 0.007600730285048485, 0.015747344121336937, 0.02579529583454132, 0.0004837196320295334, 0.0283674243837595, -0.012370269745588303, 0.03532512113451958, 0.0468534380197525, 0.013573063537478447, -0.0174034982919693, -0.04885192587971687, 0.00484818359836936, -0.017736580222845078, -0.025314178317785263, 0.00960384402424097, 0.01193541381508112, -0.03038441762328148, -0.03619483485817909, -0.009650105610489845, 0.033641211688518524, 0.01952226459980011, 0.03811930492520332, 0.05318198353052139, 0.031568706035614014, 0.054884396493434906, 0.07253770530223846, 0.016367245465517044, -0.007471198681741953, 0.033807750791311264, -0.05995463579893112, -0.029773768037557602, 0.014720343053340912, 0.0020597840193659067, 0.07024314999580383, -0.024814557284116745, 0.005232152063399553, -0.031032074242830276, -0.009020951576530933, 0.01703340746462345, -0.007656244095414877, -0.00763311330229044, -0.041672173887491226, 0.006800409872084856, -0.03169823810458183, 0.0021927852649241686, -0.014840622432529926, -0.037804726511240005, 0.03375224024057388, -0.035584185272455215, -0.050813402980566025, 0.008299276232719421, -0.022890087217092514, 0.007943063974380493, 0.04074694588780403, 0.016820605844259262, 0.05233077332377434, 0.03051394782960415, 0.03658343106508255, 0.0013427339727059007, 0.00964085292071104, 0.022797564044594765, -0.022408969700336456, 0.024425962939858437, 0.0194112379103899, -0.01383212674409151, 0.00881277583539486, -0.009548330679535866, 0.013600819744169712, 0.012703350745141506, 0.03303056210279465, 0.019855346530675888, 0.05336702615022659, -0.06324844062328339, -0.0171259306371212, -0.030884038656949997, 0.022723546251654625, -0.0015335618518292904, 0.06820765137672424, -0.053070954978466034, -0.06435871124267578, 0.037638187408447266, -0.0031781508587300777, -0.005620746873319149, 0.05129452049732208, -0.0940769612789154, -0.054995425045490265, -0.017671814188361168, 0.0007419154862873256, -0.022279437631368637, 0.05895539000630379, 0.013600819744169712, 0.0005629421211779118, 0.02155776135623455, 0.015987902879714966, -0.035787735134363174, 0.00029144613654352725, -0.05192367359995842, -0.04763062670826912, -0.011398782022297382, 0.031457677483558655, 0.016061920672655106, 0.003106445772573352, -0.06957698613405228, 0.11953917890787125, 0.057141948491334915, -0.0556245781481266, -0.02601735107600689, -0.06454375386238098, -0.0106863584369421, 0.07220462709665298, -0.07475824654102325, 0.04974014312028885, -0.004017793107777834, -0.029551712796092033, -0.0390075221657753, -0.022779060527682304, 0.04041386395692825, 0.018865354359149933, 0.016052668914198875, 0.02622090093791485, 0.05370010808110237, -0.022982610389590263, -0.0300513356924057, 0.009918421506881714, -0.03922957554459572, -0.04315253347158432, -0.012527558021247387, -0.015886127948760986, 0.027368180453777313, 0.018180688843131065, 0.017847606912255287, -0.01724620908498764, 0.04115404561161995, -0.002212446415796876, 0.04496597498655319, -0.011537566781044006, 0.006536720786243677, 0.0474085733294487, -0.005111872684210539, 0.0011923848651349545, 0.0012467418564483523, -0.0031827769707888365, 0.01299017108976841, 0.07749691605567932, -0.016367245465517044, 0.061249952763319016, 0.03040292114019394, -0.01755153387784958, -0.03604679927229881, 0.013147459365427494, -0.010436547920107841, 0.06839269399642944, 0.00851207785308361, -0.03671296313405037, -0.03723108768463135, 0.009039456956088543, 0.008290023542940617 ]
42,948
linearmodels.system.model
IVSystemGMM
System Generalized Method of Moments (GMM) estimation of linear IV models Parameters ---------- equations : dict Dictionary-like structure containing dependent, exogenous, endogenous and instrumental variables. Each key is an equations label and must be a string. Each value must be either a tuple of the form (dependent, exog, endog, instrument[, weights]) or a dictionary with keys "dependent", "exog". The dictionary may contain optional keys for "endog", "instruments", and "weights". Endogenous and/or Instrument can be empty if all variables in an equation are exogenous. sigma : array_like Prespecified residual covariance to use in GLS estimation. If not provided, FGLS is implemented based on an estimate of sigma. Only used if weight_type is "unadjusted" weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- Estimates a linear model using GMM. Each equation is of the form .. math:: y_{i,k} = x_{i,k}\beta_i + \epsilon_{i,k} where k denotes the equation and i denoted the observation index. By stacking vertically arrays of dependent and placing the exogenous variables into a block diagonal array, the entire system can be compactly expressed as .. math:: Y = X\beta + \epsilon where .. math:: Y = \left[\begin{array}{x}Y_1 \\ Y_2 \\ \vdots \\ Y_K\end{array}\right] and .. math:: X = \left[\begin{array}{cccc} X_1 & 0 & \ldots & 0 \\ 0 & X_2 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & X_K \end{array}\right] The system GMM estimator uses the moment condition .. math:: z_{ij}(y_{ij} - x_{ij}\beta_j) = 0 where j indexes the equation. The estimator for the coefficients is given by .. math:: \hat{\beta}_{GMM} & = (X'ZW^{-1}Z'X)^{-1}X'ZW^{-1}Z'Y \\ where :math:`W` is a positive definite weighting matrix.
class IVSystemGMM(_SystemModelBase): r""" System Generalized Method of Moments (GMM) estimation of linear IV models Parameters ---------- equations : dict Dictionary-like structure containing dependent, exogenous, endogenous and instrumental variables. Each key is an equations label and must be a string. Each value must be either a tuple of the form (dependent, exog, endog, instrument[, weights]) or a dictionary with keys "dependent", "exog". The dictionary may contain optional keys for "endog", "instruments", and "weights". Endogenous and/or Instrument can be empty if all variables in an equation are exogenous. sigma : array_like Prespecified residual covariance to use in GLS estimation. If not provided, FGLS is implemented based on an estimate of sigma. Only used if weight_type is "unadjusted" weight_type : str Name of moment condition weight function to use in the GMM estimation **weight_config Additional keyword arguments to pass to the moment condition weight function Notes ----- Estimates a linear model using GMM. Each equation is of the form .. math:: y_{i,k} = x_{i,k}\beta_i + \epsilon_{i,k} where k denotes the equation and i denoted the observation index. By stacking vertically arrays of dependent and placing the exogenous variables into a block diagonal array, the entire system can be compactly expressed as .. math:: Y = X\beta + \epsilon where .. math:: Y = \left[\begin{array}{x}Y_1 \\ Y_2 \\ \vdots \\ Y_K\end{array}\right] and .. math:: X = \left[\begin{array}{cccc} X_1 & 0 & \ldots & 0 \\ 0 & X_2 & \dots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \dots & X_K \end{array}\right] The system GMM estimator uses the moment condition .. math:: z_{ij}(y_{ij} - x_{ij}\beta_j) = 0 where j indexes the equation. The estimator for the coefficients is given by .. math:: \hat{\beta}_{GMM} & = (X'ZW^{-1}Z'X)^{-1}X'ZW^{-1}Z'Y \\ where :math:`W` is a positive definite weighting matrix. """ def __init__( self, equations: Mapping[ str, Mapping[str, ArrayLike | None] | Sequence[ArrayLike | None] ], *, sigma: ArrayLike | None = None, weight_type: str = "robust", **weight_config: bool | str | float, ) -> None: super().__init__(equations, sigma=sigma) self._weight_type = weight_type self._weight_config = weight_config if weight_type not in COV_TYPES: raise ValueError("Unknown estimator for weight_type") if weight_type not in ("unadjusted", "homoskedastic") and sigma is not None: warnings.warn( "sigma has been provided but the estimated weight " "matrix not unadjusted (homoskedastic). sigma will " "be ignored.", UserWarning, ) weight_type = COV_TYPES[weight_type] self._weight_est = GMM_W_EST[weight_type](**weight_config) def fit( self, *, iter_limit: int = 2, tol: float = 1e-6, initial_weight: Float64Array | None = None, cov_type: str = "robust", **cov_config: bool | float, ) -> GMMSystemResults: """ Estimate model parameters Parameters ---------- iter_limit : int Maximum number of iterations for iterative GLS tol : float Tolerance to use when checking for convergence in iterative GLS initial_weight : ndarray Initial weighting matrix to use in the first step. If not specified, uses the average outer-product of the set containing the exogenous variables and instruments. cov_type : str Name of covariance estimator. Valid options are * "unadjusted", "homoskedastic" - Classic covariance estimator * "robust", "heteroskedastic" - Heteroskedasticity robust covariance estimator **cov_config Additional parameters to pass to covariance estimator. All estimators support debiased which employs a small-sample adjustment Returns ------- GMMSystemResults Estimation results """ if cov_type not in COV_TYPES: raise ValueError(f"Unknown cov_type: {cov_type}") # Parameter estimation wx, wy, wz = self._wx, self._wy, self._wz k = len(wx) nobs = wx[0].shape[0] k_total = sum(map(lambda a: a.shape[1], wz)) if initial_weight is None: w = blocked_inner_prod(wz, np.eye(k_total)) / nobs else: w = initial_weight assert w is not None beta_last = beta = self._blocked_gmm( wx, wy, wz, w=cast(Float64Array, w), constraints=self.constraints ) _eps = [] loc = 0 for i in range(k): nb = wx[i].shape[1] b = beta[loc : loc + nb] _eps.append(wy[i] - wx[i] @ b) loc += nb eps = np.hstack(_eps) sigma = self._weight_est.sigma(eps, wx) if self._sigma is None else self._sigma vinv = None iters = 1 norm = 10 * tol + 1 while iters < iter_limit and norm > tol: sigma = ( self._weight_est.sigma(eps, wx) if self._sigma is None else self._sigma ) w = self._weight_est.weight_matrix(wx, wz, eps, sigma=sigma) beta = self._blocked_gmm( wx, wy, wz, w=cast(Float64Array, w), constraints=self.constraints ) delta = beta_last - beta if vinv is None: winv = np.linalg.inv(w) xpz = blocked_cross_prod(wx, wz, np.eye(k)) xpz = cast(Float64Array, xpz / nobs) v = (xpz @ winv @ xpz.T) / nobs vinv = inv(v) norm = float(np.squeeze(delta.T @ vinv @ delta)) beta_last = beta _eps = [] loc = 0 for i in range(k): nb = wx[i].shape[1] b = beta[loc : loc + nb] _eps.append(wy[i] - wx[i] @ b) loc += nb eps = np.hstack(_eps) iters += 1 cov_type = COV_TYPES[cov_type] cov_est = GMM_COV_EST[cov_type] cov = cov_est( wx, wz, eps, w, sigma=sigma, constraints=self._constraints, **cov_config ) weps = eps _eps = [] loc = 0 x, y = self._x, self._y for i in range(k): nb = x[i].shape[1] b = beta[loc : loc + nb] _eps.append(y[i] - x[i] @ b) loc += nb eps = np.hstack(_eps) iters += 1 return self._finalize_results( beta, cov.cov, weps, eps, cast(np.ndarray, w), sigma, iters - 1, cov_type, cov_config, cov, ) @staticmethod def _blocked_gmm( x: ArraySequence, y: ArraySequence, z: ArraySequence, *, w: Float64Array, constraints: LinearConstraint | None = None, ) -> Float64Array: k = len(x) xpz = blocked_cross_prod(x, z, np.eye(k)) wi = np.linalg.inv(w) xpz_wi_zpx = xpz @ wi @ xpz.T zpy_arrs = [] for i in range(k): zpy_arrs.append(z[i].T @ y[i]) zpy = np.vstack(zpy_arrs) xpz_wi_zpy = xpz @ wi @ zpy params = _parameters_from_xprod(xpz_wi_zpx, xpz_wi_zpy, constraints=constraints) return params def _finalize_results( self, beta: Float64Array, cov: Float64Array, weps: Float64Array, eps: Float64Array, wmat: Float64Array, sigma: Float64Array, iter_count: int,
(equations: 'Mapping[str, Mapping[str, ArrayLike | None] | Sequence[ArrayLike | None]]', *, sigma: 'ArrayLike | None' = None, weight_type: 'str' = 'robust', **weight_config: 'bool | str | float') -> 'None'
[ 0.10490700602531433, -0.041327640414237976, -0.032452188432216644, 0.04099113121628761, -0.015616169199347496, -0.06435754895210266, -0.0929609015583992, -0.04530266672372818, 0.03396648168563843, 0.004790010396391153, -0.03590141609311104, -0.026331910863518715, 0.0019572791643440723, 0.0317581370472908, -0.08501084893941879, 0.0779862031340599, -0.011188958771526814, -0.02159973978996277, 0.027341442182660103, -0.033629972487688065, -0.07251791656017303, -0.05577654018998146, -0.002055866178125143, 0.07020440697669983, 0.009206704795360565, -0.005405192729085684, -0.022924747318029404, -0.019612226635217667, 0.009043707512319088, -0.04437726363539696, -0.052159056067466736, -0.053042396903038025, 0.012009202502667904, -0.054346371442079544, 0.03337759152054787, -0.04075977951288223, 0.05771147459745407, 0.010352942161262035, -0.10490700602531433, -0.02689977176487446, 0.05447256565093994, -0.037857379764318466, 0.09169898927211761, -0.01912849396467209, 0.018907658755779266, 0.018213607370853424, -0.030264873057603836, 0.0954006016254425, -0.018139995634555817, 0.018465988337993622, 0.010011173784732819, -0.060697998851537704, 0.03794150799512863, -0.022462045773863792, -0.059688471257686615, 0.03989747166633606, 0.03295695409178734, 0.01782451756298542, 0.07075123488903046, -0.04988761618733406, 0.026794612407684326, -0.0165836364030838, 0.0071455808356404305, 0.003691094694659114, -0.01300821639597416, -0.0031022019684314728, -0.021810058504343033, -0.02123168110847473, 0.03184226527810097, 0.06355833262205124, 0.030285904183983803, -0.02801446244120598, 0.0011883011320605874, 0.04113835468888283, 0.011346697807312012, 0.006235952023416758, -0.05152809992432594, -0.0317581370472908, -0.02582714706659317, -0.026584293693304062, 0.05796385556459427, 0.04143280163407326, -0.025995401665568352, -0.08564180880784988, 0.007361157331615686, -0.01111534796655178, -0.0049871839582920074, 0.016488991677761078, 0.039687152951955795, -0.055692411959171295, -0.025343412533402443, 0.02218863181769848, 0.06911075115203857, 0.05649162456393242, 0.050518572330474854, -0.0049214595928788185, -0.020253699272871017, -0.06595596671104431, 0.014280645176768303, -0.0036358858924359083, 0.012187973596155643, 0.026310879737138748, 0.02223069593310356, 0.021852120757102966, -0.023871181532740593, -0.026605326682329178, -0.03400854766368866, -0.04437726363539696, 0.03947683423757553, -0.053042396903038025, -0.042862966656684875, 0.008517910726368427, -0.009048965759575367, -0.05131778120994568, -0.012839961796998978, 0.023913245648145676, -0.04054946079850197, 0.049046341329813004, 0.010421295650303364, 0.05897338688373566, -0.003943477291613817, -0.00871245563030243, -0.03419783338904381, 0.015258627943694592, 0.02870851382613182, -0.02395530976355076, 0.027341442182660103, -0.005431482568383217, 0.04824712872505188, -0.03154781833291054, -0.03076963685452938, -0.026668421924114227, -0.011746304109692574, 0.0021938877180218697, 0.022041408345103264, 0.003533355426043272, -0.045050282031297684, -0.03472363203763962, 0.02418665960431099, 0.04614394158124924, 0.039981599897146225, 0.024396978318691254, -0.009385475888848305, 0.008517910726368427, -0.014837989583611488, 0.020043380558490753, 0.0760512724518776, -0.026962867006659508, -0.008754519745707512, -0.026268815621733665, -0.01640486530959606, 0.0015734473709017038, -0.0013644431019201875, -0.00765034556388855, -0.018255669623613358, -0.0016707198228687048, -0.0031468947418034077, 0.015006245113909245, -0.002905028173699975, 0.0010667105671018362, -0.07558856904506683, 0.005231679882854223, -0.022756492719054222, 0.036910947412252426, 0.01782451756298542, 0.025679923593997955, -0.0231140349060297, 0.0422530435025692, -0.037626031786203384, 0.01364968903362751, -0.017193559557199478, -0.043620117008686066, -0.05796385556459427, -0.028897801414132118, 0.01706736907362938, 0.09649425745010376, 0.009043707512319088, 0.0026368717662990093, 0.013954651542007923, -0.008155111223459244, 0.06801709532737732, 0.004503450822085142, -0.0637686550617218, -0.016783438622951508, -0.05300033465027809, 0.04319947957992554, 0.015016760677099228, -0.02576404996216297, 0.0074715749360620975, 0.001193559030070901, -0.038740720599889755, -0.03125337138772011, 0.06511469185352325, 0.014133421704173088, 0.009869208559393883, 0.054682884365320206, 0.05077095329761505, 0.03983437642455101, -0.003283601952716708, 0.029802171513438225, 0.021168585866689682, -0.03133749961853027, 0.007550444453954697, -0.03411370515823364, -0.01659415103495121, -0.04677489772439003, -0.02265133336186409, -0.03249425068497658, -0.013660204596817493, 0.010326651856303215, -0.035985544323921204, 0.003904042299836874, 0.011567533016204834, 0.02824581228196621, 0.06065593659877777, -0.028098588809370995, 0.06641867011785507, 0.04258955270051956, -0.005087085533887148, -0.022903716191649437, 0.019780481234192848, -0.04223201051354408, -0.07335919141769409, -0.019107460975646973, 0.014995729550719261, -0.015258627943694592, 0.018739404156804085, 0.028393035754561424, 0.007960566319525242, -0.0031311209313571453, 0.07390601933002472, -0.010831417515873909, 0.022041408345103264, -0.04576536640524864, -0.0276569202542305, -0.041622087359428406, -0.020684851333498955, 0.024460073560476303, -0.010883997194468975, -0.015079856850206852, 0.009984884411096573, -0.021620770916342735, -0.01705685257911682, 0.06595596671104431, 0.016972726210951805, -0.02448110654950142, 0.06734407693147659, 0.04246336221694946, 0.00820243265479803, 0.02900296077132225, -0.02258823625743389, -0.008633585646748543, -0.044503454118967056, 0.023429512977600098, -0.05337890610098839, -0.039918504655361176, 0.030559318140149117, 0.02000131644308567, 0.06149721145629883, -0.027698984369635582, 0.00036017090314999223, -0.006819586269557476, -0.05371541529893875, 0.052453503012657166, -0.01889714226126671, 0.05346303433179855, 0.04387249797582626, 0.01706736907362938, -0.012997700832784176, 0.06906868517398834, 0.0462280698120594, 0.05577654018998146, -0.05384160950779915, -0.013418338261544704, 0.0019809401128441095, 0.04900427535176277, -0.008722971193492413, -0.0006920802406966686, -0.013250083662569523, 0.024207692593336105, 0.011493921279907227, -0.028056524693965912, -0.008659875951707363, 0.0066513316705822945, -0.045092348009347916, 0.016205061227083206, -0.03996056690812111, -0.05220112204551697, 0.04282090440392494, -0.002923431107774377, 0.0011797569459304214, -0.025448571890592575, 0.05228525027632713, -0.0006979954778216779, 0.08051002770662308, -0.05329477787017822, 0.021031878888607025, 0.020842591300606728, 0.007534670177847147, -0.0035833062138408422, 0.053925734013319016, 0.05514558404684067, 0.04568123817443848, 0.01718304492533207, -0.007050937041640282, -0.008838647045195103, 0.05005586892366409, -0.05026618763804436, 0.0005070654442533851, 0.012650675140321255, -0.04147486388683319, 0.009127834811806679, 0.024144595488905907, 0.011409793980419636, 0.019275715574622154, -0.019223136827349663, 0.015521526336669922, 0.012282616458833218, 0.036974042654037476, 0.04189550131559372, 0.03859349712729454, 0.0021860008127987385, 0.04517647251486778, -0.006009859032928944, -0.03272560238838196, -0.023219194263219833, 0.022251727059483528, 0.02942359820008278, -0.013944135047495365, -0.031232338398694992, -0.02677358128130436, -0.008491620421409607, -0.005339467898011208, 0.029970426112413406, 0.007797569036483765, 0.008197174407541752, 0.024207692593336105, -0.013355243019759655, 0.046985216438770294, -0.053631290793418884, 0.05661781504750252, -0.000481432827655226, -0.059814661741256714, 0.008107788860797882, -0.00330200488679111, -0.062464676797389984, 0.051864612847566605, 0.000026906016501015984, -0.01853960007429123, 0.061581339687108994, -0.0030180744361132383, 0.05884719640016556, 0.025679923593997955, 0.07600920647382736, -0.012251068837940693, -0.016141965985298157, -0.017025304958224297, -0.024460073560476303, 0.029612883925437927, 0.03407164290547371, -0.04702727869153023, 0.08833388984203339, -0.03625895828008652, 0.031737104058265686, 0.006882681977003813, -0.04534472897648811, 0.0013296090764924884, -0.017856065183877945, 0.0331672728061676, -0.05636543408036232, 0.026731517165899277, -0.0524955689907074, -0.04908840358257294, 0.03335655853152275, -0.01053697057068348, 0.008423266932368279, -0.055397968739271164, -0.006104502826929092, -0.005626027472317219, 0.011830431409180164, 0.04988761618733406, -0.02064278908073902, 0.008722971193492413, 0.0056891231797635555, 0.04559711366891861, -0.003083799034357071, 0.06275912374258041, 0.012019718065857887, 0.015290175564587116, -0.05295826867222786, 0.019875124096870422, -0.03825698792934418, 0.023219194263219833, 0.049635231494903564, -0.03011764958500862, 0.010100559331476688, 0.03299901634454727, 0.02241998165845871, -0.04141176864504814, -0.011010188609361649, -0.05640749633312225, 0.006141308229416609, -0.053168587386608124, 0.03432402387261391, -0.03207361325621605, -0.07718699425458908, -0.003233651164919138, 0.061455149203538895, -0.008812356740236282, 0.08850214630365372, -0.058510683476924896, 0.021031878888607025, -0.036090701818466187, -0.029970426112413406, -0.0290660560131073, -0.01417548581957817, -0.046101875603199005, -0.01836082898080349, 0.03461847081780434, 0.04795268177986145, 0.03617483004927635, 0.0008977982797659934, 0.11214197427034378, -0.017971739172935486, -0.0032862310763448477, 0.018918175250291824, -0.07424253225326538, -0.038278017193078995, -0.06587184220552444, -0.031442657113075256, 0.004440355114638805, 0.015258627943694592, -0.013334210962057114, -0.024796584621071815, -0.018918175250291824, -0.02284061908721924, -0.015668749809265137, -0.011588565073907375, 0.006530398037284613, 0.004682221915572882, 0.02517515793442726, 0.01020571868866682, -0.005915215704590082, -0.01736181601881981, -0.042631618678569794, -0.012419324368238449, -0.006519882008433342, -0.022272758185863495, -0.04319947957992554, 0.01397568266838789, 0.047279663383960724, 0.05228525027632713, 0.043325670063495636, -0.02389221452176571, -0.006230693776160479, 0.0012001314898952842, 0.02500690333545208, -0.04471377283334732, -0.01711994968354702, -0.005741702858358622, -0.031274404376745224, -0.0006841932772658765, -0.041622087359428406, 0.007050937041640282, -0.013502465561032295, 0.07441078126430511, 0.04988761618733406, -0.01664673164486885, -0.0028577065095305443, 0.032683540135622025, -0.014627670869231224, 0.014816958457231522, 0.011493921279907227, -0.04791061952710152, -0.05388367176055908, -0.014806441962718964, -0.06713375449180603, 0.01912849396467209, 0.030391063541173935, -0.033987514674663544, 0.03169504180550575, -0.028140652924776077, 0.03112717904150486, 0.04149589687585831, 0.004908314440399408, 0.0039066714234650135, 0.06688137352466583, -0.027698984369635582, 0.04471377283334732, -0.038930006325244904, -0.07588301599025726, 0.040339142084121704, 0.061034511774778366, 0.05413605272769928, -0.03501807898283005, -0.00009677949856268242, -0.020548144355416298, -0.03581728786230087, 0.08467434346675873, -0.05724877119064331, 0.02542754076421261, 0.01983306184411049, -0.06763852387666702, -0.05947815254330635, -0.004645416047424078, -0.027614856138825417, -0.02723628282546997, 0.006598751991987228, -0.009022675454616547, -0.03194742277264595, -0.03806769847869873, -0.030348999425768852, 0.02071640081703663, -0.014427868649363518, -0.03855143114924431, -0.017256656661629677, -0.019191589206457138, 0.026079528033733368, 0.006525140255689621, -0.0027972396928817034, 0.04099113121628761, -0.018550116568803787, -0.010883997194468975, -0.02265133336186409, 0.040044695138931274, 0.026731517165899277, -0.03308314457535744, -0.05855274945497513, 0.04031810909509659, 0.03093789331614971, -0.02159973978996277, -0.020043380558490753, 0.017109433189034462, 0.0700361579656601, -0.00422214949503541, -0.04294709488749504, 0.04530266672372818, -0.06688137352466583, -0.1012895256280899, -0.005108117591589689, -0.02235688641667366, -0.044924091547727585, 0.03272560238838196, 0.007497864775359631, 0.006772264838218689, 0.05985672399401665, 0.010221492499113083, 0.008339139632880688, -0.05119159072637558, -0.03241012245416641, -0.00894906371831894, -0.004038120619952679, -0.012093329802155495, 0.01829773373901844, 0.0612027645111084, -0.03217877447605133, -0.003922445233911276, 0.012156425975263119, 0.01020571868866682, 0.030391063541173935, -0.024312851950526237, 0.006041407119482756, 0.0028471904806792736, -0.043620117008686066, -0.008717713877558708, 0.03947683423757553, -0.01199868693947792, 0.03230496495962143, -0.02988629974424839, 0.03135852888226509, 0.01694117859005928, -0.04866776615381241, 0.0031206049025058746, -0.009248767979443073, -0.020053895190358162, 0.0522431842982769, -0.0034939206670969725, 0.009101545438170433, -0.03335655853152275, -0.043746307492256165, 0.01929674856364727, -0.013407822698354721, 0.0021058167330920696, -0.019212620332837105, 0.036742690950632095, -0.015858035534620285, -0.057921793311834335, 0.007114032749086618, -0.0041800858452916145, 0.054220180958509445, -0.015332238748669624, 0.07718699425458908, -0.0123246805742383, -0.04420900717377663, -0.0007262570434249938, 0.0610765740275383, -0.01836082898080349, 0.016162998974323273, 0.002928689122200012, 0.012724285945296288, -0.002046664711087942, 0.0032283933833241463, 0.05005586892366409, 0.037457775324583054, -0.015142952091991901, 0.028855737298727036, -0.027909303084015846, -0.026079528033733368, 0.03632205352187157, -0.02513309381902218, -0.04576536640524864, -0.04176931083202362, -0.014753862284123898, 0.03219980373978615, -0.022083472460508347, -0.026563262566924095, -0.05001380667090416, 0.06860598921775818, 0.09876570105552673, 0.018518568947911263, 0.010873480699956417, -0.01664673164486885, -0.006362142972648144, 0.0016759778372943401, 0.0059309895150363445, -0.03335655853152275, 0.006115018390119076, -0.06141308322548866, 0.00526848528534174, 0.006330595351755619, 0.010347683914005756, 0.015353270806372166, 0.05973053351044655, -0.02064278908073902, 0.022735459730029106, 0.002881367225199938, -0.003833059687167406, -0.003806769847869873, -0.027215249836444855, 0.03972921893000603, -0.014764378778636456, 0.03135852888226509, 0.008065725676715374, 0.015900099650025368, -0.052159056067466736, 0.024102533236145973, 0.015689780935645103, 0.03129543364048004, 0.046859025955200195, 0.03627999126911163, -0.0035543874837458134, -0.02340847998857498, -0.054809074848890305, -0.06162340193986893, -0.025259286165237427, -0.009895498864352703, -0.03455537557601929, 0.040086761116981506, 0.01695169322192669, -0.03581728786230087, -0.0033887613099068403, 0.0116201126947999, -0.008491620421409607, -0.013954651542007923, -0.02772001549601555, -0.018571147695183754, 0.01073677372187376, -0.0053131780587136745, 0.0467328317463398, 0.017614198848605156, 0.02041143737733364, -0.04526060074567795, -0.01988564059138298, -0.010310878045856953, -0.06856392323970795, -0.014469931833446026, 0.021810058504343033, -0.004406178370118141, -0.019023334607481956, 0.013334210962057114, 0.10953402519226074, 0.062212295830249786, -0.018318766728043556, 0.02366086281836033, 0.04807887226343155, -0.03041209653019905, -0.024964839220046997, -0.007603024132549763, -0.003840946825221181, -0.0167098268866539, -0.0409700982272625, 0.0047926390543580055, 0.04997174069285393, 0.010289845988154411, 0.011430826038122177, -0.032220836728811264, 0.0019480776973068714, -0.03928754851222038, 0.00031761423451825976, -0.04229510575532913, 0.0014604009920731187, -0.027320409193634987, -0.06078212708234787, 0.032262902706861496, -0.006519882008433342, 0.032620444893836975, -0.02830890752375126, 0.003867236664518714, -0.000013627589396492112, -0.05661781504750252, 0.01300821639597416, 0.00044199806870892644, 0.05783766508102417, -0.059267833828926086, 0.07958462834358215, 0.02129477635025978, -0.013050280511379242, 0.007534670177847147, 0.012755834497511387, 0.005783766508102417, -0.0061307926662266254, 0.062212295830249786, 0.00650410819798708, -0.01581597328186035, -0.048163000494241714, -0.033693067729473114, -0.006015117280185223, -0.04723759740591049, 0.04242129996418953, 0.0012770293978974223, 0.030096618458628654, 0.008907000534236431, -0.0219572801142931, 0.028140652924776077, 0.016226094216108322, -0.04681695997714996, -0.038635559380054474, -0.010237266309559345, -0.03158988058567047, 0.0841275155544281, -0.041979629546403885, 0.03783635050058365, -0.06275912374258041, -0.021378904581069946, -0.03384029120206833, 0.038740720599889755, 0.012209005653858185, 0.010310878045856953, 0.03325140103697777, -0.01515346858650446, 0.09397043287754059, -0.04854157567024231, 0.010105817578732967, 0.036090701818466187, 0.06793296337127686, 0.027614856138825417, 0.017677294090390205, -0.057921793311834335, -0.03663753345608711, -0.04383043572306633, -0.021810058504343033, -0.014438384212553501, 0.03953992947936058, 0.02441801130771637, -0.046270132064819336, 0.006972067523747683, -0.014322709292173386, 0.05279001593589783 ]
42,949
linearmodels.system.model
__init__
null
def __init__( self, equations: Mapping[ str, Mapping[str, ArrayLike | None] | Sequence[ArrayLike | None] ], *, sigma: ArrayLike | None = None, weight_type: str = "robust", **weight_config: bool | str | float, ) -> None: super().__init__(equations, sigma=sigma) self._weight_type = weight_type self._weight_config = weight_config if weight_type not in COV_TYPES: raise ValueError("Unknown estimator for weight_type") if weight_type not in ("unadjusted", "homoskedastic") and sigma is not None: warnings.warn( "sigma has been provided but the estimated weight " "matrix not unadjusted (homoskedastic). sigma will " "be ignored.", UserWarning, ) weight_type = COV_TYPES[weight_type] self._weight_est = GMM_W_EST[weight_type](**weight_config)
(self, equations: collections.abc.Mapping[str, collections.abc.Mapping[str, typing.Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType]] | collections.abc.Sequence[typing.Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType]]], *, sigma: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, weight_type: str = 'robust', **weight_config: bool | str | float) -> NoneType
[ 0.07116091251373291, -0.043917298316955566, 0.02370789833366871, -0.021214287728071213, -0.033961471170186996, -0.03833458945155144, -0.06758797913789749, -0.05828346684575081, 0.004538275767117739, 0.030183838680386543, -0.006443374790251255, 0.041572559624910355, -0.013779982924461365, 0.04700639843940735, -0.07190527021884918, 0.02197725884616375, 0.02329849824309349, -0.021921431645751, 0.02836015447974205, -0.009378948248922825, -0.0435079000890255, -0.07756241410970688, -0.0062386756762862206, 0.10845339298248291, 0.02962556667625904, 0.013928854838013649, -0.021660905331373215, -0.04856955632567406, 0.05177030712366104, -0.05430113524198532, -0.05809737369418144, -0.014989569783210754, -0.0375157929956913, 0.01898120529949665, 0.053705643862485886, -0.06647143512964249, 0.029030079022049904, 0.03919060528278351, -0.03450113162398338, 0.04458722472190857, 0.05441278964281082, -0.03893008083105087, 0.04566654562950134, -0.02582932636141777, -0.025401318445801735, 0.02046992816030979, -0.034724440425634384, 0.03699474036693573, 0.018106581643223763, -0.011528290808200836, 0.004333576653152704, -0.05742745101451874, 0.05400339141488075, 0.005940931383520365, -0.07224023342132568, 0.0372924841940403, 0.0444011315703392, 0.03234248608350754, 0.05229135975241661, -0.03647368773818016, -0.008425235748291016, 0.019483648240566254, -0.01090488862246275, -0.02871372550725937, -0.0350780114531517, -0.012728572823107243, -0.03997218608856201, 0.007908836007118225, 0.03347763419151306, 0.021028198301792145, 0.04138647019863129, -0.03280771151185036, -0.0507282018661499, 0.008118187077343464, 0.019893048331141472, 0.03613872453570366, -0.08969549834728241, -0.014552257023751736, -0.012179606594145298, 0.009853478521108627, 0.026722559705376625, 0.021084025502204895, -0.038743991404771805, -0.05858121067285538, -0.01510122325271368, -0.0372924841940403, 0.02467556670308113, -0.008318234235048294, 0.07376617193222046, -0.008988158777356148, -0.07313346862792969, 0.005447791889309883, 0.02737387642264366, 0.010876975022256374, 0.09386391937732697, 0.05284963175654411, 0.01834849826991558, -0.09177970886230469, 0.02923477813601494, 0.0039544180035591125, 0.0025145444087684155, 0.009667388163506985, 0.02997913956642151, -0.014412689954042435, -0.04998384043574333, -0.04034436494112015, -0.011332896538078785, -0.031151507049798965, 0.023168236017227173, -0.036101508885622025, -0.031225943937897682, 0.012216825038194656, -0.04689474403858185, 0.031132899224758148, -0.020116355270147324, 0.053705643862485886, 0.002926269080489874, 0.0345197394490242, 0.023800943046808243, 0.030686281621456146, 0.007155170198529959, 0.03600846230983734, -0.03907895088195801, 0.034724440425634384, 0.03210056945681572, 0.025159401819109917, 0.016040978953242302, -0.016757426783442497, 0.048532336950302124, -0.03565489128232002, 0.0019481322960928082, -0.032993800938129425, 0.003230992006137967, 0.011211937293410301, -0.0047057573683559895, 0.03734831139445305, -0.056236471980810165, -0.01270996406674385, 0.012635528109967709, 0.07800903171300888, 0.04354511946439743, 0.005238440353423357, 0.014803479425609112, -0.027169175446033478, -0.0011560856364667416, 0.04618759825825691, 0.034482523798942566, -0.0063828956335783005, -0.01015122327953577, 0.0034101037308573723, -0.027913536876440048, 0.05913948267698288, -0.037943802773952484, 0.0038241546135395765, -0.020004700869321823, -0.02186560444533825, 0.04146090894937515, -0.02393120527267456, 0.02882537990808487, 0.012281956151127815, -0.028322935104370117, 0.03803684562444687, 0.014877915382385254, -0.019595302641391754, -0.00471971370279789, 0.010876975022256374, -0.02318684570491314, -0.04302406683564186, -0.025345491245388985, -0.014226599596440792, -0.043917298316955566, -0.0933428704738617, -0.08656918257474899, 0.0071458653546869755, 0.06468497216701508, 0.05504549667239189, 0.04503383859992027, 0.04093985632061958, -0.011686467565596104, -0.04499662294983864, 0.07361730188131332, 0.010300095193088055, -0.09743685275316238, 0.005675752647221088, -0.015222182497382164, 0.032472748309373856, -0.008536890149116516, -0.004889521282166243, -0.010625753551721573, 0.028267107903957367, 0.0006658541969954967, -0.02750413864850998, 0.024470867589116096, 0.0041916826739907265, 0.05266353860497475, 0.03554323688149452, 0.0384090282022953, -0.012616918422281742, -0.06457331776618958, 0.09096091240644455, 0.009337077848613262, -0.046336472034454346, 0.014654607512056828, 0.025178011506795883, 0.0003125734510831535, -0.002954182680696249, 0.001214238815009594, -0.015696711838245392, -0.024936093017458916, -0.02681560441851616, -0.030444364994764328, -0.02934643253684044, 0.020116355270147324, 0.016385246068239212, 0.044438350945711136, -0.008322886191308498, 0.05314737558364868, 0.021307334303855896, -0.015845583751797676, -0.04067932814359665, 0.07071429491043091, 0.00262387259863317, 0.006866730283945799, -0.0014363840455189347, 0.031895868480205536, -0.016013065353035927, 0.005815320182591677, -0.020321054384112358, -0.03755301237106323, 0.03974887728691101, 0.029662786051630974, -0.014719738624989986, 0.010876975022256374, -0.06822068244218826, -0.0254199281334877, -0.04216805100440979, -0.047080833464860916, 0.004203313495963812, -0.0279693640768528, 0.003777632024139166, 0.04198196157813072, -0.001109563047066331, -0.02547575533390045, 0.011351505294442177, 0.016943516209721565, -0.07733910530805588, 0.07235188782215118, 0.007904183119535446, -0.02728082984685898, -0.017166825011372566, -0.006224718876183033, -0.020730454474687576, -0.025959590449929237, 0.019018422812223434, -0.032361093908548355, 0.05396617203950882, 0.01904633641242981, 0.023279890418052673, 0.01858111098408699, -0.0697094053030014, 0.007532002869993448, -0.014226599596440792, -0.005517575889825821, 0.03254718333482742, -0.01916729472577572, 0.009471993893384933, 0.03572932630777359, 0.015175660140812397, 0.0036171292886137962, 0.034668613225221634, 0.006643421947956085, 0.08478271961212158, 0.019762784242630005, 0.005219831597059965, -0.008234493434429169, 0.006373590789735317, 0.01078393030911684, -0.0038311330135911703, -0.009513864293694496, 0.04722970351576805, 0.013017012737691402, -0.012040039524435997, -0.0023679984733462334, 0.04079098254442215, -0.026145679876208305, -0.005936278961598873, -0.029327822849154472, -0.0071458653546869755, 0.062154144048690796, -0.03986053168773651, 0.009234728291630745, 0.026164289563894272, 0.04838346317410469, -0.005471053067594767, 0.047899629920721054, -0.10770903527736664, 0.03960000351071358, 0.022107521072030067, 0.024303385987877846, -0.018432239070534706, 0.039786096662282944, 0.006657378748059273, 0.03660395368933678, -0.0018062384333461523, -0.003340319963172078, -0.024415040388703346, 0.04492218419909477, -0.02664812281727791, 0.026331769302487373, 0.034612786024808884, 0.011630640365183353, 0.07149587571620941, -0.01927894912660122, 0.026796996593475342, -0.0017504113493487239, 0.016478290781378746, 0.037832148373126984, -0.006592247169464827, 0.01754830963909626, 0.07328233867883682, 0.01966973952949047, -0.0029472042806446552, -0.012616918422281742, -0.048532336950302124, -0.08895114064216614, -0.031039852648973465, -0.0006873708334751427, -0.030574627220630646, 0.022275002673268318, -0.010858366265892982, -0.05284963175654411, 0.003661325667053461, 0.0499466210603714, -0.027820492163300514, -0.04856955632567406, -0.026331769302487373, 0.05177030712366104, -0.008090273477137089, -0.029588349163532257, -0.03269605711102486, 0.016208460554480553, -0.02594098076224327, -0.017743704840540886, 0.007322651334106922, -0.013659024611115456, -0.07317068427801132, -0.0140963364392519, -0.030574627220630646, 0.016096806153655052, -0.014282426796853542, -0.045182712376117706, 0.030165228992700577, 0.037646058946847916, 0.044103387743234634, 0.015278009697794914, 0.000782742106821388, -0.0218097772449255, -0.007117952220141888, 0.020804889500141144, -0.006396852433681488, -0.0008257754961960018, 0.01159342285245657, -0.049276698380708694, 0.009113769978284836, -0.0016050284029915929, -0.04923947900533676, 0.04198196157813072, 0.019055642187595367, 0.06762519478797913, -0.02043270878493786, 0.037999629974365234, -0.08761128783226013, -0.09840452671051025, 0.05199361592531204, 0.017557615414261818, 0.007094690576195717, -0.08061429858207703, -0.01581767201423645, -0.006196805275976658, -0.029811657965183258, 0.03738553076982498, -0.01021635439246893, 0.0249733105301857, 0.010411749593913555, -0.04756466671824455, -0.039153389632701874, 0.03907895088195801, 0.07097481936216354, 0.03148647025227547, 0.00121191272046417, -0.001986513379961252, -0.03997218608856201, 0.020786279812455177, -0.001598050002939999, -0.02662951499223709, 0.033105455338954926, 0.010188440792262554, 0.00019917471217922866, -0.061298128217458725, -0.0014817436458542943, -0.0502815842628479, -0.00957434345036745, -0.03537575528025627, 0.03550601750612259, -0.011974907480180264, -0.028695115819573402, -0.04023271054029465, 0.07808347046375275, 0.03904173523187637, 0.033105455338954926, -0.01703656278550625, 0.01886024698615074, 0.004870912060141563, 0.009369644336402416, -0.07499437034130096, 0.004089333117008209, 0.025587409734725952, -0.04261466860771179, 0.01978139393031597, 0.0005050605395808816, 0.05132368952035904, 0.020674627274274826, 0.07309625297784805, 0.0011828361311927438, 0.07302181422710419, 0.012589005753397942, -0.03967444226145744, -0.05270075798034668, -0.007397087290883064, 0.008443845435976982, -0.04209361597895622, 0.01742735132575035, -0.055901508778333664, -0.012700659222900867, 0.004805780481547117, -0.002809962723404169, -0.024880265817046165, -0.010346617549657822, 0.0001949586148839444, -0.029365040361881256, 0.011007238179445267, -0.011491072364151478, 0.005131438374519348, -0.035803765058517456, -0.06144699826836586, -0.03187726065516472, 0.02668534219264984, -0.0060665421187877655, -0.062265798449516296, -0.04075376316905022, 0.06665752828121185, -0.016552727669477463, 0.006210762076079845, 0.037701886147260666, 0.010234964080154896, 0.005596664268523455, -0.00327984057366848, -0.05031880363821983, 0.033328764140605927, 0.01571532152593136, -0.014375471509993076, -0.04287519305944443, -0.02783910185098648, -0.024805830791592598, -0.05121203511953354, 0.07957219332456589, 0.03786936402320862, -0.045368801802396774, 0.0037939150352030993, 0.005196569953113794, 0.006234023254364729, 0.023168236017227173, 0.02674116939306259, -0.036901697516441345, -0.06874173879623413, 0.021270114928483963, -0.014645302668213844, -0.03286353871226311, 0.011686467565596104, -0.038111284375190735, 0.019427821040153503, 0.01510122325271368, 0.031318988651037216, 0.044066172093153, 0.002451739041134715, -0.025047747418284416, 0.011230546049773693, -0.05489662289619446, 0.05456165969371796, 0.012970490381121635, -0.07343120872974396, 0.07201692461967468, 0.10480602830648422, 0.061298128217458725, 0.01328684389591217, 0.019595302641391754, -0.0076343524269759655, -0.0009763922425918281, 0.05954888090491295, -0.008862548507750034, 0.023577634245157242, -0.01886024698615074, -0.05954888090491295, -0.028732335194945335, 0.023335717618465424, -0.026964476332068443, -0.06021880358457565, 0.003382190363481641, -0.0021225919481366873, -0.007085386198014021, -0.023279890418052673, 0.0071365609765052795, -0.009620865806937218, 0.02140037901699543, -0.004584798589348793, -0.0350780114531517, -0.027746055275201797, 0.021623685956001282, 0.0011834176257252693, -0.0028727680910378695, 0.05742745101451874, 0.021158460527658463, 0.009327773936092854, -0.011007238179445267, 0.03554323688149452, 0.026331769302487373, 0.028564853593707085, -0.04923947900533676, 0.07544098794460297, 0.01874859258532524, 0.02393120527267456, -0.055082712322473526, -0.03933947905898094, 0.0951293334364891, -0.019893048331141472, 0.030239665880799294, 0.07793459296226501, -0.022293612360954285, -0.030574627220630646, 0.0051686568185687065, -0.018599720671772957, -0.0340731255710125, 0.03256579488515854, -0.0024354560300707817, 0.06755076348781586, 0.04101429134607315, 0.00755061162635684, 0.018376411870121956, -0.049500007182359695, -0.0569436177611351, -0.032137785106897354, -0.010476880706846714, -0.002670394955202937, 0.04313572123646736, 0.07224023342132568, -0.01351945661008358, -0.01812518946826458, -0.023112408816814423, 0.00891837477684021, 0.021493423730134964, 0.00181554292794317, -0.03669699653983116, 0.020116355270147324, 0.031021244823932648, 0.0003329270984977484, 0.024247558787465096, -0.012281956151127815, 0.01363111101090908, -0.03930225968360901, 0.004224248696118593, -0.008983506821095943, -0.025457145646214485, 0.03904173523187637, 0.029011469334363937, -0.038632337003946304, 0.004729018546640873, 0.0022854208946228027, 0.008448497392237186, -0.06148421764373779, -0.044959403574466705, -0.017473874613642693, -0.0384090282022953, -0.05333346500992775, -0.034315042197704315, 0.05158421769738197, -0.04574098438024521, -0.04577820003032684, 0.023112408816814423, -0.04012105613946915, 0.035059403628110886, -0.010653667151927948, -0.005689709447324276, 0.007383130490779877, 0.004773214925080538, -0.00845314934849739, 0.010234964080154896, -0.05199361592531204, -0.06446166336536407, 0.011351505294442177, -0.005066306795924902, -0.07711579650640488, 0.006834164261817932, 0.0069551230408251286, 0.026722559705376625, -0.002070253947749734, 0.004856955260038376, 0.00046900557936169207, 0.03671560436487198, 0.016701599583029747, -0.04920226335525513, 0.027411093935370445, -0.010514099150896072, -0.006131673697382212, 0.03647368773818016, 0.029011469334363937, -0.030016357079148293, -0.058246247470378876, 0.03291936591267586, 0.05947444215416908, 0.010979324579238892, 0.00641546119004488, -0.02112124301493168, 0.0015678103081882, 0.02605263516306877, -0.04172143340110779, 0.003740414045751095, 0.04700639843940735, -0.10726241767406464, 0.010774625465273857, -0.00760643882676959, 0.0702676773071289, 0.008322886191308498, 0.057390231639146805, -0.06122369319200516, 0.021791167557239532, 0.017408743500709534, 0.02071184478700161, 0.021679513156414032, -0.00583858136087656, 0.012347088195383549, -0.058022938668727875, 0.006731814704835415, 0.05746467038989067, 0.0022854208946228027, -0.0033659073524177074, 0.0003782865824177861, 0.0036124768666923046, 0.000514655839651823, 0.005647839047014713, 0.03636203333735466, -0.015789758414030075, -0.02048853598535061, -0.0349663570523262, -0.01645037718117237, 0.006489897612482309, 0.01432894915342331, -0.01697142980992794, -0.0031123594380915165, 0.03159812465310097, -0.017678573727607727, -0.06501993536949158, 0.02104680798947811, 0.03301240876317024, 0.031132899224758148, 0.025047747418284416, -0.007713440805673599, -0.024005642160773277, -0.01328684389591217, 0.017622746527194977, -0.0064666359685361385, 0.009369644336402416, 0.006796946283429861, -0.0006175870075821877, -0.03533853963017464, -0.03526410087943077, 0.0384090282022953, 0.01188186276704073, -0.014691825024783611, 0.011295678094029427, -0.02668534219264984, 0.08381504565477371, 0.0634939894080162, 0.008895114064216614, -0.018767202273011208, 0.06018158793449402, -0.07972106337547302, -0.06081429496407509, 0.03893008083105087, -0.0078250952064991, -0.022219175472855568, -0.0342964343726635, -0.048011284321546555, 0.0441778264939785, -0.0560503825545311, 0.020116355270147324, -0.04689474403858185, -0.05690639838576317, -0.05329624563455582, 0.031895868480205536, -0.03411034122109413, 0.057390231639146805, 0.017269175499677658, -0.06334511935710907, 0.028546243906021118, -0.005592011846601963, -0.01138872280716896, -0.03234248608350754, 0.033924251794815063, 0.04838346317410469, -0.05057932808995247, 0.009946524165570736, 0.0004972098977304995, 0.05046767368912697, -0.04529436677694321, 0.06405226141214371, 0.06755076348781586, 0.039265044033527374, 0.04629925265908241, -0.022163348272442818, -0.03647368773818016, -0.0027192437555640936, -0.009346382692456245, 0.033459026366472244, -0.01555714476853609, -0.025010529905557632, -0.037887975573539734, -0.018078668043017387, -0.05158421769738197, 0.020562972873449326, 0.0012293587205931544, 0.03665977716445923, 0.001703888876363635, -0.021846994757652283, -0.0111002828925848, -0.015696711838245392, -0.015920020639896393, -0.02404285967350006, -0.003026292659342289, 0.01496165618300438, 0.07451053708791733, 0.004370794631540775, 0.027541356161236763, -0.027020303532481194, -0.020749062299728394, -0.005424530711025, 0.003745066234841943, 0.0017701834440231323, 0.02681560441851616, 0.0500582754611969, 0.007871617563068867, 0.026778386905789375, -0.010542012751102448, 0.05463609844446182, 0.011211937293410301, 0.05858121067285538, -0.03855789825320244, 0.052328579127788544, -0.07726467400789261, -0.03312406316399574, -0.028918424621224403, 0.003949765581637621, -0.02605263516306877, 0.02288910001516342, 0.015836279839277267, -0.03319850191473961, -0.011277069337666035, 0.01927894912660122, 0.024991920217871666 ]
42,952
linearmodels.system.model
_blocked_gmm
null
@staticmethod def _blocked_gmm( x: ArraySequence, y: ArraySequence, z: ArraySequence, *, w: Float64Array, constraints: LinearConstraint | None = None, ) -> Float64Array: k = len(x) xpz = blocked_cross_prod(x, z, np.eye(k)) wi = np.linalg.inv(w) xpz_wi_zpx = xpz @ wi @ xpz.T zpy_arrs = [] for i in range(k): zpy_arrs.append(z[i].T @ y[i]) zpy = np.vstack(zpy_arrs) xpz_wi_zpy = xpz @ wi @ zpy params = _parameters_from_xprod(xpz_wi_zpx, xpz_wi_zpy, constraints=constraints) return params
(x: collections.abc.Sequence[numpy.ndarray], y: collections.abc.Sequence[numpy.ndarray], z: collections.abc.Sequence[numpy.ndarray], *, w: numpy.ndarray, constraints: Optional[linearmodels.system._utility.LinearConstraint] = None) -> numpy.ndarray
[ 0.08677418529987335, 0.011420050635933876, 0.002104292158037424, 0.05288711562752724, -0.047645725309848785, -0.03534300997853279, -0.0826975405216217, -0.030501998960971832, -0.0005664526834152639, 0.013731359504163265, -0.019564229995012283, -0.009222486987709999, -0.04149436578154564, 0.013603963889181614, -0.06245994195342064, 0.027881301939487457, -0.006347000133246183, -0.04557100683450699, 0.01290329173207283, -0.058674488216638565, -0.023731864988803864, -0.04615338146686554, 0.0048683080822229385, 0.11385471373796463, 0.004317780025303364, -0.0015116779832169414, -0.04345988854765892, -0.011010566726326942, -0.008590062148869038, -0.007975836284458637, -0.016415754333138466, -0.0029892323072999716, -0.0017471312312409282, -0.033978063613176346, 0.030884183943271637, -0.031921543180942535, 0.061477180570364, 0.02240331843495369, -0.09769375622272491, -0.05689096078276634, 0.06344269961118698, -0.056963756680488586, 0.07206916064023972, 0.012384612113237381, 0.03963803872466087, 0.0023499825038015842, 0.0131034841760993, 0.05019362270832062, -0.025606391951441765, 0.025952177122235298, 0.05463424697518349, -0.044151462614536285, 0.0521591454744339, -0.037144735455513, -0.04932005703449249, 0.047427333891391754, 0.011547445319592953, 0.013340074568986893, 0.06402508169412613, -0.03221273049712181, 0.0022623983677476645, -0.027262525632977486, -0.009054142981767654, 0.002301071770489216, 0.01538749411702156, 0.021092969924211502, -0.036580558866262436, -0.01339467242360115, 0.030993379652500153, 0.04924726113677025, 0.02979222685098648, -0.0007325211772695184, -0.02693493850529194, 0.04837369546294212, 0.008517264388501644, -0.0006511930841952562, -0.0350700207054615, -0.010409990325570107, -0.008744755759835243, -0.036762550473213196, 0.04273191839456558, 0.0032895205076783895, -0.027044134214520454, -0.03137556463479996, -0.009263435378670692, -0.013658561743795872, 0.02942824177443981, 0.0022908346727490425, 0.015305597335100174, -0.08291593194007874, -0.04371467977762222, 0.02558819204568863, 0.031921543180942535, 0.06253273785114288, 0.018035490065813065, 0.024805624037981033, -0.02611597068607807, -0.011347252875566483, -0.00671098567545414, 0.020819980651140213, 0.03095698170363903, 0.008121429942548275, -0.01034629251807928, 0.0003895784029737115, 0.0024159548338502645, -0.016097266227006912, -0.003844598541036248, -0.06970325857400894, -0.02047419361770153, -0.021620748564600945, -0.0034396646078675985, -0.018381275236606598, -0.05736413970589638, -0.03499722108244896, -0.01657954789698124, 0.05048481002449989, -0.031339164823293686, 0.030101614072918892, 0.018062788993120193, 0.012830494903028011, 0.0030529298819601536, -0.00940902903676033, -0.031648553907871246, -0.026734746992588043, 0.0031666753347963095, 0.004936555400490761, 0.03374147042632103, -0.02540619857609272, 0.06165917217731476, -0.021766342222690582, -0.042003944516181946, -0.03880087286233902, -0.0489196740090847, 0.010728477500379086, -0.028336284682154655, -0.006447095889598131, 0.0015640008496120572, -0.01630655862390995, 0.07483544945716858, 0.006542642135173082, 0.01010060217231512, 0.04680855572223663, -0.006651837844401598, 0.0463353767991066, -0.04371467977762222, -0.01561498548835516, 0.08488145470619202, -0.03122997097671032, 0.05012082681059837, 0.003874172456562519, 0.020892776548862457, 0.011747637763619423, 0.03381427004933357, 0.003441939363256097, -0.009672919288277626, 0.019600627943873405, 0.013303675688803196, -0.005832870490849018, 0.008007684722542763, -0.00517314625903964, -0.06984885036945343, 0.02951923757791519, -0.07305192202329636, 0.013986148871481419, 0.02939184196293354, 0.02056518942117691, 0.028882263228297234, 0.06799252331256866, -0.0031029777601361275, -0.011183459311723709, -0.020401395857334137, -0.05121278390288353, -0.054233863949775696, -0.02948283962905407, 0.03159395605325699, 0.048009708523750305, -0.0722147524356842, -0.0198008194565773, 0.03141196444630623, -0.008157828822731972, 0.06493504345417023, 0.02819068916141987, 0.015050807036459446, -0.059074874967336655, -0.023750064894557, 0.008444467559456825, 0.01445023063570261, -0.015824276953935623, -0.0013421971816569567, -0.040038421750068665, -0.0591476708650589, -0.04746372997760773, 0.02378646284341812, 0.015014409087598324, -0.023222286254167557, 0.06766493618488312, 0.035015422850847244, 0.05900207534432411, 0.0004527071723714471, -0.025697387754917145, 0.02160254865884781, -0.0381820946931839, -0.01384055521339178, -0.02384106069803238, -0.00016677936946507543, -0.027116931974887848, -0.013704060576856136, 0.0016879835166037083, -0.017143724486231804, 0.0011590668000280857, 0.040511604398489, 0.004854658618569374, -0.010855872184038162, 0.009955007582902908, 0.05212274566292763, 0.029009656980633736, -0.011201659217476845, 0.037526920437812805, 0.019527830183506012, -0.018763460218906403, -0.01091047003865242, -0.03457864001393318, -0.07108639925718307, -0.011329053901135921, 0.02504221349954605, 0.005637228023260832, 0.04942925274372101, 0.001987134339287877, -0.020092008635401726, -0.018581468611955643, 0.037308529019355774, -0.02182094007730484, -0.014441131614148617, -0.03741772472858429, -0.03184874728322029, -0.04928366094827652, -0.017362115904688835, -0.040256813168525696, 0.006274202838540077, -0.008876700885593891, 0.022749103605747223, -0.006092210300266743, -0.010519186034798622, 0.054743442684412, 0.02693493850529194, 0.006565391551703215, 0.00843081809580326, 0.035998180508613586, 0.040438808500766754, 0.048628486692905426, -0.05117638409137726, -0.002461452968418598, -0.04313230141997337, 0.01241191104054451, 0.011056064628064632, 0.008344371803104877, 0.06813811510801315, -0.022876499220728874, 0.052850719541311264, -0.008594611659646034, -0.01839037612080574, -0.01606086827814579, -0.05503463372588158, -0.02258531004190445, 0.038291290402412415, 0.04211314022541046, 0.0185723677277565, 0.0451706200838089, -0.03033820539712906, 0.02859107404947281, 0.05252313241362572, 0.04680855572223663, 0.011911431327462196, -0.04087559133768082, 0.03381427004933357, 0.054233863949775696, 0.04422425851225853, 0.007475355640053749, 0.046662963926792145, -0.019600627943873405, 0.02464183047413826, -0.03177594766020775, -0.03386886790394783, -0.011966029182076454, 0.0033441183622926474, 0.0034669635351747274, -0.02038319781422615, -0.0381820946931839, -0.0010549897560849786, -0.03696274384856224, -0.02418684773147106, 0.012339114211499691, 0.039092060178518295, -0.03319549188017845, 0.05408826842904091, -0.024569032713770866, 0.024878419935703278, 0.025788383558392525, 0.008030434139072895, 0.022548912093043327, 0.04830089956521988, 0.031193571165204048, 0.07254233956336975, 0.05721854791045189, -0.007307012099772692, -0.035015422850847244, 0.03288610652089119, -0.02577018551528454, -0.02203933149576187, -0.0040152170695364475, -0.021384157240390778, 0.011492847464978695, 0.03184874728322029, -0.03574339300394058, -0.0004106213164050132, 0.019382236525416374, 0.039274051785469055, 0.0943450853228569, 0.02926444821059704, 0.04964764416217804, 0.09041403979063034, -0.030138013884425163, 0.02240331843495369, 0.030975179746747017, -0.018099186941981316, -0.004229058511555195, 0.001710732583887875, 0.017689703032374382, -0.04382387548685074, -0.01546029094606638, -0.009973207488656044, 0.020328599959611893, -0.04932005703449249, 0.02185733988881111, -0.03705374151468277, 0.07483544945716858, 0.015487589873373508, 0.012339114211499691, 0.04418785870075226, -0.03745412454009056, -0.013249077834188938, -0.016989031806588173, -0.05736413970589638, 0.004299580585211515, -0.011492847464978695, -0.025569992139935493, 0.006055811420083046, 0.007798392791301012, -0.025297002866864204, 0.06111319363117218, 0.02957383543252945, 0.035961784422397614, 0.06500784307718277, 0.007115919608622789, -0.034032661467790604, -0.017116425558924675, 0.016479451209306717, -0.005232294090092182, -0.008822103030979633, 0.062168750911951065, -0.00365805602632463, 0.051321979612112045, -0.015114504843950272, 0.025952177122235298, 0.01584247685968876, -0.01823568157851696, -0.017353016883134842, -0.0036398565862327814, -0.004179010633379221, -0.023331481963396072, -0.002420504577457905, -0.03137556463479996, -0.05277791991829872, 0.05550781264901161, -0.0025751986540853977, 0.012739498168230057, -0.09398110210895538, -0.024842021986842155, 0.01786259561777115, 0.06067641079425812, -0.02243971638381481, -0.04870128259062767, 0.07541783154010773, -0.018872655928134918, -0.01621556095778942, 0.034960824996232986, 0.02267630770802498, -0.0014377434272319078, -0.004736363422125578, -0.0327405110001564, 0.057145748287439346, -0.05962085351347923, 0.020801780745387077, 0.023913858458399773, -0.02957383543252945, 0.003419190412387252, 0.03354128077626228, 0.027298925444483757, -0.03388706594705582, -0.036544159054756165, -0.07163237780332565, 0.00667458726093173, -0.06580860912799835, 0.01881805807352066, -0.033632274717092514, -0.059438858181238174, -0.030356405302882195, 0.07832971215248108, 0.023804662749171257, 0.04870128259062767, -0.045316215604543686, 0.00988221075385809, 0.036853548139333725, -0.04535261541604996, 0.017298419028520584, -0.04371467977762222, 0.012102523818612099, -0.01140185073018074, -0.004645367152988911, 0.038691677153110504, 0.10555583983659744, -0.05780092254281044, 0.0926707535982132, -0.0440058670938015, -0.02733532339334488, -0.01738031581044197, -0.05627218261361122, -0.08167838305234909, -0.021202165633440018, -0.06566301733255386, -0.03696274384856224, -0.023622669279575348, 0.009618321433663368, -0.012994288466870785, 0.002616147045046091, -0.00034493330167606473, 0.04786411672830582, 0.012530206702649593, 0.011693039909005165, 0.026370761916041374, 0.030229009687900543, 0.01958242803812027, -0.020910976454615593, -0.020019210875034332, -0.07534503191709518, 0.012493807822465897, -0.01344017032533884, 0.00496385432779789, -0.03603458032011986, 0.04022041708230972, 0.031066177412867546, 0.060021236538887024, 0.06744654476642609, -0.0272443275898695, 0.026425359770655632, 0.012730398215353489, 0.010464588180184364, -0.07541783154010773, -0.010164299979805946, 0.03476063162088394, 0.027116931974887848, -0.026498155668377876, -0.04447904974222183, 0.032685913145542145, -0.009131490252912045, 0.07716496288776398, -0.0002988663618452847, -0.01111066248267889, 0.010682979598641396, 0.01192053034901619, 0.002163439756259322, 0.0056963758543133736, 0.0037558770272880793, -0.03872807323932648, -0.0021429655607789755, 0.020637987181544304, -0.013822355307638645, 0.06209595501422882, 0.05234113708138466, -0.01805368810892105, -0.00916333869099617, -0.019527830183506012, -0.028773067519068718, 0.031102575361728668, -0.02078358083963394, -0.011838633567094803, 0.021675346419215202, -0.006374299060553312, 0.031921543180942535, -0.003783175954595208, -0.003692179685458541, 0.0638066902756691, 0.04746372997760773, 0.05758253112435341, -0.04553460702300072, 0.002784490352496505, -0.026279764249920845, -0.03319549188017845, 0.08546383678913116, -0.024842021986842155, -0.028882263228297234, 0.012148021720349789, -0.06307871639728546, -0.09944088757038116, -0.01703452877700329, 0.005582630168646574, -0.02442343905568123, 0.010591982863843441, -0.007093170657753944, 0.012985188513994217, -0.02486022189259529, -0.024805624037981033, -0.04302310571074486, -0.002429604297503829, -0.05113998427987099, 0.008844851516187191, -0.0005010490422137082, 0.024769224226474762, 0.048592086881399155, -0.019018251448869705, 0.04331429302692413, -0.0003426583716645837, -0.005987564101815224, -0.03334108740091324, 0.04557100683450699, 0.014959811232984066, -0.024004854261875153, -0.07934887707233429, 0.01209342386573553, 0.017826197668910027, -0.03217633441090584, -0.022785503417253494, 0.010364491492509842, 0.03257671743631363, -0.017689703032374382, 0.009272534400224686, 0.005250493064522743, -0.04946565255522728, -0.041639961302280426, -0.008003135211765766, -0.009058693423867226, -0.022385118529200554, 0.054197464138269424, 0.04804610833525658, -0.02486022189259529, 0.07370709627866745, -0.04000202566385269, 0.04229513555765152, -0.029828624799847603, 0.004517972003668547, -0.027808504179120064, -0.0022328244522213936, -0.028973259031772614, -0.010737577453255653, 0.029319046065211296, -0.03847328573465347, -0.017462212592363358, -0.01180223561823368, -0.02056518942117691, 0.06013043224811554, -0.004003842361271381, 0.02899145893752575, 0.03781811147928238, -0.030574796721339226, -0.06227794662117958, 0.015178202651441097, -0.007866640575230122, 0.02347707562148571, 0.012257217429578304, 0.04189474880695343, -0.0025342502631247044, 0.0314483605325222, 0.042185939848423004, 0.02706233412027359, 0.014013447798788548, 0.048009708523750305, 0.034160055220127106, 0.000812143029179424, -0.057910118252038956, -0.02486022189259529, 0.01621556095778942, 0.012257217429578304, 0.005687275901436806, -0.019327638670802116, 0.018281180411577225, -0.03941964730620384, -0.06671857088804245, -0.018654264509677887, -0.0013945200480520725, 0.09696578234434128, 0.0021793642081320286, 0.10380870848894119, -0.02320408634841442, 0.004247257951647043, -0.011292655020952225, 0.029828624799847603, -0.02567918784916401, 0.0064698453061282635, -0.048592086881399155, 0.018708862364292145, 0.02460543066263199, -0.00577827263623476, 0.01492341235280037, 0.04695415124297142, 0.003548860317096114, 0.009736616164445877, -0.07905768603086472, -0.051285579800605774, -0.037344928830862045, -0.048410095274448395, -0.05212274566292763, -0.02509681135416031, -0.023713666945695877, 0.007871190086007118, -0.025024013593792915, -0.03441484645009041, -0.06271473318338394, 0.05667256936430931, 0.09871291369199753, 0.010400890372693539, -0.03181234747171402, -0.029064254835247993, -0.01162934210151434, 0.01460492517799139, 0.0324857197701931, -0.00047119081136770546, -0.015942571684718132, -0.02553359419107437, -0.0017471312312409282, 0.061477180570364, -0.013986148871481419, 0.02549719624221325, 0.0442606583237648, 0.0030688541010022163, 0.008594611659646034, -0.010155200026929379, -0.030811386182904243, -0.018617866560816765, -0.042404331266880035, 0.02930084615945816, -0.01765330508351326, -0.00384687352925539, 0.009063242934644222, -0.024095851927995682, -0.02930084615945816, 0.008549113757908344, -0.005104898940771818, 0.021311361342668533, -0.010009605437517166, -0.000442185701103881, -0.022658107802271843, -0.04156716167926788, -0.05761893093585968, -0.01516910269856453, 0.02231232076883316, -0.01512360479682684, -0.0675557404756546, 0.034615036100149155, 0.021038372069597244, -0.08611901104450226, 0.0036671555135399103, -0.013549366034567356, -0.05030281841754913, -0.00264344597235322, -0.042586322873830795, -0.002311308868229389, -0.007170517463237047, -0.03614377602934837, 0.015105404891073704, -0.027608312666416168, 0.04484303295612335, -0.024296043440699577, -0.023313282057642937, -0.026316164061427116, -0.04990243539214134, -0.04786411672830582, -0.016807038336992264, -0.016297457739710808, -0.017598707228899002, 0.010073303245007992, 0.13285477459430695, -0.030138013884425163, 0.021675346419215202, 0.04269551858305931, 0.04174915701150894, 0.0035898087080568075, -0.038327690213918686, -0.03696274384856224, -0.010255295783281326, 0.04597138985991478, -0.01848137192428112, 0.00760730030015111, 0.054816242307424545, 0.01707092858850956, -0.002907335525378585, -0.012775897048413754, 0.014513928443193436, -0.03650776296854019, 0.024205047637224197, 0.018854457885026932, -0.05234113708138466, -0.03807289898395538, -0.08313432335853577, 0.023731864988803864, -0.061040397733449936, 0.011501947417855263, 0.020219404250383377, 0.019837219268083572, 0.0025911228731274605, -0.030574796721339226, 0.013285476714372635, -0.01651584915816784, 0.04262272268533707, -0.03448764234781265, 0.05507102981209755, 0.026152370497584343, -0.025260604918003082, 0.01593347266316414, 0.03876447305083275, 0.037745311856269836, -0.002791315084323287, 0.0775289461016655, -0.013567565940320492, -0.04156716167926788, -0.0489196740090847, -0.006824731361120939, -0.03263131529092789, -0.053651485592126846, -0.002012158278375864, -0.02644355781376362, 0.03527021035552025, 0.02280370146036148, -0.011747637763619423, 0.06027602776885033, 0.04072999581694603, -0.003664880758151412, -0.0498296394944191, -0.05503463372588158, -0.039092060178518295, 0.05743693932890892, -0.03665335476398468, 0.021984733641147614, 0.012430110946297646, 0.0004660722624976188, -0.048009708523750305, 0.05026641860604286, -0.0010606769938021898, -0.00940902903676033, 0.022658107802271843, 0.003696729429066181, 0.07323391735553741, -0.01113796140998602, 0.008908549323678017, 0.011738537810742855, 0.05066680535674095, 0.029628433287143707, 0.04699055105447769, -0.04302310571074486, -0.06828371435403824, -0.029191650450229645, -0.06751934438943863, 0.03419645503163338, 0.025551794096827507, 0.038145698606967926, -0.04011122137308121, -0.02424144558608532, 0.039856430143117905, 0.05467064678668976 ]
42,958
linearmodels.system.model
_finalize_results
Collect results to return after GLS estimation
def _finalize_results( self, beta: Float64Array, cov: Float64Array, weps: Float64Array, eps: Float64Array, wmat: Float64Array, sigma: Float64Array, iter_count: int, cov_type: str, cov_config: dict[str, bool | float], cov_est: GMMHeteroskedasticCovariance | GMMHomoskedasticCovariance, ) -> GMMSystemResults: """Collect results to return after GLS estimation""" k = len(self._wy) # Repackage results for individual equations individual = AttrDict() debiased = bool(cov_config.get("debiased", False)) method = f"{iter_count}-Step System GMM" if iter_count > 2: method = "Iterative System GMM" for i in range(k): cons = bool(self.has_constant.iloc[i]) if cons: c = np.sqrt(self._w[i]) ye = self._wy[i] - c @ lstsq(c, self._wy[i], rcond=None)[0] else: ye = self._wy[i] total_ss = float(np.squeeze(ye.T @ ye)) stats = self._common_indiv_results( i, beta, cov, weps, eps, method, cov_type, cov_est, iter_count, debiased, cons, total_ss, weight_est=self._weight_est, ) key = self._eq_labels[i] individual[key] = stats # Populate results dictionary nobs = eps.size results = self._common_results( beta, cov, method, iter_count, nobs, cov_type, sigma, individual, debiased ) # wresid is different between GLS and OLS wresiduals = [] for individual_key in individual: wresiduals.append(individual[individual_key].wresid) wresid = np.hstack(wresiduals) results["wresid"] = wresid results["wmat"] = wmat results["weight_type"] = self._weight_type results["weight_config"] = self._weight_est.config results["cov_estimator"] = cov_est results["cov_config"] = cov_est.cov_config results["weight_estimator"] = self._weight_est results["j_stat"] = self._j_statistic(beta, wmat) r2s = [individual[eq].r2 for eq in individual] results["system_r2"] = self._system_r2(eps, sigma, "gls", False, debiased, r2s) return GMMSystemResults(results)
(self, beta: numpy.ndarray, cov: numpy.ndarray, weps: numpy.ndarray, eps: numpy.ndarray, wmat: numpy.ndarray, sigma: numpy.ndarray, iter_count: int, cov_type: str, cov_config: dict[str, bool | float], cov_est: linearmodels.system.covariance.GMMHeteroskedasticCovariance | linearmodels.system.covariance.GMMHomoskedasticCovariance) -> linearmodels.system.results.GMMSystemResults
[ 0.050493184477090836, -0.04459189251065254, -0.05768416449427605, 0.03443072363734245, -0.010434737429022789, -0.026125924661755562, -0.07687313854694366, -0.09574946016073227, 0.04513903334736824, 0.0268489308655262, -0.010317493230104446, 0.011558327823877335, -0.017176281660795212, 0.04177803173661232, -0.06225669011473656, 0.061318736523389816, -0.024601750075817108, -0.012154319323599339, 0.005911063868552446, -0.00886171031743288, -0.07917894423007965, -0.014977951534092426, 0.007777201011776924, 0.08449401706457138, 0.0036687676329165697, -0.029975444078445435, 0.014929099939763546, -0.06479698419570923, 0.024836238473653793, 0.003104529809206724, -0.03568132966756821, -0.0342157781124115, 0.011783045716583729, -0.03654111921787262, 0.023722417652606964, -0.029154734686017036, 0.03087431564927101, 0.012906636111438274, -0.058231305330991745, 0.018602753058075905, 0.017215361818671227, -0.03914003446698189, 0.04193435609340668, -0.02741561084985733, 0.009472357109189034, -0.01831941306591034, -0.02553970366716385, 0.05815314128994942, -0.0321444608271122, -0.01987289823591709, -0.02180742844939232, -0.05018053576350212, -0.0078993309289217, 0.004804571159183979, 0.00848066620528698, 0.01856367103755474, 0.015984298661351204, 0.011274987831711769, 0.03665836527943611, -0.07511447370052338, 0.019091270864009857, -0.03833886608481407, -0.04728851094841957, 0.04599882289767265, -0.022061457857489586, -0.03507556766271591, -0.0009165812516584992, -0.012789391912519932, 0.039960745722055435, 0.06288199126720428, 0.020947637036442757, -0.004071794915944338, 0.008920332416892052, 0.00760133471339941, -0.008998495526611805, 0.039960745722055435, -0.035251434892416, -0.07706854492425919, -0.0069320653565227985, -0.024367261677980423, 0.05717610567808151, 0.07773292809724808, -0.06393719464540482, -0.07144082337617874, -0.027767343446612358, -0.007752775214612484, 0.01267214771360159, -0.013737116940319538, 0.0160429198294878, -0.045920658856630325, -0.019140122458338737, 0.022491352632641792, 0.09426436573266983, 0.011304298415780067, 0.027904128655791283, 0.003964320756494999, -0.03894462808966637, -0.04521719366312027, -0.0067415437661111355, -0.03904233127832413, 0.03011222928762436, 0.00883728452026844, 0.02546153962612152, 0.05018053576350212, 0.005735197104513645, -0.0011754955630749464, 0.007791856769472361, -0.0626475065946579, 0.04232516884803772, -0.006199289113283157, -0.023663794621825218, 0.04924257844686508, -0.026927093043923378, -0.02079131081700325, -0.023722417652606964, -0.019052188843488693, -0.052173685282468796, 0.02069360762834549, 0.004860750865191221, 0.04756207764148712, -0.022159161046147346, 0.004953569266945124, 0.003908141050487757, 0.0263017900288105, -0.0017440080409869552, -0.009145050309598446, 0.021240748465061188, 0.00233022915199399, 0.023448847234249115, -0.022960329428315163, 0.03136283531785011, -0.011314068920910358, -0.004552984610199928, -0.017909057438373566, 0.054401326924562454, 0.0025525048840790987, -0.04338036850094795, -0.05764508247375488, 0.023194817826151848, 0.020654527470469475, 0.021279828622937202, 0.024562668055295944, -0.06006813049316406, -0.003453819779679179, 0.0067317732609808445, 0.04298955574631691, 0.07706854492425919, -0.006624299567192793, -0.047601159662008286, -0.050962161272764206, -0.0006631627329625189, -0.011020958423614502, 0.018348723649978638, -0.028021372854709625, -0.03663882613182068, -0.01970680244266987, 0.053189802914857864, -0.0054958234541118145, -0.01095256581902504, -0.02219824306666851, -0.03181226924061775, -0.02620408684015274, -0.009037576615810394, 0.01715674065053463, -0.006697576958686113, 0.027435151860117912, -0.03255481645464897, 0.0278845876455307, -0.044513728469610214, -0.02034187503159046, -0.007210520561784506, -0.015349225141108036, -0.03654111921787262, -0.036208927631378174, -0.01752801425755024, 0.08082035928964615, 0.025402918457984924, -0.007303338963538408, 0.005261335056275129, -0.004694654606282711, 0.02499256283044815, -0.05115756765007973, -0.053189802914857864, 0.003800667356699705, -0.036580201238393784, 0.040058448910713196, 0.005740082357078791, -0.048539113253355026, 0.017625717446208, -0.00041615599184297025, -0.047054022550582886, -0.009487013332545757, 0.02034187503159046, 0.015300373546779156, 0.03665836527943611, 0.03517327085137367, 0.029799576848745346, 0.020107386633753777, -0.010249100625514984, 0.019648179411888123, -0.05201736092567444, -0.0029994985088706017, -0.013463546521961689, -0.024973023682832718, -0.015505550429224968, -0.0284317284822464, -0.034626130014657974, -0.02675122767686844, 0.006604758556932211, 0.04009753093123436, -0.038104377686977386, -0.0035466381814330816, 0.0084318146109581, 0.03908141329884529, 0.05455765128135681, -0.025402918457984924, 0.08269626647233963, 0.014850936830043793, 0.010395655408501625, -0.051235731691122055, -0.007405927870422602, -0.09137234091758728, -0.0017659913282841444, -0.01688317023217678, -0.05127481371164322, 0.008920332416892052, 0.009135279804468155, 0.01668776385486126, 0.005534905008971691, -0.010297952219843864, 0.0320858396589756, -0.0005727869574911892, 0.07026837766170502, -0.0641716793179512, -0.06370270252227783, -0.04345853254199028, -0.03581811487674713, 0.0574105940759182, 0.011304298415780067, -0.012838244438171387, -0.025852354243397713, -0.05510479211807251, -0.05401051416993141, 0.05256450176239014, -0.031186968088150024, -0.03190997242927551, 0.0546748973429203, 0.0263017900288105, 0.00873958133161068, 0.01510496623814106, -0.0016817220021039248, -0.028607593849301338, -0.010297952219843864, -0.011089351028203964, -0.018759077414870262, -0.07773292809724808, 0.002723485929891467, 0.0452953577041626, 0.0677671730518341, -0.05119664967060089, 0.04986788332462311, 0.019325759261846542, -0.05350245535373688, 0.034352563321590424, -0.06135781854391098, 0.03132375329732895, 0.014059538021683693, 0.025129348039627075, 0.022159161046147346, 0.09184131771326065, 0.05174379050731659, 0.044904544949531555, -0.04896901175379753, -0.026712145656347275, -0.0007339977892115712, 0.10450369864702225, -0.016345800831913948, -0.00020563539874274284, -0.009379538707435131, 0.02385920286178589, 0.03861243650317192, -0.002774780383333564, -0.0068197064101696014, -0.0024206049274653196, -0.02733744867146015, 0.013981375843286514, -0.046936776489019394, -0.020732689648866653, 0.035290516912937164, -0.01463598944246769, 0.01273076981306076, -0.034743376076221466, 0.04869544133543968, -0.001405709539540112, 0.07187071442604065, -0.012447429820895195, -0.0017305738292634487, -0.014381960034370422, 0.015329684130847454, 0.004975552204996347, 0.015407847240567207, 0.016805008053779602, 0.04455281049013138, 0.017420539632439613, 0.014059538021683693, -0.007713693659752607, 0.045373521745204926, -0.07331673055887222, 0.0037102915812283754, 0.012506051920354366, -0.06315556168556213, 0.045373521745204926, 0.05068859085440636, 0.05248633772134781, -0.01710788905620575, -0.03157778084278107, -0.00778208626434207, -0.03665836527943611, 0.00803611520677805, 0.025793733075261116, -0.0025573899038136005, -0.0032266590278595686, 0.08128933608531952, -0.03278930485248566, 0.014206093735992908, -0.03169502690434456, -0.019169433042407036, 0.009218328632414341, 0.033610016107559204, -0.041074566543102264, -0.04326312243938446, -0.052447255700826645, 0.03648249804973602, 0.032124921679496765, 0.011460624635219574, -0.008617451414465904, 0.0542450025677681, -0.02815815806388855, 0.01660959981381893, -0.07613059133291245, 0.0510794073343277, -0.009511439129710197, -0.06088884174823761, 0.020849933847784996, -0.020771771669387817, -0.038553815335035324, 0.043028634041547775, -0.0357399508357048, -0.008974069729447365, -0.024367261677980423, -0.032398492097854614, 0.04064466804265976, 0.027200663462281227, 0.0994231104850769, 0.019325759261846542, 0.05330704525113106, -0.007615990471094847, -0.029701873660087585, 0.020185548812150955, -0.023722417652606964, -0.04670228809118271, 0.09684374183416367, -0.050766754895448685, 0.03699055686593056, 0.020361416041851044, -0.08027321845293045, -0.005085468757897615, -0.0012615968007594347, 0.05995088815689087, -0.07136265933513641, 0.025109807029366493, -0.050024207681417465, -0.013678494840860367, 0.032691601663827896, 0.0069613768719136715, 0.023898283019661903, -0.04189527407288551, -0.01295548863708973, -0.025715569034218788, -0.04150446131825447, 0.021182125434279442, -0.005036617163568735, -0.022960329428315163, -0.008832399733364582, 0.06550044566392899, -0.0236833356320858, 0.0178699754178524, 0.010776699520647526, 0.024210935458540916, -0.044513728469610214, -0.009648223407566547, 0.0061113559640944, 0.04756207764148712, 0.035935357213020325, 0.005109894555062056, 0.05147022008895874, 0.021103963255882263, -0.0010722962906584144, -0.08128933608531952, 0.023527011275291443, -0.03730320930480957, -0.026223627850413322, -0.03011222928762436, 0.05119664967060089, -0.05233001336455345, -0.10434737056493759, -0.020302793011069298, -0.01696133241057396, -0.013805508613586426, 0.07370754331350327, -0.04412291571497917, 0.0036443418357521296, -0.029486926272511482, -0.023663794621825218, -0.06467973440885544, 0.03804575651884079, -0.04904717206954956, 0.01930621825158596, 0.09238845854997635, 0.07613059133291245, 0.030561665073037148, 0.017019955441355705, 0.11388323456048965, 0.05330704525113106, 0.013023881241679192, 0.025129348039627075, -0.05913017690181732, -0.0320858396589756, -0.08175831288099289, -0.021748805418610573, 0.0029653022065758705, -0.0008866595453582704, -0.019521165639162064, -0.011861208826303482, -0.01856367103755474, -0.018700456246733665, -0.039863042533397675, 0.03456750884652138, -0.030249012634158134, 0.0059159486554563046, 0.04576433449983597, 0.020029224455356598, -0.0031387258786708117, 0.0028187469579279423, 0.018807929009199142, -0.002896909834817052, 0.021299369633197784, -0.03964809328317642, -0.10020474344491959, 0.0033170348033308983, 0.05174379050731659, 0.036580201238393784, 0.016795236617326736, -0.031929515302181244, 0.021279828622937202, 0.011724423617124557, 0.04123089089989662, -0.035837654024362564, -0.03833886608481407, 0.01807515323162079, -0.012076156213879585, -0.015583713538944721, -0.015124506317079067, 0.033336445689201355, -0.005236909259110689, -0.016209015622735023, 0.004416199866682291, 0.014118160121142864, -0.02518797107040882, 0.004267201758921146, -0.03206630051136017, 0.033316902816295624, 0.0157986618578434, -0.03953084722161293, -0.0315386988222599, -0.036033064126968384, -0.11521200835704803, -0.008451355621218681, 0.0015168472891673446, -0.022354567423462868, 0.006853902712464333, 0.021279828622937202, 0.055339280515909195, 0.03978487849235535, 0.020771771669387817, -0.015212439931929111, 0.08754236251115799, -0.04271598532795906, 0.05643355846405029, -0.004973109811544418, -0.033062875270843506, 0.00928183551877737, 0.041738949716091156, 0.05807498097419739, -0.04334128648042679, 0.022139620035886765, 0.02227640524506569, -0.008280374109745026, 0.053463373333215714, -0.047991976141929626, 0.059247422963380814, -0.04400566965341568, -0.03364909812808037, -0.031655944883823395, 0.008754236623644829, -0.03562270849943161, -0.011870979331433773, 0.017000414431095123, -0.014645759016275406, 0.018358493223786354, -0.07882720977067947, -0.05354153364896774, 0.006980917416512966, -0.0234097670763731, 0.0045114606618881226, -0.011245676316320896, -0.019794736057519913, -0.006746429018676281, -0.02675122767686844, 0.02462128922343254, 0.0073717315681278706, 0.021690184250473976, -0.03075707145035267, 0.009540749713778496, 0.002470677951350808, 0.037068720906972885, -0.024074150249361992, -0.003888600505888462, 0.03978487849235535, 0.00399851705878973, -0.05064951255917549, -0.016062460839748383, -0.01930621825158596, 0.05416683852672577, 0.04459189251065254, -0.04263782128691673, 0.038456108421087265, -0.06675105541944504, -0.012300875037908554, -0.016550978645682335, -0.002833402482792735, -0.023722417652606964, 0.06284291297197342, -0.019052188843488693, 0.011558327823877335, 0.033707719296216965, 0.03187089040875435, 0.0014508974272757769, -0.004846095107495785, -0.03304333612322807, -0.01096233632415533, -0.004606721457093954, 0.008158245123922825, 0.029057029634714127, 0.010200249031186104, 0.022589055821299553, -0.01394229382276535, -0.01883724145591259, 0.020869474858045578, 0.01693202182650566, 0.009203672409057617, -0.009457701817154884, 0.009218328632414341, -0.013561250641942024, 0.003356116358190775, 0.023253440856933594, 0.03796759247779846, 0.052173685282468796, -0.07511447370052338, 0.013336531817913055, 0.02761101722717285, -0.023917824029922485, -0.03589627891778946, -0.03486061841249466, -0.004750834312289953, -0.00654613645747304, 0.020029224455356598, -0.004868078511208296, -0.0002369310677750036, -0.013316991738975048, 0.011489935219287872, -0.023663794621825218, 0.002052995376288891, -0.028978867456316948, 0.036326173692941666, 0.02079131081700325, -0.08590094745159149, -0.013082503341138363, 0.015007262118160725, 0.03654111921787262, -0.019491855055093765, 0.08824583142995834, -0.02516843006014824, -0.07413744181394577, 0.026516739279031754, 0.03228124603629112, -0.02432817965745926, -0.000018672442820388824, -0.018329182639718056, -0.011157743632793427, -0.05018053576350212, 0.012408348731696606, 0.032300788909196854, 0.020302793011069298, -0.0024780058301985264, -0.0013910540146753192, -0.020302793011069298, 0.045373521745204926, 0.02546153962612152, 0.01169511303305626, -0.004015615209937096, -0.053854186087846756, 0.041621703654527664, 0.024973023682832718, 0.022237323224544525, -0.03355139121413231, -0.02890070527791977, -0.007791856769472361, 0.08074219524860382, 0.008426929824054241, 0.02014646865427494, 0.014401501044631004, -0.02415231242775917, 0.017811354249715805, -0.028861623257398605, 0.0037102915812283754, 0.023937365040183067, -0.05037594214081764, 0.018426885828375816, -0.010473818518221378, -0.04189527407288551, 0.004193923901766539, 0.09215397387742996, -0.03554454445838928, 0.04896901175379753, -0.0011754955630749464, -0.002596471458673477, 0.03513418883085251, 0.005388349760323763, 0.009843630716204643, 0.02012692764401436, 0.046467799693346024, 0.026927093043923378, 0.012848014011979103, -0.0648360624909401, 0.001262818113900721, 0.011870979331433773, 0.02108442224562168, 0.0815238282084465, 0.049750637263059616, -0.009242754429578781, 0.013356072828173637, -0.02313619665801525, -0.02694663405418396, -0.022120079025626183, -0.007254487369209528, -0.006936950609087944, -0.0001473949378123507, 0.01473369263112545, -0.008158245123922825, -0.0034464921336621046, -0.016062460839748383, 0.020302793011069298, -0.04697585850954056, -0.005036617163568735, -0.010825551114976406, -0.0011113777291029692, 0.03157778084278107, 0.0436539389193058, -0.022999411448836327, 0.01599406823515892, -0.03169502690434456, -0.007611105218529701, -0.00483876746147871, -0.0900435745716095, 0.02917427383363247, -0.01631649024784565, -0.0023998429533094168, -0.03187089040875435, 0.014225633814930916, 0.06593034416437149, 0.047405753284692764, -0.07273051142692566, 0.029057029634714127, 0.015661876648664474, -0.04111364483833313, -0.01053244061768055, -0.005114779807627201, -0.0003492901159916073, -0.020576363429427147, -0.04361485689878464, 0.004723965656012297, 0.04959431290626526, -0.011089351028203964, -0.000015247093870129902, 0.014870477840304375, 0.023370685055851936, -0.06440617144107819, 0.046858612447977066, -0.022686760872602463, 0.03775264322757721, -0.02108442224562168, -0.025383377447724342, 0.03478245809674263, 0.003253527684137225, 0.03898371011018753, -0.010757158510386944, 0.0006869779317639768, 0.015368765220046043, -0.03441118448972702, 0.01767456904053688, 0.012232482433319092, 0.02227640524506569, -0.007322879508137703, 0.021025799214839935, 0.009189017117023468, 0.0410354845225811, 0.021045340225100517, 0.01930621825158596, -0.02145569585263729, 0.026927093043923378, 0.048734523355960846, 0.03478245809674263, 0.010053693316876888, -0.017293525859713554, -0.0037371600046753883, 0.02749377302825451, -0.03198813647031784, 0.09402988106012344, 0.014088849537074566, -0.014450352638959885, -0.03728366643190384, -0.028509890660643578, 0.02815815806388855, -0.033531852066516876, -0.012242252938449383, 0.014802085235714912, -0.012183630838990211, -0.019931521266698837, 0.049359824508428574, -0.0294673852622509, 0.05643355846405029, -0.03486061841249466, -0.035466380417346954, -0.042286086827516556, 0.0268489308655262, 0.03394220769405365, 0.021768346428871155, 0.019296446815133095, -0.03853427246212959, 0.11067856103181839, -0.05295531451702118, 0.04959431290626526, 0.060263536870479584, 0.03665836527943611, 0.04259873926639557, 0.031030641868710518, -0.08324340730905533, -0.0024364818818867207, -0.008099623024463654, 0.014743463136255741, -0.0003688308352138847, -0.00927206501364708, 0.046194229274988174, -0.03495832532644272, 0.013678494840860367, 0.00019723900186363608, 0.025109807029366493 ]
42,961
linearmodels.system.model
_j_statistic
J stat and test Parameters ---------- params : ndarray Estimated model parameters weight_mat : ndarray Weighting matrix used in estimation of the parameters Returns ------- stat : WaldTestStatistic Test statistic Notes ----- Assumes that the efficient weighting matrix has been used. Using other weighting matrices will not produce the correct test.
def _j_statistic( self, params: Float64Array, weight_mat: Float64Array ) -> WaldTestStatistic: """ J stat and test Parameters ---------- params : ndarray Estimated model parameters weight_mat : ndarray Weighting matrix used in estimation of the parameters Returns ------- stat : WaldTestStatistic Test statistic Notes ----- Assumes that the efficient weighting matrix has been used. Using other weighting matrices will not produce the correct test. """ y, x, z = self._wy, self._wx, self._wz k = len(x) ze_lst = [] idx = 0 for i in range(k): kx = x[i].shape[1] beta = params[idx : idx + kx] eps = y[i] - x[i] @ beta ze_lst.append(z[i] * eps) idx += kx ze = np.concatenate(ze_lst, 1) g_bar = ze.mean(0) nobs = x[0].shape[0] stat = float(nobs * g_bar.T @ np.linalg.inv(weight_mat) @ g_bar.T) null = "Expected moment conditions are equal to 0" ninstr = sum(map(lambda a: a.shape[1], z)) nvar = sum(map(lambda a: a.shape[1], x)) ncons = 0 if self.constraints is None else self.constraints.r.shape[0] return WaldTestStatistic(stat, null, ninstr - (nvar - ncons))
(self, params: numpy.ndarray, weight_mat: numpy.ndarray) -> linearmodels.shared.hypotheses.WaldTestStatistic
[ 0.09516289085149765, -0.020389476791024208, 0.04463009908795357, 0.05110866203904152, 0.042254626750946045, -0.05863099545240402, -0.06061055511236191, 0.024510562419891357, -0.0014205599436536431, 0.0560755617916584, -0.03205088898539543, 0.039447247982025146, 0.009987784549593925, -0.02253100275993347, -0.05132461339235306, 0.04268652945756912, 0.008012722246348858, 0.01399189606308937, -0.0297114085406065, 0.040994904935359955, -0.05794714763760567, -0.06316598504781723, 0.050424814224243164, 0.11747793853282928, -0.0007142165559343994, -0.03597402200102806, 0.015791496261954308, -0.06752102077007294, 0.07723886519670486, -0.03869141638278961, -0.07637505978345871, -0.04283050075173378, -0.010977565310895443, -0.011643417179584503, 0.028991568833589554, -0.009726841934025288, 0.030269285663962364, 0.01402788795530796, -0.06878074258565903, -0.02253100275993347, 0.05773119255900383, -0.0335625559091568, 0.039555225521326065, -0.02256699465215206, -0.0010015902807936072, 0.012381253764033318, 0.02161320485174656, 0.04862521216273308, 0.0005871197790838778, -0.03624396026134491, 0.03516419976949692, -0.04056300222873688, 0.001961564878001809, -0.002892858348786831, -0.04128284379839897, 0.05258433520793915, 0.03905133903026581, 0.009141972288489342, 0.04117486625909805, -0.046465691179037094, 0.010509668849408627, -0.023340823128819466, 0.02402467094361782, 0.036729853600263596, -0.05262032896280289, -0.010266722179949284, -0.04416220262646675, 0.0030615709256380796, 0.03923129662871361, 0.0033899981062859297, 0.04657366871833801, 0.0056957365013659, 0.04182272404432297, 0.029189525172114372, -0.020461460575461388, 0.03937526419758797, -0.055643655359745026, -0.07637505978345871, -0.0339224748313427, -0.032716743648052216, 0.031223073601722717, 0.017285166308283806, -0.010554659180343151, -0.03775562345981598, 0.023772725835442543, -0.015782499685883522, -0.01729416288435459, 0.0051603554747998714, 0.00836364459246397, -0.0134970061480999, -0.035398148000240326, 0.02265697345137596, 0.05071274936199188, -0.0320688858628273, 0.0483732707798481, 0.04974096640944481, -0.011715400964021683, -0.010311712510883808, -0.031529005616903305, 0.019399696961045265, 0.013353037647902966, 0.0037724131252616644, 0.022477013990283012, 0.05251235142350197, -0.012984120287001133, -0.011229509487748146, -0.01681726984679699, -0.035650093108415604, -0.004532744642347097, -0.02690403163433075, -0.015845485031604767, 0.01603444293141365, -0.030053334310650826, -0.0532681830227375, 0.04196669161319733, 0.009065489284694195, 0.014549772255122662, 0.020443465560674667, -0.021055329591035843, 0.05078473314642906, 0.0511806458234787, 0.013047105632722378, -0.022369038313627243, 0.0031110600102692842, 0.04858922213315964, -0.04689759761095047, 0.0063615888357162476, -0.010608647018671036, 0.030053334310650826, -0.016952238976955414, -0.022153085097670555, -0.002935598837211728, -0.0018569630337879062, 0.01864386349916458, -0.00299408589489758, 0.020515449345111847, -0.06212221831083298, -0.034372374415397644, 0.04563787579536438, 0.0045732357539236546, 0.05323219299316406, 0.0030638203024864197, -0.039771176874637604, -0.014945684932172298, 0.010392694734036922, -0.030503233894705772, 0.030395258218050003, 0.036837827414274216, 0.017087209969758987, 0.007792271673679352, -0.01805899478495121, -0.03183493763208389, -0.01543157733976841, -0.08558901399374008, -0.009825820103287697, -0.053052231669425964, 0.04657366871833801, 0.004746447317302227, 0.027587881311774254, -0.019201740622520447, -0.007679796312004328, -0.05485183373093605, -0.04585382714867592, 0.03609999269247055, -0.0022191328462213278, 0.07104823738336563, -0.03397646173834801, 0.07435950636863708, -0.05992670729756355, -0.042290620505809784, -0.016700295731425285, -0.011175520718097687, -0.025716295465826988, -0.006555045954883099, 0.007099425420165062, 0.05524774640798569, -0.005875696428120136, -0.0038129042368382215, 0.02416863851249218, -0.04704156517982483, 0.0027376427315175533, 0.0040558502078056335, -0.05992670729756355, -0.03901534527540207, -0.010842595249414444, 0.021703185513615608, 0.03449834883213043, -0.016322379931807518, -0.02528439089655876, 0.02154122106730938, -0.008885528892278671, -0.017465125769376755, 0.015692519024014473, 0.02017352543771267, 0.007594315335154533, 0.048877157270908356, 0.06129440292716026, 0.012399249710142612, 0.002548684598878026, 0.03613598272204399, -0.006037660874426365, -0.06410177797079086, 0.006546047981828451, 0.01194035168737173, 0.03440836817026138, -0.006195125635713339, -0.016259392723441124, -0.016592320054769516, 0.0113914730027318, -0.04797735810279846, -0.025770284235477448, -0.013029109686613083, -0.036711856722831726, 0.0312950573861599, 0.031367041170597076, -0.03572207689285278, 0.03196091204881668, 0.017258170992136, 0.01867985725402832, -0.038223519921302795, -0.028829604387283325, -0.03345457836985588, 0.00664502615109086, 0.015755504369735718, 0.00671251118183136, -0.004962399136275053, 0.06705312430858612, 0.03858344256877899, -0.04279450699687004, -0.01346101425588131, 0.00937592051923275, -0.03453433886170387, 0.10171344131231308, -0.05621952936053276, -0.043298397213220596, -0.0348762646317482, -0.07457545399665833, 0.015251616947352886, -0.010554659180343151, -0.007756279315799475, -0.01616041548550129, -0.04070696979761124, 0.0187518410384655, 0.023520782589912415, 0.000494609063025564, -0.07486339658498764, 0.04808533191680908, -0.003731922246515751, 0.0037724131252616644, -0.02022751234471798, -0.03779161721467972, 0.013721955940127373, 0.016079433262348175, -0.023268839344382286, -0.02692202851176262, -0.003239281475543976, 0.0894041657447815, 0.03484027087688446, 0.013685964047908783, -0.05359211191534996, -0.008377141319215298, -0.03313064947724342, 0.01864386349916458, 0.007423353381454945, -0.0643177330493927, 0.028559664264321327, 0.0294414684176445, 0.04290248453617096, -0.0031852934043854475, 0.03879939392209053, 0.007022941950708628, -0.005799213424324989, -0.05611155182123184, -0.04189470782876015, -0.03215886652469635, 0.021883144974708557, 0.02532038278877735, -0.035470131784677505, -0.007265888154506683, 0.013550993986427784, -0.038367487490177155, -0.06266210228204727, 0.006289605051279068, 0.05366409569978714, -0.06064654886722565, 0.024510562419891357, -0.0068429820239543915, -0.0167812779545784, 0.02002955786883831, -0.0060286629013717175, -0.011679409071803093, -0.02535637468099594, 0.034372374415397644, -0.0016522584483027458, -0.007490838412195444, -0.04858922213315964, -0.00573172839358449, -0.0017411138396710157, 0.07061633467674255, 0.012435241602361202, 0.0014801716897636652, -0.01339802797883749, 0.029981348663568497, -0.02958543784916401, -0.05603956803679466, 0.003923129756003618, -0.010428686626255512, -0.048913151025772095, 0.0017602345906198025, 0.00993379671126604, -0.0017219929723069072, 0.0200655497610569, -0.0014576766407117248, 0.0032617764081805944, -0.014900694601237774, -0.05193648114800453, -0.04840926080942154, -0.029855377972126007, 0.05866698548197746, 0.08782052248716354, 0.05337616056203842, 0.0049713971093297005, 0.06734105944633484, 0.0010184615384787321, -0.04437815770506859, -0.04149879515171051, 0.04056300222873688, 0.03473229706287384, 0.003702678717672825, -0.02008354477584362, -0.019363705068826675, -0.044954027980566025, 0.05503179132938385, -0.010221732780337334, -0.011895361356437206, 0.05226040631532669, 0.026562107726931572, -0.05474385619163513, -0.005979173816740513, 0.008165688253939152, 0.023682747036218643, -0.058235082775354385, -0.04682561382651329, 0.03244680166244507, 0.015755504369735718, -0.04034705087542534, 0.031636983156204224, -0.0030390757601708174, 0.023862706497311592, 0.013928910717368126, 0.00041925074765458703, 0.055643655359745026, 0.03753967210650444, 0.026364151388406754, -0.006258111912757158, 0.03253678232431412, -0.021847153082489967, -0.019525669515132904, 0.023322826251387596, 0.03901534527540207, -0.07882251590490341, 0.04117486625909805, -0.02422262728214264, -0.01398289855569601, 0.038079552352428436, -0.046105772256851196, 0.07130018621683121, -0.02433060295879841, 0.023214850574731827, -0.06305801123380661, 0.009654858149588108, -0.05884694680571556, -0.05128862336277962, 0.034336384385824203, -0.010059768334031105, 0.03717975318431854, -0.03377850726246834, -0.008611089549958706, 0.020713405683636665, -0.058199089020490646, -0.008543604984879494, -0.039447247982025146, -0.015827490016818047, 0.010356702841818333, -0.024942466989159584, -0.018400918692350388, -0.014486786909401417, -0.004233560990542173, -0.06446170061826706, -0.024708518758416176, -0.015665525570511818, -0.03651390224695206, -0.006307600997388363, 0.038259513676166534, -0.011076542548835278, 0.07101225107908249, 0.06507356464862823, -0.0010971941519528627, -0.07169609516859055, 0.06212221831083298, -0.027569884434342384, -0.08162989467382431, -0.042290620505809784, 0.035056222230196, -0.07551124691963196, -0.03512820601463318, -0.036837827414274216, 0.0532681830227375, -0.04380228370428085, 0.04027506709098816, -0.03915931284427643, 0.011841373518109322, -0.03746768832206726, 0.010212734341621399, -0.050352830439805984, 0.03915931284427643, -0.00668101804330945, -0.007072431035339832, 0.03185293450951576, 0.0322488471865654, 0.046105772256851196, -0.04283050075173378, 0.09033995866775513, 0.026418140158057213, 0.0008216302376240492, -0.01882382482290268, -0.03789959475398064, -0.060898490250110626, -0.060862500220537186, 0.014252838678658009, -0.00831865519285202, 0.008759557269513607, -0.027443911880254745, -0.026040224358439445, 0.007549325469881296, -0.008273664861917496, -0.02566230669617653, 0.0006720384117215872, 0.01805899478495121, 0.006744003854691982, -0.005830706562846899, 0.06410177797079086, 0.0017579850973561406, 0.029027560725808144, -0.06608134508132935, 0.003729672636836767, 0.04945303127169609, -0.042146649211645126, -0.07515133172273636, -0.011526443064212799, 0.047581445425748825, 0.01867985725402832, 0.0662253126502037, -0.031187081709504128, -0.02965742163360119, -0.01889580860733986, 0.027857821434736252, -0.0425785556435585, 0.01481971237808466, 0.011598426848649979, 0.026058219373226166, -0.02296290546655655, -0.03735971450805664, -0.013811936601996422, -0.07565521448850632, -0.0030908144544810057, 0.02424062229692936, -0.01999356411397457, 0.014945684932172298, 0.05913488194346428, 0.02020951732993126, 0.04250657185912132, -0.02132526971399784, -0.01900378428399563, -0.008084706962108612, 0.01869785226881504, -0.08299759030342102, 0.003270774381235242, 0.05002890154719353, 0.014288830570876598, -0.07738283276557922, 0.005938682705163956, 0.0363699309527874, 0.028793612495064735, 0.013524000532925129, -0.0310251172631979, 0.0036239461041986942, -0.05877496302127838, 0.0729198232293129, -0.05884694680571556, -0.027623873203992844, 0.048697199672460556, 0.09228353202342987, 0.05197247117757797, -0.03197890520095825, 0.04009510576725006, 0.01214730553328991, 0.008395138196647167, 0.023412806913256645, 0.024384591728448868, 0.05236838385462761, 0.008593093603849411, -0.047797396779060364, -0.03887137770652771, -0.01398289855569601, -0.0799022763967514, 0.03197890520095825, -0.035542115569114685, -0.02148723416030407, 0.012750172056257725, -0.02161320485174656, 0.035380151122808456, -0.0459258109331131, 0.013515002094209194, -0.015224622562527657, -0.04822930321097374, -0.011436463333666325, 0.011895361356437206, 0.04416220262646675, -0.015422578901052475, 0.03383249416947365, -0.010122754611074924, 0.006815988104790449, 0.0039973631501197815, 0.020443465560674667, 0.038187529891729355, -0.02031749300658703, 0.007225397042930126, 0.043622322380542755, 0.08112600445747375, -0.03363453969359398, -0.034372374415397644, -0.046285733580589294, 0.036729853600263596, 0.003477728459984064, -0.03854744881391525, 0.04790537431836128, -0.04272252321243286, -0.043514348566532135, 0.00466996431350708, 0.0060871499590575695, -0.034066442400217056, 0.038403481245040894, -0.06316598504781723, 0.022243065759539604, 0.0841493308544159, -0.029729405418038368, 0.03250079229474068, -0.0324288047850132, -0.043406371027231216, 0.016916247084736824, 0.0032280338928103447, -0.04171474650502205, 0.0742875188589096, 0.025194412097334862, 0.006262610666453838, -0.017186187207698822, -0.02418663538992405, 0.03367052972316742, 0.020749397575855255, 0.006411077920347452, -0.022351041436195374, 0.017195185646414757, 0.02289092168211937, -0.02550034411251545, 0.02415064349770546, 0.08407735079526901, 0.013218067586421967, -0.05794714763760567, 0.038295503705739975, -0.010644638910889626, 0.029981348663568497, -0.0007097175694070756, -0.011193516664206982, -0.005209844559431076, -0.04383827745914459, 0.03869141638278961, 0.026022227481007576, 0.0052773295901715755, 0.010230730287730694, -0.0012540968600660563, -0.02676006406545639, 0.017024222761392593, 0.024906475096940994, 0.010896583087742329, 0.021091321483254433, -0.04470208287239075, 0.007828263565897942, -0.016187408939003944, -0.0031515508890151978, -0.02559032291173935, 0.02157721295952797, -0.009690850041806698, -0.031367041170597076, 0.0016140169464051723, 0.01858987659215927, -0.046105772256851196, 0.004885916132479906, 0.06770098209381104, 0.026382148265838623, -0.007648303639143705, -0.05755123496055603, -0.016133422031998634, 0.0035452134907245636, 0.00017433632456231862, -0.010887584649026394, -0.011805381625890732, 0.022513005882501602, 0.012336263433098793, -0.002964842366054654, 0.015557548962533474, -0.040958914905786514, 0.02530238777399063, 0.010554659180343151, -0.0026296665892004967, -0.002307988004758954, -0.010293716564774513, 0.03340059146285057, 0.0778147354722023, 0.001966063864529133, -0.010581652633845806, 0.05258433520793915, 0.039411257952451706, 0.03059321455657482, 0.017753062769770622, -0.03584804758429527, 0.02418663538992405, -0.05848702788352966, 0.039411257952451706, -0.03660387918353081, -0.011877365410327911, 0.01745612733066082, 0.05459988862276077, -0.027173971757292747, -0.016592320054769516, -0.04297446832060814, 0.015719512477517128, -0.062230195850133896, -0.0030323273967951536, 0.06194226071238518, 0.012003337033092976, 0.008557101711630821, 0.05251235142350197, 0.031529005616903305, -0.0185718797147274, 0.031241070479154587, 0.01346101425588131, 0.0141538605093956, 0.006474063731729984, 0.017636088654398918, -0.013344040140509605, 0.022584989666938782, -0.028865596279501915, 0.009519888088107109, 0.034246403723955154, -0.0133620360866189, -0.025212407112121582, 0.026328159496188164, 0.01346101425588131, 0.009114977903664112, -0.02136126160621643, 0.006528052035719156, -0.0035834552254527807, -0.016466347500681877, 0.02697601541876793, -0.006946458946913481, 0.010293716564774513, -0.005655245389789343, 0.007931740954518318, -0.03743169829249382, 0.008017221465706825, 0.03883538395166397, 0.02828972414135933, -0.04063498601317406, -0.020659416913986206, 0.006478562951087952, 0.016466347500681877, 0.04448613151907921, 0.014900694601237774, -0.024492567405104637, 0.11409468948841095, 0.031690970063209534, 0.011481452733278275, 0.001827719621360302, 0.05531973019242287, -0.025104431435465813, -0.03187093138694763, -0.019453683868050575, -0.015215625055134296, -0.026094211265444756, -0.09523487836122513, -0.02945946529507637, 0.03793558478355408, 0.02555433101952076, 0.042470578104257584, -0.032932695001363754, -0.015584543347358704, 0.07295581698417664, 0.013317045755684376, -0.04196669161319733, -0.011535441502928734, -0.008962011896073818, -0.03079116903245449, 0.024996455758810043, 0.05877496302127838, 0.02564431168138981, -0.001526286476291716, 0.003000834258273244, 0.05812710523605347, -0.08882829546928406, -0.00901150144636631, 0.023484790697693825, 0.022243065759539604, -0.048913151025772095, 0.03350856527686119, 0.08710067719221115, -0.016520336270332336, -0.02145124226808548, 0.005754223559051752, 0.03377850726246834, 0.0009521013125777245, 0.017060216516256332, 0.005821708589792252, 0.009582874365150928, -0.040670979768037796, -0.013793940655887127, 0.006892471108585596, -0.03399445861577988, 0.009852814488112926, 0.006860977970063686, -0.04427018016576767, -0.007126419339329004, -0.011121532879769802, 0.014423800632357597, -0.02024550922214985, -0.004809433128684759, -0.0005328505649231374, -0.019885588437318802, 0.02933349274098873, 0.1044488325715065, -0.02283693477511406, 0.06316598504781723, -0.03930328041315079, -0.024600543081760406, 0.00901150144636631, 0.039555225521326065, -0.003563209669664502, -0.004454012028872967, 0.021883144974708557, -0.075007364153862, 0.070112444460392, -0.07076030224561691, -0.008633584715425968, -0.003644191659986973, 0.07939838618040085, 0.01676328107714653, 0.019201740622520447, -0.052872270345687866, -0.0339224748313427, -0.03651390224695206, -0.0332026332616806, -0.014216846786439419, 0.008867532946169376, 0.05341215059161186, -0.09437106549739838, 0.04416220262646675, -0.002877111779525876, 0.031259067356586456 ]
42,968
linearmodels.system.model
fit
Estimate model parameters Parameters ---------- iter_limit : int Maximum number of iterations for iterative GLS tol : float Tolerance to use when checking for convergence in iterative GLS initial_weight : ndarray Initial weighting matrix to use in the first step. If not specified, uses the average outer-product of the set containing the exogenous variables and instruments. cov_type : str Name of covariance estimator. Valid options are * "unadjusted", "homoskedastic" - Classic covariance estimator * "robust", "heteroskedastic" - Heteroskedasticity robust covariance estimator **cov_config Additional parameters to pass to covariance estimator. All estimators support debiased which employs a small-sample adjustment Returns ------- GMMSystemResults Estimation results
def fit( self, *, iter_limit: int = 2, tol: float = 1e-6, initial_weight: Float64Array | None = None, cov_type: str = "robust", **cov_config: bool | float, ) -> GMMSystemResults: """ Estimate model parameters Parameters ---------- iter_limit : int Maximum number of iterations for iterative GLS tol : float Tolerance to use when checking for convergence in iterative GLS initial_weight : ndarray Initial weighting matrix to use in the first step. If not specified, uses the average outer-product of the set containing the exogenous variables and instruments. cov_type : str Name of covariance estimator. Valid options are * "unadjusted", "homoskedastic" - Classic covariance estimator * "robust", "heteroskedastic" - Heteroskedasticity robust covariance estimator **cov_config Additional parameters to pass to covariance estimator. All estimators support debiased which employs a small-sample adjustment Returns ------- GMMSystemResults Estimation results """ if cov_type not in COV_TYPES: raise ValueError(f"Unknown cov_type: {cov_type}") # Parameter estimation wx, wy, wz = self._wx, self._wy, self._wz k = len(wx) nobs = wx[0].shape[0] k_total = sum(map(lambda a: a.shape[1], wz)) if initial_weight is None: w = blocked_inner_prod(wz, np.eye(k_total)) / nobs else: w = initial_weight assert w is not None beta_last = beta = self._blocked_gmm( wx, wy, wz, w=cast(Float64Array, w), constraints=self.constraints ) _eps = [] loc = 0 for i in range(k): nb = wx[i].shape[1] b = beta[loc : loc + nb] _eps.append(wy[i] - wx[i] @ b) loc += nb eps = np.hstack(_eps) sigma = self._weight_est.sigma(eps, wx) if self._sigma is None else self._sigma vinv = None iters = 1 norm = 10 * tol + 1 while iters < iter_limit and norm > tol: sigma = ( self._weight_est.sigma(eps, wx) if self._sigma is None else self._sigma ) w = self._weight_est.weight_matrix(wx, wz, eps, sigma=sigma) beta = self._blocked_gmm( wx, wy, wz, w=cast(Float64Array, w), constraints=self.constraints ) delta = beta_last - beta if vinv is None: winv = np.linalg.inv(w) xpz = blocked_cross_prod(wx, wz, np.eye(k)) xpz = cast(Float64Array, xpz / nobs) v = (xpz @ winv @ xpz.T) / nobs vinv = inv(v) norm = float(np.squeeze(delta.T @ vinv @ delta)) beta_last = beta _eps = [] loc = 0 for i in range(k): nb = wx[i].shape[1] b = beta[loc : loc + nb] _eps.append(wy[i] - wx[i] @ b) loc += nb eps = np.hstack(_eps) iters += 1 cov_type = COV_TYPES[cov_type] cov_est = GMM_COV_EST[cov_type] cov = cov_est( wx, wz, eps, w, sigma=sigma, constraints=self._constraints, **cov_config ) weps = eps _eps = [] loc = 0 x, y = self._x, self._y for i in range(k): nb = x[i].shape[1] b = beta[loc : loc + nb] _eps.append(y[i] - x[i] @ b) loc += nb eps = np.hstack(_eps) iters += 1 return self._finalize_results( beta, cov.cov, weps, eps, cast(np.ndarray, w), sigma, iters - 1, cov_type, cov_config, cov, )
(self, *, iter_limit: int = 2, tol: float = 1e-06, initial_weight: Optional[numpy.ndarray] = None, cov_type: str = 'robust', **cov_config: bool | float) -> linearmodels.system.results.GMMSystemResults
[ 0.07451231777667999, -0.037774182856082916, -0.040861595422029495, 0.0046570198610424995, -0.020244309678673744, -0.031122775748372078, -0.06253564357757568, -0.08661331981420517, 0.031143497675657272, 0.023891186341643333, -0.059800487011671066, -0.04247782379388809, 0.007210869342088699, 0.03800211101770401, -0.06829605251550674, 0.09904585033655167, -0.014297413639724255, -0.038623739033937454, 0.0077185314148664474, 0.012836591340601444, -0.06096085533499718, -0.04960580915212631, -0.02065872587263584, 0.07318618148565292, 0.011665861122310162, 0.0031806565821170807, -0.014079844579100609, 0.00578630855306983, 0.025652460753917694, -0.04264359176158905, -0.04774092882871628, -0.03255251795053482, 0.039183203130960464, -0.03447955846786499, 0.0460418164730072, -0.04881841689348221, 0.05718965455889702, -0.02490650862455368, -0.06021490320563316, -0.039846271276474, 0.03856157511472702, -0.03371288627386093, 0.06721856445074081, 0.008547366596758366, 0.006755009759217501, 0.015561387874186039, -0.0005306490347720683, 0.08412680774927139, -0.010375984944403172, 0.01876276545226574, -0.008568087592720985, -0.02658490091562271, 0.012846951372921467, -0.045710280537605286, -0.012732986360788345, 0.0012037542182952166, 0.013043800368905067, -0.01575823687016964, 0.08391959965229034, -0.055117566138505936, 0.03358856216073036, -0.06083653122186661, 0.013551461510360241, 0.0020707938820123672, -0.03340207412838936, -0.031930889934301376, -0.027662387117743492, -0.015312736853957176, 0.04239493981003761, 0.07231590151786804, 0.0448400042951107, 0.003082232316955924, -0.005791488569229841, 0.03628227859735489, -0.0170118510723114, 0.006972579285502434, -0.03723543882369995, -0.03775345906615257, -0.05785272270441055, -0.040467895567417145, 0.05482747405767441, 0.07268887758255005, -0.031454309821128845, -0.07724747806787491, -0.01137576811015606, -0.0009913650574162602, -0.03139214590191841, -0.02898852527141571, 0.04890130087733269, -0.026481296867132187, -0.01641094498336315, 0.04347242787480354, 0.09075749665498734, 0.032573238015174866, 0.05416440591216087, 0.01984025165438652, -0.01047958992421627, -0.0448400042951107, 0.0077806939370930195, 0.00017256615683436394, -0.014660029672086239, 0.0476580448448658, 0.041503939777612686, 0.033091261982917786, -0.015861840918660164, -0.0155199458822608, -0.003491469891741872, -0.035743534564971924, 0.03704895079135895, -0.05536621809005737, -0.03961833938956261, 0.008682052604854107, 0.012038837186992168, -0.02413983643054962, -0.034666046500205994, 0.024492090567946434, -0.04861120507121086, 0.0418354757130146, -0.010142875835299492, 0.04301656782627106, -0.013510019518435001, -0.013623984530568123, -0.022337118163704872, -0.0003988771350122988, 0.022088468074798584, -0.033174142241477966, 0.03423091024160385, -0.003424126887694001, 0.050558969378471375, -0.044632796198129654, -0.015188411809504032, -0.03358856216073036, -0.017623117193579674, -0.03619939461350441, 0.030666915699839592, 0.001166197587735951, -0.05072473734617233, -0.0460418164730072, -0.02215063013136387, 0.008925522677600384, 0.06837893277406693, 0.05134636536240578, -0.0280353631824255, 0.017457349225878716, -0.01997493766248226, 0.020492959767580032, 0.05453738197684288, -0.049149949103593826, 0.005879552569240332, -0.01850375346839428, -0.016856443136930466, -0.02009926363825798, -0.0022210204042494297, -0.015457783825695515, -0.038022831082344055, -0.03159935772418976, -0.008537006564438343, 0.019923135638237, -0.004641479346901178, -0.001959419110789895, -0.07438798993825912, -0.0018648800905793905, -0.018089337274432182, 0.054040078073740005, 0.003260950092226267, 0.03839580714702606, -0.0636545717716217, 0.046870652586221695, -0.04861120507121086, -0.0026600442361086607, 0.010629815980792046, -0.034852534532547, -0.004708822350949049, -0.043389543890953064, -0.011987034231424332, 0.07480241358280182, 0.00777033343911171, -0.005952075589448214, 0.009883863851428032, -0.0018687652191147208, 0.04276791587471962, -0.014722191728651524, -0.018783485516905785, -0.043099451810121536, -0.046746328473091125, 0.016928967088460922, 0.012732986360788345, 0.001943878480233252, -0.0022689374163746834, -0.01867988146841526, -0.01940511353313923, -0.03298765420913696, 0.061126623302698135, 0.009137912653386593, -0.02271009422838688, 0.032573238015174866, 0.08462411165237427, 0.06423475593328476, 0.003434487385675311, 0.02627408690750599, -0.001985320122912526, -0.020296111702919006, 0.006091941613703966, -0.06974651664495468, -0.006558161694556475, -0.00026192498626187444, -0.0302317775785923, -0.04117240756750107, 0.011448291130363941, 0.04065438359975815, -0.03868589922785759, 0.009365841746330261, 0.00882709864526987, 0.019643403589725494, 0.046870652586221695, -0.00017434686014894396, 0.048072464764118195, 0.007024381309747696, 0.022834420204162598, -0.01790284924209118, 0.012805509380996227, -0.0592617429792881, -0.021031701937317848, -0.01850375346839428, 0.026419134810566902, -0.03014889359474182, 0.035101186484098434, 0.016214096918702126, 0.007034741807729006, -0.009619672782719135, 0.06067076325416565, -0.046870652586221695, 0.06547801196575165, -0.03912103921175003, -0.0716942772269249, -0.037339042872190475, -0.04053005948662758, 0.048155348747968674, -0.03951473534107208, -0.00989940483123064, 0.0012594416039064527, -0.035784974694252014, -0.039659783244132996, 0.058847326785326004, -0.03447955846786499, 0.006470097694545984, 0.06514647603034973, 0.032013773918151855, 0.026087600737810135, 0.037339042872190475, -0.020751969888806343, 0.0018053074600175023, -0.05594640225172043, 0.006687667220830917, -0.04187691584229469, -0.034500282257795334, 0.02271009422838688, 0.01191451121121645, 0.049191392958164215, -0.019788449630141258, 0.0003373619692865759, 0.0019814351107925177, -0.051636457443237305, 0.05379142984747887, -0.043099451810121536, 0.049149949103593826, 0.012442894279956818, 0.012919474393129349, -0.004677740857005119, 0.09108903259038925, 0.006066040601581335, 0.07215013355016708, -0.016162293031811714, 0.004628528840839863, -0.009396923705935478, 0.06551945209503174, -0.023953348398208618, -0.02438848651945591, -0.013644705526530743, 0.009438364766538143, 0.011562256142497063, -0.028325455263257027, -0.02559029869735241, 0.013126683421432972, -0.061209507286548615, 0.0021666279062628746, -0.03760841488838196, -0.02018214575946331, 0.04011564329266548, -0.001063888194039464, 0.014763633720576763, -0.030542591586709023, 0.058474350720644, -0.026688504964113235, 0.07977542281150818, -0.06464917212724686, 0.04023996740579605, -0.015768596902489662, 0.020378995686769485, 0.006319871172308922, 0.04753372073173523, -0.003991361241787672, 0.004664790350943804, 0.0074906013906002045, 0.05225808173418045, 0.01045886892825365, 0.021238911896944046, -0.07824207842350006, -0.006040139123797417, 0.004294404294341803, -0.06075364723801613, 0.02838761918246746, 0.03447955846786499, -0.0025396039709448814, 0.0014323315117508173, -0.054993242025375366, -0.0037375304382294416, -0.032013773918151855, 0.037339042872190475, 0.048031020909547806, 0.015354178845882416, 0.007169427815824747, 0.05843290686607361, -0.03392009437084198, -0.04757516086101532, 0.009003226645290852, 0.009158632718026638, 0.07339338958263397, -0.02064836584031582, -0.04256070777773857, -0.02726869098842144, 0.003724579932168126, 0.011686582118272781, 0.035184070467948914, -0.021321795880794525, 0.035702090710401535, 0.03400297835469246, 0.008961784653365612, 0.05474459007382393, -0.047989580780267715, 0.07119697332382202, -0.01359290350228548, -0.027765991166234016, 0.005141370464116335, -0.0484454408288002, -0.028366897255182266, 0.06162392348051071, 0.0011182804591953754, 0.0004992439062334597, 0.0604635551571846, -0.013758670538663864, 0.06348880380392075, 0.03653092682361603, 0.048196788877248764, -0.02554885670542717, 0.020410075783729553, -0.01768527925014496, -0.025942552834749222, 0.027724549174308777, 0.00018033648666460067, -0.0636545717716217, 0.08909982442855835, -0.035577766597270966, 0.0338372141122818, 0.009314039722084999, -0.027165086939930916, 0.012619021348655224, -0.02890564128756523, 0.023974068462848663, -0.038582295179367065, 0.019943855702877045, -0.04633190855383873, -0.0340237021446228, 0.025963274762034416, -0.014722191728651524, 0.021549725905060768, -0.06377889961004257, -0.022047026082873344, 0.017364105209708214, 0.02306235022842884, 0.02983808144927025, -0.0197159256786108, 0.011251443065702915, 0.0015993936685845256, 0.03331919014453888, -0.029361499473452568, 0.03735976293683052, -0.00824691355228424, 0.01802717335522175, -0.03949401527643204, 0.01790284924209118, -0.036012906581163406, 0.009065388701856136, 0.038748063147068024, -0.0040768347680568695, 0.02310379222035408, 0.05951039493083954, -0.0038230041973292828, -0.041068803519010544, 0.015872200950980186, -0.05093194544315338, 0.021487561985850334, -0.04508865624666214, 0.03870662301778793, -0.04129673168063164, -0.07389069348573685, -0.01575823687016964, 0.014742912724614143, -0.01949835754930973, 0.08785656839609146, -0.04195979982614517, 0.04019852727651596, -0.036655254662036896, -0.007335194852203131, -0.03083268366754055, 0.022295676171779633, -0.055117566138505936, -0.014380297623574734, 0.060877975076436996, 0.03628227859735489, 0.05238240957260132, -0.020503319799900055, 0.10725132375955582, 0.012826230376958847, 0.005972796585410833, 0.014059123583137989, -0.0380435548722744, -0.082096166908741, -0.05602928623557091, -0.04956436902284622, -0.0028154507745057344, -0.012370371259748936, -0.0019529438577592373, 0.011448291130363941, -0.03346423804759979, -0.0011791480937972665, -0.04616614058613777, 0.013282090425491333, -0.015913642942905426, 0.0005756522295996547, 0.013644705526530743, -0.010023729875683784, -0.033650726079940796, 0.004905670415610075, -0.04591749235987663, -0.00955751072615385, 0.009521248750388622, -0.034417398273944855, -0.11355047672986984, 0.018824927508831024, 0.04856976494193077, 0.02791103720664978, 0.015271295793354511, -0.028781315311789513, 0.017882127314805984, 0.004519743844866753, 0.00888926163315773, -0.01395551860332489, -0.007200509309768677, -0.0013870045077055693, 0.005224254447966814, 0.019052857533097267, 0.004281453788280487, -0.01519877277314663, -0.003882576711475849, 0.047077860683202744, 0.0500616692006588, 0.03302909806370735, 0.009516068734228611, 0.0076460083946585655, -0.012929835356771946, -0.0015022645238786936, -0.003986181225627661, -0.028284013271331787, -0.028967803344130516, -0.007765153422951698, -0.09108903259038925, 0.050558969378471375, 0.06821316480636597, -0.028884919360280037, 0.00568788405507803, 0.0046932813711464405, 0.048113904893398285, 0.040550779551267624, 0.007216049823909998, -0.013851914554834366, 0.0314335897564888, -0.015022644773125648, 0.023435326293110847, -0.00884781964123249, -0.04993734508752823, 0.03808499500155449, 0.04881841689348221, 0.06178969144821167, -0.025818228721618652, -0.002241741167381406, 0.02198486402630806, -0.015986166894435883, 0.07720603048801422, -0.056319378316402435, 0.07144562900066376, -0.0007899838965386152, -0.043555308133363724, -0.05002022534608841, -0.0382300429046154, -0.030086731538176537, -0.022855140268802643, -0.010417426936328411, -0.006625504232943058, -0.02426416240632534, -0.00037718494422733784, -0.013820833526551723, 0.006480458192527294, -0.011272164061665535, -0.005304547492414713, -0.019374031573534012, -0.019933495670557022, 0.03230386599898338, 0.01644202508032322, 0.0003022335877176374, 0.030003847554326057, -0.04001203924417496, -0.010044450871646404, -0.01828618533909321, 0.03972194343805313, 0.03147502988576889, -0.0007582550751976669, -0.032220982015132904, 0.04475712031126022, 0.04347242787480354, -0.03423091024160385, -0.006029778625816107, 0.011655500158667564, 0.05495179817080498, 0.015146969817578793, -0.0836709514260292, 0.03164079785346985, -0.06253564357757568, -0.04595893248915672, -0.023000188171863556, -0.031164217740297318, -0.014349215663969517, 0.05474459007382393, -0.004198570270091295, 0.02322811633348465, 0.034210190176963806, 0.012100999243557453, -0.009044668637216091, -0.061250947415828705, -0.02575606480240822, -0.0067394692450761795, -0.0060608601197600365, -0.022088468074798584, 0.0524652935564518, 0.02125963196158409, -0.02275153622031212, -0.005610181018710136, 0.0019024367211386561, 0.007801414933055639, 0.03302909806370735, -0.055241890251636505, 0.015302376821637154, 0.018524475395679474, -0.029444383457303047, 0.012422173283994198, 0.03404442220926285, 0.0033697346225380898, 0.02979663945734501, -0.018990695476531982, 0.022647932171821594, 0.02747589908540249, -0.02442992851138115, -0.03636516258120537, 0.011085676029324532, -0.026253366842865944, 0.049191392958164215, 0.0036365161649882793, 0.012235685251653194, -0.018959613516926765, -0.013820833526551723, 0.03980482742190361, -0.015126249752938747, 0.03657237067818642, -0.016265898942947388, 0.029962405562400818, 0.006107482127845287, -0.08818810433149338, -0.023642534390091896, -0.019260067492723465, 0.04504721239209175, -0.01708437316119671, 0.07521682977676392, -0.03947329521179199, -0.0680474042892456, 0.015281655825674534, 0.03414802625775337, -0.03338135406374931, -0.013002358376979828, -0.0028491222765296698, 0.001322251744568348, -0.004087195266038179, 0.0010748961940407753, 0.03367144614458084, 0.0684618204832077, -0.03764985501766205, 0.019374031573534012, -0.05225808173418045, 0.008941063657402992, 0.05731397867202759, 0.013510019518435001, -0.029175011441111565, -0.04898418113589287, -0.006330231670290232, 0.019384391605854034, -0.03711111471056938, -0.01213208120316267, -0.027890317142009735, 0.02413983643054962, 0.11902078986167908, 0.01307488139718771, 0.0368417426943779, -0.024056952446699142, 0.0003541976911947131, 0.015913642942905426, -0.008739035576581955, -0.021031701937317848, 0.022088468074798584, -0.06518791615962982, 0.004861638881266117, 0.02266865223646164, -0.005993517115712166, 0.01764383725821972, 0.06029778718948364, -0.005527297034859657, 0.02687499299645424, 0.012826230376958847, 0.019052857533097267, 0.00011291266127955168, -0.010671257972717285, 0.013779391534626484, 0.009179353713989258, 0.06216266751289368, 0.053915753960609436, 0.03099844977259636, -0.049108508974313736, 0.026087600737810135, 0.030293939635157585, 0.04137961566448212, 0.053915753960609436, 0.021031701937317848, 0.0067394692450761795, -0.040219247341156006, -0.032697562128305435, -0.03039754554629326, -0.024844346567988396, -0.030003847554326057, -0.0010127334389835596, 0.051595013588666916, 0.04028140753507614, -0.05801849067211151, -0.006262888666242361, 0.01249469630420208, 0.028864199295639992, -0.037380483001470566, -0.025092996656894684, 0.003781562438234687, 0.0023362801875919104, -0.02778671309351921, -0.012038837186992168, -0.0209177378565073, 0.0005050716572441161, -0.0031884268391877413, -0.05851579084992409, 0.0018519294681027532, -0.06344736367464066, -0.007096904795616865, -0.026833551004529, -0.03180656582117081, -0.04521298035979271, 0.016203735023736954, 0.116948701441288, 0.04293368384242058, -0.03709039092063904, 0.033775050193071365, 0.06759154051542282, -0.02275153622031212, -0.04069582745432854, -0.014162727631628513, 0.01700148917734623, 0.007076183799654245, -0.029983127489686012, -0.0008152375230565667, 0.030024569481611252, 0.011831628158688545, 0.0187213234603405, -0.030625473707914352, -0.021881259977817535, -0.043555308133363724, 0.019871333613991737, -0.022896582260727882, 0.028221851214766502, -0.005630901549011469, -0.03941113129258156, 0.030521869659423828, -0.010578013956546783, 0.004851278383284807, -0.010417426936328411, 0.018172219395637512, 0.020503319799900055, -0.03526695445179939, 0.010712699964642525, 0.010733420960605145, 0.007174607831984758, -0.055241890251636505, 0.054205846041440964, 0.03628227859735489, -0.014846517704427242, -0.010225758887827396, 0.0008469663443975151, 0.006418295670300722, 0.026564180850982666, 0.04372107610106468, -0.04351386800408363, -0.020544761791825294, -0.018607359379529953, -0.02530020661652088, 0.004159718751907349, -0.005480675492435694, 0.03764985501766205, 0.01155189611017704, 0.0390588752925396, -0.017933929339051247, -0.03709039092063904, 0.030335381627082825, 0.009598951786756516, -0.020109623670578003, -0.05457882210612297, 0.00022161638480611145, -0.025611018761992455, 0.062411319464445114, -0.041545383632183075, 0.06721856445074081, -0.06858614087104797, -0.02675066888332367, -0.06900056451559067, 0.04272647574543953, 0.018731683492660522, -0.013551461510360241, 0.06336448341608047, -0.02198486402630806, 0.057521190494298935, -0.0436381921172142, 0.04417693614959717, 0.03307053819298744, 0.050517529249191284, 0.030604753643274307, -0.02331100031733513, -0.06311582773923874, -0.032739005982875824, -0.02442992851138115, 0.0006591833080165088, -0.01417308859527111, 0.04301656782627106, 0.036738138645887375, -0.07202581316232681, 0.010044450871646404, 0.0272272489964962, 0.04239493981003761 ]
42,971
linearmodels.asset_pricing.model
LinearFactorModel
Linear factor model estimator Parameters ---------- portfolios : array_like Test portfolio returns (nobs by nportfolio) factors : array_like Priced factor returns (nobs by nfactor) risk_free : bool Flag indicating whether the risk-free rate should be estimated from returns along other risk premia. If False, the returns are assumed to be excess returns using the correct risk-free rate. sigma : array_like Positive definite residual covariance (nportfolio by nportfolio) Notes ----- Suitable for traded or non-traded factors. Implements a 2-step estimator of risk premia, factor loadings and model tests. The first stage model estimated is .. math:: r_{it} = c_i + f_t \beta_i + \epsilon_{it} where :math:`r_{it}` is the return on test portfolio i and :math:`f_t` are the traded factor returns. The parameters :math:`c_i` are required to allow non-traded to be tested, but are not economically interesting. These are not reported. The second stage model uses the estimated factor loadings from the first and is .. math:: \bar{r}_i = \lambda_0 + \hat{\beta}_i^\prime \lambda + \eta_i where :math:`\bar{r}_i` is the average excess return to portfolio i and :math:`\lambda_0` is only included if estimating the risk-free rate. GLS is used in the second stage if ``sigma`` is provided. The model is tested using the estimated values :math:`\hat{\alpha}_i=\hat{\eta}_i`.
class LinearFactorModel(_LinearFactorModelBase): r""" Linear factor model estimator Parameters ---------- portfolios : array_like Test portfolio returns (nobs by nportfolio) factors : array_like Priced factor returns (nobs by nfactor) risk_free : bool Flag indicating whether the risk-free rate should be estimated from returns along other risk premia. If False, the returns are assumed to be excess returns using the correct risk-free rate. sigma : array_like Positive definite residual covariance (nportfolio by nportfolio) Notes ----- Suitable for traded or non-traded factors. Implements a 2-step estimator of risk premia, factor loadings and model tests. The first stage model estimated is .. math:: r_{it} = c_i + f_t \beta_i + \epsilon_{it} where :math:`r_{it}` is the return on test portfolio i and :math:`f_t` are the traded factor returns. The parameters :math:`c_i` are required to allow non-traded to be tested, but are not economically interesting. These are not reported. The second stage model uses the estimated factor loadings from the first and is .. math:: \bar{r}_i = \lambda_0 + \hat{\beta}_i^\prime \lambda + \eta_i where :math:`\bar{r}_i` is the average excess return to portfolio i and :math:`\lambda_0` is only included if estimating the risk-free rate. GLS is used in the second stage if ``sigma`` is provided. The model is tested using the estimated values :math:`\hat{\alpha}_i=\hat{\eta}_i`. """ def __init__( self, portfolios: IVDataLike, factors: IVDataLike, *, risk_free: bool = False, sigma: ArrayLike | None = None, ) -> None: super().__init__(portfolios, factors, risk_free=risk_free, sigma=sigma) @classmethod def from_formula( cls, formula: str, data: DataFrame, *, portfolios: DataFrame | None = None, risk_free: bool = False, sigma: ArrayLike | None = None, ) -> LinearFactorModel: """ Parameters ---------- formula : str Formula modified for the syntax described in the notes data : DataFrame DataFrame containing the variables used in the formula portfolios : array_like Portfolios to be used in the model. If provided, must use formula syntax containing only factors. risk_free : bool Flag indicating whether the risk-free rate should be estimated from returns along other risk premia. If False, the returns are assumed to be excess returns using the correct risk-free rate. sigma : array_like Positive definite residual covariance (nportfolio by nportfolio) Returns ------- LinearFactorModel Model instance Notes ----- The formula can be used in one of two ways. The first specified only the factors and uses the data provided in ``portfolios`` as the test portfolios. The second specified the portfolio using ``+`` to separate the test portfolios and ``~`` to separate the test portfolios from the factors. Examples -------- >>> from linearmodels.datasets import french >>> from linearmodels.asset_pricing import LinearFactorModel >>> data = french.load() >>> formula = "S1M1 + S1M5 + S3M3 + S5M1 + S5M5 ~ MktRF + SMB + HML" >>> mod = LinearFactorModel.from_formula(formula, data) Using only factors >>> portfolios = data[["S1M1", "S1M5", "S3M1", "S3M5", "S5M1", "S5M5"]] >>> formula = "MktRF + SMB + HML" >>> mod = LinearFactorModel.from_formula(formula, data, portfolios=portfolios) """ factors, portfolios, formula = cls._prepare_data_from_formula( formula, data, portfolios ) mod = cls(portfolios, factors, risk_free=risk_free, sigma=sigma) mod.formula = formula return mod def fit( self, cov_type: str = "robust", debiased: bool = True, **cov_config: bool | int | str, ) -> LinearFactorModelResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator debiased : bool Flag indicating whether to debias the covariance estimator using a degree of freedom adjustment **cov_config Additional covariance-specific options. See Notes. Returns ------- LinearFactorModelResults Results class with parameter estimates, covariance and test statistics Notes ----- The kernel covariance estimator takes the optional arguments ``kernel``, one of "bartlett", "parzen" or "qs" (quadratic spectral) and ``bandwidth`` (a positive integer). """ nobs, nf, nport, nrf, s1, s2, s3 = self._boundaries() excess_returns = not self._risk_free f = self.factors.ndarray p = self.portfolios.ndarray nport = p.shape[1] # Step 1, n regressions to get B fc = np.c_[np.ones((nobs, 1)), f] b = lstsq(fc, p, rcond=None)[0] # nf+1 by np eps = p - fc @ b if excess_returns: betas = b[1:].T else: betas = b.T.copy() betas[:, 0] = 1.0 sigma_m12 = self._sigma_m12 lam = lstsq(sigma_m12 @ betas, sigma_m12 @ p.mean(0)[:, None], rcond=None)[0] expected = betas @ lam pricing_errors = p - expected.T # Moments alphas = pricing_errors.mean(0)[:, None] moments = self._moments(eps, betas, alphas, pricing_errors) # Jacobian jacobian = self._jacobian(betas, lam, alphas) if cov_type not in ("robust", "heteroskedastic", "kernel"): raise ValueError(f"Unknown weight: {cov_type}") if cov_type in ("robust", "heteroskedastic"): cov_est_inst = HeteroskedasticCovariance( moments, jacobian=jacobian, center=False, debiased=debiased, df=fc.shape[1], ) else: # "kernel": bandwidth = get_float(cov_config, "bandwidth") kernel = get_string(cov_config, "kernel") cov_est_inst = KernelCovariance( moments, jacobian=jacobian, center=False, debiased=debiased, df=fc.shape[1], kernel=kernel, bandwidth=bandwidth, ) # VCV full_vcv = cov_est_inst.cov alpha_vcv = full_vcv[s2:, s2:] stat = float(np.squeeze(alphas.T @ np.linalg.pinv(alpha_vcv) @ alphas)) jstat = WaldTestStatistic( stat, "All alphas are 0", nport - nf - nrf, name="J-statistic" ) total_ss = ((p - p.mean(0)[None, :]) ** 2).sum() residual_ss = (eps**2).sum() r2 = 1 - residual_ss / total_ss rp = lam rp_cov = full_vcv[s1:s2, s1:s2] betas = betas if excess_returns else betas[:, 1:] params = np.c_[alphas, betas] param_names = [] for portfolio in self.portfolios.cols: param_names.append(f"alpha-{portfolio}") for factor in self.factors.cols: param_names.append(f"beta-{portfolio}-{factor}") if not excess_returns: param_names.append("lambda-risk_free") for factor in self.factors.cols: param_names.append(f"lambda-{factor}") # Pivot vcv to remove unnecessary and have correct order order = np.reshape(np.arange(s1), (nport, nf + 1)) order[:, 0] = np.arange(s2, s3) order = order.ravel() order = np.r_[order, s1:s2] full_vcv = full_vcv[order][:, order] factor_names = list(self.factors.cols) rp_names = factor_names[:] if not excess_returns:
(portfolios: 'IVDataLike', factors: 'IVDataLike', *, risk_free: 'bool' = False, sigma: 'ArrayLike | None' = None) -> 'None'
[ 0.02382763661444187, -0.06415487080812454, -0.023435886949300766, 0.015946542844176292, -0.02229520119726658, -0.04482084512710571, -0.059776488691568375, -0.060513898730278015, 0.01638437993824482, 0.009442334994673729, -0.009269503876566887, -0.0043121338821947575, -0.005032263230532408, 0.046641331166028976, -0.04710221290588379, 0.0829588919878006, 0.027376433834433556, -0.009799518622457981, 0.009430812671780586, 0.024196341633796692, -0.06498446315526962, 0.005029382649809122, -0.034427937120199203, 0.06148175522685051, 0.026869462803006172, 0.02398894540965557, 0.043184708803892136, -0.024334607645869255, 0.03670930862426758, 0.007984792813658714, -0.05327804014086723, 0.024288518354296684, -0.05595116317272186, -0.01864270493388176, -0.004801821894943714, -0.009851368144154549, 0.05051274597644806, -0.005343358963727951, -0.013665172271430492, 0.026016829535365105, 0.03742367774248123, -0.007472061086446047, 0.032837893813848495, -0.030164774507284164, -0.055628541857004166, -0.03092523105442524, -0.04682568460702896, 0.09139303863048553, 0.03495795279741287, -0.02205323800444603, -0.01090563740581274, -0.04021201655268669, 0.034520115703344345, -0.031063495203852654, -0.031017405912280083, 0.03150133416056633, 0.016361337155103683, 0.049637068063020706, 0.041502486914396286, -0.023297620937228203, 0.017594197764992714, -0.01687982864677906, 0.01291623804718256, -0.0012991131516173482, -0.05659639835357666, -0.016660910099744797, -0.0005822245148010552, -0.0032953114714473486, 0.03117871657013893, 0.028528640046715736, -0.020912552252411842, -0.00001616915142221842, 0.007299229968339205, 0.030095640569925308, 0.027122948318719864, 0.012881672009825706, 0.02804471366107464, -0.07277338206768036, -0.03972809016704559, -0.03728540986776352, 0.049222275614738464, 0.006296810228377581, -0.023942856118083, -0.07825788855552673, -0.005766795016825199, -0.04168684035539627, 0.010191269218921661, -0.021166037768125534, 0.058670368045568466, 0.05249454081058502, -0.05539810284972191, -0.007904138416051865, 0.021016251295804977, 0.0300265084952116, 0.026708154007792473, -0.021914973855018616, 0.015059342607855797, -0.030648700892925262, -0.007437494583427906, -0.029150832444429398, 0.009597882628440857, 0.046641331166028976, -0.05502939596772194, 0.07710567861795425, -0.039981573820114136, -0.016522645950317383, -0.07530823349952698, -0.001313515705987811, 0.037400633096694946, -0.05470677837729454, -0.08862774819135666, 0.08830513060092926, -0.019218809902668, 0.008445675484836102, -0.08000923693180084, 0.0014424188993871212, -0.06862543523311615, 0.038253266364336014, -0.0446825809776783, 0.031109582632780075, -0.008595462888479233, 0.03392096608877182, -0.03597189486026764, 0.03412836417555809, -0.017432888969779015, -0.01170642115175724, 0.03528057038784027, 0.029888244345784187, 0.033160511404275894, -0.04295426979660988, -0.0015050701331347227, -0.025970740243792534, 0.01606176234781742, -0.012455355376005173, 0.021834319457411766, -0.019656646996736526, -0.0033644437789916992, -0.020935596898198128, -0.011660332791507244, 0.020140575245022774, 0.05055883526802063, 0.040396369993686676, -0.06212699040770531, -0.015278262086212635, -0.018550530076026917, 0.0237815473228693, 0.09567925333976746, -0.049913596361875534, -0.056365955621004105, -0.0005674618296325207, -0.013515385799109936, -0.019529905170202255, -0.03638669103384018, -0.014656070619821548, 0.032630495727062225, 0.0035977656953036785, 0.031270891427993774, -0.045765653252601624, 0.008295889012515545, -0.002376426476985216, -0.051526688039302826, -0.021615399047732353, -0.014137577265501022, 0.0323539674282074, 0.00397511338815093, 0.0029093220364302397, -0.042193811386823654, -0.07314208894968033, -0.05590507388114929, 0.026685109362006187, -0.0036870616022497416, -0.0034508593380451202, -0.04857703670859337, 0.011798597872257233, -0.025279417634010315, 0.020924074575304985, 0.03569536656141281, -0.044705621898174286, 0.02845950797200203, 0.004182510543614626, 0.02825210988521576, -0.03659408912062645, -0.03991244360804558, -0.017363756895065308, -0.036248426884412766, 0.017513543367385864, -0.038875456899404526, -0.0007806200883351266, 0.011522067710757256, -0.005968431010842323, -0.0323539674282074, -0.027745138853788376, 0.05235627666115761, 0.0016476557357236743, -0.049176186323165894, -0.005138842388987541, 0.036363646388053894, 0.015600879676640034, 0.01123401615768671, -0.03548796847462654, 0.013561474159359932, 0.03346008434891701, 0.011798597872257233, -0.014275842346251011, -0.06461575627326965, -0.010173985734581947, -0.05281715840101242, -0.028206022456288338, 0.013042980805039406, 0.01864270493388176, -0.03145524486899376, 0.028390375897288322, 0.0030735116451978683, 0.03071783296763897, 0.011182166635990143, -0.05134233459830284, 0.041087694466114044, -0.01692591793835163, 0.024749401956796646, 0.004349580500274897, 0.05346239358186722, -0.0869685709476471, -0.02624727040529251, 0.02303261309862137, -0.03196221590042114, -0.011913818307220936, 0.019564472138881683, 0.053692836314439774, 0.008952646516263485, -0.035626232624053955, -0.023942856118083, -0.035626232624053955, 0.05134233459830284, -0.026685109362006187, -0.030256949365139008, 0.0017859204672276974, -0.0418020635843277, 0.05046665668487549, -0.07037679105997086, -0.018677271902561188, -0.01931098662316799, -0.0318700410425663, 0.02756078541278839, 0.05498330667614937, -0.004199793562293053, 0.006798020098358393, 0.05161886289715767, 0.04461344704031944, -0.03878328204154968, -0.03092523105442524, -0.009701580740511417, -0.013619083911180496, -0.017190925776958466, 0.03652495518326759, -0.050328392535448074, -0.09835237264633179, 0.05134233459830284, 0.031063495203852654, 0.06489228457212448, -0.02147713489830494, 0.002579502994194627, -0.03339095413684845, -0.0035401552449911833, 0.054476335644721985, -0.023873724043369293, 0.017225490882992744, -0.026500755921006203, -0.002853152109310031, 0.07069940865039825, 0.025648122653365135, 0.0711142048239708, 0.058624282479286194, -0.028689948841929436, 0.017594197764992714, -0.007120638154447079, 0.008491763845086098, -0.05244845151901245, -0.0003042546159122139, 0.019034456461668015, 0.02463418059051037, 0.011752509512007236, -0.025394637137651443, -0.03449707105755806, 0.011285865679383278, 0.017836160957813263, -0.01420670934021473, -0.012351656332612038, -0.048070065677165985, 0.02550985850393772, 0.021223649382591248, -0.004873834550380707, -0.029058655723929405, 0.03917502984404564, 0.005107156466692686, 0.07392558455467224, 0.02945040538907051, 0.015658490359783173, -0.010467798449099064, 0.052955422550439835, -0.030487392097711563, -0.007955987937748432, 0.03470446914434433, 0.11079620569944382, -0.02871299348771572, -0.04424474015831947, -0.04673350602388382, 0.03180090710520744, -0.04341515153646469, -0.0036496149841696024, 0.010790416970849037, 0.02624727040529251, 0.0353957936167717, 0.007604565005749464, -0.00612974027171731, 0.011936862021684647, -0.03650191053748131, -0.02341284230351448, -0.025924652814865112, 0.08065447211265564, 0.018170300871133804, -0.0039203837513923645, -0.03521144017577171, 0.020636023953557014, -0.03212352469563484, 0.006112456787377596, -0.005089873448014259, 0.027629919350147247, 0.010243118740618229, -0.0377923808991909, -0.0024830056354403496, 0.011694898828864098, 0.020336449146270752, 0.028597772121429443, 0.05535201355814934, -0.04290818050503731, -0.02521028369665146, 0.03770020604133606, -0.021408002823591232, 0.04028115049004555, -0.013791915029287338, 0.08471024036407471, -0.011821641586720943, -0.06231134384870529, 0.0011471658945083618, -0.013907135464251041, -0.03652495518326759, 0.07913356274366379, 0.01598110795021057, 0.013780392706394196, 0.05549027770757675, -0.024611137807369232, -0.020463192835450172, 0.03454316034913063, 0.07881094515323639, -0.017628764733672142, 0.026523800566792488, -0.03060261160135269, -0.05558245629072189, 0.06535317003726959, -0.05078927427530289, -0.0017801595386117697, 0.061251312494277954, -0.05313977599143982, 0.042078591883182526, 0.03454316034913063, -0.060191281139850616, -0.02924300916492939, -0.008555135689675808, 0.10130202025175095, -0.031155671924352646, 0.02797558158636093, -0.04106464982032776, -0.0006697201752103865, -0.007345318328589201, 0.01596958562731743, -0.03627146780490875, -0.011648810468614101, 0.009010257199406624, -0.004893998149782419, -0.00444751838222146, -0.0022856902796775103, -0.04154857620596886, -0.04541999101638794, 0.008261322975158691, 0.004801821894943714, 0.002818585839122534, 0.005003457888960838, -0.02640857920050621, 0.06821063905954361, -0.013596040196716785, 0.01671851985156536, -0.006043324712663889, 0.08480241894721985, 0.008958407677710056, -0.014114533551037312, -0.020025353878736496, 0.03979722410440445, -0.010502364486455917, -0.005804241634905338, -0.0318700410425663, -0.03682452812790871, -0.009448095224797726, -0.003782118670642376, 0.020589934661984444, -0.02352806180715561, -0.034427937120199203, 0.02834428660571575, 0.020624501630663872, -0.04311557859182358, 0.06922458112239838, -0.011717943474650383, 0.017939860001206398, -0.042401209473609924, -0.05807122215628624, -0.05438416078686714, 0.04742483049631119, 0.0028358688578009605, -0.030349126085639, 0.07756656408309937, 0.03207743540406227, 0.0472404770553112, -0.027122948318719864, 0.04348428547382355, 0.0037705968134105206, -0.012824061326682568, 0.05171104148030281, -0.02673119679093361, 0.04719439148902893, -0.025440726429224014, -0.012720363214612007, 0.01844683103263378, -0.0010168225271627307, -0.03113262727856636, -0.02530246041715145, -0.06254178285598755, -0.0221799798309803, -0.05327804014086723, 0.002349061658605933, -0.012017516419291496, 0.012708840891718864, 0.04737874120473862, 0.0193801186978817, 0.02472635731101036, -0.024956798180937767, -0.055997248739004135, 0.029150832444429398, 0.017156358808279037, -0.02003687620162964, -0.09853672236204147, -0.032745715230703354, 0.02176518552005291, 0.018619662150740623, 0.013607562519609928, 0.02993433177471161, -0.05585898458957672, -0.008941125124692917, 0.032261788845062256, -0.06198872625827789, 0.004677959717810154, 0.020140575245022774, 0.023435886949300766, 0.03382879123091698, 0.01819334551692009, 0.021281259134411812, -0.024657225236296654, 0.02213389240205288, 0.0711142048239708, -0.030072597786784172, -0.009983872063457966, -0.0042487625032663345, -0.009661253541707993, 0.015796754509210587, 0.0204171035438776, -0.060974784195423126, -0.03260745108127594, 0.06857934594154358, -0.01618850603699684, -0.010335294529795647, -0.005383686162531376, 0.007644892204552889, 0.009234937839210033, -0.04714830219745636, 0.012397744692862034, 0.031040450558066368, 0.004902639891952276, -0.014460194855928421, 0.023597195744514465, 0.04495910927653313, 0.02656988799571991, -0.024795489385724068, -0.06235743314027786, -0.0010650710901245475, 0.05088145285844803, 0.0866459533572197, -0.023193921893835068, 0.0005897858645766973, 0.03548796847462654, 0.004323655739426613, 0.03986635431647301, -0.03097131848335266, 0.003666898002848029, 0.005498907063156366, -0.046180449426174164, -0.03682452812790871, 0.010364100337028503, -0.0321926586329937, -0.04313862323760986, -0.01572762243449688, -0.028759080916643143, -0.061666108667850494, -0.02546376921236515, -0.03030303865671158, 0.04682568460702896, -0.042816005647182465, -0.007264663930982351, 0.033529218286275864, -0.015589358285069466, 0.025717254728078842, -0.019944699481129646, -0.007546954322606325, 0.04136422276496887, -0.005887776613235474, 0.04710221290588379, -0.020428625866770744, 0.03991244360804558, 0.06406269967556, -0.02181127481162548, -0.026500755921006203, 0.05097362771630287, 0.021223649382591248, -0.010214312933385372, -0.05046665668487549, 0.012731884606182575, 0.05890081077814102, -0.0006322734989225864, -0.01451780553907156, -0.008877753280103207, -0.06816454976797104, -0.022364333271980286, -0.018377698957920074, -0.03645582124590874, 0.03894459083676338, 0.013814959675073624, -0.010778894647955894, 0.004683720413595438, 0.005818644072860479, 0.010813460685312748, 0.01234013494104147, -0.024979842826724052, -0.03606407344341278, 0.041871193796396255, 0.03297615796327591, 0.018250955268740654, -0.0019861164037138224, 0.04894574359059334, 0.017997469753026962, -0.04913009703159332, 0.015024776570498943, 0.00993778370320797, -0.025809431448578835, -0.0006668396526947618, 0.016050240024924278, 0.0411568246781826, -0.057840779423713684, -0.00322905951179564, 0.012075127102434635, 0.01893075741827488, 0.004994816612452269, -0.017801593989133835, -0.04286209121346474, 0.013999312184751034, -0.02250259928405285, 0.00292660528793931, 0.06558360904455185, -0.020313406363129616, -0.018585095182061195, 0.021615399047732353, -0.03820717707276344, -0.06120522320270538, 0.0035689605865627527, 0.010848026722669601, -0.06138957664370537, -0.02546376921236515, -0.0698237344622612, 0.006849869154393673, 0.017548108473420143, -0.03905981034040451, 0.042401209473609924, -0.022767605260014534, 0.040926385670900345, -0.022283678874373436, 0.06424704939126968, -0.045765653252601624, -0.07051505893468857, -0.02447287179529667, 0.043553415685892105, -0.049959685653448105, 0.011257059872150421, 0.040672898292541504, 0.01976034604012966, -0.06300266832113266, -0.020440148189663887, 0.0014186545740813017, 0.002078292891383171, -0.0034364566672593355, 0.01404540054500103, -0.04357646033167839, -0.01515151932835579, 0.06562969833612442, 0.008906558156013489, 0.011228254996240139, 0.008491763845086098, 0.005815763957798481, 0.013976268470287323, 0.0003989516117144376, -0.01515151932835579, -0.03359834849834442, -0.010629107244312763, 0.07876485586166382, 0.034842733293771744, -0.003263625781983137, 0.01840074174106121, 0.01482890173792839, 0.023435886949300766, -0.04624957963824272, 0.008486002683639526, 0.02965780347585678, -0.0964166671037674, -0.010197030380368233, -0.06544534862041473, 0.018008992075920105, 0.07798135280609131, 0.039290253072977066, 0.034266628324985504, 0.03055652417242527, 0.018008992075920105, 0.06226525455713272, 0.013319510035216808, 0.012697318568825722, 0.023919813334941864, -0.024380695074796677, 0.0015353155322372913, -0.007598803844302893, 0.01966816931962967, 0.0009937783470377326, -0.013066024519503117, -0.0024426784366369247, -0.031109582632780075, 0.10471255332231522, 0.02382763661444187, -0.0472404770553112, -0.010392905212938786, -0.06821063905954361, -0.03014172986149788, -0.016810696572065353, 0.030902186408638954, 0.01769789680838585, 0.04111073911190033, 0.05572072044014931, -0.021753665059804916, -0.01848139613866806, -0.029519537463784218, 0.05019012838602066, -0.040396369993686676, -0.002091255271807313, 0.010341055691242218, 0.06622884422540665, 0.010652151890099049, -0.02882821299135685, 0.04293122515082359, -0.024795489385724068, -0.007086071651428938, -0.02928909659385681, -0.007218575570732355, -0.00693052401766181, 0.01217882614582777, -0.023274576291441917, 0.021212127059698105, 0.0026212704833596945, 0.01704113744199276, 0.0883973017334938, 0.03723932430148125, -0.011764030903577805, 0.026961639523506165, 0.05217192322015762, -0.024058077484369278, -0.02546376921236515, -0.01073856744915247, -0.011764030903577805, -0.03689366206526756, -0.03359834849834442, 0.004182510543614626, 0.03392096608877182, -0.003278028219938278, 0.01451780553907156, -0.012029038742184639, -0.060882605612277985, 0.003839729120954871, -0.020636023953557014, -0.009799518622457981, 0.014402585104107857, -0.02295195870101452, 0.000023584232621942647, 0.07088375836610794, -0.030464347451925278, 0.04505128413438797, -0.02608596161007881, -0.032630495727062225, 0.0349118672311306, -0.07028461247682571, 0.021673008799552917, 0.016211548820137978, 0.048530951142311096, -0.05917733907699585, 0.029427360743284225, 0.03629451245069504, -0.049222275614738464, -0.020071441307663918, -0.01626916043460369, 0.04389907792210579, 0.057932958006858826, -0.005003457888960838, 0.06747323274612427, -0.0026500755921006203, -0.03249223157763481, -0.054107632488012314, 0.004041365347802639, 0.017156358808279037, 0.04747091978788376, 0.010254640132188797, 0.05853210389614105, 0.06415487080812454, -0.026224225759506226, -0.0204171035438776, -0.004505128599703312, -0.05871645733714104, -0.0001404251961503178, -0.022433465346693993, -0.013181245885789394, 0.039290253072977066, -0.0221799798309803, -0.0032837893813848495, -0.037354543805122375, -0.033736616373062134, 0.024495916441082954, 0.10462037473917007, -0.008589701727032661, 0.012559054419398308, 0.05078927427530289, -0.0701463520526886, 0.03334486484527588, -0.05682683736085892, -0.028229067102074623, 0.029012566432356834, 0.019195765256881714, -0.009476901032030582, 0.047701362520456314, -0.028966479003429413, -0.014552371576428413, -0.05203365907073021, 0.01004148181527853, -0.018654227256774902, 0.03617929294705391, 0.06940893828868866, 0.03350617364048958, 0.010583018884062767, -0.0034595008473843336, 0.02136191353201866 ]
42,972
linearmodels.asset_pricing.model
__init__
null
def __init__( self, portfolios: IVDataLike, factors: IVDataLike, *, risk_free: bool = False, sigma: ArrayLike | None = None, ) -> None: super().__init__(portfolios, factors, risk_free=risk_free, sigma=sigma)
(self, portfolios: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], factors: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, risk_free: bool = False, sigma: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None) -> NoneType
[ 0.028113752603530884, -0.04651224613189697, -0.03297138214111328, 0.0026267673820257187, -0.04914568364620209, -0.02526678889989853, -0.022633349522948265, -0.05014212056994438, 0.005578266456723213, 0.04338058829307556, 0.003841174766421318, 0.022829078137874603, -0.04469730705022812, 0.01830952614545822, -0.03136996552348137, 0.023184949532151222, 0.061636731028556824, 0.03871868550777435, 0.016450103372335434, 0.04476848244667053, -0.012393182143568993, 0.05757981166243553, -0.06864737719297409, 0.016174303367733955, 0.018878918141126633, 0.10725930333137512, 0.021921608597040176, -0.009136969223618507, -0.0016281065763905644, -0.020017703995108604, -0.034163545817136765, 0.04704605042934418, -0.01880774460732937, 0.05701041966676712, 0.029750755056738853, -0.0028869975358247757, -0.0009719706722535193, 0.04786455258727074, -0.05238410457968712, 0.09715258330106735, 0.04476848244667053, -0.026797031983733177, 0.04227738827466965, -0.027864642441272736, -0.0420282781124115, 0.004306030459702015, 0.021192075684666634, 0.03403899073600769, 0.012624498456716537, 0.004741971381008625, -0.023345090448856354, 0.018736571073532104, 0.07010644674301147, -0.03750872611999512, -0.05608515441417694, 0.10654756426811218, 0.048327185213565826, 0.051031798124313354, -0.0020173396915197372, 0.040675971657037735, -0.024626223370432854, -0.0008613172685727477, 0.05807802826166153, -0.06131644919514656, -0.04316706582903862, 0.030782779678702354, -0.0517791248857975, 0.007949252612888813, 0.010062231682240963, 0.07494628429412842, 0.015960782766342163, 0.019697420299053192, -0.06839826703071594, 0.04558698087930679, 0.03733079135417938, 0.017544405534863472, -0.00894124060869217, -0.0343414805829525, -0.02425255998969078, -0.05797126889228821, 0.05181471258401871, -0.002577835228294134, -0.036316562443971634, 0.017081772908568382, 0.02736642397940159, -0.03412795811891556, 0.00644570030272007, -0.03610303997993469, 0.0330781415104866, 0.06636980921030045, -0.06957264244556427, 0.016556864604353905, 0.0037677765358239412, -0.01053376030176878, 0.054412566125392914, 0.004419464152306318, -0.008954585529863834, -0.03546247258782387, -0.009519529528915882, -0.008918998762965202, 0.030676018446683884, -0.006739293225109577, 0.00011392019223421812, -0.003298472613096237, -0.045337874442338943, -0.02670806460082531, -0.0361386276781559, -0.025124441832304, 0.026619097217917442, -0.025053268298506737, -0.046832527965307236, 0.13459013402462006, -0.025622660294175148, 0.03505322337150574, -0.11501727253198624, 0.024750778451561928, -0.016281064599752426, 0.003302921075373888, 0.011192120611667633, 0.0031650213059037924, -0.04932362213730812, 0.030729398131370544, -0.01001774799078703, 0.06370078027248383, 0.018878918141126633, -0.006232178304344416, -0.00722861522808671, 0.027918023988604546, 0.0013067112304270267, -0.009070243686437607, 0.0178202036768198, -0.04896774888038635, -0.021103108301758766, -0.029092395678162575, 0.025088854134082794, -0.08939461410045624, 0.08156546950340271, -0.007081818766891956, -0.027668913826346397, 0.03701050952076912, 0.0041925967670977116, -0.011343365535140038, -0.0497150793671608, 0.015711672604084015, -0.05455491319298744, 0.05658337473869324, 0.02137001045048237, -0.04466171935200691, -0.034839700907468796, 0.009706362150609493, -0.026120878756046295, 0.03035573475062847, -0.04676135629415512, 0.01023127045482397, 0.04046244919300079, 0.015524840913712978, 0.027846848592162132, -0.06024883687496185, 0.024590635672211647, 0.0016725902678444982, -0.05423463135957718, -0.010916320607066154, -0.0030449151527136564, 0.03978629782795906, -0.030124418437480927, 0.0066770161502063274, -0.044519372284412384, -0.08249072730541229, -0.002649009460583329, 0.04338058829307556, 0.023202741518616676, -0.06654774397611618, -0.03907455503940582, 0.004777558613568544, -0.00011127896868856624, 0.04220621660351753, 0.028932252898812294, -0.0033829917665570974, 0.043807629495859146, 0.02962619997560978, -0.00557381846010685, -0.02368316613137722, -0.028772111982107162, -0.019199201837182045, 0.011049771681427956, -0.04722398519515991, -0.013923424296081066, 0.008127187378704548, 0.032224055379629135, -0.023042600601911545, -0.012241937220096588, -0.0023331744596362114, 0.02948385290801525, -0.00028970063431188464, -0.012820227071642876, -0.03551585227251053, 0.007326479535549879, -0.023967863991856575, -0.019501691684126854, -0.01632554829120636, 0.032063912600278854, 0.05829155072569847, -0.008669889532029629, -0.05106738582253456, -0.02444828860461712, 0.0671527236700058, -0.044412609189748764, -0.03814929351210594, -0.015035519376397133, 0.024697396904230118, 0.0189678855240345, 0.004973287228494883, 0.0074955178424716, -0.02450166828930378, -0.0057161664590239525, -0.021085314452648163, 0.01286471076309681, -0.048006899654865265, -0.003167245537042618, 0.03971512243151665, 0.09701023995876312, -0.06480398029088974, -0.007588933687657118, -0.00009668272832641378, -0.008554231375455856, 0.024875331670045853, 0.05252645164728165, -0.012099589221179485, -0.04722398519515991, 0.005720614921301603, -0.08113842457532883, -0.0013200562680140138, -0.021334422752261162, 0.004822042305022478, -0.01491986121982336, 0.023914482444524765, -0.007210821378976107, 0.0066369809210300446, -0.090248703956604, -0.00431937538087368, 0.012855813838541508, -0.0023709856905043125, 0.048469532281160355, 0.04750868305563927, -0.034216925501823425, 0.0007501078071072698, -0.012446562759578228, 0.05733070150017738, -0.033398427069187164, -0.010587140917778015, -0.028024785220623016, -0.08270425349473953, -0.05316701903939247, 0.01830952614545822, 0.010026644915342331, -0.029359297826886177, 0.0022086198441684246, 0.020676063373684883, 0.04120977967977524, -0.052419692277908325, 0.0189678855240345, -0.03475073352456093, -0.006419009994715452, 0.07145874947309494, -0.018487460911273956, 0.02523120306432247, -0.013007058762013912, -0.048006899654865265, 0.06487514823675156, 0.007424343843013048, 0.0876864343881607, 0.03644111752510071, 0.04131653904914856, -0.004408343229442835, 0.0058540659956634045, -0.005200154613703489, -0.010987495072185993, 0.010115612298250198, -0.024110211059451103, 0.044519372284412384, 0.05747304856777191, -0.03256212919950485, 0.009733051992952824, 0.022829078137874603, 0.020747236907482147, -0.048932164907455444, -0.0012110710376873612, -0.003260661382228136, -0.01545366644859314, -0.003269558073952794, -0.03572937473654747, 0.09003517776727676, 0.012055105529725552, 0.031298790127038956, 0.058113615959882736, 0.05284673720598221, 0.047544270753860474, -0.005026667844504118, 0.01798924244940281, -0.01752661168575287, 0.04249091073870659, -0.039288077503442764, 0.05960827320814133, -0.01233090553432703, -0.026369987055659294, -0.042882367968559265, 0.0666189193725586, -0.0003617087786551565, 0.013442999683320522, 0.0364055298268795, 0.0584339015185833, 0.06316697597503662, -0.019982116296887398, 0.029288124293088913, -0.011930551379919052, -0.05270438641309738, -0.015035519376397133, -0.051494430750608444, 0.01875436305999756, 0.041494473814964294, 0.0111476369202137, -0.050213295966386795, -0.01574726030230522, -0.06088940426707268, -0.04014216735959053, 0.012535530142486095, 0.018789950758218765, -0.02681482583284378, -0.025053268298506737, 0.04220621660351753, -0.023647580295801163, 0.0512809082865715, 0.02476857230067253, 0.042526498436927795, -0.0440923273563385, -0.027562152594327927, 0.0065924967639148235, -0.025355758145451546, 0.0164056196808815, -0.02193940244615078, 0.02733083814382553, -0.04537346214056015, -0.05007094889879227, 0.008371848613023758, 0.014937655068933964, -0.04825600981712341, 0.02733083814382553, -0.07750854641199112, 0.032277435064315796, 0.05153001472353935, 0.013193890452384949, 0.0043905493803322315, -0.002104083076119423, 0.03935925289988518, 0.030533669516444206, 0.024234766140580177, -0.024003449827432632, -0.011886067688465118, -0.0031983840744942427, -0.015462563373148441, 0.06060471013188362, 0.038113705813884735, -0.006779328919947147, 0.05302467197179794, 0.0006372302304953337, -0.03747314214706421, -0.010578243993222713, -0.018594222143292427, 0.0497150793671608, 0.03882544860243797, 0.019750799983739853, -0.028220513835549355, -0.020320191979408264, -0.02019563876092434, 0.028594177216291428, 0.0026134224608540535, -0.03024897351861, 0.004733074922114611, -0.014403849840164185, -0.02880769968032837, -0.029910895973443985, -0.015293525531888008, 0.00681936414912343, 0.004090283997356892, -0.06352284550666809, 0.012918091379106045, -0.028220513835549355, 0.005791788920760155, 0.09039104729890823, 0.036939334124326706, 0.008585370145738125, -0.03861192613840103, 0.06245523318648338, -0.013256167992949486, -0.01830952614545822, -0.03722403198480606, 0.025391343981027603, -0.0435941107571125, -0.01574726030230522, -0.03797135874629021, -0.006303352303802967, -0.030569257214665413, -0.0004131431633140892, 0.01973300613462925, -0.011316674761474133, -0.06537336856126785, 0.017099566757678986, -0.023238329216837883, 0.02055150829255581, 0.04886098951101303, 0.064626045525074, -0.0014190326910465956, -0.02635219320654869, -0.048184834420681, 0.0021352216135710478, -0.024430494755506516, -0.006120968610048294, -0.06501749902963638, 0.07170785963535309, -0.009768638759851456, 0.04864746704697609, 0.01774013414978981, 0.0039924196898937225, 0.04174358397722244, -0.005925239995121956, 0.029643993824720383, -0.006472390610724688, 0.031352169811725616, 0.016361135989427567, -0.015925195068120956, -0.01790917105972767, 0.03096071444451809, -0.031138649210333824, -0.019519485533237457, 0.0033385080751031637, -0.0018471891526132822, -0.06309580057859421, -0.018380699679255486, -0.00895013753324747, 0.03348739445209503, 0.04402115195989609, -0.025248996913433075, 0.056832484900951385, -0.021458977833390236, -0.018033726140856743, 0.020320191979408264, -0.03761548921465874, 0.030836159363389015, -0.023362884297966957, -0.043060302734375, 0.024270353838801384, -0.018051519989967346, -0.009937677532434464, -0.019466103985905647, -0.030533669516444206, -0.0415300615131855, 0.000436219124821946, -0.032473161816596985, 0.031031887978315353, 0.004248201381415129, 0.05722394213080406, 0.008425229229032993, -0.015569324605166912, -0.042775608599185944, -0.005311363842338324, 0.015515943989157677, 0.04469730705022812, -0.03747314214706421, 0.032224055379629135, -0.03836281597614288, 0.025337964296340942, 0.04501758888363838, 0.029394885525107384, -0.072811059653759, -0.028024785220623016, 0.04640548303723335, 0.0037010509986430407, -0.011903860606253147, -0.018238352611660957, 0.003549806075170636, -0.018033726140856743, -0.026103084906935692, 0.029697375372052193, 0.021405598148703575, -0.033611949533224106, -0.03492866829037666, -0.03352297842502594, 0.017339779064059258, 0.0287009384483099, 0.018362905830144882, -0.009635187685489655, -0.023398470133543015, -0.026316607370972633, 0.0487186424434185, 0.05807802826166153, -0.004323823843151331, 0.05106738582253456, 0.036939334124326706, 0.04309589043259621, 0.006988402456045151, -0.03398561105132103, -0.02599632367491722, -0.026619097217917442, -0.05042681843042374, -0.01435046922415495, -0.061957016587257385, -0.019928734749555588, -0.015800639986991882, -0.029127981513738632, -0.023202741518616676, 0.02414579875767231, -0.04597843810915947, 0.008932343684136868, -0.026832619681954384, 0.03651228919625282, 0.021085314452648163, -0.06370078027248383, 0.02265114337205887, -0.00035114388447254896, 0.01258891075849533, 0.035248950123786926, -0.0009141417685896158, 0.038683097809553146, 0.006846054457128048, 0.01373659260571003, -0.02209954336285591, -0.014181430451571941, -0.04270443320274353, 0.010257961228489876, 0.02362978644669056, -0.01594298891723156, -0.0845547765493393, -0.020160051062703133, 0.05633426457643509, -0.01621878705918789, 0.05081827566027641, -0.014128049835562706, -0.034377068281173706, 0.04177917167544365, -0.015925195068120956, -0.012206350453197956, 0.04480406641960144, 0.05341612920165062, -0.04035568982362747, -0.005467057228088379, -0.04295354336500168, -0.05014212056994438, 0.032775651663541794, 0.03814929351210594, -0.04017775505781174, 0.005814030766487122, -0.00015847348549868912, -0.0035453576128929853, -0.0042348564602434635, 0.0394660122692585, 0.013220581226050854, -0.015515943989157677, 0.005947481840848923, 0.007339824456721544, -0.01839849352836609, 0.01706397905945778, 0.013087129220366478, 0.03172583505511284, -0.03049808368086815, -0.008500851690769196, -0.037081681191921234, -0.006868296302855015, -0.021868228912353516, -0.02035577967762947, -0.01306933630257845, 0.01918140798807144, -0.04565815627574921, -0.0013545312685891986, 0.08597826212644577, -0.002820271998643875, -0.017019495368003845, 0.01875436305999756, 0.015925195068120956, -0.03661905229091644, -0.04679694026708603, -0.05530223995447159, -0.03453721106052399, -0.06683243811130524, -0.11494609713554382, -0.010791766457259655, 0.02932371012866497, -0.032811239361763, 0.017206327989697456, 0.015320215374231339, 0.05156560242176056, 0.004653003998100758, -0.011530197225511074, -0.06569365411996841, -0.04622754827141762, -0.06039118766784668, 0.01094301138073206, -0.020249018445611, -0.06384313106536865, 0.0023776583839207888, 0.00029998752870596945, -0.06708154827356339, 0.03035573475062847, -0.04291795566678047, 0.01320278737694025, 0.027384217828512192, -0.022615555673837662, -0.02425255998969078, 0.024821951985359192, 0.009724155068397522, 0.021245455369353294, 0.01084514707326889, 0.038220468908548355, -0.005498195998370647, 0.006886089686304331, 0.016281064599752426, -0.004853181075304747, -0.01967962644994259, -0.017313089221715927, 0.05612074211239815, 0.01921699568629265, -0.04896774888038635, 0.007820249535143375, -0.005235741380602121, 0.00644570030272007, -0.0671527236700058, -0.029821928590536118, 0.01023127045482397, -0.09494619071483612, -0.019501691684126854, -0.06679685413837433, 0.03096071444451809, 0.036014072597026825, 0.00266457861289382, 0.014323778450489044, -0.00948394276201725, 0.03193935751914978, -0.0034942012280225754, 0.02558707259595394, 0.023772135376930237, 0.04120977967977524, 0.010889630764722824, 0.02491091936826706, 0.006423458456993103, 0.013336238451302052, -0.0010158984223380685, -0.05903887748718262, -0.060462359338998795, -0.007139647379517555, 0.04177917167544365, -0.01727750152349472, -0.029643993824720383, -0.005311363842338324, -0.045551396906375885, -0.024216972291469574, -0.04085390642285347, 0.06394989043474197, 0.024537255987524986, 0.02245541475713253, 0.05878977105021477, -0.01861201599240303, -0.0044506024569272995, 0.0033051453065127134, 0.0340745784342289, 0.011645854450762272, 0.06455487012863159, -0.019359342753887177, 0.049181271344423294, -0.06352284550666809, -0.05085386335849762, 0.05085386335849762, -0.011797099374234676, 0.027953609824180603, 0.005480402149260044, 0.0002899786632042378, 0.003874537767842412, 0.004132543690502644, -0.03144114091992378, 0.04658341780304909, 0.04060479998588562, 0.021512357518076897, 0.044377025216817856, -0.030053244903683662, 0.020106671378016472, -0.02393227629363537, -0.004577381536364555, 0.03736637905240059, -0.07957259565591812, 0.0032784549985080957, -0.05348730459809303, -0.037935771048069, 0.004639658611267805, -0.05419904366135597, 0.033238284289836884, -0.018113797530531883, 0.016467897221446037, 0.0002810819132719189, -0.06839826703071594, 0.0018449649214744568, 0.029127981513738632, 0.03238419443368912, 0.012437665835022926, 0.0212810430675745, 0.000534639460965991, 0.08448360115289688, -0.06156555935740471, 0.0071129570715129375, -0.0021908264607191086, -0.011628061532974243, 0.04060479998588562, -0.019145820289850235, 0.029750755056738853, 0.07416336238384247, 0.02471519075334072, -0.07786441594362259, 0.013122716918587685, 0.07551567256450653, -0.001925035729072988, 0.015257937833666801, -0.0420282781124115, -0.008794444613158703, 0.04480406641960144, -0.034626178443431854, 0.02060488983988762, 0.008696580305695534, -0.024181384593248367, -0.02651233598589897, -0.008140532299876213, 0.0471528135240078, 0.073807492852211, -0.03444824367761612, 0.0661206990480423, 0.04548022150993347, -0.03638773411512375, -0.06316697597503662, 0.003939039073884487, -0.03588951751589775, -0.026387780904769897, 0.019750799983739853, 0.03172583505511284, 0.008362951688468456, -0.01839849352836609, -0.01030244491994381, -0.038220468908548355, -0.00917255599051714, 0.06807798147201538, 0.03377208858728409, 0.005351399537175894, -0.0003967397497035563, 0.021974990144371986, 0.00729089230298996, 0.0018382924608886242, -0.0034586142282932997, -0.023718753829598427, 0.04786455258727074, 0.0060364496894180775, -0.02378992736339569, 0.06199260428547859, -0.02373654767870903, -0.00431937538087368, -0.06594276428222656, -0.033149316906929016, -0.014323778450489044, 0.031103061512112617, 0.026992760598659515, 0.04259767383337021, 0.03882544860243797, 0.048683054745197296, -0.0138433538377285 ]
42,974
linearmodels.asset_pricing.model
__str__
null
def __str__(self) -> str: out = super().__str__() if np.any(self._sigma != np.eye(self.portfolios.shape[1])): out += " using GLS" out += f"\nEstimated risk-free rate: {self._risk_free}" return out
(self) -> str
[ 0.04285839572548866, -0.06349935382604599, 0.04667128995060921, 0.02456383779644966, 0.015627365559339523, -0.08190389722585678, -0.016122309491038322, -0.06749555468559265, 0.06584575027227402, -0.017368832603096962, -0.01302433293312788, -0.017423825338482857, -0.014041715301573277, -0.004149730317294598, -0.04267508536577225, 0.00747913820669055, 0.014719970524311066, -0.09466242790222168, 0.04832110181450844, 0.027350181713700294, 0.017772119492292404, 0.07024524360895157, -0.02328065223991871, -0.039118826389312744, 0.0011061746627092361, 0.0696219801902771, 0.0333261601626873, -0.03922881558537483, -0.014985773712396622, -0.0015157628804445267, -0.05349050462245941, -0.025480397045612335, 0.021484192460775375, -0.027771800756454468, 0.01704803667962551, 0.029238298535346985, -0.0018377049127593637, -0.0178271122276783, -0.00708043435588479, 0.018734509125351906, -0.0011210687225684524, 0.008620256558060646, -0.02029266208410263, -0.037249043583869934, -0.07413145899772644, -0.030154859647154808, -0.001264854334294796, 0.0873299390077591, -0.004672170151025057, -0.024343863129615784, 0.03745068609714508, 0.04494815692305565, -0.014050881378352642, -0.014234193600714207, -0.03642413765192032, 0.01359260082244873, 0.0578533336520195, -0.022877365350723267, 0.050777483731508255, 0.0032789972610771656, 0.005311471410095692, 0.009495573118329048, 0.02252907119691372, -0.06096964329481125, -0.011411185376346111, -0.005036503076553345, -0.03158469498157501, 0.035122621804475784, 0.04461819306015968, 0.07442475855350494, 0.015068263746798038, -0.016204800456762314, -0.06199619174003601, 0.03541592136025429, -0.022987352684140205, -0.008743993006646633, -0.026250308379530907, -0.06283942610025406, 0.02368393912911415, -0.08725661784410477, 0.04157521203160286, -0.019614407792687416, 0.04645131528377533, -0.05708342418074608, 0.004516354762017727, -0.06463588774204254, 0.010476293042302132, -0.04241844639182091, 0.02428886853158474, 0.04362830892205238, -0.03919215127825737, 0.03809227794408798, 0.014371677301824093, 0.016131475567817688, 0.008221552707254887, 0.012547721154987812, -0.013115989044308662, -0.05433373898267746, 0.043005045503377914, -0.019834382459521294, 0.05044751986861229, 0.009715547785162926, 0.0035654224921017885, 0.03715738654136658, -0.04333500936627388, 0.002229534788057208, -0.006521332077682018, 0.01776295341551304, 0.032006312161684036, 0.01302433293312788, -0.03554423898458481, 0.050374194979667664, 0.01838621497154236, -0.043371669948101044, -0.02243741601705551, -0.008684416301548481, -0.06085965409874916, 0.004807362798601389, 0.02405056357383728, -0.007689947262406349, -0.02104424312710762, 0.001976334722712636, -0.01808374933898449, 0.013464282266795635, -0.006956698372960091, 0.03442603349685669, -0.02654360793530941, 0.015049932524561882, 0.029274960979819298, -0.07431477308273315, 0.0438116192817688, -0.028871674090623856, 0.0007424145005643368, 0.014573320746421814, 0.06034637987613678, -0.05437040328979492, 0.03644246980547905, -0.009014378301799297, 0.06973196566104889, 0.10874080657958984, 0.003169009927660227, -0.04208848625421524, -0.052280642092227936, 0.01666308008134365, 0.020860930904746056, 0.04311503469944, 0.024453850463032722, 0.04249177128076553, 0.0018399963155388832, -0.06621237099170685, 0.023848919197916985, 0.03158469498157501, -0.029219966381788254, -0.015379894524812698, -0.0013989013386890292, 0.02306067757308483, 0.03184133023023605, -0.044398218393325806, 0.04003538936376572, 0.008120731450617313, -0.020091019570827484, -0.043518319725990295, -0.0045805140398442745, -0.0014332723803818226, 0.0007057520560920238, -0.006865042261779308, -0.017515482380986214, 0.0030613141134381294, 0.022822370752692223, 0.006195952650159597, -0.02542540431022644, -0.04810112714767456, -0.044031593948602676, 0.04586471617221832, 0.017066366970539093, 0.100675068795681, 0.019064471125602722, 0.0898963138461113, -0.03028317727148533, -0.0005184298497624695, 0.03719404712319374, -0.048541076481342316, -0.07728443294763565, 0.005261060781776905, 0.027368513867259026, -0.06401262432336807, -0.0013931728899478912, -0.021832484751939774, 0.014179199934005737, 0.008359037339687347, 0.011823638342320919, 0.0055176978930830956, 0.008024492301046848, -0.011585332453250885, 0.000845527567435056, -0.036130838096141815, 0.0006375827942974865, -0.07380149513483047, 0.007263746578246355, -0.06294941157102585, 0.0004599990788847208, 0.04318835958838463, -0.04780782759189606, 0.017359666526317596, -0.017295507714152336, 0.01619563437998295, 0.00528855761513114, -0.024967122822999954, -0.002696980955079198, 0.06276610493659973, -0.0007951167062856257, 0.032757893204689026, -0.025095442309975624, -0.026012003421783447, 0.03897217661142349, -0.01926611363887787, 0.024967122822999954, 0.012547721154987812, -0.115120068192482, 0.03578254580497742, 0.032006312161684036, -0.09979517012834549, 0.02965991571545601, 0.015187417156994343, -0.05224398151040077, 0.019596075639128685, 0.05279391631484032, 0.014829957857728004, -0.013803409412503242, -0.005215232726186514, -0.04355498403310776, 0.009440579451620579, -0.01840454712510109, 0.03493930771946907, -0.06877874583005905, 0.03468267247080803, -0.04799113795161247, 0.028999991714954376, -0.04029202461242676, 0.0034118986222893, -0.030154859647154808, -0.00016183032130356878, 0.006448007188737392, 0.04887103661894798, 0.026965226978063583, -0.07200504094362259, -0.0022822371684014797, 0.052280642092227936, -0.021740829572081566, -0.006681730039417744, 0.007740358356386423, -0.0480644628405571, -0.03695574402809143, -0.026213645935058594, 0.011374522931873798, -0.0663590207695961, -0.03941212594509125, 0.01433501485735178, 0.034004416316747665, -0.023225657641887665, -0.004032868891954422, 0.008629422634840012, -0.04843108728528023, 0.03118140809237957, 0.0025984507519751787, 0.03442603349685669, -0.025132104754447937, -0.02368393912911415, 0.0633893609046936, 0.007286660373210907, 0.057780008763074875, 0.043408334255218506, -0.0356542244553566, -0.0023017139174044132, -0.00575600378215313, -0.011493676342070103, -0.009614725597202778, 0.03429771587252617, -0.04461819306015968, 0.03031983971595764, 0.05994309484958649, -0.019101133570075035, 0.018303724005818367, 0.00996301881968975, 0.019871044903993607, -0.01427085604518652, 0.0013381792232394218, -0.0738748237490654, 0.034004416316747665, 0.017854610458016396, 0.007286660373210907, 0.060419704765081406, -0.000863285968080163, 0.024820473045110703, 0.0915827825665474, -0.014252524822950363, 0.11321362107992172, -0.0076624504290521145, 0.01616813801229, 0.021190892904996872, 0.026488615199923515, -0.0032950369641184807, 0.05851325765252113, -0.029898222535848618, -0.017726290971040726, -0.045021481812000275, 0.046414654701948166, -0.046781279146671295, 0.023005682975053787, 0.023262320086359978, -0.03871554136276245, 0.039998725056648254, 0.062032852321863174, 0.02065928652882576, 0.022492408752441406, 0.024838805198669434, -0.01866118423640728, -0.03107142075896263, 0.01838621497154236, 0.06272944062948227, 0.003489806316792965, -0.017359666526317596, -0.0036318732891231775, -0.007964915595948696, -0.030961433425545692, -0.09737545251846313, -0.03889885172247887, 0.003776231547817588, 0.008918139152228832, -0.0075570461340248585, -0.021740829572081566, -0.06859543174505234, 0.046011365950107574, -0.0061501250602304935, 0.0076761990785598755, 0.004516354762017727, 0.04395826905965805, -0.031016426160931587, -0.024582168087363243, -0.036259155720472336, 0.0287800170481205, -0.011631160043179989, -0.033876098692417145, 0.05594688653945923, -0.0027771801687777042, 0.006626736372709274, -0.010182993486523628, -0.03682742267847061, 0.025700371712446213, 0.019229451194405556, -0.02577369660139084, 0.0029467439744621515, 0.000917706754989922, 0.003157552797347307, 0.023262320086359978, 0.03897217661142349, -0.006319688633084297, 0.0310530886054039, -0.019357770681381226, 0.0457913912832737, 0.03977875038981438, 0.002561788307502866, -0.023225657641887665, 0.06489252299070358, -0.01977938786149025, -0.013115989044308662, 0.013482613489031792, 0.009917191229760647, 0.0833703950047493, 0.010457961820065975, -0.03761566802859306, -0.009944687597453594, -0.02014601230621338, -0.02164917252957821, -0.030613139271736145, 0.06672564893960953, -0.0008913556230254471, -0.018111247569322586, -0.014316683635115623, -0.0984020009636879, -0.010412134230136871, 0.004404075909405947, -0.03044815920293331, 0.0362958200275898, -0.015104926191270351, 0.031749676913022995, -0.004294088575989008, 0.006938367150723934, 0.026873569935560226, -0.012355242855846882, 0.006489252205938101, -0.05184069275856018, 0.06056635454297066, 0.013134320266544819, -0.011667822487652302, -0.05070415884256363, -0.004319293890148401, -0.004080988001078367, -0.04560808092355728, 0.030979763716459274, -0.0048027802258729935, -0.025737034156918526, -0.0839569941163063, -0.030613139271736145, -0.05660681053996086, -0.051290757954120636, 0.006351768039166927, 0.0028275910299271345, -0.006525914650410414, 0.05598355084657669, 0.0054764524102211, -0.013207645155489445, -0.06320605427026749, -0.0369374118745327, 0.02216244675219059, -0.006090548355132341, -0.0003849556378554553, -0.027331851422786713, 0.02727685682475567, 0.002179123926907778, -0.01891782134771347, 0.021832484751939774, 0.04010871425271034, 0.058659907430410385, -0.0009526506764814258, 0.019229451194405556, -0.04146522283554077, 0.034132733941078186, 0.054407063871622086, 0.0548836775124073, -0.031364720314741135, 0.010082172229886055, -0.0015444053569808602, 0.016745571047067642, 0.004811945836991072, -0.06269277632236481, -0.018560361117124557, -0.012731033377349377, -0.039375465363264084, 0.021960804238915443, 0.07072184979915619, -0.03631414845585823, 0.0009331737528555095, 0.02806510031223297, -0.016635583713650703, 0.025883683934807777, -0.029219966381788254, -0.0418318472802639, 0.005769751965999603, 0.010494624264538288, 0.01447249948978424, 0.02416055090725422, -0.051767367869615555, 0.0035195944365113974, 0.017038870602846146, -0.03306952491402626, 0.02806510031223297, -0.0716017484664917, -0.009724712930619717, -0.0016417900333181024, -0.0073049915954470634, 0.06910870224237442, -0.0375790037214756, 0.09546900540590286, 0.03481099009513855, -0.04733121395111084, 0.04095194861292839, -0.004472818225622177, -0.034004416316747665, -0.03477432578802109, 0.032372936606407166, -0.005723923910409212, 0.002603033557534218, -0.04832110181450844, -0.02555372193455696, 0.04542476683855057, -0.0346093475818634, 0.03539758920669556, -0.01370258815586567, 0.005998892243951559, -0.049017686396837234, -0.026085328310728073, -0.01880783401429653, 0.006828379817306995, 0.012987670488655567, -0.00701169203966856, -0.02078760601580143, 0.018239565193653107, 0.010989567264914513, 0.029274960979819298, 0.023482294753193855, -0.021575847640633583, -0.03327116742730141, -0.01691971719264984, -0.01954108290374279, 0.01808374933898449, 0.017900437116622925, -0.028615036979317665, -0.04256509616971016, 0.05349050462245941, -0.012006950564682484, -0.013555938377976418, -0.01602148823440075, -0.012327746488153934, 0.014967442490160465, -0.05957647040486336, 0.03721237927675247, 0.014179199934005737, -0.02001769468188286, -0.016204800456762314, 0.014949111267924309, -0.06038304418325424, 0.04260176047682762, -0.017579641193151474, -0.009926356375217438, -0.015004104934632778, -0.012098606675863266, 0.02768014371395111, 0.01943109557032585, 0.02905498631298542, -0.009403917007148266, -0.00813906267285347, -0.03591086342930794, -0.02965991571545601, 0.00018689253192860633, 0.00466529605910182, 0.02403223142027855, -0.0043422081507742405, -0.02001769468188286, 0.04348165914416313, 0.016113143414258957, -0.010842917487025261, 0.0013095366302877665, 0.03867887705564499, -0.014848289079964161, 0.10624776035547256, -0.03794562816619873, -0.02128254808485508, 0.03317951038479805, -0.017341336235404015, 0.0056231021881103516, -0.014875786378979683, 0.021355872973799706, -0.033142849802970886, 0.019192788749933243, -0.00019591492309700698, 0.03845890238881111, -0.008670668117702007, 0.05382046476006508, -0.061042968183755875, -0.002447218168526888, 0.023958906531333923, 0.021502522751688957, -0.052170656621456146, 0.07207836210727692, 0.07625788450241089, 0.006956698372960091, 0.051034118980169296, 0.018560361117124557, -0.00528855761513114, -0.02181415446102619, -0.01165865734219551, 0.06690895557403564, -0.027148539200425148, -0.004926515743136406, 0.011924459598958492, 0.0009692633175291121, 0.01827622763812542, -0.008331540040671825, -0.01872534304857254, -0.0011835094774141908, -0.04681793972849846, -0.01376674696803093, 0.018175406381487846, -0.06452590227127075, -0.009688050486147404, 0.036259155720472336, 0.04524145647883415, -0.023390639573335648, 0.019504420459270477, -0.03831225261092186, -0.019486088305711746, -0.0041863927617669106, -0.04432489350438118, -0.009779706597328186, 0.0316946804523468, -0.07200504094362259, -0.009825535118579865, 0.004532394465059042, 0.03690074756741524, -0.030759789049625397, -0.019632738083600998, -0.019632738083600998, -0.06947533041238785, -0.0012167348759248853, -0.0011915294453501701, -0.0025686623994261026, -0.02452717535197735, 0.012034446932375431, 0.04245511069893837, -0.02091592364013195, 0.0253154169768095, -0.01032964326441288, 0.050777483731508255, 0.0405486635863781, 0.022345758974552155, 0.017497150227427483, 0.02392224408686161, -0.03118140809237957, 0.03471933305263519, -0.019761057570576668, 0.07625788450241089, -0.04912767559289932, -0.03160302713513374, -0.02590201608836651, -0.03129139542579651, 0.038642216473817825, -0.025095442309975624, -0.009032709524035454, 0.0187895018607378, 0.004720289725810289, 0.06412260979413986, -0.06481920182704926, 0.006195952650159597, -0.01619563437998295, 0.01228191889822483, 0.005769751965999603, -0.0470745787024498, 0.016553092747926712, -0.08982298523187637, -0.01915612630546093, 0.024215543642640114, -0.0009446307667531073, -0.06434258818626404, -0.03497597202658653, 0.017680462449789047, -0.01552654430270195, 0.06397596001625061, -0.039632100611925125, 0.036259155720472336, -0.00839569978415966, 0.025205429643392563, -0.04879771173000336, 0.02856004238128662, -0.045498091727495193, 0.018972814083099365, -0.06060301885008812, -0.033362824469804764, 0.042381785809993744, -0.06819214671850204, -0.05880655720829964, 0.008061154745519161, 0.0004542705719359219, -0.010650440119206905, -0.005256477743387222, 0.04003538936376572, -0.00785951130092144, 0.02504044771194458, 0.021355872973799706, -0.028706692159175873, -0.012529389932751656, -0.06276610493659973, 0.03519594669342041, -0.016223130747675896, 0.0794108510017395, 0.004608010873198509, 0.029641585424542427, -0.030704796314239502, -0.01307932659983635, -0.046891264617443085, -0.04568140581250191, 0.009733879007399082, -0.004601136781275272, -0.022767378017306328, -0.05748670920729637, 0.03409607335925102, 0.0030338172800838947, 0.04700125381350517, 0.025132104754447937, -0.03715738654136658, 0.06723891943693161, -0.02280404046177864, -0.025572054088115692, -0.044251568615436554, 0.025572054088115692, 0.048651061952114105, -0.07845763117074966, 0.019486088305711746, -0.02654360793530941, -0.021355872973799706, -0.06049302965402603, -0.10536786168813705, 0.025443734601140022, -0.006140959449112415, 0.101261667907238, 0.02379392646253109, 0.002680941252037883, 0.017726290971040726, 0.00017085271247196943, -0.008789820596575737, 0.03004487231373787, 0.0457913912832737, -0.0025640795938670635, 0.057303398847579956, -0.03867887705564499, 0.002317753853276372, 0.03616749867796898, -0.03383943438529968, 0.0026305303908884525, -0.022620728239417076, 0.04494815692305565, 0.0898963138461113, 0.006209701299667358, -0.03429771587252617, -0.02804676815867424, -0.011292032897472382, -0.01570069044828415, 0.004571348428726196, -0.007483721245080233, -0.03695574402809143, -0.001172052463516593, 0.004115359392017126, 0.011686153709888458, -0.0299165528267622, -0.018092915415763855, 0.06870541721582413, -0.006736723706126213, -0.009614725597202778, 0.047404538840055466, -0.02593867853283882, 0.004569056909531355, 0.04788115248084068, -0.028248412534594536, -0.02142919786274433, 0.015792347490787506, 0.02656194008886814, -0.0418318472802639, 0.01941276341676712, 0.027716806158423424, -0.0016223130514845252, 0.0418318472802639, 0.07211502641439438, 0.04681793972849846, -0.0405486635863781, 0.04810112714767456, 0.05272059142589569, -0.001488266047090292, 0.04960428550839424, -0.014921613968908787, 0.00888147670775652, 0.06324271112680435, 0.0323912687599659, 0.021465860307216644, -0.007465390022844076, 0.02166750468313694, -0.04634132981300354, 0.040255364030599594, -0.0019179040100425482, 0.022492408752441406, -0.020219337195158005, -0.002389932982623577, -0.04373829439282417, 0.03165801987051964, 0.06514915823936462, -0.013748415745794773, 0.056020211428403854, -0.048541076481342316, -0.01838621497154236 ]
42,975
linearmodels.asset_pricing.model
_boundaries
null
def _boundaries(self) -> tuple[int, int, int, int, int, int, int]: nobs, nf = self.factors.ndarray.shape nport = self.portfolios.ndarray.shape[1] nrf = int(bool(self._risk_free)) s1 = (nf + 1) * nport s2 = s1 + (nf + nrf) s3 = s2 + nport return nobs, nf, nport, nrf, s1, s2, s3
(self) -> tuple[int, int, int, int, int, int, int]
[ 0.021953459829092026, 0.0013661617413163185, -0.06694192439317703, -0.003225659718737006, -0.026735026389360428, -0.01990421675145626, -0.008121072314679623, -0.07768147438764572, -0.03984638303518295, -0.0034604687243700027, -0.003277839394286275, 0.0012701035011559725, -0.017200356349349022, -0.057113151997327805, -0.021498072892427444, 0.035140715539455414, 0.009027102962136269, -0.05441877618432045, -0.01182109396904707, 0.01332007721066475, -0.018794210627675056, 0.020928839221596718, -0.028670422732830048, -0.010796472430229187, -0.005369774531573057, 0.04261665791273117, -0.00006229703285498545, -0.0016365479677915573, 0.030435048043727875, -0.01705804653465748, -0.06625884771347046, 0.03920125216245651, 0.010502368211746216, -0.04815720021724701, 0.018699338659644127, 0.014420595951378345, 0.05422903224825859, 0.05718904733657837, 0.028177086263895035, 0.08204559981822968, 0.0005719023174606264, -0.061856769025325775, -0.03322429582476616, 0.019505754113197327, -0.05157260596752167, -0.035463280975818634, 0.03077658824622631, -0.07392452657222748, 0.016109323129057884, 0.01815856620669365, 0.005365030840039253, -0.03912535309791565, 0.05290081724524498, -0.03326224163174629, -0.005236953496932983, 0.046183858066797256, 0.007196067366749048, 0.03713303431868553, -0.02593809925019741, -0.03307249769568443, 0.0026682845782488585, 0.056240323930978775, 0.043755125254392624, -0.041857678443193436, -0.023604238405823708, 0.02229500003159046, -0.025596557185053825, 0.006171445827931166, 0.0023765522055327892, 0.07597377151250839, 0.010483393445611, 0.02235192432999611, -0.01842420920729637, -0.012162634171545506, -0.009847749024629593, -0.016763942316174507, 0.08546100556850433, 0.005293876864016056, 0.04413461312651634, -0.06083214655518532, 0.022655515000224113, 0.030055558308959007, 0.010360060259699821, 0.016365479677915573, 0.0612875334918499, -0.008633383549749851, 0.011792631819844246, 0.03796791285276413, -0.01919267512857914, 0.027626825496554375, -0.0427684523165226, 0.010492880828678608, 0.012409302406013012, 0.010312623344361782, 0.027266310527920723, 0.023490391671657562, -0.03409712016582489, -0.03180120885372162, -0.027721699327230453, -0.045500773936510086, -0.00962954293936491, -0.002893606433644891, -0.07608761638402939, 0.030491970479488373, -0.029751965776085854, -0.0017077021766453981, 0.018300874158740044, -0.03077658824622631, -0.05870700627565384, -0.016403427347540855, -0.025976046919822693, 0.03299660235643387, -0.04876438528299332, 0.0878138393163681, -0.0998816043138504, 0.027607852593064308, -0.05267312377691269, 0.011498527601361275, 0.00009435351239517331, 0.041933573782444, -0.03880278766155243, -0.009961595758795738, 0.015113163739442825, 0.032370444387197495, -0.0017598819686099887, 0.03125094994902611, 0.0330914743244648, 0.06007316708564758, -0.03973253816366196, -0.011242372915148735, 0.025729378685355186, -0.04493154212832451, -0.03161146491765976, 0.038764838129282, -0.046145908534526825, -0.013377000577747822, 0.03897355869412422, -0.039656639099121094, -0.0008692678529769182, -0.009306976571679115, 0.006735936272889376, 0.04200947284698486, -0.03191505745053291, 0.013158793561160564, -0.018699338659644127, 0.051952093839645386, 0.027247337624430656, 0.01796882227063179, 0.027987340465188026, 0.026507332921028137, -0.023072954267263412, 0.0032375187147408724, -0.0354253314435482, -0.001226225052960217, -0.01931600831449032, -0.013860849663615227, 0.05248337984085083, -0.05035823956131935, 0.04049151763319969, 0.015264960005879402, -0.0990467220544815, -0.02506527304649353, -0.02312987670302391, -0.00605759909376502, 0.006693243980407715, 0.05290081724524498, -0.005801443941891193, -0.08227329701185226, 0.05995932221412659, -0.01451546885073185, 0.010312623344361782, 0.020264731720089912, -0.05054798349738121, 0.026697076857089996, -0.04929566755890846, -0.032503265887498856, 0.0049238745123147964, -0.026146817952394485, 0.008135302923619747, 0.029638119041919708, 0.03350891172885895, -0.05164850503206253, -0.01700112409889698, -0.029467349871993065, -0.006550935097038746, 0.05119311437010765, 0.021991409361362457, -0.015606500208377838, 0.008880050852894783, -0.0022816797718405724, -0.05013054609298706, -0.026412460952997208, -0.004378358833491802, 0.008182739838957787, -0.012200583703815937, 0.022427821531891823, 0.04147818684577942, 0.048536691814661026, -0.04367922618985176, -0.10519445687532425, 0.007561325561255217, -0.002710977103561163, -0.06360241770744324, 0.03318634629249573, -0.002042127074673772, 0.047550018876791, -0.03455250710248947, -0.04102279990911484, -0.02041652798652649, 0.0507756769657135, -0.023471416905522346, 0.007608762010931969, -0.042085371911525726, -0.020435502752661705, 0.021327301859855652, 0.022048331797122955, 0.007286196108907461, -0.012636995874345303, -0.020378578454256058, -0.004539641551673412, 0.04352743178606033, -0.04857463762164116, 0.04132639244198799, -0.034628406167030334, 0.0012878919951617718, 0.01744702458381653, 0.0434894822537899, 0.03252223879098892, -0.0075708129443228245, 0.020245758816599846, -0.04455205053091049, -0.0044447691179811954, -0.03525456413626671, -0.0020089219324290752, 0.01424033846706152, 0.04049151763319969, -0.004404448438435793, -0.06261574476957321, -0.012627508491277695, 0.029922736808657646, -0.009506208822131157, -0.013908285647630692, 0.014031619764864445, 0.03390737622976303, 0.008215945214033127, -0.004219447262585163, -0.018243951722979546, 0.026241689920425415, 0.02713349089026451, 0.00012170342961326241, -0.08955948799848557, -0.036336109042167664, -0.020283706486225128, -0.029467349871993065, 0.02193448506295681, -0.04610795900225639, -0.03908740356564522, 0.04800540581345558, 0.013832387514412403, -0.006963629741221666, 0.05589878559112549, 0.026070918887853622, 0.023945778608322144, -0.02106166072189808, 0.0017349779373034835, 0.06337472796440125, -0.0021097236312925816, -0.02912580966949463, 0.015189061872661114, 0.012693919241428375, 0.1169586256146431, 0.04383102059364319, 0.010179802775382996, -0.003569571999832988, -0.008865820243954659, -0.03328121826052666, 0.04238896444439888, 0.006142984144389629, 0.007807993795722723, 0.010483393445611, 0.05225568637251854, -0.006660038605332375, -0.0173236895352602, 0.013215716928243637, 0.02487552911043167, -0.03200992941856384, -0.015653936192393303, -0.0717993900179863, 0.04773976281285286, -0.022181153297424316, -0.059921372681856155, 0.02022678405046463, -0.003000337863340974, 0.04542487859725952, 0.07916148006916046, 0.0050946446135640144, 0.035273537039756775, -0.031269922852516174, 0.04713258147239685, 0.02432526834309101, 0.006992091424763203, -0.054115183651447296, 0.03920125216245651, 0.021953459829092026, 0.03295865282416344, -0.007494915276765823, 0.07176143676042557, -0.013073408976197243, 0.027209388092160225, 0.00658888416364789, -0.012779304757714272, -0.03599456697702408, 0.0685737282037735, -0.027019642293453217, 0.012817253358662128, -0.029524272307753563, -0.017892923206090927, 0.009273771196603775, -0.018206002190709114, 0.06219830736517906, 0.027247337624430656, -0.0572269968688488, 0.018832160159945488, 0.00846735667437315, -0.018433695659041405, 0.03405917063355446, -0.03035914897918701, -0.04014997556805611, 0.026241689920425415, 0.005735033191740513, -0.06265369802713394, 0.004629770293831825, -0.014591366052627563, 0.0678526982665062, 0.025406813248991966, 0.003681046888232231, 0.05229363590478897, 0.014098030515015125, 0.03132684901356697, -0.08955948799848557, 0.005507339257746935, -0.01900292932987213, -0.033888399600982666, 0.03185813128948212, 0.038726888597011566, -0.012029812671244144, 0.024989375844597816, -0.009306976571679115, 0.008453126065433025, 0.07954097539186478, -0.046563345938920975, -0.015264960005879402, -0.005606955382972956, 0.02386988140642643, 0.0018239207565784454, 0.04800540581345558, -0.011270834133028984, -0.07817480713129044, 0.03176325932145119, 0.03811970725655556, 0.03109915368258953, -0.00374982925131917, -0.007134400308132172, 0.05354595184326172, 0.008989154361188412, -0.01967652328312397, -0.026829898357391357, 0.04322383925318718, -0.00015772526967339218, 0.02151704765856266, 0.012333404272794724, -0.02548271045088768, -0.03760739788413048, 0.023945778608322144, -0.00023984913423191756, 0.05176234990358353, -0.0026018740609288216, -0.01101467851549387, -0.014733674935996532, -0.05441877618432045, -0.05119311437010765, -0.048916179686784744, -0.032408393919467926, 0.03783509135246277, -0.051117219030857086, 0.012086736038327217, -0.017171893268823624, -0.021213455125689507, 0.02077704295516014, 0.04424846172332764, 0.037208933383226395, -0.009330694563686848, 0.02290218323469162, -0.05574698746204376, 0.03811970725655556, 0.019619600847363472, 0.057340845465660095, -0.014989830553531647, 0.05362184718251228, 0.02064422145485878, -0.015388294123113155, -0.0274181067943573, -0.046145908534526825, 0.023376544937491417, -0.014183415099978447, -0.018281901255249977, 0.013149307109415531, 0.05290081724524498, 0.03400224819779396, -0.0008520722039975226, -0.03331916779279709, 0.02451501414179802, 0.03533045947551727, -0.0724065750837326, -0.02183961309492588, -0.016308555379509926, -0.024078600108623505, 0.04899207875132561, 0.06265369802713394, -0.06337472796440125, 0.039694588631391525, -0.05309056118130684, 0.03760739788413048, 0.020264731720089912, -0.026412460952997208, -0.009520439431071281, 0.002914952812716365, 0.0013471872080117464, 0.003377455286681652, 0.019249597564339638, -0.031364794820547104, 0.014686238951981068, -0.06880142539739609, -0.05532955005764961, -0.029524272307753563, -0.02164986915886402, -0.039049457758665085, 0.055633142590522766, 0.016811378300189972, -0.011735708452761173, 0.018822671845555305, 0.05957983061671257, 0.04811925068497658, -0.015388294123113155, 0.023793984204530716, 0.011972889304161072, -0.05574698746204376, -0.062312155961990356, -0.039466895163059235, -0.01854754239320755, -0.012570585124194622, -0.03299660235643387, 0.012693919241428375, 0.000064705905970186, -0.004053420852869749, -0.016052400693297386, -0.07130604982376099, -0.0708506628870964, 0.020435502752661705, -0.015179574489593506, 0.07100246101617813, 0.011631349101662636, -0.01599547639489174, 0.022522693499922752, -0.03426789119839668, -0.08121072500944138, -0.006845039315521717, -0.06531012058258057, -0.02183961309492588, -0.026298614218831062, 0.0249704010784626, 0.010075442492961884, 0.01606188714504242, -0.059465985745191574, 0.0056211864575743675, 0.03584277257323265, 0.0458802655339241, -0.012323916889727116, 0.042882297188043594, -0.013946234248578548, -0.0030643767677247524, 0.011878017336130142, -0.039884332567453384, 0.015056240372359753, -0.03394532576203346, -0.03290172666311264, -0.08986308425664902, 0.04409666359424591, -0.05939008668065071, -0.0434894822537899, 0.010464419610798359, -0.0221621785312891, 0.006731192581355572, 0.0039324588142335415, 0.017655743286013603, 0.007357350084930658, 0.06948450207710266, 0.0005627115606330335, 0.02709554135799408, 0.0013649758184328675, -0.013747001998126507, -0.012010838836431503, 0.025217069312930107, -0.009743389673531055, -0.04136434197425842, -0.058403413742780685, -0.01619470864534378, -0.06603115051984787, -0.025862200185656548, -0.006071829702705145, 0.028404779732227325, -0.0443243570625782, 0.0005612291861325502, -0.019638575613498688, -0.00471041165292263, 0.033110447227954865, -0.009207360446453094, -0.009819287806749344, -0.01787394843995571, 0.029391450807452202, -0.018794210627675056, -0.03286378085613251, 0.04857463762164116, 0.042237166315317154, 0.004871694836765528, 0.02271243929862976, 0.01822497695684433, -0.04003612697124481, -0.029467349871993065, -0.009961595758795738, 0.0000627788103884086, -0.047208476811647415, 0.0483848936855793, 0.011242372915148735, -0.019562676548957825, 0.02948632463812828, -0.002146486658602953, -0.044817693531513214, -0.0028437983710318804, 0.02722836285829544, -0.005687596742063761, -0.003849445376545191, 0.012551611289381981, -0.0050045158714056015, 0.001021063537336886, -0.0037142522633075714, -0.004791053477674723, -0.013984182849526405, 0.013215716928243637, -0.012456738390028477, 0.04390691965818405, 0.012020326219499111, 0.08568870276212692, -0.02087191492319107, 0.045045386999845505, 0.022276025265455246, -0.01553060207515955, 0.018851134926080704, -0.0006469108047895133, 0.003384570823982358, -0.04789155721664429, -0.039277151226997375, 0.030852485448122025, -0.010768011212348938, -0.0998816043138504, -0.0338125042617321, 0.0197144728153944, 0.011906478554010391, -0.0025900150649249554, 0.03842329978942871, -0.02051139995455742, 0.05016849562525749, -0.010141853243112564, -0.01393674686551094, 0.026621179655194283, -0.07396247982978821, -0.007333632092922926, -0.033053524792194366, -0.058403413742780685, -0.028917089104652405, -0.004494577180594206, 0.012285968288779259, -0.01670701988041401, -0.09563132375478745, -0.004523038864135742, 0.08007225394248962, -0.07282400876283646, 0.00376643193885684, -0.001226225052960217, 0.01453444268554449, -0.015018291771411896, 0.03009350784122944, -0.034400712698698044, -0.05586083605885506, -0.0523315854370594, 0.029410425573587418, -0.06257779896259308, -0.036146361380815506, -0.04216126725077629, -0.007983507588505745, 0.027911443263292313, 0.04151613637804985, -0.06420960277318954, 0.06603115051984787, 0.016725994646549225, -0.015634961426258087, 0.011707247234880924, -0.04337563365697861, -0.04261665791273117, -0.010616214945912361, 0.018376773223280907, -0.024533987045288086, 0.025463737547397614, -0.05293876677751541, 0.0008164950995706022, -0.008714024908840656, -0.008287099190056324, 0.0024809117894619703, 0.014477519318461418, 0.025425788015127182, -0.03157351538538933, -0.005625929683446884, 0.008419920690357685, 0.0015416755340993404, 0.040984850376844406, -0.007200810592621565, 0.07733993232250214, -0.056202374398708344, 0.05032029002904892, -0.001896261004731059, 0.028879141435027122, 0.06291934102773666, -0.000054292180720949546, -0.053052615374326706, -0.012399815022945404, 0.09555542469024658, 0.027702724561095238, -0.006683756597340107, 0.004425794817507267, 0.014923419803380966, -0.012760329991579056, 0.06170497089624405, 0.059276238083839417, 0.005673366133123636, 0.03713303431868553, -0.040301769971847534, 0.012162634171545506, -0.003211428876966238, 0.04405871406197548, 0.007907609455287457, -0.06132548302412033, -0.0008876493666321039, -0.021498072892427444, -0.025236042216420174, -0.04113664850592613, 0.02935350313782692, -0.010976729914546013, 0.025634506717324257, -0.000706206017639488, -0.066069096326828, -0.065955251455307, 0.008196970447897911, 0.01091980654746294, -0.034078147262334824, 0.030909409746527672, 0.04713258147239685, 0.029011962935328484, -0.01446803193539381, -0.024154499173164368, 0.006949399132281542, 0.04216126725077629, -0.005512082949280739, 0.01606188714504242, 0.03276890888810158, -0.031213000416755676, 0.03119402565062046, -0.02368013747036457, 0.05187619850039482, 0.02916375733911991, 0.004240793641656637, 0.04667719081044197, -0.015653936192393303, -0.03961868956685066, -0.03641200438141823, 0.09585901349782944, -0.026070918887853622, -0.0507756769657135, -0.0046890657395124435, -0.019657548516988754, 0.08796563744544983, 0.01767471805214882, -0.03996023163199425, 0.030795563012361526, -0.004520667251199484, 0.010796472430229187, 0.0011028909357264638, -0.016688045114278793, 0.049181822687387466, 0.07267221808433533, 0.013993670232594013, -0.01364264264702797, -0.06390600651502609, -0.03009350784122944, 0.03669662028551102, -0.02428731881082058, 0.0189365204423666, 0.03521661460399628, -0.016811378300189972, 0.028784269466996193, 0.027911443263292313, -0.018794210627675056, 0.03451455757021904, 0.025767328217625618, -0.040112026035785675, -0.05965572968125343, 0.06318497657775879, -0.00662208953872323, 0.041629984974861145, -0.025217069312930107, 0.004122203215956688, 0.000473768770461902, 0.054115183651447296, 0.03984638303518295, -0.02977094054222107, -0.029011962935328484, 0.020378578454256058, 0.0523315854370594, -0.02151704765856266, -0.035083793103694916, -0.011545964516699314, 0.004141177982091904, 0.040339719504117966, -0.0620085634291172, 0.006977860815823078, 0.006569909863173962, 0.008035687729716301, -0.01553060207515955, 0.002182063879445195, -0.05274902284145355, -0.00026875556795857847, 0.028006315231323242, -0.02100473642349243, 0.0023362315259873867, -0.024799630045890808, -0.014003157615661621, 0.07711224257946014, -0.0003213800664525479, -0.014752649702131748, -0.0016199452802538872, -0.034533534198999405, 0.05532955005764961, 0.08621998131275177, 0.05331825837492943, -0.0540013387799263, -0.04136434197425842, -0.024913476780056953, 0.10481496155261993, -0.0676250085234642, -0.03168736398220062, 0.0018535683630034328, 0.006873500999063253, 0.04629770293831825, -0.020568324252963066, 0.10033699125051498, 0.028177086263895035, 0.023661162704229355, 0.005184773355722427, 0.013035459443926811 ]
42,976
linearmodels.asset_pricing.model
_drop_missing
null
def _drop_missing(self) -> BoolArray: data = (self.portfolios, self.factors) missing = cast(BoolArray, np.any(np.c_[[dh.isnull for dh in data]], 0)) if any(missing): if all(missing): raise ValueError( "All observations contain missing data. " "Model cannot be estimated." ) self.portfolios.drop(missing) self.factors.drop(missing) missing_warning(missing) return missing
(self) -> numpy.ndarray
[ -0.023896198719739914, 0.03418615460395813, -0.027913641184568405, 0.02095891907811165, -0.010318382643163204, -0.027818890288472176, -0.036554932594299316, -0.021527424454689026, -0.030225565657019615, 0.024028850719332695, -0.006594668608158827, 0.01767105981707573, 0.03659282997250557, -0.04468456655740738, -0.02308133989572525, 0.032082684338092804, 0.02285393886268139, 0.08648870140314102, 0.0556756816804409, -0.038089897483587265, -0.01516963355243206, 0.012838758528232574, -0.058669812977313995, 0.03001711331307888, -0.018618568778038025, 0.001588263432495296, 0.028880100697278976, -0.007670092396438122, -0.030831972137093544, 0.0628388524055481, 0.0019720050040632486, 0.023517195135354996, -0.00786433182656765, 0.004628585651516914, 0.001981480047106743, 0.02243703417479992, 0.029619159176945686, 0.008484951220452785, 0.029713910073041916, 0.03968171402812004, 0.03691498562693596, -0.011881774291396141, -0.01336936466395855, -0.005083390511572361, -0.03066141903400421, -0.05059702694416046, 0.027345135807991028, 0.037218187004327774, -0.023024490103125572, 0.06863761693239212, 0.02552591636776924, 0.061360739171504974, 0.02359299547970295, 0.05518297478556633, 0.002031224314123392, 0.08436627686023712, -0.00500758970156312, 0.004550416022539139, 0.022418083623051643, -0.016354020684957504, -0.028141044080257416, 0.038696303963661194, 0.09725241363048553, -0.06420326977968216, 0.05078652873635292, 0.02594282105565071, 0.016297169029712677, -0.01970820501446724, -0.02404780127108097, 0.014117897488176823, -0.02400990016758442, 0.008418625220656395, 0.008158059790730476, 0.0662119910120964, 0.03583482280373573, -0.052795249968767166, 0.05681269243359566, -0.010905838571488857, -0.02395305037498474, -0.06969882547855377, 0.006480967625975609, -0.01928182691335678, -0.041197728365659714, 0.05753279849886894, 0.023971999064087868, 0.022626535966992378, -0.00008786673424765468, 0.017614208161830902, 0.05541037768125534, 0.011834397912025452, 0.024313103407621384, 0.038279399275779724, 0.010223631747066975, -0.04468456655740738, 0.036194875836372375, 0.03162787854671478, -0.048171401023864746, 0.021015768870711327, -0.06120913848280907, -0.046882789582014084, 0.03846890106797218, 0.0016841988544911146, 0.0011346430983394384, 0.06924401968717575, -0.006390953902155161, 0.007139486726373434, 0.022721286863088608, -0.05101393163204193, -0.0075232284143567085, 0.032082684338092804, -0.06367266178131104, 0.038184646517038345, -0.03196898475289345, 0.017329955473542213, -0.055713579058647156, -0.05980682373046875, -0.007883282378315926, 0.007911707274615765, -0.08823212236166, -0.03810884803533554, -0.04377495497465134, 0.041046127676963806, -0.011512245051562786, -0.013236712664365768, 0.0861096978187561, -0.04487406834959984, 0.009494048543274403, 0.03572112321853638, 0.02016301080584526, 0.010972164571285248, -0.004941264167428017, -0.03130572661757469, 0.016117142513394356, -0.04786819964647293, -0.05226464569568634, -0.0366496816277504, 0.017936361953616142, -0.04862620681524277, 0.0330301932990551, 0.0186375193297863, -0.02025776170194149, -0.0009131626575253904, 0.005130765959620476, 0.039984915405511856, 0.020504113286733627, 0.0397954136133194, 0.019499752670526505, -0.008020671084523201, -0.029012752696871758, -0.007286351174116135, -0.04138723015785217, -0.0061730267480015755, -0.07155594229698181, -0.03899950534105301, 0.003456042381003499, 0.016344545409083366, 0.010631061159074306, -0.0025274825748056173, -0.06727319955825806, -0.010327857919037342, -0.036005374044179916, 0.026795579120516777, 0.024066749960184097, 0.046882789582014084, -0.029012752696871758, 0.000692274421453476, -0.034337759017944336, -0.06143654137849808, -0.0018215877935290337, 0.0682586133480072, 0.010697386227548122, 0.025241663679480553, -0.026246024295687675, -0.0026482900138944387, -0.028690598905086517, 0.011038489639759064, -0.022171732038259506, -0.03611907735466957, 0.0009404035517945886, 0.06249774992465973, -0.00874551571905613, -0.05601678416132927, -0.05533457547426224, -0.019262876361608505, 0.04805770143866539, -0.01702675223350525, -0.048550404608249664, -0.06321785598993301, 0.0024303628597408533, 0.01910179853439331, -0.04006071761250496, 0.015993967652320862, 0.01209970097988844, 0.05946572124958038, 0.009621962904930115, 0.015577062033116817, 0.008712353184819221, 0.05059702694416046, 0.015501261688768864, -0.08770151436328888, 0.016666699200868607, -0.04866410791873932, -0.030737221240997314, 0.032632239162921906, -0.0839114710688591, -0.0020691247191280127, -0.09558479487895966, -0.046920690685510635, 0.04335805028676987, 0.007570603862404823, 0.005884036421775818, -0.011161666363477707, 0.015529686585068703, -0.01683725044131279, 0.0397954136133194, -0.016297169029712677, 0.023706696927547455, -0.022721286863088608, 0.03918900713324547, 0.008451787754893303, -0.04654168337583542, -0.047110192477703094, 0.06026162952184677, 0.007385839708149433, 0.009001343511044979, 0.030642470344901085, 0.024085700511932373, 0.015150683000683784, -0.042524244636297226, -0.029069602489471436, -0.007414264604449272, -0.025355365127325058, -0.0341293066740036, -0.028008392080664635, 0.05393226072192192, 0.03007396310567856, -0.013009310699999332, -0.009697763249278069, 0.037350840866565704, 0.007267400622367859, -0.04115982726216316, -0.005538195371627808, 0.02054201439023018, 0.012677682563662529, 0.02452155575156212, 0.010839512571692467, -0.009844627231359482, 0.03803304582834244, 0.010583685711026192, -0.0309456717222929, 0.02118632011115551, -0.011436443775892258, 0.006324628368020058, 0.0032404838129878044, 0.053553257137537, -0.0745500773191452, -0.01798373833298683, 0.013729417696595192, 0.04233474284410477, -0.03926480934023857, 0.0482093021273613, -0.01697937771677971, -0.030547717586159706, 0.08550328761339188, -0.05260574817657471, 0.05018012225627899, 0.05605468526482582, -0.03653598204255104, 0.04684488847851753, 0.0032546964939683676, 0.0818648561835289, 0.02526061423122883, 0.014885379932820797, -0.02872850000858307, 0.031286776065826416, 0.07072214037179947, 0.009418248198926449, -0.05973102152347565, 0.052946850657463074, 0.0131135368719697, 0.02372564747929573, -0.051506638526916504, 0.05325005576014519, 0.0661361888051033, 0.011426969431340694, -0.004529097117483616, -0.005405543837696314, -0.0861855000257492, -0.004138249438256025, 0.021243171766400337, -0.0027335660997778177, 0.029353855177760124, 0.03602432459592819, -0.024578405544161797, 0.01674249954521656, 0.017519457265734673, -0.01320828776806593, -0.05052122846245766, -0.0010890441481024027, 0.019575554877519608, 0.0055760955438017845, 0.0031338888220489025, 0.011502769775688648, -0.012251302599906921, 0.02941070683300495, -0.04131143167614937, -0.017699483782052994, 0.008375987410545349, 0.018249040469527245, 0.011872299015522003, 0.003875315422192216, -0.059693120419979095, 0.05980682373046875, -0.027004031464457512, 0.0009646834805607796, -0.02526061423122883, 0.027022982016205788, -0.0015681288205087185, 0.02484370954334736, 0.004576472565531731, 0.02761043794453144, -0.03649808093905449, -0.046920690685510635, 0.012876659631729126, -0.04278954491019249, 0.025923870503902435, -0.011701746843755245, -0.012488179840147495, -0.09179475903511047, 0.028387395665049553, 0.00994885340332985, -0.010479459539055824, 0.01678987592458725, 0.023346643894910812, 0.05063492804765701, -0.014117897488176823, 0.012649256736040115, -0.06837230920791626, 0.06742480397224426, 0.08118264377117157, -0.028008392080664635, 0.007281613536179066, -0.014326348900794983, 0.0007023416692391038, 0.040818724781274796, 0.017926886677742004, 0.0008420994272455573, 0.025241663679480553, -0.00020297437731642276, 0.012706107459962368, -0.01601291634142399, 0.07515648007392883, 0.004358545411378145, 0.0288232509046793, 0.040818724781274796, 0.026795579120516777, -0.02742093615233898, 0.03284069150686264, 0.005429231561720371, 0.04597317799925804, 0.05162033811211586, 0.00767956767231226, 0.018618568778038025, 0.07599028944969177, 0.021982228383421898, -0.06617408990859985, 0.011294317431747913, -0.030813021585345268, -0.10324067622423172, -0.012156551703810692, -0.04684488847851753, -0.01896914839744568, -0.04426766186952591, -0.0033304973039776087, 0.0026530276518315077, -0.01191019918769598, 0.0555240772664547, -0.015614963136613369, 0.006106701213866472, -0.0052681551314890385, -0.04601107910275459, -0.048133499920368195, -0.06753850728273392, -0.011085866019129753, -0.008920805528759956, -0.0036029063630849123, -0.06261145323514938, -0.02581016905605793, -0.006627831608057022, -0.026378674432635307, 0.0859580934047699, -0.03141942620277405, 0.0009806727757677436, 0.026947181671857834, 0.00006240241054911166, -0.015643388032913208, -0.028520047664642334, -0.013246187940239906, 0.0320068821310997, -0.03736979141831398, 0.03020661510527134, -0.07185915112495422, -0.01984085701406002, 0.029903411865234375, 0.016069767996668816, 0.002419703407213092, -0.03267014026641846, -0.01553916186094284, -0.0039984919130802155, 0.0555240772664547, 0.05434916540980339, 0.015122258104383945, -0.005978787317872047, -0.018978623673319817, 0.0049886396154761314, 0.033788200467824936, 0.014032620936632156, -0.032404836267232895, 0.07341306656599045, 0.03835520148277283, 0.06363476067781448, -0.020428312942385674, -0.009674075990915298, -0.009579325094819069, -0.02687137946486473, -0.022740237414836884, -0.030907772481441498, 0.027743089944124222, -0.013862069696187973, 0.07436057180166245, -0.018154289573431015, -0.022304382175207138, -0.037483491003513336, -0.04203153774142265, -0.04358545318245888, 0.036384377628564835, -0.04934631288051605, -0.028292644768953323, -0.043547555804252625, 0.052150942385196686, 0.0011535933008417487, 0.04335805028676987, 0.013615717180073261, -0.006291465368121862, -0.02584807015955448, 0.019916657358407974, 0.017102552577853203, -0.029334906488656998, -0.05313635244965553, 0.05165823921561241, -0.04491196945309639, -0.032310087233781815, -0.009143469855189323, -0.07951503247022629, -0.021811677142977715, 0.022834988310933113, 0.005533457733690739, -0.06901662051677704, -0.054652370512485504, 0.025753319263458252, 0.056774791330099106, 0.020788365975022316, -0.07451217621564865, -0.009351922199130058, 0.013615717180073261, 0.003934534732252359, -0.023460345342755318, -0.04028812050819397, 0.00428037578240037, 0.027212483808398247, 0.002728828461840749, 0.007063685916364193, -0.03647913038730621, -0.02683348022401333, -0.04237264022231102, 0.009873053058981895, 0.0006940509774722159, 0.06822071224451065, 0.02876639924943447, 0.016827775165438652, -0.044798266142606735, 0.02118632011115551, -0.008849741891026497, -0.013520966283977032, -0.016950951889157295, -0.0038374150171875954, -0.03971961513161659, 0.0044082896783947945, 0.0320068821310997, -0.04642798379063606, -0.0029254367109388113, -0.10104245692491531, 0.0051023405976593494, -0.04320644959807396, 0.04832300543785095, -0.0017505245050415397, 0.06973672658205032, 0.04760289564728737, 0.06772800534963608, 0.0015740507515147328, 0.027136683464050293, 0.05021802335977554, -0.012052325531840324, 0.004384601954370737, -0.01924392580986023, -0.08868692815303802, 0.022721286863088608, -0.01017625629901886, -0.0545765683054924, -0.041008226573467255, -0.01808796264231205, -0.004145355895161629, -0.026246024295687675, -0.01849539205431938, 0.034072455018758774, -0.022683385759592056, -0.021716926246881485, -0.062005046755075455, -0.008574964478611946, 0.037350840866565704, -0.015321235172450542, -0.00595509959384799, -0.010365758091211319, 0.038791052997112274, -0.07003992795944214, 0.048588305711746216, -0.03299229219555855, -0.0068457587622106075, -0.04343385249376297, -0.05271944776177406, 0.010972164571285248, -0.025563815608620644, 0.04025021940469742, 0.05389436334371567, -0.03589167445898056, -0.032954394817352295, 0.0018061907030642033, -0.028501097112894058, -0.041614633053541183, 0.004815719090402126, 0.0419936366379261, -0.0008610496297478676, 0.04657958447933197, -0.0215463750064373, 0.032632239162921906, 0.00047345884377136827, -0.026170222088694572, 0.000038862708606757224, 0.07113904505968094, 0.06901662051677704, -0.009214533492922783, 0.0110290152952075, 0.05995842441916466, -0.05942782014608383, 0.09694921225309372, 0.006016687490046024, 0.031192025169730186, 0.051089733839035034, 0.03168473020195961, -0.03922690823674202, -0.012222877703607082, -0.07280665636062622, 0.05605468526482582, -0.014534801244735718, -0.06696999818086624, -0.024294152855873108, -0.01147434487938881, -0.036611780524253845, 0.012175502255558968, 0.04680698737502098, -0.005410281475633383, 0.017130978405475616, -0.06314206123352051, 0.025127962231636047, 0.03630857914686203, -0.021015768870711327, -0.011038489639759064, 0.006864708848297596, -0.039568010717630386, -0.027345135807991028, 0.019442902877926826, -0.024635257199406624, -0.034811511635780334, -0.07951503247022629, -0.02173587679862976, -0.00830018613487482, -0.048133499920368195, 0.002757253823801875, 0.07394366711378098, 0.00044710622751154006, 0.060754332691431046, -0.007617979310452938, -0.012819808907806873, -0.03390190377831459, -0.02391514927148819, 0.05218884348869324, -0.008849741891026497, -0.04066712409257889, 0.0011381962103769183, 0.021470574662089348, 0.02243703417479992, -0.00992042850703001, -0.032859642058610916, -0.02247493341565132, 0.014051571488380432, 0.03871525451540947, -0.08118264377117157, 0.04612478241324425, -0.005713484715670347, -0.014307399280369282, 0.004763606004416943, 0.017472082749009132, 0.0005560698336921632, -0.029202254489064217, 0.001234131632372737, 0.005831923335790634, 0.05897301435470581, -0.06067853420972824, 0.0024540505837649107, 0.04464666545391083, -0.025696467608213425, -0.09717661142349243, -0.019187074154615402, 0.007063685916364193, 0.03352290019392967, -0.04043972119688988, 0.030737221240997314, 0.013473590835928917, -0.0272503849118948, -0.007575341500341892, -0.010233107022941113, -0.006362529005855322, -0.01808796264231205, 0.03807094693183899, -0.023934099823236465, -0.0019968771375715733, 0.03949221223592758, -0.013918920420110226, 0.03899950534105301, 0.0008486135629937053, -0.0711769387125969, 0.039151109755039215, -0.014667453244328499, 0.019348151981830597, -0.016306644305586815, -0.06674259901046753, -0.033181797713041306, 0.028918001800775528, 0.03937850892543793, -0.02063676528632641, -0.024275202304124832, -0.014582176692783833, -0.003955853637307882, -0.04256214201450348, -0.010413133539259434, 0.04407816007733345, -0.014629552140831947, 0.04892941191792488, 0.037483491003513336, -0.04559417441487312, -0.00019542391237337142, 0.009470361284911633, -0.03953011333942413, -0.016818299889564514, 0.07053263485431671, -0.03339024633169174, -0.012412379495799541, -0.03771089389920235, -0.0038990031462162733, 0.04434346407651901, -0.006229877471923828, 0.045253071933984756, 0.017566833645105362, 0.028141044080257416, -0.036384377628564835, -0.0157286636531353, -0.020466214045882225, 0.03903740644454956, 0.0071252742782235146, 0.011313267983496189, 0.016619322821497917, -0.008224385790526867, -0.01459165196865797, 0.00045717350440099835, 0.003747401526197791, 0.031154124066233635, -0.02507111057639122, -0.014970656484365463, 0.0029183304868638515, -0.01807848922908306, -0.03752139210700989, -0.03797619417309761, 0.06897871941328049, 0.07913602143526077, 0.034811511635780334, -0.03862050175666809, 0.0036739695351570845, 0.0691303238272667, 0.024161502718925476, -0.007878544740378857, 0.0064572799019515514, 0.02095891907811165, -0.03949221223592758, 0.03168473020195961, -0.030471917241811752, 0.03691498562693596, 0.008309661410748959, 0.03983331471681595, -0.04422976076602936, -0.0099867545068264, -0.0514308363199234, 0.033143896609544754, -0.008177010342478752, -0.024711057543754578, -0.02867164835333824, 0.014544276520609856, -0.012080751359462738, -0.010763712227344513, 0.030358215793967247, -0.023327693343162537, 0.042258940637111664, 0.08019723743200302, -0.039568010717630386, 0.0482093021273613, -0.029676008969545364, 0.060716431587934494, -0.05537247657775879, -0.08148585259914398, -0.009105569683015347, -0.01535913534462452, 0.027724139392375946, 0.027117732912302017, 0.007333726622164249, 0.009740401990711689, -0.0014260023599490523, -0.028463196009397507, 0.02808419242501259, 0.01581393927335739, 0.003548424458131194, -0.015804463997483253, -0.048550404608249664, -0.008219648152589798, 0.07049473375082016, 0.02279708720743656, 0.042713746428489685, 0.013284088112413883, -0.009910953231155872, -0.009565112181007862, -0.017964787781238556, -0.020181959494948387, 0.02696613036096096, -0.011862823739647865, -0.011919674463570118, 0.009096094407141209, 0.00397954136133194, 0.022304382175207138, 0.03539896756410599, -0.014885379932820797, 0.02359299547970295, -0.014127371832728386, -0.04263794422149658, 0.031893182545900345, -0.024995310232043266, 0.04999062046408653, 0.001455612014979124, 0.04108402878046036, -0.02956230752170086, 0.01209970097988844 ]
42,977
linearmodels.asset_pricing.model
_jacobian
null
def _jacobian( self, betas: Float64Array, lam: Float64Array, alphas: Float64Array ) -> Float64Array: nobs, nf, nport, nrf, s1, s2, s3 = self._boundaries() f = self.factors.ndarray fc = np.c_[np.ones((nobs, 1)), f] excess_returns = not self._risk_free bc = betas sigma_inv = self._sigma_inv jac = np.eye((nport * (nf + 1)) + (nf + nrf) + nport) fpf = fc.T @ fc / nobs jac[:s1, :s1] = np.kron(np.eye(nport), fpf) b_tilde = sigma_inv @ bc alpha_tilde = sigma_inv @ alphas _lam = lam if excess_returns else lam[1:] for i in range(nport): block = np.zeros((nf + nrf, nf + 1)) block[:, 1:] = b_tilde[[i]].T @ _lam.T block[nrf:, 1:] -= alpha_tilde[i] * np.eye(nf) jac[s1:s2, (i * (nf + 1)) : ((i + 1) * (nf + 1))] = block jac[s1:s2, s1:s2] = bc.T @ sigma_inv @ bc zero_lam = np.r_[[[0]], _lam] jac[s2:s3, :s1] = np.kron(np.eye(nport), zero_lam.T) jac[s2:s3, s1:s2] = bc return jac
(self, betas: numpy.ndarray, lam: numpy.ndarray, alphas: numpy.ndarray) -> numpy.ndarray
[ -0.002543695969507098, -0.019687792286276817, 0.0115350978448987, 0.009365947917103767, -0.03200415149331093, -0.03218797966837883, -0.0874277725815773, -0.02909969724714756, -0.016718998551368713, 0.01674657315015793, -0.008400860242545605, 0.011397228576242924, 0.020533394068479538, 0.012821882031857967, -0.07033193111419678, 0.0229782834649086, 0.06827307492494583, -0.017693277448415756, -0.003667333861812949, 0.025809207931160927, -0.03448580577969551, -0.03288652002811432, 0.02439374476671219, 0.11617819964885712, -0.029651176184415817, 0.010873323306441307, 0.05720673128962517, 0.009908235631883144, -0.011176636442542076, 0.010202357545495033, 0.00673723267391324, 0.00823082122951746, 0.001251167501322925, -0.029504114761948586, 0.06224357336759567, 0.030312949791550636, 0.06753776967525482, 0.007536876946687698, -0.06316270679235458, -0.02606656402349472, 0.05411845073103905, -0.04841983690857887, 0.038787342607975006, -0.05268460512161255, -0.010092061944305897, -0.037188053131103516, -0.015027796849608421, 0.07294226437807083, -0.0033847009763121605, 0.012785116210579872, 0.0001799486781237647, -0.09956030547618866, 0.04569920897483826, -0.07478052377700806, -0.01305166445672512, 0.076839379966259, 0.06908190995454788, 0.03981676697731018, 0.022022387012839317, -0.012132532894611359, 0.010560818947851658, -0.036324068903923035, 0.013520421460270882, -0.033364467322826385, 0.004903565626591444, 0.04654480889439583, -0.0518757700920105, -0.034688014537096024, 0.062390632927417755, 0.022665778174996376, 0.04077266529202461, 0.029283523559570312, -0.01682010293006897, 0.02895263582468033, -0.024191536009311676, -0.0030331332236528397, -0.02689378149807453, -0.06452301889657974, -0.08698658645153046, -0.016038840636610985, 0.0026953525375574827, -0.040993254631757736, 0.006406345404684544, -0.04728011414408684, 0.03516596555709839, -0.02689378149807453, 0.007656363770365715, 0.000021739610019722022, -0.00881446897983551, 0.0215444378554821, -0.039559412747621536, -0.05194929987192154, 0.03421006724238396, 0.023989327251911163, 0.006415536627173424, -0.013575569726526737, 0.01913631334900856, -0.015220814384520054, 0.04341976344585419, 0.04069913551211357, 0.05790527164936066, 0.02987176738679409, -0.01685686782002449, 0.00576754892244935, 0.020992958918213844, 0.036360833793878555, -0.03586450219154358, -0.018934104591608047, 0.04036824777722359, -0.08331006020307541, -0.053309615701436996, 0.10036914050579071, 0.026636425405740738, -0.08000119030475616, -0.025459937751293182, 0.0059375884011387825, -0.056324366480112076, 0.020331185311079025, -0.030037211254239082, 0.03759247064590454, 0.018658366054296494, 0.013575569726526737, 0.023474613204598427, 0.04187562316656113, 0.04518449679017067, 0.004885182715952396, 0.03511081635951996, 0.026360686868429184, 0.003975242841988802, -0.05915529280900955, -0.004680676385760307, 0.017867913469672203, 0.022040769457817078, 0.03341961279511452, 0.01182002853602171, 0.00162916025146842, -0.02141575887799263, -0.03889763727784157, -0.030312949791550636, -0.024099623784422874, 0.03292328491806984, -0.004283152054995298, -0.022592248395085335, -0.007693129125982523, 0.003228448797017336, 0.006493662483990192, 0.10728100687265396, -0.05489052087068558, -0.025643764063715935, -0.004512934945523739, 0.02525772899389267, 0.00081572902854532, -0.04422859847545624, -0.021213550120592117, -0.013630717061460018, -0.006456897594034672, 0.06650833785533905, 0.013888074085116386, -0.003586909966543317, 0.00998176634311676, -0.040147654712200165, 0.021617967635393143, -0.04691246151924133, -0.003945371136069298, -0.01304247323423624, -0.0038764362689107656, -0.03443066030740738, 0.01920984499156475, -0.043125640600919724, -0.04963308945298195, -0.010459714569151402, -0.002543695969507098, -0.04040501266717911, 0.027941592037677765, -0.02437536232173443, -0.007955081760883331, -0.01989000104367733, 0.0008323882939293981, 0.021287081763148308, -0.014071900397539139, -0.0038006079848855734, 0.01453146617859602, -0.02301504835486412, -0.009945000521838665, 0.03669172152876854, 0.04985368251800537, -0.0009461307781748474, -0.0026493959594517946, 0.01879623532295227, -0.0030492180958390236, -0.0414712056517601, 0.040993254631757736, 0.053236085921525955, 0.011581054888665676, -0.023290786892175674, -0.015046179294586182, 0.05507434904575348, 0.026342302560806274, -0.050074271857738495, -0.027334965765476227, 0.03746379166841507, -0.0009277481585741043, 0.004517530556768179, -0.014889927580952644, 0.06220680847764015, 0.007550663780421019, -0.043382998555898666, 0.0050552221946418285, 0.03227989003062248, 0.0038212884683161974, 0.02222459577023983, 0.007739085704088211, -0.050221335142850876, -0.03343799710273743, -0.024908458814024925, -0.03432036191225052, 0.07433933764696121, -0.00012393911310937256, 0.03586450219154358, -0.021838560700416565, -0.01604803279042244, -0.020423097535967827, 0.01072626281529665, 0.006493662483990192, -0.019779706373810768, 0.007592024747282267, 0.05617730692028999, 0.06386124342679977, 0.00163145805709064, -0.028879106044769287, -0.07860410958528519, 0.009724409319460392, -0.0236952044069767, -0.05944941192865372, -0.018594026565551758, -0.023180492222309113, -0.015597658231854439, -0.01898925192654133, -0.06202298030257225, 0.014733674935996532, -0.008115929551422596, -0.016507597640156746, 0.056287601590156555, 0.08191297948360443, 0.0018842192366719246, 0.013676674105226994, 0.03830939158797264, 0.02614009380340576, -0.045515380799770355, 0.033971093595027924, -0.04606686159968376, -0.06867749243974686, 0.02766585163772106, -0.015560893341898918, -0.03055192530155182, -0.009421096183359623, 0.053052257746458054, 0.055515531450510025, 0.05731702968478203, -0.02152605541050434, 0.007642576936632395, -0.05202283337712288, 0.002796456916257739, -0.006098436191678047, -0.018014973029494286, 0.04669187217950821, 0.015230005607008934, 0.013860500417649746, 0.05823615938425064, 0.02915484458208084, 0.06974368542432785, 0.030331334099173546, 0.008322734385728836, -0.04220651090145111, 0.028750427067279816, 0.02364005707204342, 0.012803499586880207, 0.00033979135332629085, -0.03959617763757706, 0.006930250208824873, 0.03220636025071144, -0.06000089272856712, -0.013851309195160866, 0.01691201515495777, -0.012150916270911694, 0.0038189906626939774, -0.0011150211794301867, -0.02290475182235241, 0.01847453974187374, -0.030147507786750793, 0.02983500249683857, 0.016617894172668457, 0.04599333181977272, 0.021985620260238647, 0.11228108406066895, 0.008207842707633972, 0.008299755863845348, 0.017334816977381706, 0.030202655121684074, 0.001154084224253893, 0.006705062929540873, -0.017849529162049294, 0.07375109940767288, -0.049302201718091965, -0.019301757216453552, -0.06900838017463684, -0.019577497616410255, -0.0010954895988106728, -0.00403039064258337, 0.03682040050625801, 0.017941443249583244, -0.03900793194770813, 0.04345652833580971, -0.017472686246037483, -0.01486235298216343, -0.04750070720911026, 0.00898450892418623, -0.03073575161397457, 0.054743461310863495, 0.03882410749793053, 0.04386094585061073, -0.05125076323747635, 0.017362389713525772, -0.012472611851990223, -0.013906456530094147, -0.019485583528876305, 0.026636425405740738, 0.02682025171816349, -0.007881551049649715, -0.031801942735910416, 0.00958653911948204, 0.04444919154047966, -0.017527833580970764, -0.00411081500351429, -0.033235788345336914, -0.018014973029494286, 0.01691201515495777, -0.042537398636341095, -0.016397302970290184, -0.05507434904575348, 0.01917307823896408, -0.05228018760681152, -0.04819924756884575, 0.016976354643702507, -0.020147358998656273, -0.0015246090479195118, 0.015551702119410038, -0.0007789637893438339, -0.03606671094894409, 0.0394858792424202, 0.008115929551422596, 0.005689422599971294, -0.0030698985792696476, 0.08779542148113251, -0.012720777653157711, 0.06933926790952682, -0.005657253321260214, -0.05790527164936066, 0.005822696723043919, -0.0063190278597176075, 0.008920169435441494, 0.013088430278003216, 0.01454984862357378, 0.009660069830715656, 0.04529479146003723, -0.030460011214017868, -0.0063603888265788555, -0.015138092450797558, 0.06705982238054276, -0.06834660470485687, 0.05489052087068558, 0.01305166445672512, 0.008253798820078373, 0.009421096183359623, -0.03614024445414543, -0.003297383664175868, -0.025110667571425438, -0.02060692384839058, -0.021599585190415382, -0.004843822214752436, -0.008626047521829605, -0.09389845281839371, 0.012426655739545822, -0.0038557557854801416, -0.018538879230618477, 0.023290786892175674, 0.026434216648340225, -0.03514758124947548, -0.011921132914721966, -0.007348455023020506, 0.013161960057914257, -0.016415685415267944, 0.03659980744123459, 0.00935216061770916, -0.02840115688741207, 0.006383366882801056, 0.07481728494167328, 0.006558001972734928, 0.01183841098099947, 0.03000044636428356, -0.02066207118332386, -0.01500022318214178, -0.004634719807654619, -0.005239048507064581, -0.04121384769678116, -0.028051886707544327, 0.024724632501602173, 0.004326810594648123, 0.0214525256305933, 0.09272196888923645, -0.024209918454289436, 0.03351152688264847, 0.006751019507646561, -0.06882455199956894, -0.02750040963292122, 0.027169521898031235, -0.04683893173933029, -0.0890454426407814, 0.051765475422143936, -0.008180269040167332, 0.011636202223598957, -0.03220636025071144, 0.05661848932504654, -0.014246535487473011, 0.019761323928833008, 0.01772085204720497, 0.008092951029539108, -0.0245959535241127, -0.0858101025223732, -0.014834779314696789, 0.03226150944828987, -0.007173819933086634, 0.004423319362103939, -0.026452599093317986, -0.0006520087481476367, 0.02292313426733017, -0.015983693301677704, -0.019375288859009743, 0.05312579125165939, -0.005606701131910086, 0.004692165181040764, 0.05911852419376373, -0.03852998465299606, -0.03512919694185257, -0.04970662295818329, 0.01033103559166193, 0.07698643952608109, -0.07069958001375198, -0.05216989293694496, -0.014641761779785156, -0.011562671512365341, 0.04911837726831436, 0.03897116705775261, -0.02674672193825245, -0.013888074085116386, -0.008515751920640469, 0.01423734426498413, -0.06878779083490372, 0.005059817805886269, 0.046949226409196854, 0.04080943018198013, -0.044081538915634155, 0.06691276282072067, 0.03066221997141838, 0.02902616746723652, -0.015588467009365559, 0.04297858104109764, 0.013529612682759762, 0.0021174487192183733, -0.008979912847280502, 0.004703654441982508, 0.0016567341517657042, 0.01640649326145649, -0.031765177845954895, -0.0037753318902105093, -0.03443066030740738, -0.0429050512611866, -0.002016344340518117, 0.0049311392940580845, 0.007991846650838852, -0.09779556840658188, 0.028897488489747047, -0.0014866949059069157, 0.005914609879255295, 0.015514936298131943, -0.03740864247083664, -0.005606701131910086, -0.005225261673331261, 0.06279505044221878, -0.04518449679017067, -0.041728559881448746, 0.006162775214761496, 0.03582773730158806, 0.09941324591636658, -0.023235639557242393, 0.007578237447887659, 0.014742866158485413, -0.01450389251112938, -0.010183975100517273, 0.00629604933783412, -0.030368098989129066, 0.0012672522570937872, -0.09323667734861374, -0.0008392817690037191, -0.023217257112264633, -0.10323683172464371, -0.0007129012374207377, -0.03430198132991791, -0.04143444076180458, -0.005799718666821718, -0.039412349462509155, -0.01565280556678772, -0.05720673128962517, -0.03827262669801712, -0.05878764018416405, 0.0506257526576519, -0.027334965765476227, -0.001210955553688109, 0.03310710936784744, -0.0018554963171482086, -0.003977540880441666, -0.00026180880377069116, 0.03450419008731842, 0.03911823034286499, -0.0031135573517531157, 0.05647142603993416, 0.021856943145394325, -0.014301682822406292, -0.026912163943052292, 0.04073590040206909, -0.07022163271903992, -0.06764806061983109, 0.0046737827360630035, 0.058567047119140625, -0.04841983690857887, 0.0229782834649086, -0.0016751168295741081, -0.034173302352428436, -0.024044474586844444, 0.0022185530979186296, -0.01303328201174736, 0.03849321976304054, 0.03970647230744362, -0.03606671094894409, -0.06823630630970001, 0.03441227599978447, -0.0400373600423336, 0.03292328491806984, 0.012187681160867214, 0.012729968875646591, 0.030092358589172363, 0.029320288449525833, 0.020533394068479538, 0.043309468775987625, 0.015772292390465736, 0.010524053126573563, -0.02441212721168995, -0.013621525838971138, 0.024283450096845627, 0.014926692470908165, -0.020809132605791092, 0.018189609050750732, 0.020037062466144562, -0.04889778420329094, -0.049302201718091965, 0.035588763654232025, 0.09367786347866058, 0.004414128139615059, 0.05194929987192154, 0.02614009380340576, 0.008364095352590084, -0.006626936607062817, 0.02770261839032173, -0.026268772780895233, -0.011112297885119915, -0.023290786892175674, -0.01602965034544468, -0.052500780671834946, -0.06117738038301468, -0.006052479613572359, 0.0017888592556118965, -0.04349329322576523, -0.07338344305753708, -0.00402119942009449, 0.03547846898436546, 0.02753717452287674, -0.11213401705026627, -0.0041682603769004345, 0.014430361799895763, -0.017794381827116013, -0.032629162073135376, 0.07095693796873093, -0.03281298652291298, -0.024173153564333916, -0.03360344097018242, 0.020459862425923347, -0.07029516249895096, 0.02295990101993084, 0.0021300867665559053, 0.016002075746655464, -0.02437536232173443, -0.034688014537096024, -0.04382418096065521, 0.014016752131283283, 0.01920984499156475, 0.024301832541823387, -0.02994529716670513, -0.04051530733704567, 0.03970647230744362, 0.013272255659103394, 0.007224372122436762, 0.007886146195232868, 0.011682159267365932, 0.007233563344925642, -0.06209651008248329, -0.027996739372611046, -0.0058548664674162865, 0.02077236771583557, 0.027169521898031235, 0.033272553235292435, -0.02678348682820797, 0.02231650799512863, 0.012831073254346848, 0.012022237293422222, -0.013318212702870369, -0.032537247985601425, 0.044706545770168304, -0.06433919072151184, 0.01304247323423624, 0.024706250056624413, 0.01531272754073143, 0.057868506759405136, 0.007444963790476322, 0.023143725469708443, -0.023603292182087898, -0.005046030972152948, 0.0015280557563528419, -0.011397228576242924, -0.018162034451961517, 0.04444919154047966, -0.039338819682598114, 0.011691350489854813, 0.011029575951397419, -0.02454080618917942, 0.019467201083898544, 0.0019451116677373648, -0.013134386390447617, -0.008028611540794373, -0.0063603888265788555, -0.025000371038913727, -0.05290519818663597, 0.029596028849482536, -0.05882440507411957, 0.030221037566661835, 0.00023782522475812584, -0.014246535487473011, -0.00013621813559439033, 0.09507494419813156, 0.009641687385737896, -0.029301906004548073, 0.04125061258673668, -0.05989059433341026, -0.024669485166668892, -0.07742761820554733, 0.009421096183359623, 0.0030630051624029875, 0.050147805362939835, -0.01613994501531124, -0.008736343123018742, -0.006144392769783735, -0.00400281697511673, -0.007936699315905571, -0.03908146172761917, -0.06275828927755356, 0.0520595982670784, 0.027040842920541763, -0.04066237062215805, 0.0414712056517601, 0.03768438473343849, -0.025551849976181984, 0.06672893464565277, -0.017132608219981194, 0.006613149773329496, 0.03886087238788605, 0.02071722038090229, -0.03922852501273155, 0.01909954845905304, 0.025073902681469917, -0.03694907948374748, -0.02902616746723652, -0.033290937542915344, 0.038677044212818146, 0.056103773415088654, 0.06183915585279465, 0.07025839388370514, 0.0841924250125885, -0.04194915294647217, 0.03389756381511688, -0.005349344108253717, 0.0013269957853481174, 0.028621748089790344, -0.020864279940724373, -0.01381454337388277, 0.07080987840890884, -0.01303328201174736, 0.06180239096283913, 0.05606700852513313, -0.023254022002220154, -0.03463286906480789, 0.025551849976181984, -0.009733600541949272, 0.04878748953342438, 0.012206063605844975, -0.037794679403305054, -0.02992691472172737, 0.0411035530269146, -0.010450523346662521, -0.04040501266717911, -0.015919353812932968, 0.03886087238788605, -0.03830939158797264, 0.006098436191678047, 0.057022906839847565, -0.027077607810497284, 0.00987146981060505, -0.06823630630970001, 0.024816544726490974, 0.005257430952042341, 0.008961530402302742, 0.007711511570960283, 0.011783263646066189, 0.02382388338446617, 0.01452227495610714, 0.009641687385737896, -0.03974323719739914, -0.041655030101537704, 0.005427470430731773, -0.045441851019859314, -0.03292328491806984, 0.04819924756884575, -0.0014005263801664114, 0.013547995127737522, 0.0034467424266040325, 0.020128976553678513, 0.02768423594534397, 0.046434514224529266, -0.05617730692028999, -0.00846519973129034, 0.07224372029304504, -0.04202268272638321, 0.012500185519456863, 0.011976281180977821, -0.031746797263622284, 0.017150990664958954, 0.034853458404541016, -0.028879106044769287, 0.06580980122089386, -0.016700616106390953, -0.0429050512611866, -0.05588318407535553, -0.03674687072634697, 0.051581647247076035, 0.0004960437072440982, 0.06191268563270569, -0.03297843039035797, -0.014972648583352566, -0.0026310132816433907, -0.0017532429192215204 ]
42,978
linearmodels.asset_pricing.model
_moments
null
def _moments( self, eps: Float64Array, betas: Float64Array, alphas: Float64Array, pricing_errors: Float64Array, ) -> Float64Array: sigma_inv = self._sigma_inv f = self.factors.ndarray nobs, nf, nport, _, s1, s2, s3 = self._boundaries() fc = np.c_[np.ones((nobs, 1)), f] f_rep = np.tile(fc, (1, nport)) eps_rep = np.tile(eps, (nf + 1, 1)) eps_rep = np.reshape(eps_rep.T, (nport * (nf + 1), nobs)).T # Moments g1 = f_rep * eps_rep g2 = pricing_errors @ sigma_inv @ betas g3 = pricing_errors - alphas.T return np.c_[g1, g2, g3]
(self, eps: numpy.ndarray, betas: numpy.ndarray, alphas: numpy.ndarray, pricing_errors: numpy.ndarray) -> numpy.ndarray
[ 0.017047859728336334, -0.00009866710024653003, -0.01947030797600746, -0.042606040835380554, -0.009095518849790096, -0.036200620234012604, -0.02531321533024311, -0.0645260140299797, 0.038722869008779526, 0.0743972659111023, -0.02288169413805008, -0.03041214868426323, -0.02834354154765606, -0.010860186070203781, -0.06568733602762222, 0.02108527347445488, 0.01892593689262867, 0.006482542026787996, 0.0008142871083691716, -0.021792953833937645, -0.023081297054886818, 0.030738770961761475, -0.02239176072180271, 0.009113664738833904, -0.014135479927062988, 0.000014645897863374557, 0.020776797086000443, -0.01688454858958721, -0.017501503229141235, 0.022282887250185013, 0.05545317754149437, -0.012792699970304966, 0.03785187378525734, -0.027526987716555595, 0.013309851288795471, -0.005144298542290926, 0.049573980271816254, 0.0025948313996195793, -0.08107487112283707, 0.033750955015420914, 0.00978959072381258, -0.034313470125198364, 0.06205820292234421, 0.03315214440226555, 0.009390385821461678, -0.06884468346834183, 0.043150413781404495, 0.05026351660490036, -0.011685813777148724, 0.019343288615345955, -0.03988419100642204, -0.057666949927806854, 0.06673979014158249, -0.03095651976764202, 0.009744226932525635, 0.10292226076126099, 0.05175146088004112, 0.04892073571681976, -0.020577194169163704, 0.00107626523822546, 0.021067127585411072, -0.02193811908364296, -0.015360312536358833, -0.07105845957994461, 0.008764360100030899, -0.0325896292924881, -0.01688454858958721, -0.002515444066375494, -0.009299658238887787, 0.009113664738833904, -0.02014169842004776, -0.02524063177406788, -0.029867779463529587, -0.0002908978203777224, 0.007612110115587711, 0.056795958429574966, 0.034204594790935516, -0.0341683030128479, 0.013618328608572483, -0.0025970996357500553, -0.016920840367674828, 0.026674140244722366, -0.05534430593252182, 0.008179162628948689, 0.06481634825468063, -0.024351494386792183, -0.02166593447327614, 0.0191073939204216, -0.006337376777082682, -0.00870992336422205, -0.022137722000479698, -0.019361434504389763, 0.015922829508781433, 0.017528720200061798, -0.028180230408906937, 0.036581676453351974, -0.030430294573307037, -0.0055389669723808765, 0.04921106621623039, -0.0028193839825689793, 0.04685213044285774, 0.05654191970825195, -0.003413654863834381, 0.08310718834400177, 0.009054691530764103, 0.021629642695188522, -0.020831232890486717, -0.07385288923978806, 0.04634404927492142, -0.014416737481951714, -0.05411040037870407, 0.09551882743835449, 0.007807176094502211, -0.031863804906606674, 0.018517659977078438, -0.07802639901638031, 0.00619221106171608, 0.030847646296024323, -0.011794688180088997, 0.023861560970544815, -0.02436964027583599, 0.009980120696127415, 0.01937958039343357, 0.041952796280384064, 0.010869259014725685, 0.007557672914117575, 0.06467118114233017, -0.043440744280815125, -0.047033585608005524, -0.08071195334196091, -0.026474537327885628, 0.038432538509368896, 0.04779570549726486, -0.014843161217868328, 0.0294504277408123, -0.0069407201372087, 0.005947244353592396, -0.051533713936805725, 0.019688056781888008, -0.0640542283654213, -0.009961974807083607, 0.02239176072180271, -0.06441713869571686, -0.020649775862693787, -0.09515590965747833, 0.007444262504577637, 0.05494510009884834, -0.04931994155049324, 0.0021264462266117334, -0.01615872234106064, -0.026202352717518806, -0.0024995666462928057, 0.030521024018526077, -0.007367143407464027, -0.018889646977186203, -0.00988939218223095, 0.029341554269194603, -0.020595340058207512, -0.007716447580605745, 0.05559834465384483, -0.06205820292234421, -0.0042959884740412235, 0.010860186070203781, -0.01836342178285122, 0.006682144477963448, -0.006559661123901606, -0.013364288955926895, -0.02484142780303955, -0.059336353093385696, 0.00642810482531786, 0.019688056781888008, 0.0696793869137764, 0.012683825567364693, -0.007072276435792446, 0.0382147878408432, -0.01985136792063713, 0.03643651306629181, -0.008991180919110775, -0.008224526420235634, 0.01589561067521572, 0.020940108224749565, -0.0017623985186219215, -0.028742747381329536, -0.01632203347980976, -0.03661796823143959, 0.03571068495512009, -0.04169875755906105, -0.005734032951295376, -0.052840203046798706, -0.043731074780225754, -0.005094397813081741, -0.003277562325820327, -0.00026509695453569293, 0.03659982234239578, 0.0025381261948496103, 0.03536591678857803, -0.011449920013546944, -0.00403968058526516, -0.0033773635514080524, -0.019742492586374283, -0.04706987738609314, 0.0008244940545409918, -0.021248584613204002, -0.012302766554057598, 0.05352973937988281, -0.026057187467813492, -0.038069624453783035, -0.020468320697546005, -0.04837636649608612, -0.013473162427544594, -0.035438500344753265, -0.003710790304467082, -0.013954022899270058, 0.027363676577806473, 0.013854222372174263, 0.0034612873569130898, 0.11482582241296768, 0.007956878282129765, 0.02899678610265255, -0.019633619114756584, -0.030720625072717667, -0.08760730922222137, 0.012556806206703186, 0.05146113038063049, -0.04500127211213112, 0.07062296569347382, -0.012066872790455818, 0.052186958491802216, 0.018209183588624, -0.003418191336095333, -0.0277628805488348, 0.03126499429345131, -0.04543676599860191, -0.05374748632311821, 0.03890432417392731, 0.02549467235803604, -0.0032594166696071625, -0.009208929724991322, 0.03915836289525032, 0.022446198388934135, -0.03317029029130936, -0.059917014092206955, -0.014462102204561234, 0.058029863983392715, 0.02447851374745369, -0.036581676453351974, 0.026147915050387383, -0.017056932672858238, 0.006155919749289751, 0.022573217749595642, -0.051715169101953506, 0.013790711760520935, 0.08165553212165833, 0.03222671523690224, 0.010950913652777672, -0.03567439317703247, 0.003465823596343398, 0.06176787242293358, 0.05490880832076073, -0.03594658151268959, 0.06387276947498322, -0.057558078318834305, 0.00011170930520165712, 0.05617900565266609, 0.011595085263252258, 0.04997318610548973, 0.017247462645173073, 0.031863804906606674, 0.035728830844163895, 0.023299045860767365, 0.06572362780570984, 0.030575459823012352, -0.03173678368330002, -0.07817156612873077, 0.05487251654267311, 0.047215044498443604, -0.0056614503264427185, -0.03701717406511307, -0.025295069441199303, 0.018236402422189713, -0.027563277631998062, -0.06318323314189911, -0.010769457556307316, -0.026801159605383873, 0.00335241318680346, 0.031228704378008842, -0.02389785274863243, -0.04587226361036301, 0.042896371334791183, -0.007308170199394226, -0.003422727808356285, 0.010451908223330975, 0.01299230195581913, -0.007893367670476437, 0.031845659017562866, -0.01203965488821268, -0.020159844309091568, -0.006659462116658688, -0.007675619795918465, -0.01807309128344059, 0.026873743161559105, 0.019815076142549515, 0.05186033621430397, 0.004225673619657755, -0.057267747819423676, -0.01340965274721384, 0.06438084691762924, -0.002461007097736001, 0.0764295756816864, -0.03378724306821823, 0.03503929451107979, 0.0012350399047136307, -0.04434802755713463, 0.008650950156152248, 0.05675966665148735, 0.0005236727884039283, -0.01744706556200981, -0.04351332411170006, 0.014525611884891987, 0.026510829105973244, 0.0382147878408432, 0.0196699108928442, 0.06082429736852646, 0.014861307106912136, -0.004863040521740913, -0.042968954890966415, -0.022990569472312927, 0.040319688618183136, 0.016576072201132774, -0.006323767360299826, -0.04648921638727188, -0.042206838726997375, 0.010524490848183632, 0.033932410180568695, -0.0028352616354823112, -0.08927671611309052, 0.04039226844906807, -0.05527172237634659, 0.01845414936542511, -0.03627320006489754, 0.03832366317510605, -0.049283649772405624, -0.023462356999516487, 0.033369895070791245, 0.008936744183301926, -0.030666189268231392, 0.07701023668050766, -0.06499779969453812, 0.009381312876939774, 0.03879544883966446, -0.052949074655771255, 0.06612283736467361, -0.0001462994987377897, 0.025567254051566124, 0.0013325728941708803, 0.030375858768820763, -0.020758651196956635, -0.03850511834025383, -0.009032009169459343, -0.017673885449767113, -0.05429185554385185, 0.07225607335567474, 0.008347010239958763, -0.02231917902827263, -0.012438859790563583, -0.06615912914276123, 0.011359191499650478, -0.0302306916564703, 0.030738770961761475, -0.0165216363966465, 0.019542891532182693, 0.030938373878598213, -0.03226300701498985, 0.02240990661084652, -0.01543289516121149, -0.00002365671389270574, 0.005334828048944473, -0.0579935722053051, -0.006931647192686796, 0.014779651537537575, 0.008351546712219715, -0.04830378293991089, -0.00004242260183673352, -0.0008636206621304154, 0.041735049337148666, 0.0029668177012354136, 0.0589008554816246, -0.0029486720450222492, -0.0035565521102398634, 0.025168050080537796, 0.003581502242013812, -0.04558193311095238, 0.053239405155181885, 0.05846536159515381, -0.059263769537210464, 0.007507772650569677, 0.03131943196058273, -0.04830378293991089, -0.06372760981321335, -0.008020387962460518, 0.0012792700435966253, 0.05487251654267311, 0.015042763203382492, 0.0429326631128788, -0.06278403103351593, -0.06768336147069931, -0.04641663283109665, -0.008855088613927364, 0.005929098930209875, 0.09762372821569443, -0.023861560970544815, 0.04471094161272049, 0.029486719518899918, -0.025948313996195793, -0.0005645005730912089, 0.01472521387040615, -0.07363514602184296, -0.10212384909391403, 0.026293082162737846, 0.01203965488821268, -0.011059788055717945, -0.015505477786064148, 0.024678116664290428, 0.01214852835983038, -0.000328606809489429, 0.02364381216466427, -0.04017452150583267, -0.052840203046798706, -0.07367143779993057, -0.04017452150583267, 0.04111809656023979, -0.003098373766988516, -0.02965003065764904, -0.06140495836734772, 0.02221030555665493, -0.0005452207988128066, -0.0577758252620697, -0.010052703320980072, 0.0024179110769182444, -0.002271611476317048, -0.029486719518899918, 0.06851806491613388, 0.030176255851984024, -0.0138814402744174, 0.013763493858277798, -0.011903561651706696, 0.06035251170396805, -0.06528813391923904, -0.006341912783682346, 0.01834527589380741, -0.006600488908588886, 0.016358325257897377, 0.05723145604133606, -0.04307783022522926, 0.04286007955670357, 0.01836342178285122, 0.03211784362792969, -0.03433161601424217, -0.03857770189642906, 0.05291278287768364, -0.015568988397717476, -0.012248329818248749, -0.02270023711025715, -0.00042188691440969706, -0.03542035445570946, -0.004239283036440611, 0.048521529883146286, 0.001008218969218433, -0.026329372078180313, 0.034132011234760284, 0.05298536643385887, 0.004967377986758947, 0.05345715582370758, -0.01901666633784771, -0.07185687124729156, -0.01303766667842865, -0.019071104004979134, -0.005067179445177317, 0.03738008812069893, 0.004922014195472002, 0.01793699897825718, -0.007848003879189491, 0.04442061111330986, 0.004094117786735296, -0.01321912370622158, 0.08847830444574356, 0.038432538509368896, -0.013582036830484867, 0.07802639901638031, -0.05995330587029457, -0.018100310117006302, -0.037053465843200684, 0.027127781882882118, 0.012556806206703186, 0.01242978684604168, -0.030067380517721176, 0.040138229727745056, 0.01185819786041975, 0.04206167161464691, -0.02861572802066803, -0.018780771642923355, -0.021593350917100906, -0.007385289296507835, -0.02701890841126442, -0.009571842849254608, -0.04594484716653824, -0.023299045860767365, 0.0014221671735867858, -0.02231917902827263, -0.015650643035769463, -0.051352255046367645, -0.027726588770747185, -0.03509373217821121, -0.0022580022923648357, -0.022936131805181503, 0.017483357340097427, -0.03756154328584671, -0.015931902453303337, -0.01699342392385006, 0.008827870711684227, -0.007875222712755203, -0.00696340249851346, -0.042968954890966415, -0.02569427341222763, -0.05298536643385887, 0.021048981696367264, -0.06869952380657196, 0.030902082100510597, 0.006010754499584436, -0.020468320697546005, 0.020849378779530525, -0.005915489513427019, 0.03605545312166214, 0.030629897490143776, -0.03309771046042442, -0.03643651306629181, 0.027436258271336555, -0.07007858902215958, 0.0022557340562343597, 0.043622199445962906, -0.0018621997442096472, 0.014090115204453468, -0.020559048280119896, 0.0003237868659198284, -0.011685813777148724, 0.007054130546748638, 0.034603800624608994, 0.01825454831123352, 0.00894581712782383, 0.0019347824854776263, 0.048521529883146286, 0.0033456087112426758, -0.012348131276667118, 0.04648921638727188, -0.026401955634355545, -0.00275360606610775, -0.012493296526372433, -0.01811845600605011, -0.004817676264792681, -0.026783013716340065, 0.024696262553334236, -0.028561290353536606, 0.07301819324493408, 0.04561822488903999, -0.05146113038063049, 0.037126049399375916, -0.013164686039090157, 0.015178856439888477, -0.015832100063562393, 0.06285661458969116, 0.021321166306734085, -0.00978959072381258, -0.0038468828424811363, -0.012484223581850529, 0.04837636649608612, 0.0059064170345664024, -0.012692898511886597, -0.05490880832076073, -0.02344421111047268, 0.014434883370995522, 0.029631884768605232, -0.0977688878774643, -0.055961258709430695, -0.03810591623187065, 0.037779293954372406, 0.03585585206747055, -0.0968979001045227, 0.005711350589990616, 0.06325581669807434, 0.04286007955670357, -0.056614503264427185, 0.08354268223047256, 0.0036177937872707844, -0.029795195907354355, 0.0042619649320840836, -0.0055344305001199245, -0.018572097644209862, 0.0013926804531365633, -0.04790457710623741, 0.00048171094385907054, 0.01232998538762331, 0.03643651306629181, 0.0018644679803401232, 0.029795195907354355, -0.0071539320051670074, -0.04961027204990387, 0.002336255507543683, -0.03476710990071297, 0.04511014372110367, -0.015151637606322765, -0.021030835807323456, -0.04242458567023277, 0.015550842508673668, 0.04402140527963638, 0.05675966665148735, -0.016802893951535225, 0.01285620965063572, -0.0023544011637568474, 0.052658744156360626, 0.05846536159515381, 0.03485783934593201, -0.062457408756017685, 0.0037901776377111673, -0.022627655416727066, 0.04246087744832039, -0.06213078647851944, 0.0013960828073322773, -0.04783199727535248, -0.044093988835811615, -0.08288943767547607, -0.012393495067954063, 0.04859411343932152, -0.01928885094821453, -0.03041214868426323, -0.0366361141204834, 0.0319182388484478, -0.01699342392385006, -0.048521529883146286, -0.021230438724160194, 0.0022364542819559574, 0.006654925644397736, 0.02852499857544899, -0.01976063847541809, 0.004468372091650963, -0.008179162628948689, 0.04677954688668251, -0.0499006025493145, 0.018417859449982643, 0.07232865691184998, 0.07976838201284409, 0.017120443284511566, 0.0026492683682590723, -0.0189985204488039, 0.030720625072717667, -0.035148169845342636, 0.023553084582090378, -0.020087260752916336, -0.0011176600819453597, 0.03464009240269661, -0.01751057431101799, 0.0046180738136172295, -0.042206838726997375, -0.0041689686477184296, -0.023952288553118706, 0.04859411343932152, -0.041263263672590256, -0.03273479640483856, 0.025168050080537796, 0.03719863295555115, 0.029323408380150795, -0.007807176094502211, -0.002073143143206835, 0.00719929626211524, -0.0003992048150394112, -0.0314645990729332, 0.043912529945373535, 0.03904949128627777, 0.04209796339273453, 0.009444823488593102, 0.025857584550976753, 0.04888444393873215, 0.028942350298166275, -0.009050155058503151, -0.007094958331435919, -0.018463222309947014, -0.05363861098885536, 0.004212064668536186, 0.041553594172000885, -0.019052958115935326, 0.016403689980506897, -0.032988835126161575, -0.018290838226675987, 0.05919118598103523, 0.039412401616573334, -0.015514550730586052, 0.07432468235492706, -0.01789163425564766, -0.013246341608464718, 0.014543757773935795, 0.0008709923131391406, 0.0018417858518660069, 0.019706200808286667, -0.053239405155181885, 0.026565266773104668, 0.021230438724160194, -0.007630256004631519, 0.007852540351450443, 0.011341046541929245, -0.0339505560696125, 0.018962228670716286, 0.00391039252281189, 0.03598286956548691, 0.07512308657169342, -0.032335590571165085, 0.08985737711191177, 0.023226462304592133, 0.05352973937988281, 0.00035667591146193445, 0.008832406252622604, 0.021121563389897346, -0.02665599435567856, 0.009807736612856388, 0.08347009867429733, -0.00839691050350666, -0.018064018338918686, -0.05654191970825195, -0.01568693481385708, 0.003218588884919882, 0.03317029029130936, -0.024170037358999252, 0.008460420183837414, 0.020159844309091568, 0.0045114681124687195, -0.010234160348773003, -0.12593097984790802, -0.05222325026988983, -0.023008713498711586, 0.0017102297861129045, 0.007385289296507835, 0.06303807348012924, -0.03963015228509903, -0.0024836889933794737, -0.00047632394125685096, -0.007299097254872322, 0.041009221225976944, -0.002162737539038062, -0.015986338257789612, -0.004153090994805098, 0.00625572120770812, -0.016258522868156433, 0.05157000571489334, -0.04282379150390625, -0.026946324855089188, -0.0015094932168722153, 0.03915836289525032, 0.011495284736156464, 0.04728762432932854, -0.0379970408976078, 0.014326008968055248, -0.04754166677594185, -0.026692286133766174, 0.0037380089052021503, 0.012584025040268898, 0.04380365461111069, -0.06851806491613388, -0.01125031802803278, -0.01811845600605011, 0.02484142780303955 ]
42,979
linearmodels.asset_pricing.model
_prepare_data_from_formula
null
@staticmethod def _prepare_data_from_formula( formula: str, data: DataFrame, portfolios: DataFrame | None ) -> tuple[DataFrame, DataFrame, str]: orig_formula = formula na_action = NAAction("raise") if portfolios is not None: factors_mm = model_matrix( formula + " + 0", data, context=0, # TODO: self._eval_env, ensure_full_rank=True, na_action=na_action, ) factors = DataFrame(factors_mm) else: formula_components = formula.split("~") portfolios_mm = model_matrix( formula_components[0].strip() + " + 0", data, context=0, # TODO: self._eval_env, ensure_full_rank=False, na_action=na_action, ) portfolios = DataFrame(portfolios_mm) factors_mm = model_matrix( formula_components[1].strip() + " + 0", data, context=0, # TODO: self._eval_env, ensure_full_rank=False, na_action=na_action, ) factors = DataFrame(factors_mm) return factors, portfolios, orig_formula
(formula: str, data: pandas.core.frame.DataFrame, portfolios: pandas.core.frame.DataFrame | None) -> tuple[pandas.core.frame.DataFrame, pandas.core.frame.DataFrame, str]
[ 0.0149226114153862, -0.019272413104772568, 0.007483819965273142, -0.025558462366461754, -0.0393013134598732, -0.018353821709752083, 0.009627200663089752, -0.013679810799658298, -0.006353592034429312, 0.005880787502974272, 0.042111121118068695, 0.0029584055300801992, -0.034077949821949005, 0.007245166227221489, 0.0004564815026242286, 0.04178691282868385, 0.04362409561872482, 0.028242189437150955, 0.002402297221124172, 0.003446970134973526, -0.023883381858468056, -0.021776026114821434, -0.06300458312034607, 0.004043604247272015, 0.016741782426834106, 0.04272351786494255, -0.0073937620036304, 0.003498753532767296, 0.030907906591892242, -0.005331433843821287, 0.011599470861256123, 0.011194209568202496, -0.012734201736748219, 0.004021089989691973, 0.003111504018306732, -0.001555752009153366, 0.025468403473496437, 0.03269105404615402, 0.019146332517266273, 0.01954258605837822, 0.029773175716400146, -0.06876829266548157, -0.010653861798346043, 0.032817136496305466, -0.07078558951616287, -0.0621040016412735, -0.07143400609493256, -0.042795564979314804, 0.01992082968354225, -0.02044316753745079, -0.012058766558766365, 0.0025734074879437685, 0.03611325845122337, 0.024027476087212563, -0.023937417194247246, 0.053566500544548035, 0.004863132257014513, 0.07730579376220703, 0.017876513302326202, -0.008839192800223827, 0.03357362374663353, 0.06426539272069931, -0.01597628928720951, -0.05857372656464577, -0.014508344233036041, -0.01818271167576313, 0.019056273624300957, -0.0011268507223576307, 0.01323852688074112, 0.009005800820887089, -0.10670072585344315, 0.06642678380012512, 0.017615346238017082, 0.021577898412942886, 0.026044774800539017, -0.032078661024570465, 0.07802625745534897, -0.04247135668992996, 0.02091146819293499, -0.0011617483105510473, -0.0254864152520895, -0.00550254387781024, -0.07222651690244675, -0.025360334664583206, -0.0037846877239644527, -0.02510817162692547, 0.032330822199583054, 0.05601608008146286, 0.006592245772480965, -0.0003585434169508517, -0.057348936796188354, -0.051621247082948685, -0.02453180029988289, 0.005597104784101248, 0.0021219917107373476, 0.0028165641706436872, -0.015381907112896442, 0.010284624062478542, -0.022784674540162086, -0.018876157701015472, 0.003127264091745019, 0.08876116573810577, -0.05911407247185707, 0.04340795800089836, -0.012157830409705639, -0.038436755537986755, -0.010626844130456448, -0.03611325845122337, 0.025558462366461754, -0.07853057980537415, -0.10821370035409927, 0.037175945937633514, -0.012806247919797897, 0.040165871381759644, -0.023667244240641594, -0.02132573537528515, -0.049495879560709, 0.011230233125388622, -0.026386994868516922, -0.008762643672525883, -0.015147756785154343, 0.04481286182999611, -0.026495065540075302, 0.008794164285063744, 0.014094077982008457, 0.04956792667508125, 0.056448355317115784, -0.0048496234230697155, 0.004361059051007032, -0.04639788344502449, 0.04030996188521385, -0.03532074764370918, 0.0008617425337433815, 0.05169329419732094, 0.004014335572719574, -0.009266968816518784, 0.03793243318796158, -0.006943472195416689, -0.009807316586375237, 0.0056061106733977795, 0.014625419862568378, -0.02190210670232773, -0.07500030845403671, 0.018110664561390877, -0.04402035102248192, 0.04304772615432739, 0.049207694828510284, 0.028872596099972725, -0.06001465395092964, -0.007920601405203342, 0.019218377768993378, -0.019308436661958694, -0.05994260683655739, -0.06974092125892639, 0.04578549042344093, 0.014742495492100716, 0.01195069681853056, -0.017264120280742645, 0.040165871381759644, -0.017372189089655876, -0.007844052277505398, -0.023847360163927078, -0.03180848807096481, 0.018623994663357735, -0.007123588118702173, 0.00864106509834528, -0.00644815294072032, -0.12103796005249023, 0.019092297181487083, -0.011356314644217491, 0.015994301065802574, 0.03994973003864288, 0.02002890035510063, 0.018533937633037567, -0.03858084976673126, -0.025198230519890785, -0.004415093455463648, -0.04366011917591095, 0.014949629083275795, 0.029340898618102074, -0.02501811273396015, -0.023937417194247246, -0.04329988732933998, -0.00916790496557951, -0.020371120423078537, 0.012229876592755318, -0.026152843609452248, -0.024423731490969658, 0.011500407010316849, 0.024982091039419174, -0.08054787665605545, -0.06815589964389801, 0.052413757890462875, 0.026495065540075302, -0.014022030867636204, -0.044848885387182236, 0.03861687332391739, 0.02249648980796337, -0.03908517211675644, -0.04315579682588577, 0.012346952222287655, 0.010815965943038464, 0.0485592745244503, 0.06531006842851639, -0.058717817068099976, 0.026026763021945953, -0.06005067750811577, 0.03609524667263031, -0.05090078338980675, -0.015841202810406685, 0.019002238288521767, -0.00457269512116909, -0.0013970248401165009, 0.030907906591892242, -0.022676605731248856, 0.0036698635667562485, 0.06628268957138062, -0.0308538731187582, 0.05169329419732094, 0.007443293929100037, 0.03229479864239693, -0.08126834034919739, -0.0021309976000338793, 0.01476951315999031, 0.013544724322855473, -0.02469390444457531, -0.020136969164013863, 0.024207592010498047, 0.017507275566458702, -0.0031722933053970337, -0.036023203283548355, -0.05489936098456383, 0.022784674540162086, -0.042435333132743835, 0.01027561817318201, -0.012833265587687492, -0.012779231183230877, -0.009154396131634712, 0.004354304634034634, -0.0036270860582590103, -0.04275954142212868, -0.036851733922958374, 0.07035331428050995, 0.017786456272006035, 0.005353948567062616, -0.04499297961592674, 0.034924495965242386, -0.01512974500656128, -0.05954635143280029, -0.08227699249982834, -0.02732359804213047, 0.06152762845158577, -0.016408568248152733, 0.0067183272913098335, -0.010833977721631527, -0.07121787220239639, -0.002144506201148033, 0.08321359753608704, 0.04603765159845352, -0.048739392310380936, 0.05133306235074997, -0.07716169953346252, 0.060194771736860275, -0.06275241822004318, -0.024189580231904984, -0.03130416199564934, -0.06685905903577805, 0.02091146819293499, 0.05270194262266159, 0.014679454267024994, 0.0015287345740944147, 0.030907906591892242, 0.027197517454624176, 0.033663682639598846, 0.029521014541387558, 0.025288287550210953, 0.038905058056116104, -0.041282590478658676, 0.043371934443712234, 0.003179047489538789, 0.0313221737742424, -0.021343747153878212, -0.030907906591892242, -0.03636542335152626, 0.019992876797914505, -0.010230589658021927, 0.03069176711142063, -0.006065406370908022, 0.07809830456972122, 0.03440215811133385, -0.00017068805755116045, 0.014139106497168541, 0.00034250185126438737, 0.049099624156951904, -0.015318866819143295, 0.040958382189273834, 0.04293965548276901, -0.04293965548276901, 0.04366011917591095, -0.041642822325229645, -0.016102371737360954, 0.004158428404480219, 0.11232034116983414, 0.004590706899762154, -0.06300458312034607, -0.023577185347676277, 0.0033794266637414694, -0.004430853761732578, 0.006376106757670641, -0.06199593096971512, 0.04499297961592674, 0.03618530556559563, 0.02444174326956272, -0.014625419862568378, -0.003989569377154112, -0.02894464321434498, -0.01770540326833725, 0.010599827393889427, 0.044164445251226425, 0.02222631499171257, -0.00953714270144701, -0.016057342290878296, 0.053098198026418686, -0.02390139363706112, 0.0072586750611662865, 0.06174376606941223, 0.009239951148629189, -0.04971201717853546, 0.032384857535362244, 0.039121195673942566, -0.0596904456615448, 0.06141955778002739, 0.04196703061461449, 0.04250737652182579, -0.010626844130456448, -0.05464719608426094, 0.0053674569353461266, -0.008807673119008541, 0.011212221346795559, -0.005561081692576408, 0.03079983778297901, -0.03425806388258934, 0.013247532770037651, -0.030493639409542084, 0.0824931338429451, -0.029971303418278694, 0.01755230501294136, 0.022406430914998055, 0.023973440751433372, 0.021577898412942886, -0.004277755040675402, -0.023847360163927078, -0.015093721449375153, -0.013814898207783699, 0.021253688260912895, 0.01792154274880886, -0.03966154530644417, -0.046217769384384155, 0.020046912133693695, -0.024081509560346603, 0.09157098084688187, 0.025396356359124184, -0.02690933085978031, 0.042903631925582886, 0.027395645156502724, -0.05443105846643448, -0.043480005115270615, 0.05547573044896126, 0.0298452228307724, -0.014958634972572327, 0.026567110791802406, 0.01549898274242878, 0.03357362374663353, -0.015553017146885395, 0.002645453903824091, 0.021001527085900307, 0.06174376606941223, -0.022766662761569023, -0.04816301912069321, -0.04996418207883835, -0.03000732697546482, -0.04733448848128319, -0.0639772042632103, -0.009609188884496689, 0.003446970134973526, 0.01100508775562048, -0.03195257857441902, 0.0013733846135437489, 0.029863234609365463, 0.04362409561872482, -0.0022593301255255938, -0.006668795365840197, 0.05475526675581932, 0.016255469992756844, 0.053566500544548035, 0.021613921970129013, 0.05547573044896126, -0.02249648980796337, -0.00024428233155049384, -0.00808720849454403, -0.017984583973884583, -0.05742098391056061, 0.010518775321543217, 0.027611784636974335, -0.037284012883901596, 0.013634782284498215, -0.009082349948585033, -0.0426514707505703, -0.0017347423126921058, 0.003210567869246006, 0.0587538406252861, 0.0010052724974229932, 0.03721196576952934, -0.03721196576952934, -0.00953714270144701, 0.06484176218509674, 0.004550180863589048, -0.02438770793378353, 0.06721929460763931, 0.05032441392540932, 0.02559448406100273, -0.05129703879356384, 0.008235804736614227, 0.02543237991631031, -0.028818560764193535, 0.07132594287395477, -0.015958277508616447, -0.012716189958155155, -0.046361859887838364, 0.052521828562021255, -0.02764780819416046, -0.012734201736748219, -0.035807061940431595, -0.012446016073226929, -0.018380839377641678, 0.013292561285197735, -0.0008988914778456092, 0.029340898618102074, 0.0026071793399751186, 0.034924495965242386, 0.037392083555459976, -0.0008921371190808713, 0.05417889729142189, 0.01187865063548088, -0.10598026216030121, -0.01570611633360386, 0.00990638043731451, -0.0033321462105959654, -0.09661422669887543, -0.007416276726871729, 0.005362953990697861, 0.026206878945231438, 0.04549730196595192, 0.011401343159377575, 0.004568192176520824, 0.0028503357898443937, -0.0257565900683403, -0.026242902502417564, 0.035446830093860626, 0.06531006842851639, 0.08890525996685028, 0.01728213019669056, 0.021667955443263054, 0.02463986910879612, -0.02516220696270466, 0.0024180575273931026, 0.0378243625164032, -0.0422552153468132, -0.03562694787979126, -0.01765136793255806, 0.0019824018236249685, -0.012229876592755318, 0.04056212678551674, -0.05212557315826416, -0.059978630393743515, 0.02937692031264305, 0.010860995389521122, 0.024207592010498047, 0.032871171832084656, -0.010491757653653622, -0.007119085174053907, -0.02505413629114628, -0.010320647619664669, 0.026495065540075302, -0.04207510128617287, 0.013598758727312088, -0.005398977547883987, -0.015201791189610958, -0.0014319223118945956, 0.005047751124948263, -0.008609545417129993, 0.0012450518552213907, 0.06149160489439964, -0.009284980595111847, 0.04067019373178482, -0.012229876592755318, 0.0567365437746048, 0.029196804389357567, 0.01734517142176628, -0.03753617778420448, -0.01766037382185459, -0.021685967221856117, -0.014229164458811283, -0.020839422941207886, -0.0019722701981663704, -0.030385570600628853, 0.00830334797501564, -0.016723770648241043, -0.0519094355404377, -0.06703917682170868, -0.042687494307756424, -0.05994260683655739, -0.03146626800298691, 0.020299073308706284, 0.0038882542867213488, 0.04146270453929901, -0.007943116128444672, -0.03079983778297901, -0.05796132981777191, 0.01880411058664322, -0.016300499439239502, 0.028404295444488525, 0.04517309367656708, -0.02148783951997757, -0.020929479971528053, 0.014445303939282894, 0.007808029185980558, 0.006628269329667091, -0.018948204815387726, -0.06084318831562996, -0.0291067473590374, -0.05911407247185707, 0.0519094355404377, 0.07168617099523544, 0.037500154227018356, 0.02049720101058483, -0.004795588552951813, -0.04196703061461449, -0.03611325845122337, 0.02896265499293804, -0.029034700244665146, 0.054611172527074814, -0.05371059477329254, -0.05226966738700867, 0.039445407688617706, -0.02611682191491127, 0.002830072771757841, 0.05716882273554802, -0.02274865098297596, -0.03804050013422966, -0.03652752563357353, 0.030457617715001106, 0.010491757653653622, 0.0437321662902832, 0.0029516511131078005, 0.0019182354444637895, -0.017615346238017082, 0.04917167127132416, -0.01134730875492096, -0.046217769384384155, -0.022100234404206276, -0.07262277603149414, 0.012112801894545555, -0.020425155758857727, -0.028242189437150955, -0.013202503323554993, -0.017957566305994987, 0.018876157701015472, -0.07744988054037094, -0.04528116434812546, 0.003822962287813425, -0.03335748612880707, 0.049495879560709, 0.008938256651163101, 0.03618530556559563, -0.056304264813661575, 0.011401343159377575, -0.09553352743387222, -0.008262821473181248, -0.00615996727719903, 0.024189580231904984, -0.024135544896125793, -0.10129724442958832, -0.03584308549761772, 0.02249648980796337, 0.044632747769355774, -0.027972016483545303, 0.03699582815170288, 0.028872596099972725, -0.038796987384557724, -0.033609647303819656, 0.05079271271824837, -0.007695456501096487, -0.017525287345051765, -0.02716149389743805, 0.02085743471980095, -0.049099624156951904, -0.049099624156951904, 0.011653506197035313, 0.0019778988789767027, -0.046217769384384155, 0.004768571350723505, -0.021667955443263054, 0.0073532359674572945, 0.01902025006711483, -0.03130416199564934, -0.05702472850680351, 0.017507275566458702, 0.041642822325229645, -0.02321695350110531, 0.013877938501536846, -0.0001626672747079283, 0.035969167947769165, 0.037067875266075134, -0.016372544690966606, -0.033447541296482086, -0.026386994868516922, -0.05907805263996124, -0.005642133764922619, 0.06826397031545639, -0.05118896812200546, -0.009483108296990395, -0.004129159729927778, 0.025630507618188858, -0.019686680287122726, 0.029196804389357567, 0.04149872809648514, -0.053782641887664795, -0.06531006842851639, -0.0625002533197403, 0.018696041777729988, 0.039337337017059326, 0.06869624555110931, 0.06938068568706512, -0.005750203505158424, 0.03400590270757675, 0.05291808396577835, 0.03000732697546482, -0.009375038556754589, -0.022568535059690475, -0.0283682718873024, -0.0077765085734426975, 0.0519094355404377, -0.014373257756233215, 0.02422560378909111, -0.010167548432946205, 0.019524576142430305, -0.06671497225761414, 0.01839885115623474, 0.01822773925960064, -0.032871171832084656, -0.017264120280742645, -0.01671476475894451, 0.04585753753781319, 0.03667161986231804, 0.05536765977740288, -0.027863945811986923, -0.049675993621349335, 0.023577185347676277, -0.032330822199583054, -0.011527424678206444, 0.02800804004073143, 0.054719243198633194, 0.0051152948290109634, 0.0008690597605891526, 0.011032105423510075, 0.016930904239416122, 0.029665106907486916, 0.012941335327923298, 0.028512364253401756, -0.008906736969947815, 0.03296123072504997, -0.016102371737360954, 0.00432053254917264, 0.03641945868730545, 0.021776026114821434, 0.0064346445724368095, 0.012653149664402008, -0.02690933085978031, 0.015084715560078621, 0.023361045867204666, -0.013877938501536846, 0.0062185050919651985, -0.021776026114821434, -0.010879007168114185, 0.033609647303819656, 0.03173644095659256, -0.0329972542822361, 0.04081428796052933, -0.02680126205086708, 0.003034954657778144, 0.006947975140064955, 0.022604558616876602, 0.005308919586241245, -0.026260914281010628, -0.04992815852165222, -0.09092256426811218, -0.004701027646660805, 0.042327262461185455, 0.02296479046344757, 0.006272539962083101, -0.016327517107129097, 0.027809912338852882, 0.034654319286346436, -0.000853299570735544, -0.060879211872816086, 0.001919361180625856, -0.005525058601051569, 0.013733845204114914, 0.006002366077154875, 0.029448967427015305, -0.00864106509834528, 0.013445660471916199, -0.031772464513778687, 0.04697425663471222, 0.04203907772898674, -0.07053343206644058, 0.04387626051902771, -0.04103042557835579, -0.016363538801670074, 0.09351623058319092, -0.008771649561822414, 0.1010090559720993, 0.012211865745484829, -0.01187865063548088, -0.05255785211920738, -0.008051185868680477, -0.03966154530644417, 0.0587538406252861, -0.006817391142249107, 0.012851277366280556, 0.05122499167919159, 0.008379897102713585, 0.048199042677879333, 0.028512364253401756, -0.033123333007097244, 0.011482395231723785, -0.018569961190223694, -0.042111121118068695, 0.04870336875319481, 0.0022503244690597057, -0.008186272345483303, 0.0030034345109015703, 0.057348936796188354, 0.0461457222700119, 0.03571700304746628, 0.03204263746738434, -0.026495065540075302, 0.009311997331678867, -0.04438058286905289, 0.01691289246082306, -0.02175801433622837, 0.017111020162701607, -0.0013981505762785673, 0.01316648069769144, -0.021163631230592728, 0.07716169953346252, 0.0009912009118124843, 0.010644855909049511, -0.026657169684767723, -0.0055385674349963665, 0.06739941239356995, -0.007659433409571648, 0.04376818984746933, 0.006628269329667091, -0.03571700304746628, 0.03904915228486061, 0.0051648267544806 ]
42,980
linearmodels.asset_pricing.model
_validate_additional_data
null
def _validate_additional_data(self) -> None: f = self.factors.ndarray p = self.portfolios.ndarray nrp = f.shape[1] + int(self._risk_free) if p.shape[1] < nrp: raise ValueError( "The number of test portfolio must be at least as " "large as the number of risk premia, including the " "risk free rate if estimated." )
(self) -> NoneType
[ -0.01031494140625, 0.027796240523457527, -0.05924661085009575, 0.06488745659589767, -0.02653680555522442, -0.016887057572603226, 0.014173067174851894, -0.05105142295360565, 0.022403733804821968, 0.009144200012087822, 0.06155261769890785, 0.0023392655421048403, 0.004033293109387159, -0.06424887478351593, -0.025915957987308502, -0.0009462384623475373, 0.04353029653429985, -0.006913582794368267, 0.03155680373311043, 0.046616796404123306, -0.04640393331646919, 0.019388187676668167, -0.07847515493631363, 0.001890259562060237, 0.005800491664558649, 0.11764177680015564, 0.06187191233038902, 0.018288400024175644, 0.07031544297933578, 0.026590021327137947, -0.06063021719455719, 0.04746824502944946, -0.016009002923965454, 0.08017805218696594, 0.019210802391171455, 0.046581316739320755, 0.008186320774257183, -0.04015997797250748, -0.015272853896021843, 0.0839386135339737, -0.009046638384461403, 0.011627591215074062, 0.00424172030761838, 0.011556637473404408, -0.037570156157016754, -0.03501581400632858, -0.019618788734078407, 0.05867898091673851, -0.021853839978575706, -0.02754790149629116, 0.0018060017609968781, 0.012762855738401413, 0.04817778244614601, 0.01145020592957735, 0.009153068996965885, 0.06765466183423996, 0.04459460452198982, 0.04565891623497009, 0.01704670488834381, -0.05690512806177139, -0.04289171099662781, 0.011388121172785759, 0.04459460452198982, -0.09876800328493118, -0.021960271522402763, -0.005738406907767057, -0.03613333776593208, -0.007787204347550869, 0.0050244322046637535, 0.04785849153995514, -0.008186320774257183, 0.04562344029545784, -0.054989371448755264, 0.02671419084072113, 0.019902603700757027, -0.019068894907832146, 0.06478102505207062, -0.036967046558856964, -0.01603561080992222, -0.02898471988737583, 0.051228806376457214, -0.019955819472670555, -0.006527770310640335, 0.036683231592178345, 0.010696319863200188, -0.039663299918174744, 0.03572535142302513, 0.005671887658536434, 0.04537510126829147, 0.04321100190281868, -0.0025055641308426857, 0.03244372829794884, 0.03024415299296379, -0.04910018667578697, 0.08017805218696594, 0.004492276813834906, -0.024887124076485634, -0.008860384114086628, -0.04977424815297127, -0.015734056010842323, -0.003427966497838497, 0.017907023429870605, 0.02972973696887493, 0.029605567455291748, -0.004283849149942398, 0.0003822094004135579, 0.012230700813233852, -0.047219906002283096, -0.009809394367039204, 0.04512676224112511, -0.0307585708796978, 0.0014711874537169933, -0.050022587180137634, 0.04338838905096054, -0.06446173042058945, 0.0033969241194427013, -0.020825006067752838, 0.003946817945688963, -0.023911507800221443, 0.012869286350905895, 0.018199708312749863, 0.026749668642878532, 0.003126411698758602, 0.019636526703834534, 0.017818329855799675, -0.00952557846903801, 0.028825072571635246, 0.028168749064207077, 0.016292817890644073, -0.05662131309509277, 0.02447913959622383, -0.030740832909941673, -0.010412503033876419, -0.012966847978532314, -0.05367672070860863, -0.0367187075316906, 0.06570342928171158, -0.04920661821961403, 0.015113207511603832, -0.06868349760770798, 0.03693157061934471, 0.05112237483263016, -0.04867446422576904, 0.02728182263672352, -0.016106564551591873, 0.03428853303194046, -0.01177836861461401, -0.01419080514460802, -0.013951335102319717, -0.009924694895744324, -0.03428853303194046, -0.007663034833967686, -0.06290074437856674, -0.06311360746622086, 0.034270793199539185, -0.013951335102319717, 0.033153269439935684, -0.060701169073581696, 0.021481331437826157, -0.025525711476802826, -0.04910018667578697, -0.00596013804897666, 0.01784493774175644, 0.04817778244614601, -0.03294040635228157, 0.007396957371383905, -0.0010404742788523436, -0.07755275070667267, -0.008847080171108246, 0.06481650471687317, 0.05733085423707962, -0.006691851653158665, -0.020363805815577507, 0.022829458117485046, -0.06609367579221725, -0.01553893182426691, 0.019725220277905464, -0.06481650471687317, 0.022474687546491623, 0.012949110008776188, -0.004501146264374256, -0.017667552456259727, -0.030049029737710953, -0.006164131220430136, 0.009374801069498062, -0.02011546678841114, -0.052718840539455414, -0.011157521046698093, 0.008718475699424744, 0.007002275437116623, -0.03613333776593208, -0.0033148834481835365, -0.015334938652813435, 0.0281510092318058, -0.011982360854744911, -0.04101142659783363, 0.022368257865309715, 0.022563381120562553, -0.009126462042331696, -0.060417354106903076, -0.021942533552646637, -0.030687617138028145, 0.011867061257362366, -0.032550159841775894, -0.06421339511871338, 0.023716382682323456, -0.07159261405467987, -0.02155228517949581, 0.011574375443160534, 0.0525059811770916, -0.011973491869866848, 0.03285171464085579, -0.011388121172785759, 0.012629816308617592, 0.04640393331646919, 0.00801780540496111, 0.04746824502944946, -0.07148618251085281, -0.018607692793011665, 0.016700804233551025, 0.04154358431696892, -0.025915957987308502, 0.03471425920724869, -0.0023326135706156492, 0.02619977481663227, 0.0020643186289817095, 0.03813778981566429, 0.08968588709831238, 0.010864835232496262, 0.039237577468156815, -0.06268788129091263, 0.03866994380950928, -0.03498033434152603, -0.003221756312996149, -0.017738506197929382, 0.025578927248716354, 0.01052780356258154, -0.0166830662637949, 0.005680756643414497, 0.03842160478234291, -0.025064509361982346, -0.04023093357682228, -0.020612144842743874, 0.005822664592415094, -0.022847196087241173, -0.006811586674302816, -0.0159380491822958, 0.03169871121644974, 0.006124219391494989, -0.007090968079864979, -0.03260337561368942, -0.011263951659202576, -0.018288400024175644, 0.0010565498378127813, -0.023077797144651413, 0.009099854156374931, -0.010944658890366554, -0.013844904489815235, 0.03916662186384201, -0.030279630795121193, 0.06722894310951233, 0.014652006328105927, 0.031290724873542786, 0.06322003901004791, -0.04686513543128967, 0.029605567455291748, 0.0072949607856571674, -0.00994243286550045, 0.06282979249954224, -0.012904763221740723, 0.03024415299296379, 0.05420887470245361, 0.05186739191412926, -0.025383803993463516, 0.036363936960697174, -0.012337131425738335, 0.017357129603624344, 0.014173067174851894, 0.007374783977866173, 0.0705992579460144, 0.03852803632616997, -0.027725286781787872, 0.03290493041276932, 0.015787271782755852, -0.0020188638009130955, -0.030261892825365067, -0.03244372829794884, -0.06847063452005386, -0.016097694635391235, -0.02007998898625374, -0.0577211007475853, 0.012904763221740723, 0.02536606416106224, 0.04367220401763916, 0.013534480705857277, -0.014439144171774387, 0.034590087831020355, -0.044630084186792374, 0.03395150229334831, 0.039698779582977295, 0.003268319880589843, 0.00004386122964206152, 0.027246346697211266, -0.04154358431696892, -0.005685191601514816, -0.05988520011305809, 0.053321950137615204, -0.013623173348605633, 0.003015546128153801, 0.008541091345250607, 0.018412569537758827, 0.03093595616519451, 0.009738440625369549, 0.049313049763441086, 0.044665560126304626, -0.02309553511440754, 0.02806231752038002, -0.022776242345571518, -0.024745216593146324, 0.00526390178129077, 0.006536639761179686, -0.06797395646572113, 0.01500677689909935, -0.0720892921090126, -0.06953494995832443, 0.013295010663568974, 0.02909115143120289, -0.03317100927233696, -0.045836299657821655, -0.006678547710180283, -0.043423864990472794, -0.03377411514520645, 0.02545475773513317, 0.031166555359959602, 0.010235118679702282, 0.015104338526725769, -0.005170774646103382, -0.07077664136886597, 0.04303361847996712, 0.03127298876643181, -0.03721538558602333, -0.027051223441958427, -0.005179644096642733, 0.01113091316074133, 0.0615171417593956, -0.042820755392313004, 0.05456364527344704, -0.025685356929898262, -0.0043570208363235, 0.029428182169795036, -0.07286978513002396, 0.0047760927118361, -0.016133172437548637, 0.0016652023186907172, 0.03272754326462746, 0.023450305685400963, -0.020984653383493423, 0.007192964665591717, 0.03856351226568222, 0.0458008237183094, 0.07854610681533813, 0.02025737427175045, -0.02034606784582138, 0.05076760798692703, -0.03219538927078247, -0.030049029737710953, -0.018040060997009277, 0.007991197519004345, 0.015033384785056114, 0.012745116837322712, 0.0007167465519160032, -0.03363220766186714, 0.004334847442805767, -0.008496744558215141, 0.04622654989361763, 0.048709940165281296, 0.00021992975962348282, 0.05069665238261223, -0.011716283857822418, -0.025153202936053276, -0.07450173050165176, -0.03425305709242821, -0.05857254937291145, -0.001726178452372551, -0.027583377435803413, 0.006363689433783293, -0.06620010733604431, -0.025117725133895874, 0.011024481616914272, 0.008926903828978539, 0.049277570098638535, -0.0041375067085027695, 0.03474973514676094, 0.005374767351895571, 0.004492276813834906, 0.02424853853881359, 0.014944692142307758, -0.029623305425047874, -0.01440366730093956, 0.022173132747411728, -0.028097795322537422, -0.023822814226150513, -0.07790752500295639, 0.015875963494181633, -0.022829458117485046, -0.011964622884988785, -0.034128885716199875, 0.011104305274784565, 0.00046563579235225916, 0.09961945563554764, 0.03916662186384201, 0.0420047827064991, 0.033809594810009, -0.03419984132051468, -0.039095669984817505, 0.02634168229997158, 0.006186304148286581, -0.04502033069729805, 0.04700704291462898, -0.008004501461982727, 0.0510159470140934, -0.014306105673313141, -0.03357899188995361, 0.04587177932262421, -0.03313552960753441, -0.015618755482137203, -0.04278527945280075, 0.019583310931921005, 0.0077384235337376595, 0.03292267024517059, -0.04700704291462898, 0.02783171646296978, -0.03600917011499405, -0.02197800949215889, -0.026643237099051476, -0.028080055490136147, -0.09373027086257935, 0.0405147485435009, -0.03107786364853382, 0.016762888059020042, 0.043281957507133484, -0.010971266776323318, 0.07684320956468582, 0.01774737611413002, 0.015015645883977413, -0.016523418948054314, 0.012691901996731758, -0.01516642328351736, -0.07258597016334534, -0.02536606416106224, -0.019689742475748062, -0.05165453255176544, -0.020417021587491035, -0.012230700813233852, -0.015787271782755852, -0.0041951569728553295, 0.002585387323051691, -0.050803083926439285, 0.02086048386991024, 0.017410343512892723, 0.017117658630013466, 0.027636593207716942, -0.0577211007475853, 0.011884799227118492, 0.012301654554903507, 0.01979617401957512, 0.0011230692034587264, -0.005600933451205492, 0.021853839978575706, 0.028700903058052063, 0.0021352728363126516, 0.003217321587726474, 0.0183593537658453, -0.0712023675441742, 0.007405826356261969, 0.01391585823148489, 0.05761466920375824, 0.05037735775113106, 0.02020415849983692, 0.016612110659480095, 0.05488293990492821, 0.023911507800221443, -0.0029756345320492983, 0.01017303392291069, -0.01905115693807602, -0.04849707707762718, -0.0674772784113884, 0.014430275186896324, -0.03200026601552963, 0.011299428530037403, -0.003784953849390149, -0.07677225768566132, 0.03061666339635849, 0.07184094935655594, -0.005113124381750822, -0.03478521108627319, 0.08003614097833633, 0.02912662737071514, 0.062333110719919205, 0.01103335153311491, 0.012940241023898125, 0.008155278861522675, 0.003933514002710581, -0.029144367203116417, -0.032266344875097275, -0.013224056921899319, -0.001378060202114284, 0.0159380491822958, 0.007197399158030748, -0.008146408945322037, -0.03320648521184921, 0.02068309858441353, 0.0458008237183094, 0.025667618960142136, 0.07230215519666672, 0.024638785049319267, 0.01639924943447113, 0.015485716052353382, -0.016239602118730545, 0.04785849153995514, 0.008439094759523869, -0.02165871672332287, 0.03368542343378067, -0.01993808150291443, 0.012949110008776188, 0.0030111114028841257, -0.04842612147331238, -0.03333065286278725, -0.012416955083608627, 0.020505713298916817, -0.0020687533542513847, -0.009348193183541298, 0.0689673125743866, 0.03437722474336624, -0.04761015251278877, -0.003935731016099453, 0.037889450788497925, -0.008855949155986309, 0.009051073342561722, -0.009809394367039204, -0.010146426036953926, 0.005543283186852932, 0.055734388530254364, -0.048851847648620605, -0.0038337346632033587, 0.008669694885611534, 0.02086048386991024, 0.015530062839388847, -0.007064360193908215, -0.05147714540362358, 0.01570744812488556, 0.029002457857131958, 0.07272787392139435, 0.005268336273729801, 0.0900406613945961, 0.0026031257584691048, 0.03191157430410385, 0.010261726565659046, 0.038634467869997025, -0.04047927260398865, -0.03270980715751648, -0.08727345615625381, 0.020150942727923393, -0.030545707792043686, -0.06825777143239975, -0.0689673125743866, -0.025809526443481445, -0.0006729546003043652, -0.032124437391757965, 0.0022927019745111465, -0.01630168780684471, -0.0023525694850832224, -0.0577211007475853, 0.01263868622481823, 0.00794685073196888, -0.09812942147254944, -0.018048930913209915, 0.014048897661268711, -0.046013686805963516, -0.0022694203071296215, -0.0030931520741432905, -0.014456883072853088, 0.0183593537658453, -0.0705283060669899, -0.030581185594201088, 0.004179635550826788, -0.0495259091258049, -0.027849456295371056, -0.027104437351226807, 0.05896279588341713, 0.005126428324729204, 0.0028692034538835287, -0.03515772148966789, -0.0855705589056015, -0.0183593537658453, 0.05023545026779175, -0.014350451529026031, -0.033986978232860565, 0.0012538906885311007, 0.0007577668293379247, -0.02332613617181778, 0.013844904489815235, -0.05761466920375824, 0.002964547835290432, 0.008780560456216335, -0.02447913959622383, -0.055273186415433884, 0.04732633754611015, -0.0005687408847734332, -0.022102179005742073, 0.019210802391171455, 0.057401806116104126, -0.02912662737071514, -0.06495840847492218, -0.023592213168740273, -0.039663299918174744, -0.014660876244306564, -0.03391602635383606, 0.05165453255176544, 0.043743155896663666, -0.021534547209739685, 0.010048864409327507, 0.007241745479404926, 0.025206418707966805, -0.027476947754621506, -0.04001807048916817, 0.04672322794795036, -0.06378766894340515, -0.05495389550924301, -0.07719798386096954, -0.014820522628724575, 0.00758321164175868, 0.0026829491835087538, -0.015122076496481895, 0.00812867097556591, 0.024869386106729507, 0.02369864471256733, 0.022190872579813004, 0.033756379038095474, -0.005299378652125597, -0.027938148006796837, 0.01701122708618641, -0.0638231486082077, 0.010722927749156952, 0.0055388486944139, -0.00010192712215939537, -0.04459460452198982, -0.028966981917619705, 0.07755275070667267, -0.011148651130497456, -0.053925059735774994, -0.014066635631024837, -0.020328328013420105, -0.03136168047785759, 0.00451888469979167, 0.05037735775113106, 0.0532509982585907, 0.023077797144651413, 0.0009262826642952859, -0.04828421398997307, -0.0330645777285099, -0.013836035504937172, 0.051228806376457214, -0.04246598482131958, 0.06208477169275284, 0.03185835853219032, 0.03480295091867447, -0.0434948168694973, -0.03469651937484741, 0.035423796623945236, -0.050803083926439285, 0.035193197429180145, 0.03437722474336624, 0.022598857060074806, 0.06623558700084686, 0.05016449838876724, -0.06485197693109512, 0.012372608296573162, 0.004317109007388353, 0.01970748044550419, 0.03661227598786354, 0.0035366148222237825, -0.04069213569164276, -0.030208677053451538, -0.00241687148809433, 0.005144166760146618, -0.038953762501478195, 0.029002457857131958, -0.03732181712985039, 0.05144166946411133, -0.004166331607848406, -0.055911771953105927, 0.06769014149904251, 0.007565473206341267, -0.029002457857131958, -0.021126560866832733, -0.04250146076083183, 0.09741988033056259, 0.008789430372416973, 0.01825292408466339, -0.01592917926609516, 0.011396990157663822, -0.014864868484437466, 0.032816238701343536, -0.05924661085009575, 0.02768980897963047, -0.05970781296491623, 0.001066527678631246, -0.007867028005421162, -0.058146823197603226, -0.012532254680991173, 0.05676322057843208, 0.010377026163041592, -0.07712702453136444, -0.07031544297933578, 0.06364576518535614, 0.034873902797698975, 0.018093276768922806, -0.0229004118591547, -0.019228540360927582, 0.016053348779678345, 0.06251049786806107, -0.0008608719217590988, -0.020009035244584084, -0.07365027815103531, 0.02407115325331688, -0.004563231021165848, -0.09834228456020355, 0.06570342928171158, -0.020417021587491035, 0.042678847908973694, 0.029002457857131958, -0.027938148006796837, 0.026927053928375244, -0.0073082647286355495, -0.02188931778073311, -0.022740766406059265, 0.02573857270181179, 0.04455912858247757, 0.014119851402938366, 0.03767658770084381, 0.010900312103331089, 0.02117977663874626, -0.027672071009874344, 0.032124437391757965, 0.052435025572776794, -0.0011214062105864286, 0.0001271490618819371, -0.012026707641780376, -0.03192931041121483, 0.024425923824310303, -0.0020332762505859137, 0.018093276768922806, 0.030652139335870743, -0.027264084666967392, 0.033100053668022156, 0.024088891223073006, -0.04079856723546982, 0.0031175424810498953, -0.01765868254005909, 0.01756112091243267, 0.024319492280483246, 0.0015698578208684921, 0.07198286056518555, 0.027583377435803413, 0.0221199169754982, -0.004445713013410568, 0.017862675711512566 ]
42,981
linearmodels.asset_pricing.model
_validate_data
null
def _validate_data(self) -> None: p = self.portfolios.ndarray f = self.factors.ndarray if p.shape[0] != f.shape[0]: raise ValueError( "The number of observations in portfolios and " "factors is not the same." ) self._drop_missing() p = cast(Float64Array, self.portfolios.ndarray) f = cast(Float64Array, self.factors.ndarray) if has_constant(p)[0]: raise ValueError( "portfolios must not contains a constant or " "equivalent and must not have rank\n" "less than the dimension of the smaller shape." ) if has_constant(f)[0]: raise ValueError("factors must not contain a constant or equivalent.") if np.linalg.matrix_rank(f) < f.shape[1]: raise ValueError( "Model cannot be estimated. factors do not have full column rank." ) if p.shape[0] < (f.shape[1] + 1): raise ValueError( "Model cannot be estimated. portfolios must have factors + 1 or " "more returns to\nestimate the model parameters." )
(self) -> NoneType
[ -0.0016494961455464363, 0.020382074639201164, -0.0557979978621006, 0.031464483588933945, -0.032181255519390106, -0.03732731565833092, -0.005159844644367695, -0.03984520956873894, -0.008748302236199379, 0.019775575026869774, 0.029075240716338158, -0.013646249659359455, 0.0034207517746835947, -0.03767651319503784, -0.007351514883339405, 0.04947569593787193, 0.02828495390713215, 0.01861771196126938, 0.015447370707988739, 0.05076221004128456, -0.03723542392253876, -0.03707001358270645, -0.09902490675449371, -0.01294785551726818, 0.010034818202257156, 0.05829751119017601, 0.043962057679891586, 0.0114224161952734, 0.043962057679891586, 0.029461195692420006, -0.04682914912700653, 0.049880027770996094, 0.006951776333153248, 0.04870378598570824, 0.01319596916437149, 0.008918306790292263, 0.031372588127851486, -0.039734937250614166, 0.01773552969098091, 0.047380514442920685, -0.01801121048629284, -0.02857901342213154, -0.004158200696110725, 0.046167511492967606, -0.05355578660964966, -0.028376847505569458, -0.031078528612852097, 0.06906747817993164, -0.03197908774018288, 0.0018217972246930003, -0.05877536162734032, -0.0008672490366734564, 0.05425417795777321, 0.009037768468260765, 0.009777515195310116, 0.07039075344800949, 0.030159588903188705, 0.026005983352661133, 0.025822196155786514, -0.04951245337724686, -0.04047008976340294, 0.0012129999231547117, 0.07954338937997818, -0.09703999757766724, -0.0032737215515226126, -0.006253382191061974, 0.009731567464768887, -0.005449310410767794, 0.004383340943604708, 0.07461787760257721, -0.026042740792036057, 0.021282635629177094, -0.031041771173477173, 0.05340875685214996, 0.046865906566381454, -0.003519537625834346, 0.05153411999344826, 0.0009401898132637143, 0.0010906661627814174, -0.04271230101585388, 0.04381502792239189, 0.008045313879847527, -0.0027016818057745695, 0.025748681277036667, 0.012221893295645714, -0.017956074327230453, 0.010080765001475811, 0.0537763312458992, 0.019775575026869774, 0.052820634096860886, -0.008844790980219841, 0.012607848271727562, 0.013627870939671993, -0.048078905791044235, 0.044256120920181274, 0.04157281666994095, -0.03582025691866875, -0.011753234080970287, -0.057194784283638, -0.006078783888369799, 0.0015576021978631616, 0.031372588127851486, -0.004585507325828075, 0.05425417795777321, -0.018038779497146606, -0.005849048960953951, 0.016017112880945206, -0.05028436332941055, -0.03583863377571106, 0.01924259029328823, -0.054842300713062286, 0.04341069608926773, -0.020804787054657936, 0.0557979978621006, -0.0688469335436821, -0.022532392293214798, -0.03646351397037506, 0.004383340943604708, -0.0626349076628685, 0.02124587818980217, -0.01066888589411974, 0.0648036003112793, -0.003076149383559823, -0.0033219656907022, 0.04543236270546913, -0.013637060299515724, 0.005899590440094471, -0.0022123465314507484, 0.030986635014414787, -0.06476684659719467, -0.009281287901103497, -0.04785836115479469, 0.025822196155786514, -0.01052185520529747, -0.038080845028162, -0.028762802481651306, 0.03703325614333153, -0.057341814041137695, 0.0034965642262250185, -0.037511102855205536, 0.04965948313474655, 0.052526574581861496, -0.02356160432100296, 0.004792268853634596, 0.006873666308820248, 0.04517505690455437, -0.00345061719417572, -0.030380135402083397, -0.03611431643366814, 0.02970011904835701, -0.04300636053085327, -0.019352862611413002, -0.0251789391040802, -0.06733987480401993, 0.02617139369249344, -0.03918357565999031, 0.006340681575238705, -0.09601078182458878, 0.022275090217590332, -0.0026787081733345985, -0.0735151469707489, -0.015134931541979313, 0.014528430998325348, 0.04704969376325607, -0.03911006078124046, 0.049806512892246246, -0.03594890609383583, -0.066825270652771, 0.0028165490366518497, 0.041241999715566635, 0.03999223932623863, 0.0024719468783587217, -0.01700037717819214, -0.002444378798827529, -0.06053972616791725, -0.029259029775857925, 0.019463134929537773, -0.05076221004128456, 0.04348421096801758, 0.04050684720277786, -0.005766344256699085, -0.02165021188557148, -0.04815242066979408, 0.005977700464427471, 0.009019389748573303, 0.03219963610172272, -0.04976975545287132, -0.01634793169796467, 0.02093343809247017, -0.003565484657883644, -0.06877341866493225, -0.014418158680200577, 0.008592083118855953, 0.03457050025463104, -0.023028619587421417, -0.019352862611413002, 0.032070983201265335, 0.023745393380522728, 0.019279347732663155, -0.0926290899515152, 0.013756521977484226, -0.04649833217263222, 0.03888951241970062, -0.007893688976764679, -0.1129927858710289, 0.032254770398139954, -0.07520599663257599, -0.026410317048430443, 0.01571386307477951, 0.027568180114030838, -0.01209324225783348, -0.002091735601425171, -0.0531514510512352, -0.01771715097129345, 0.04091117903590202, -0.01582413539290428, 0.06267166137695312, -0.07682333141565323, 0.0035792686976492405, 0.024002695456147194, 0.0735151469707489, -0.01470302976667881, 0.03958790749311447, -0.023414574563503265, 0.026134634390473366, -0.00508632929995656, 0.012368923984467983, 0.04991678521037102, 0.0019458540482446551, 0.03526889160275459, -0.039624664932489395, -0.01268136315047741, -0.04109496623277664, -0.001060226233676076, 0.008895332925021648, 0.013875984586775303, 0.009713188745081425, -0.002412215806543827, -0.013655439019203186, 0.02337781712412834, -0.028468741104006767, -0.06417872756719589, -0.0021422773133963346, 0.006767988204956055, 0.01690848357975483, -0.01883825659751892, 0.01268136315047741, 0.027053574100136757, -0.03102339245378971, -0.02727412059903145, -0.05373957380652428, 0.021117227151989937, -0.020878301933407784, -0.007130969315767288, 0.025105422362685204, -0.0511297844350338, -0.012635416351258755, -0.0010010695550590754, 0.07535302639007568, -0.021466422826051712, 0.03563646972179413, 0.0153095293790102, 0.05539366602897644, 0.08755654096603394, -0.05535690486431122, 0.0026327611412853003, -0.00941912829875946, -0.009851030074059963, 0.05212223902344704, 0.016127385199069977, -0.00589040108025074, 0.04418260231614113, 0.021870756521821022, -0.020418832078576088, 0.03695974126458168, 0.019352862611413002, 0.034294817596673965, -0.01964692398905754, 0.028762802481651306, 0.06083378568291664, 0.016182521358132362, -0.05296766385436058, 0.0275865588337183, 0.013609492219984531, -0.0030049316119402647, -0.019371241331100464, -0.039220333099365234, -0.08954145014286041, -0.002545461989939213, -0.004022656939923763, -0.03587539121508598, 0.004484423901885748, 0.010641317814588547, 0.03604080155491829, -0.003583863377571106, -0.011201870627701283, 0.03339425474405289, -0.05083572492003441, 0.0638846606016159, -0.015281961299479008, -0.02277131751179695, 0.021797241643071175, 0.06487711519002914, -0.033872105181217194, 0.004700374789535999, -0.042638786137104034, 0.009106689132750034, -0.011495931074023247, 0.014868439175188541, 0.0024168104864656925, 0.03109690733253956, 0.0004660745617002249, -0.00917101465165615, 0.03866896778345108, 0.06693553924560547, -0.006607173942029476, 0.008546136319637299, -0.023212408646941185, -0.0029888502322137356, 0.03844842314720154, 0.0037607592530548573, -0.015631157904863358, 0.030747711658477783, -0.07902878522872925, -0.06362736225128174, 0.010301310569047928, 0.06094405800104141, -0.021705348044633865, -0.05590827018022537, 0.02648383192718029, -0.018875014036893845, -0.005807696841657162, 0.050615180283784866, 0.05179142206907272, 0.03743758797645569, 0.010641317814588547, -0.00032162878778763115, -0.02800927124917507, 0.08549811691045761, 0.043851785361766815, -0.005982295144349337, -0.015373855829238892, 0.0024673521984368563, -0.0069288029335439205, 0.061568938195705414, -0.026814650744199753, 0.01369219645857811, -0.009906166233122349, 0.000372170441551134, 0.04410908743739128, -0.0735151469707489, 0.0394776351749897, -0.007549086585640907, 0.005596340633928776, 0.004509694874286652, 0.01652253046631813, -0.008573704399168491, -0.04241824150085449, 0.00799477193504572, 0.026557346805930138, 0.08424835652112961, 0.02277131751179695, -0.021062089130282402, 0.03587539121508598, -0.02918551303446293, 0.008403700776398182, -0.019591787829995155, -0.019665302708745003, 0.028119543567299843, -0.0016724696615710855, -0.012699741870164871, -0.0122770294547081, -0.008183155208826065, -0.037897057831287384, 0.033982377499341965, 0.05980457365512848, 0.04410908743739128, 0.05881211906671524, 0.006055810488760471, -0.011155923828482628, -0.03381696715950966, -0.026924923062324524, -0.03958790749311447, -0.0002646258217282593, -0.01863609068095684, -0.012883529998362064, -0.056459635496139526, -0.03863221034407616, -0.004077793564647436, 0.020161530002951622, -0.002067613648250699, 0.005426337011158466, 0.004509694874286652, -0.004989840555936098, 0.03245693817734718, 0.04951245337724686, 0.039514392614364624, 0.0043167173862457275, -0.008996415883302689, -0.029424438253045082, -0.04069063439965248, -0.0469394214451313, -0.04903460294008255, 0.048336211591959, -0.03775002807378769, -0.013177590444684029, -0.012460817582905293, 0.006529063917696476, -0.005605529993772507, 0.07005993276834488, 0.1019655093550682, 0.04660860449075699, 0.05168114975094795, -0.009805083274841309, -0.00639581773430109, 0.023322680965065956, -0.03324722498655319, -0.05715802684426308, 0.06359060108661652, 0.007493950426578522, 0.047711331397295, 0.006303924135863781, 0.013499218970537186, 0.05065193772315979, -0.0275865588337183, 0.005587151274085045, -0.04341069608926773, 0.04047008976340294, 0.02203616499900818, 0.012699741870164871, -0.022128060460090637, 0.029571468010544777, -0.05245305970311165, -0.0557979978621006, -0.038227878510951996, -0.015318718738853931, -0.060245662927627563, 0.03069257363677025, -0.01787337101995945, 0.03240180015563965, 0.052306026220321655, -0.006175272632390261, 0.08233696967363358, 0.0511297844350338, -0.038705725222826004, -0.020069636404514313, 0.032162878662347794, -0.014280317351222038, -0.1268136352300644, -0.009602916426956654, -0.007406651042401791, -0.03615107387304306, -0.016035491600632668, -0.04462369531393051, -0.008077477104961872, 0.01902204379439354, -0.022275090217590332, -0.03686784580349922, 0.012653795070946217, 0.008422079496085644, 0.026649240404367447, 0.02698005922138691, -0.05186493694782257, -0.02052910439670086, -0.01384841650724411, -0.0005729012773372233, 0.0010464421939104795, -0.0034299411345273256, 0.038227878510951996, 0.03911006078124046, 0.031152043491601944, 0.004962272476404905, 0.012019726447761059, -0.050909239798784256, -0.0585915744304657, 0.040028996765613556, 0.07237566262483597, 0.05752560496330261, 0.03451536223292351, 0.00799477193504572, 0.049402181059122086, 0.011257006786763668, -0.0340375155210495, 0.012102431617677212, 0.001600103103555739, -0.020088015124201775, -0.06506090611219406, 0.01600792445242405, -0.006602579262107611, -0.008343969471752644, -0.018176620826125145, -0.07792605459690094, 0.03440508991479874, 0.0354343019425869, 0.030527165159583092, -0.01234135590493679, 0.05495257303118706, 0.02848711982369423, 0.042454998940229416, -0.004564831033349037, 0.02317565120756626, 0.025840574875473976, -0.014427348040044308, -0.026520589366555214, -0.04513829946517944, -0.03855869546532631, 0.008325590752065182, -0.015015468932688236, -0.011091598309576511, -0.04752754420042038, -0.030876362696290016, -0.003786030225455761, 0.02527083270251751, 0.016090627759695053, 0.04947569593787193, 0.0066209579817950726, -0.0005266671068966389, -0.02052910439670086, -0.04962272569537163, 0.04363124072551727, -0.008008556440472603, -0.031372588127851486, 0.021521558985114098, -0.01026455219835043, -0.022624287754297256, 0.02225671149790287, -0.04962272569537163, -0.0455426350235939, -0.006225814111530781, -0.04734375700354576, -0.017322007566690445, -0.0455426350235939, 0.0817488431930542, 0.07005993276834488, -0.04271230101585388, -0.036794330924749374, 0.02648383192718029, -0.027163846418261528, -0.034993208944797516, 0.029424438253045082, -0.037308938801288605, 0.032989922910928726, 0.023984316736459732, -0.03253045305609703, 0.018176620826125145, -0.0365186482667923, 0.006767988204956055, 0.012506764382123947, -0.00412603747099638, -0.011091598309576511, -0.002887766808271408, 0.020418832078576088, 0.06634742021560669, -0.005389579106122255, 0.04936542361974716, -0.01178080216050148, 0.019610166549682617, 0.03936736285686493, 0.043043117970228195, -0.031868815422058105, -0.051423847675323486, -0.06050296872854233, 0.03282451257109642, -0.020473968237638474, -0.06215705722570419, -0.04620426893234253, -0.028542255982756615, -0.006083378568291664, -0.02727412059903145, 0.0136003028601408, 0.023892423138022423, 0.014923575334250927, -0.0736621767282486, 0.018240945413708687, 0.03420292213559151, -0.05267360433936119, -0.023285923525691032, 0.010282930918037891, -0.05396011844277382, -0.00799477193504572, 0.02567516639828682, -0.0146111361682415, -0.020712893456220627, -0.08292508870363235, 0.0031703407876193523, 0.00048014582716859877, -0.05682720988988876, -0.019793953746557236, 0.0013117858907207847, 0.019279347732663155, -0.006924208253622055, 0.03199746832251549, -0.04377827048301697, -0.05153411999344826, 0.00333574996329844, 0.053224965929985046, -0.025344347581267357, -0.04296960309147835, -0.00042759397183544934, -0.02133777178823948, -0.04307987540960312, 0.0007713347440585494, -0.053114693611860275, -0.028431983664631844, 0.019077181816101074, -0.040028996765613556, -0.08167532831430435, 0.06142190471291542, 0.02297348342835903, -0.00931804534047842, 0.01253433246165514, 0.03675757348537445, -0.012865151278674603, -0.07726442068815231, -0.017395522445440292, -0.024021074175834656, -0.006611768621951342, -0.02637355960905552, 0.008955064229667187, 0.055724482983350754, 0.017790665850043297, -0.047711331397295, 0.006336086895316839, 0.03179530054330826, -0.025454619899392128, -0.040433332324028015, 0.03111528605222702, -0.0613851472735405, -0.03918357565999031, -0.08527757227420807, 0.02356160432100296, 0.011652151122689247, -0.008716139942407608, 0.00906993169337511, 0.009639673866331577, 0.032273150980472565, 0.016917673870921135, -0.00302331056445837, 0.04653508961200714, 0.019573409110307693, 0.0038480586372315884, 0.014068961143493652, -0.004750916268676519, 0.01574143022298813, 0.026924923062324524, -0.005499851889908314, -0.040837664157152176, -0.006455549038946629, 0.0968194529414177, 0.00428225751966238, -0.04377827048301697, -0.028266575187444687, -0.030049316585063934, -0.02718222700059414, 0.048997845500707626, 0.0401025116443634, 0.04319015145301819, -0.020786408334970474, -0.0012497574789449573, -0.028542255982756615, -0.0071998899802565575, 0.02032693848013878, 0.04285933077335358, -0.04451342299580574, 0.053114693611860275, 0.04017603024840355, 0.021595075726509094, -0.017790665850043297, -0.03282451257109642, 0.05697423964738846, -0.056643422693014145, 0.03131745383143425, 0.04517505690455437, 0.035599712282419205, 0.044844239950180054, 0.01983071118593216, -0.04319015145301819, 0.021282635629177094, -0.028928210958838463, 0.016292795538902283, 0.023929180577397346, 0.016136575490236282, -0.023322680965065956, -0.00125894695520401, 0.03344939276576042, 0.0022445092909038067, -0.04410908743739128, 0.004718753509223461, -0.00541255297139287, 0.036794330924749374, -0.004675103817135096, -0.0235432256013155, 0.025215696543455124, -0.004773890133947134, -0.0018941637827083468, -0.0585915744304657, -0.07586763054132462, 0.08527757227420807, -0.006478522438555956, 0.04333718121051788, 0.0037998142652213573, 0.005793912801891565, -0.007921257056295872, 0.05609205737709999, -0.04098469391465187, 0.018093915656208992, -0.07263296842575073, 0.045873451977968216, -0.015704672783613205, -0.04307987540960312, 0.002821143716573715, 0.05447472631931305, -0.0023915397468954325, -0.07924932986497879, -0.024131348356604576, 0.05429093539714813, 0.022495634853839874, 0.017854992300271988, 0.010990514419972897, -0.0221464391797781, 0.030453650280833244, 0.04499126970767975, -0.0043534752912819386, -0.006538253277540207, -0.04028630256652832, 0.004663617350161076, 0.0037883275654166937, -0.08461593836545944, 0.05436445400118828, -0.029130376875400543, 0.055834755301475525, 0.036996498703956604, -0.027825484052300453, 0.04741727188229561, -0.0013921931385993958, -0.021797241643071175, -0.002871685428544879, 0.026428695768117905, 0.005950132384896278, 0.0125894695520401, 0.014307885430753231, -0.018700415268540382, 0.02911199815571308, -0.004645238630473614, 0.021172363311052322, 0.04774808883666992, 0.009382370859384537, -0.03804408758878708, -0.028229817748069763, -0.029148755595088005, 0.015263582579791546, -0.028340090066194534, 0.019077181816101074, 0.02738439291715622, -0.011247817426919937, 0.006212030071765184, 0.009129662066698074, -0.03269586339592934, 0.01711065135896206, -0.035397544503211975, -0.005339037626981735, 0.035985663533210754, 0.008095855824649334, 0.07197132706642151, -0.007328541483730078, 0.0436679981648922, 0.029534710571169853, 0.03190557286143303 ]
42,982
linearmodels.asset_pricing.model
fit
Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator debiased : bool Flag indicating whether to debias the covariance estimator using a degree of freedom adjustment **cov_config Additional covariance-specific options. See Notes. Returns ------- LinearFactorModelResults Results class with parameter estimates, covariance and test statistics Notes ----- The kernel covariance estimator takes the optional arguments ``kernel``, one of "bartlett", "parzen" or "qs" (quadratic spectral) and ``bandwidth`` (a positive integer).
def fit( self, cov_type: str = "robust", debiased: bool = True, **cov_config: bool | int | str, ) -> LinearFactorModelResults: """ Estimate model parameters Parameters ---------- cov_type : str Name of covariance estimator debiased : bool Flag indicating whether to debias the covariance estimator using a degree of freedom adjustment **cov_config Additional covariance-specific options. See Notes. Returns ------- LinearFactorModelResults Results class with parameter estimates, covariance and test statistics Notes ----- The kernel covariance estimator takes the optional arguments ``kernel``, one of "bartlett", "parzen" or "qs" (quadratic spectral) and ``bandwidth`` (a positive integer). """ nobs, nf, nport, nrf, s1, s2, s3 = self._boundaries() excess_returns = not self._risk_free f = self.factors.ndarray p = self.portfolios.ndarray nport = p.shape[1] # Step 1, n regressions to get B fc = np.c_[np.ones((nobs, 1)), f] b = lstsq(fc, p, rcond=None)[0] # nf+1 by np eps = p - fc @ b if excess_returns: betas = b[1:].T else: betas = b.T.copy() betas[:, 0] = 1.0 sigma_m12 = self._sigma_m12 lam = lstsq(sigma_m12 @ betas, sigma_m12 @ p.mean(0)[:, None], rcond=None)[0] expected = betas @ lam pricing_errors = p - expected.T # Moments alphas = pricing_errors.mean(0)[:, None] moments = self._moments(eps, betas, alphas, pricing_errors) # Jacobian jacobian = self._jacobian(betas, lam, alphas) if cov_type not in ("robust", "heteroskedastic", "kernel"): raise ValueError(f"Unknown weight: {cov_type}") if cov_type in ("robust", "heteroskedastic"): cov_est_inst = HeteroskedasticCovariance( moments, jacobian=jacobian, center=False, debiased=debiased, df=fc.shape[1], ) else: # "kernel": bandwidth = get_float(cov_config, "bandwidth") kernel = get_string(cov_config, "kernel") cov_est_inst = KernelCovariance( moments, jacobian=jacobian, center=False, debiased=debiased, df=fc.shape[1], kernel=kernel, bandwidth=bandwidth, ) # VCV full_vcv = cov_est_inst.cov alpha_vcv = full_vcv[s2:, s2:] stat = float(np.squeeze(alphas.T @ np.linalg.pinv(alpha_vcv) @ alphas)) jstat = WaldTestStatistic( stat, "All alphas are 0", nport - nf - nrf, name="J-statistic" ) total_ss = ((p - p.mean(0)[None, :]) ** 2).sum() residual_ss = (eps**2).sum() r2 = 1 - residual_ss / total_ss rp = lam rp_cov = full_vcv[s1:s2, s1:s2] betas = betas if excess_returns else betas[:, 1:] params = np.c_[alphas, betas] param_names = [] for portfolio in self.portfolios.cols: param_names.append(f"alpha-{portfolio}") for factor in self.factors.cols: param_names.append(f"beta-{portfolio}-{factor}") if not excess_returns: param_names.append("lambda-risk_free") for factor in self.factors.cols: param_names.append(f"lambda-{factor}") # Pivot vcv to remove unnecessary and have correct order order = np.reshape(np.arange(s1), (nport, nf + 1)) order[:, 0] = np.arange(s2, s3) order = order.ravel() order = np.r_[order, s1:s2] full_vcv = full_vcv[order][:, order] factor_names = list(self.factors.cols) rp_names = factor_names[:] if not excess_returns: rp_names.insert(0, "risk_free") res = AttrDict( params=params, cov=full_vcv, betas=betas, rp=rp, rp_cov=rp_cov, alphas=alphas, alpha_vcv=alpha_vcv, jstat=jstat, rsquared=r2, total_ss=total_ss, residual_ss=residual_ss, param_names=param_names, portfolio_names=self.portfolios.cols, factor_names=factor_names, name=self._name, cov_type=cov_type, model=self, nobs=nobs, rp_names=rp_names, cov_est=cov_est_inst, ) return LinearFactorModelResults(res)
(self, cov_type: str = 'robust', debiased: bool = True, **cov_config: bool | int | str) -> linearmodels.asset_pricing.results.LinearFactorModelResults
[ 0.029365161433815956, -0.03988466039299965, -0.007942860946059227, -0.024190589785575867, -0.013575265184044838, -0.05758041515946388, -0.044037092477083206, -0.08628544956445694, 0.017429575324058533, 0.04050220176577568, -0.038351453840732574, -0.012414712458848953, -0.019622912630438805, 0.04207799583673477, -0.026639461517333984, 0.10366178303956985, 0.01372432615607977, -0.007048490457236767, 0.015427889302372932, 0.02073022723197937, -0.05264008417725563, -0.01039173174649477, -0.04437780752778053, 0.04186505079269409, 0.0273421797901392, 0.002512754872441292, 0.05119205638766289, -0.03607293963432312, 0.04442039504647255, 0.01407568622380495, -0.03671177476644516, 0.046251725405454636, -0.04608136788010597, 0.01328778825700283, 0.010785681195557117, 0.01196752768009901, 0.0544288270175457, 0.002683111233636737, 0.014437693171203136, 0.03713766485452652, 0.0050760842859745026, -0.00000969067605183227, 0.007245464716106653, -0.03060024417936802, -0.04169469699263573, -0.008342132903635502, -0.04957367107272148, 0.10255447030067444, 0.01528947427868843, -0.012947076000273228, -0.009518655948340893, -0.0442926287651062, 0.03798944503068924, -0.03926711902022362, -0.008310191333293915, -0.016631029546260834, 0.0024821439292281866, 0.03268710896372795, 0.05613238736987114, -0.02172042429447174, 0.012457301840186119, -0.03692471981048584, 0.005749524105340242, -0.01123286597430706, -0.050680987536907196, -0.022529615089297295, -0.0052331313490867615, -0.0051532769575715065, 0.036349765956401825, 0.04005501791834831, 0.020027508959174156, 0.005866643972694874, -0.033496301621198654, 0.02657557651400566, 0.025659911334514618, 0.013447497971355915, 0.024531301110982895, -0.094462551176548, -0.057878538966178894, -0.04033184424042702, 0.06942017376422882, 0.017003685235977173, -0.04252518340945244, -0.0925886258482933, -0.006926046684384346, -0.005611109547317028, 0.004567677155137062, -0.054173290729522705, 0.046677615493535995, 0.05587685480713844, -0.038564398884773254, -0.006026352755725384, 0.035178568214178085, 0.015374653041362762, 0.027491241693496704, -0.013117432594299316, 0.0032926672138273716, -0.02806619368493557, -0.005531255155801773, -0.01945255510509014, 0.009412183426320553, 0.027257002890110016, 0.001533206319436431, 0.07568076997995377, -0.027789365500211716, -0.023977644741535187, -0.05114946886897087, -0.0013182646362110972, 0.02751253731548786, -0.020751522853970528, -0.06997383385896683, 0.048679303377866745, -0.0011259483871981502, -0.001378820976242423, -0.057963717728853226, 0.001964420545846224, -0.073082834482193, 0.026405220851302147, -0.06320217251777649, 0.05008473992347717, -0.011435164138674736, 0.05758041515946388, -0.01709950901567936, 0.006074265576899052, -0.027086645364761353, 0.0015904353931546211, 0.009907281026244164, 0.03407125174999237, 0.073082834482193, -0.009657070972025394, -0.0014307263772934675, -0.024701658636331558, -0.0038010741118341684, -0.01017878670245409, 0.031068723648786545, -0.00778315169736743, -0.01670556142926216, -0.016588442027568817, 0.0005689632962457836, 0.002762965625151992, 0.054599180817604065, 0.051958661526441574, -0.05502507463097572, -0.02670334465801716, 0.01718468777835369, 0.022934211418032646, 0.08688169717788696, -0.06946276873350143, -0.0675036683678627, 0.026660755276679993, -0.009699659422039986, -0.023232335224747658, -0.04505923017859459, -0.014331220649182796, 0.002858791034668684, -0.04948849603533745, 0.023487869650125504, -0.044974055141210556, 0.0034204344265162945, 0.0063085053116083145, -0.0493607260286808, 0.0015505081973969936, 0.012031410820782185, 0.04344084858894348, 0.008624285459518433, 0.003055765526369214, -0.031920503824949265, -0.040033720433712006, -0.022827738896012306, 0.009907281026244164, 0.00037531612906605005, -0.011892996728420258, -0.041417866945266724, 0.014938115142285824, -0.03515727445483208, 0.029918819665908813, 0.03500821068882942, -0.05408811196684837, 0.01715274713933468, -0.018015174195170403, 0.031366847455501556, -0.035625752061605453, -0.04693315178155899, -0.011200924403965473, -0.014576108194887638, 0.02847079001367092, -0.030344709753990173, 0.01757863722741604, -0.006627923343330622, -0.026745934039354324, -0.03720154985785484, 0.008315514773130417, 0.04437780752778053, -0.011605520732700825, -0.03100484050810337, -0.023019390180706978, 0.03671177476644516, 0.018260061740875244, -0.011307396925985813, -0.023551752790808678, 0.017269866541028023, 0.014746463857591152, -0.010551441460847855, -0.025383083149790764, -0.058389607816934586, -0.0031462672632187605, -0.041843757033348083, -0.04197152331471443, 0.05451400578022003, 0.022614793851971626, -0.02016592212021351, 0.04884965717792511, -0.008331486023962498, -0.012819308787584305, -0.004530411679297686, -0.06362806260585785, 0.02910962700843811, -0.015949605032801628, 0.011797171086072922, 0.020879289135336876, 0.014320573769509792, -0.08977775275707245, 0.025787679478526115, 0.031814031302928925, -0.012936429120600224, -0.01428863126784563, 0.0146719329059124, 0.03217604011297226, 0.0017621226143091917, -0.057878538966178894, -0.021699128672480583, -0.017748992890119553, 0.04578324407339096, -0.022103725001215935, -0.06895169615745544, -0.0038489869330078363, -0.04505923017859459, 0.060306116938591, -0.07103855907917023, -0.0013881373452022672, 0.020815405994653702, -0.022188903763890266, 0.03198438882827759, 0.05873032286763191, -0.020953821018338203, -0.004368041176348925, 0.041417866945266724, 0.04761457443237305, -0.010093608871102333, -0.02115611918270588, -0.015001998282968998, -0.030408592894673347, -0.030408592894673347, 0.03620070591568947, -0.046464670449495316, -0.07806576043367386, 0.044974055141210556, -0.0008637594874016941, 0.05570649728178978, -0.020815405994653702, -0.0027523182798177004, -0.024211883544921875, 0.006090236362069845, 0.06614081561565399, -0.04231223836541176, 0.003934164997190237, -0.007421144749969244, -0.026234865188598633, 0.059965405613183975, 0.02118805982172489, -0.0074637336656451225, 0.07001642137765884, -0.005424782168120146, -0.011275455355644226, -0.011626815423369408, 0.03385830670595169, -0.04316401854157448, -0.005131982266902924, 0.04442039504647255, 0.037819091230630875, 0.02910962700843811, -0.031686265021562576, -0.020581165328621864, 0.019431261345744133, -0.00336453621275723, -0.0033006526064127684, -0.023998938500881195, -0.010205404832959175, 0.021496830508112907, 0.031814031302928925, 0.009066147729754448, -0.021273238584399223, 0.03818109631538391, -0.007548911962658167, 0.06673706322908401, -0.0018699262291193008, 0.045527711510658264, -0.023253630846738815, 0.0643094927072525, 0.0011838428908959031, -0.028449496254324913, 0.04218446835875511, 0.08143029361963272, -0.013553970493376255, -0.007868329994380474, -0.02723570726811886, 0.04369638115167618, -0.07861941307783127, 0.007639413699507713, 0.029365161433815956, 0.00422164099290967, 0.01897342875599861, 0.005275720730423927, 0.009539950639009476, 0.003763808635994792, -0.049744028598070145, -0.01998491957783699, -0.04180116951465607, 0.05915621295571327, 0.03198438882827759, -0.021571362391114235, -0.03658400848507881, 0.033602774143218994, -0.0426955372095108, -0.008571049198508263, 0.01507652923464775, 0.01291513442993164, 0.04124750941991806, -0.037393201142549515, -0.004245597403496504, -0.003686615964397788, 0.006968636065721512, 0.036754362285137177, 0.06273369491100311, -0.047742344439029694, 0.005374207627028227, 0.055749088525772095, -0.02751253731548786, 0.04706091806292534, -0.004349408205598593, 0.0546843595802784, -0.012255003675818443, -0.06341511756181717, -0.013639148324728012, -0.04761457443237305, -0.023019390180706978, 0.05941174551844597, 0.026745934039354324, 0.038564398884773254, 0.044037092477083206, -0.03238898515701294, -0.008310191333293915, 0.04599619284272194, 0.10187304764986038, -0.023232335224747658, 0.030408592894673347, -0.003010514657944441, -0.0525549054145813, 0.0685683935880661, -0.053449276834726334, -0.015385299921035767, 0.07614924758672714, -0.053321510553359985, 0.044675931334495544, 0.043398257344961166, -0.03473138436675072, -0.01907990127801895, -0.036030348390340805, 0.10315071791410446, -0.04282330721616745, 0.024935897439718246, -0.014650638215243816, -0.02945033833384514, -0.00331129995174706, 0.02657557651400566, -0.04693315178155899, -0.03737190365791321, 0.015332063660025597, 0.022125020623207092, 0.015789896249771118, -0.02425447292625904, -0.05170312523841858, -0.0405447892844677, 0.00944412499666214, -0.01688656397163868, -0.007932213135063648, -0.013053548522293568, -0.024808131158351898, 0.047742344439029694, -0.019143784418702126, 0.013884035870432854, 0.0030211617704480886, 0.06371324509382248, 0.02393505536019802, 0.018068410456180573, 0.01339426077902317, 0.030302120372653008, -0.019197020679712296, -0.024744248017668724, -0.015481125563383102, -0.03671177476644516, -0.013820151798427105, -0.017440222203731537, 0.02849208563566208, -0.029620695859193802, -0.049531083554029465, 0.02900315448641777, 0.025574734434485435, -0.02638392709195614, 0.06707777827978134, -0.012510538101196289, 0.025021076202392578, -0.050382863730192184, -0.04578324407339096, -0.05962469056248665, 0.06507609039545059, -0.012510538101196289, -0.01196752768009901, 0.11652368307113647, 0.030877072364091873, 0.06763143837451935, -0.038862522691488266, 0.043398257344961166, 0.0090022636577487, -0.0007253450457938015, 0.051745716482400894, -0.014703875407576561, 0.04031055048108101, -0.021869486197829247, -0.03660530224442482, 0.03111131303012371, 0.023892465978860855, -0.025979330763220787, -0.026405220851302147, -0.05008473992347717, -0.000777250446844846, -0.04557029902935028, 0.010689855553209782, -0.0013774901162832975, 0.03079189546406269, 0.026447810232639313, 0.016631029546260834, -0.010397056117653847, -0.005531255155801773, -0.049531083554029465, 0.03713766485452652, 0.03294264152646065, -0.039096761494874954, -0.09079989045858383, -0.039096761494874954, 0.034859150648117065, 0.0025087620597332716, 0.006233974359929562, 0.013500734232366085, -0.033496301621198654, -0.002757641952484846, -0.007857682183384895, -0.0360090546309948, 0.01402244996279478, 0.01715274713933468, 0.03858569264411926, 0.006180738098919392, -0.0033751835580915213, 0.008555078878998756, -0.0381598025560379, 0.02932257205247879, 0.04676279425621033, -0.01672685518860817, 0.0128086619079113, 0.0013222574489191175, -0.02104964666068554, 0.014874231070280075, 0.007453086320310831, -0.04252518340945244, -0.03226121887564659, 0.07112374156713486, -0.01329843606799841, 0.01412892248481512, 0.010924095287919044, 0.019537733867764473, 0.018696600571274757, -0.02710794098675251, 0.007330643013119698, 0.025191431865096092, 0.0276190098375082, -0.05890067666769028, -0.008709464222192764, 0.06107272207736969, 0.012010116130113602, 0.01987844705581665, -0.057963717728853226, 0.0029732491821050644, 0.04884965717792511, 0.08875561505556107, -0.02184819057583809, 0.01084424089640379, 0.04471851885318756, -0.0035748197697103024, 0.029940113425254822, -0.020698286592960358, 0.03134555369615555, -0.002057584235444665, -0.05072357878088951, -0.02393505536019802, -0.015534361824393272, -0.05562131851911545, -0.035072095692157745, -0.020932525396347046, -0.03185662254691124, -0.03324076533317566, -0.026298748329281807, 0.00528902979567647, 0.02955681085586548, -0.056260157376527786, -0.0038223685696721077, 0.03383701294660568, -0.00283483462408185, 0.013362319208681583, -0.024424828588962555, -0.01218047272413969, 0.034433260560035706, 0.022657383233308792, 0.060178350657224655, -0.009348300285637379, 0.036860834807157516, 0.06737590581178665, -0.007186905015259981, -0.021432947367429733, 0.056686047464609146, 0.020155275240540504, -0.02021915838122368, -0.06984607130289078, -0.000265848939307034, 0.04158822447061539, 0.03326205909252167, -0.03669048100709915, -0.022423142567276955, -0.05830443277955055, -0.04158822447061539, -0.030089175328612328, -0.02793842740356922, 0.013607206754386425, 0.02478683553636074, -0.01878177747130394, 0.013117432594299316, -0.0007832395494915545, 0.02795972116291523, -0.015214943327009678, -0.019005371257662773, -0.05898585543036461, 0.03732931613922119, 0.012904486618936062, 0.03532762825489044, 0.027576420456171036, 0.027193117886781693, 0.0349443294107914, -0.03038729913532734, -0.007330643013119698, 0.019654853269457817, -0.02891797572374344, -0.0044958083890378475, 0.021145470440387726, 0.024765541777014732, -0.045740656554698944, -0.015598244965076447, 0.006127501837909222, 0.04386673867702484, 0.03241027891635895, -0.005089393351227045, -0.04612395912408829, 0.011690698564052582, -0.0106738843023777, -0.05298079922795296, 0.05251231789588928, -0.015694070607423782, -0.01678009144961834, 0.021890779957175255, -0.02195466309785843, -0.06954794377088547, 0.025021076202392578, -0.012404065579175949, -0.06648153066635132, -0.011797171086072922, -0.06507609039545059, -0.02019786462187767, 0.0038516486529260874, -0.045740656554698944, -0.0014626681804656982, -0.00996584165841341, 0.04043831676244736, -0.03330465033650398, 0.04957367107272148, -0.0594969242811203, -0.07103855907917023, -0.01423539500683546, 0.033176884055137634, -0.04914778098464012, 0.004402644466608763, 0.02041080966591835, 0.024297062307596207, -0.04373897239565849, -0.04544253274798393, 0.016343554481863976, 0.011349986307322979, -0.020027508959174156, 0.010295907035470009, -0.049318138509988785, 0.02955681085586548, 0.07133668661117554, 0.015161707065999508, 0.012031410820782185, 0.002105497056618333, 0.010008430108428001, 0.016205139458179474, 0.0028374965768307447, -0.010870859026908875, -0.03183532506227493, -0.023445280268788338, 0.06771661341190338, 0.030940955504775047, -0.011829112656414509, 0.033602774143218994, 0.04190764203667641, 0.03249545767903328, -0.04471851885318756, -0.007980125956237316, 0.017067568376660347, -0.12930040061473846, -0.006319152656942606, -0.056260157376527786, 0.012904486618936062, 0.08202654123306274, 0.03439066931605339, 0.014277984388172626, 0.016673618927598, 0.020283043384552002, 0.0576230064034462, 0.009646423161029816, 0.01787676103413105, 0.01603478379547596, -0.003934164997190237, 0.0256173238158226, 0.035072095692157745, 0.020474692806601524, -0.011168982833623886, 0.0045463829301297665, 0.0023903113324195147, -0.022955507040023804, 0.09079989045858383, -0.002102835103869438, -0.0453573539853096, -0.018909545615315437, -0.06737590581178665, -0.020495988428592682, -0.005134644452482462, 0.022444438189268112, 0.033176884055137634, 0.059454336762428284, 0.038244981318712234, -0.011349986307322979, -0.012084647081792355, -0.04133268818259239, 0.04544253274798393, -0.05719711631536484, -0.004905728157609701, 0.016716208308935165, 0.049403317272663116, -0.016311611980199814, -0.0658852830529213, 0.0015012645162642002, -0.009715630672872066, 0.016897212713956833, -0.020453399047255516, -0.010295907035470009, -0.0032420926727354527, 0.004905728157609701, -0.05485471710562706, 0.0397568941116333, -0.011211571283638477, -0.005770818330347538, 0.11132781952619553, 0.03798944503068924, -0.01691850647330284, 0.05315115302801132, 0.0840282291173935, -0.04133268818259239, -0.03166497126221657, -0.02900315448641777, -0.031814031302928925, -0.02353045903146267, -0.04201411455869675, -0.020762169733643532, 0.018377181142568588, -0.011871702037751675, 0.02606450766324997, -0.027150530368089676, -0.038244981318712234, -0.012766072526574135, -0.020847348496317863, 0.008038686588406563, 0.0036014379002153873, -0.028534675016999245, 0.014267337508499622, 0.07925824820995331, -0.01892019249498844, 0.059880226850509644, 0.014938115142285824, -0.01440575160086155, 0.04407968372106552, -0.06601305305957794, 0.02184819057583809, 0.015161707065999508, 0.037393201142549515, -0.04948849603533745, 0.0026964202988892794, 0.04684797301888466, -0.0370950773358345, -0.029833640903234482, -0.013277141377329826, 0.03805333003401756, 0.05421588197350502, -0.0013761591399088502, 0.03036600351333618, -0.010407702997326851, -0.004357393831014633, -0.05536578595638275, -0.006947341375052929, 0.02184819057583809, 0.04970144107937813, -0.0062552690505981445, 0.06899428367614746, 0.020794112235307693, -0.04838117957115173, -0.021571362391114235, -0.015427889302372932, -0.040885504335165024, 0.010008430108428001, -0.0075116464868187904, -0.023125862702727318, 0.03767002746462822, -0.041183628141880035, 0.05958210304379463, -0.03671177476644516, -0.0405447892844677, 0.011254160664975643, 0.07815093547105789, 0.00595714570954442, -0.016524557024240494, 0.06758885085582733, -0.0835171565413475, 0.025191431865096092, -0.04390932619571686, -0.011690698564052582, 0.03196309506893158, 0.027491241693496704, -0.02574509009718895, 0.03720154985785484, -0.020932525396347046, -0.002161395037546754, -0.03236769139766693, 0.005637727677822113, -0.01883501373231411, 0.028087489306926727, 0.05502507463097572, 0.018749836832284927, 0.01375626865774393, 0.0013082828372716904, -0.010184110142290592 ]
42,983
linearmodels.asset_pricing.model
LinearFactorModelGMM
GMM estimator of Linear factor models Parameters ---------- portfolios : array_like Test portfolio returns (nobs by nportfolio) factors : array_like Priced factors values (nobs by nfactor) risk_free : bool Flag indicating whether the risk-free rate should be estimated from returns along other risk premia. If False, the returns are assumed to be excess returns using the correct risk-free rate. Notes ----- Suitable for traded or non-traded factors. Implements a GMM estimator of risk premia, factor loadings and model tests. The moments are .. math:: \left[\begin{array}{c} \epsilon_{t}\otimes f_{c,t}\\ f_{t}-\mu \end{array}\right] and .. math:: \epsilon_{t}=r_{t}-\left[1_{N}\;\beta\right]\lambda-\beta\left(f_{t}-\mu\right) where :math:`r_{it}` is the return on test portfolio i and :math:`f_t` are the factor returns. The model is tested using the optimized objective function using the usual GMM J statistic.
class LinearFactorModelGMM(_LinearFactorModelBase): r""" GMM estimator of Linear factor models Parameters ---------- portfolios : array_like Test portfolio returns (nobs by nportfolio) factors : array_like Priced factors values (nobs by nfactor) risk_free : bool Flag indicating whether the risk-free rate should be estimated from returns along other risk premia. If False, the returns are assumed to be excess returns using the correct risk-free rate. Notes ----- Suitable for traded or non-traded factors. Implements a GMM estimator of risk premia, factor loadings and model tests. The moments are .. math:: \left[\begin{array}{c} \epsilon_{t}\otimes f_{c,t}\\ f_{t}-\mu \end{array}\right] and .. math:: \epsilon_{t}=r_{t}-\left[1_{N}\;\beta\right]\lambda-\beta\left(f_{t}-\mu\right) where :math:`r_{it}` is the return on test portfolio i and :math:`f_t` are the factor returns. The model is tested using the optimized objective function using the usual GMM J statistic. """ def __init__( self, portfolios: IVDataLike, factors: IVDataLike, *, risk_free: bool = False ) -> None: super().__init__(portfolios, factors, risk_free=risk_free) @classmethod def from_formula( cls, formula: str, data: DataFrame, *, portfolios: DataFrame | None = None, risk_free: bool = False, ) -> LinearFactorModelGMM: """ Parameters ---------- formula : str Formula modified for the syntax described in the notes data : DataFrame DataFrame containing the variables used in the formula portfolios : array_like Portfolios to be used in the model. If provided, must use formula syntax containing only factors. risk_free : bool Flag indicating whether the risk-free rate should be estimated from returns along other risk premia. If False, the returns are assumed to be excess returns using the correct risk-free rate. Returns ------- LinearFactorModelGMM Model instance Notes ----- The formula can be used in one of two ways. The first specified only the factors and uses the data provided in ``portfolios`` as the test portfolios. The second specified the portfolio using ``+`` to separate the test portfolios and ``~`` to separate the test portfolios from the factors. Examples -------- >>> from linearmodels.datasets import french >>> from linearmodels.asset_pricing import LinearFactorModel >>> data = french.load() >>> formula = "S1M1 + S1M5 + S3M3 + S5M1 + S5M5 ~ MktRF + SMB + HML" >>> mod = LinearFactorModel.from_formula(formula, data) Using only factors >>> portfolios = data[["S1M1", "S1M5", "S3M1", "S3M5", "S5M1", "S5M5"]] >>> formula = "MktRF + SMB + HML" >>> mod = LinearFactorModel.from_formula(formula, data, portfolios=portfolios) """ factors, portfolios, formula = cls._prepare_data_from_formula( formula, data, portfolios ) mod = cls(portfolios, factors, risk_free=risk_free) mod.formula = formula return mod def fit( self, *, center: bool = True, use_cue: bool = False, steps: int = 2, disp: int = 10, max_iter: int = 1000, cov_type: str = "robust", debiased: bool = True, starting: ArrayLike | None = None, opt_options: dict[str, Any] | None = None, **cov_config: bool | int | str, ) -> GMMFactorModelResults: """ Estimate model parameters Parameters ---------- center : bool Flag indicating to center the moment conditions before computing the weighting matrix. use_cue : bool Flag indicating to use continuously updating estimator steps : int Number of steps to use when estimating parameters. 2 corresponds to the standard efficient GMM estimator. Higher values will iterate until convergence or up to the number of steps given disp : int Number of iterations between printed update. 0 or negative values suppresses output max_iter : int Maximum number of iterations when minimizing objective. Must be positive. cov_type : str Name of covariance estimator debiased : bool Flag indicating whether to debias the covariance estimator using a degree of freedom adjustment starting : array_like Starting values to use in optimization. If not provided, 2SLS estimates are used. opt_options : dict Additional options to pass to scipy.optimize.minimize when optimizing the objective function. If not provided, defers to scipy to choose an appropriate optimizer. All minimize inputs except ``fun``, ``x0``, and ``args`` can be overridden. **cov_config Additional covariance-specific options. See Notes. Returns ------- GMMFactorModelResults Results class with parameter estimates, covariance and test statistics Notes ----- The kernel covariance estimator takes the optional arguments ``kernel``, one of "bartlett", "parzen" or "qs" (quadratic spectral) and ``bandwidth`` (a positive integer). """ nobs, n = self.portfolios.shape k = self.factors.shape[1] excess_returns = not self._risk_free nrf = int(not bool(excess_returns)) # 1. Starting Values - use 2 pass mod = LinearFactorModel( self.portfolios, self.factors, risk_free=self._risk_free ) res = mod.fit() betas = np.asarray(res.betas).ravel() lam = np.asarray(res.risk_premia) mu = self.factors.ndarray.mean(0) sv = np.r_[betas, lam, mu][:, None] if starting is not None: starting = np.asarray(starting) if starting.ndim == 1: starting = starting[:, None] if starting.shape != sv.shape: raise ValueError(f"Starting values must have {sv.shape} elements.") sv = starting g = self._moments(sv, excess_returns) g -= g.mean(0)[None, :] if center else 0 kernel: str | None = None bandwidth: float | None = None if cov_type not in ("robust", "heteroskedastic", "kernel"): raise ValueError(f"Unknown weight: {cov_type}") if cov_type in ("robust", "heteroskedastic"): weight_est_instance = HeteroskedasticWeight(g, center=center) cov_est = HeteroskedasticCovariance else: # "kernel": kernel = get_string(cov_config, "kernel") bandwidth = get_float(cov_config, "bandwidth") weight_est_instance = KernelWeight( g, center=center, kernel=kernel, bandwidth=bandwidth ) cov_est = KernelCovariance w = weight_est_instance.w(g) args = (excess_returns, w) # 2. Step 1 using w = inv(s) from SV callback = callback_factory(self._j, args, disp=disp) _default_options: dict[str, Any] = {"callback": callback} options = {"disp": bool(disp), "maxiter": max_iter} opt_options = {} if opt_options is None else opt_options options.update(opt_options.get("options", {})) _default_options.update(opt_options) _default_options["options"] = options opt_res = minimize( fun=self._j, x0=np.squeeze(sv), args=args, **_default_options, ) params = opt_res.x last_obj = opt_res.fun iters = 1 # 3. Step 2 using step 1 estimates if not use_cue:
(portfolios: 'IVDataLike', factors: 'IVDataLike', *, risk_free: 'bool' = False) -> 'None'
[ 0.05308273062109947, -0.05073067173361778, -0.03415096551179886, 0.017951739951968193, 0.009050813503563404, -0.046326328068971634, -0.061983656138181686, -0.04150691255927086, 0.04521947726607323, -0.006306745111942291, 0.004744470585137606, -0.019658135250210762, 0.015299909748136997, 0.0387859046459198, -0.04791742563247681, 0.08854807913303375, 0.008681862615048885, -0.032928816974163055, 0.024950267747044563, 0.008249498903751373, -0.04372061416506767, 0.012890202924609184, -0.05280601605772972, 0.07134576886892319, -0.00009764212882146239, 0.00971377082169056, 0.024535197764635086, -0.016118519008159637, 0.0313146598637104, -0.02612629532814026, -0.04319024831056595, 0.005859969183802605, -0.043674495071172714, -0.04319024831056595, 0.00601273775100708, -0.026518305763602257, 0.046672217547893524, 0.014850251376628876, -0.06309051066637039, 0.0065373387187719345, 0.02679501846432686, -0.020176971331238747, 0.04750235751271248, -0.011408636346459389, -0.023889534175395966, -0.022921040654182434, -0.05446629598736763, 0.09611156582832336, 0.022183138877153397, -0.012371365912258625, 0.008209144696593285, -0.043674495071172714, 0.018286101520061493, -0.025296157225966454, -0.05755625292658806, 0.052990492433309555, 0.03080735355615616, 0.030853472650051117, 0.047686830163002014, -0.031891144812107086, 0.0163837019354105, -0.014769542962312698, 0.01700630411505699, -0.006825581192970276, -0.021652773022651672, 0.01633758284151554, 0.0028910718392580748, -0.012982440181076527, 0.02568816766142845, 0.054696887731552124, -0.038232479244470596, -0.007822900079190731, 0.016245344653725624, 0.039546865969896317, 0.030230868607759476, 0.02778657339513302, 0.018320690840482712, -0.07794076204299927, -0.01769808679819107, -0.01934683322906494, 0.053267206996679306, 0.04275212064385414, -0.04074595496058464, -0.0850430503487587, -0.020557451993227005, -0.04907039552927017, -0.0011327927932143211, -0.033597540110349655, 0.03546535223722458, 0.009102696552872658, -0.06119963899254799, 0.015046256594359875, 0.03952380642294884, 0.04014641046524048, 0.025595929473638535, -0.04035394266247749, -0.03179890662431717, -0.04019252955913544, -0.026241593062877655, -0.040976546704769135, 0.01740984432399273, 0.06622658669948578, -0.024834970012307167, 0.06927042454481125, -0.0068889944814145565, -0.04607267305254936, -0.06046173721551895, -0.048009663820266724, 0.05446629598736763, -0.052298709750175476, -0.10053896903991699, 0.04990053549408913, -0.03249068930745125, -0.02974662184715271, -0.050269484519958496, 0.011742997914552689, -0.07060787081718445, 0.02912401780486107, -0.02077651582658291, 0.029516028240323067, -0.01739831455051899, 0.0029573675710707903, -0.043282486498355865, 0.031568314880132675, 0.014930958859622478, -0.01936989277601242, 0.07037727534770966, 0.027348443865776062, 0.03910873457789421, -0.049300990998744965, -0.009419763460755348, -0.03910873457789421, -0.013801048509776592, -0.028916483744978905, 0.013282212428748608, -0.00777678145095706, 0.006935113575309515, -0.022644327953457832, 0.01033060997724533, 0.05589597672224045, 0.036272428929805756, 0.05151469260454178, -0.06428959965705872, 0.007949726656079292, -0.017813384532928467, 0.03133771941065788, 0.10515084862709045, -0.012717257253825665, -0.046672217547893524, -0.005908970255404711, -0.01834375038743019, -0.016130046918988228, -0.001619922579266131, -0.03242151066660881, -0.006692989729344845, 0.036941152065992355, -0.0023506172001361847, -0.028293879702687263, -0.005493901204317808, 0.016176166012883186, -0.07171472162008286, -0.0023967360612004995, -0.005883028730750084, 0.027002552524209023, 0.0406767763197422, 0.023866474628448486, -0.033920373767614365, -0.041622210294008255, -0.05912429094314575, 0.03350530192255974, -0.003101488808169961, -0.025572869926691055, -0.011091569438576698, -0.026864197105169296, -0.012913261540234089, 0.04339778423309326, 0.0461418516933918, -0.00787478405982256, 0.026818078011274338, 0.032237038016319275, 0.05179140344262123, -0.02469661273062229, -0.05275990068912506, -0.03855530917644501, -0.04907039552927017, 0.015288379974663258, -0.016579706221818924, -0.006139564327895641, 0.012878673151135445, -0.025595929473638535, -0.0053987810388207436, -0.058340273797512054, 0.05239094793796539, 0.01519614178687334, -0.03876284509897232, 0.016545116901397705, 0.028824245557188988, 0.02571122720837593, 0.02278268337249756, -0.016279933974146843, 0.0020782281644642353, 0.03910873457789421, 0.01003083772957325, -0.04152997210621834, -0.0647507831454277, -0.02610323764383793, -0.05045396089553833, -0.016176166012883186, 0.0027613628190010786, 0.01902400143444538, -0.030253928154706955, 0.02605711854994297, -0.010826386511325836, 0.04810190200805664, 0.03569594398140907, -0.045611485838890076, 0.06382840871810913, 0.0044821701012551785, 0.004917416255921125, 0.006341333966702223, 0.014146939851343632, -0.07849418371915817, -0.06488914042711258, -0.0001647485769353807, -0.004874180071055889, -0.01901247166097164, 0.0037817410193383694, 0.02679501846432686, -0.006906289141625166, -0.04584208130836487, 0.0010203783167526126, -0.04044618085026741, 0.03977745771408081, -0.030346166342496872, -0.006347098853439093, 0.027348443865776062, -0.004802119452506304, 0.04920875281095505, -0.03521169722080231, -0.0032513749320060015, -0.025157801806926727, -0.02409707009792328, -0.00010439781181048602, 0.07664943486452103, 0.03977745771408081, 0.010405552573502064, 0.05008500814437866, 0.05506584048271179, -0.027878809720277786, 0.01607239991426468, -0.024304604157805443, 0.011327928863465786, -0.02677195891737938, 0.029977215453982353, -0.04545006901025772, -0.05658775940537453, 0.0005292852292768657, 0.03375895693898201, 0.06244484707713127, -0.016545116901397705, 0.016867948696017265, -0.027532920241355896, -0.023889534175395966, 0.05990831181406975, -0.006814051419496536, 0.03202950209379196, -0.014723424799740314, 0.017248429358005524, 0.058294154703617096, 0.03509639948606491, 0.07305216789245605, 0.08679556846618652, -0.05423570051789284, -0.015276850201189518, 0.019819552078843117, 0.023255400359630585, -0.040261704474687576, -0.015634270384907722, -0.02137606032192707, 0.026010999456048012, 0.003672208869829774, -0.05142245441675186, -0.003375319065526128, -0.01555356290191412, -0.016187695786356926, 0.015588152222335339, -0.013339860364794731, -0.057694610208272934, 0.03837083652615547, 0.011668054386973381, -0.0014095056103542447, -0.006473925430327654, 0.03108406625688076, 0.005139362998306751, 0.09076178073883057, -0.0053468975238502026, 0.014089290983974934, 0.00007021406054263934, 0.006156858988106251, 0.002036432968452573, 0.04810190200805664, 0.0400080531835556, 0.05658775940537453, -0.006825581192970276, -0.0489320382475853, -0.027302324771881104, 0.04750235751271248, -0.043259426951408386, 0.014492830261588097, 0.022275377064943314, -0.0014671541284769773, 0.022171609103679657, 0.028916483744978905, -0.007967021316289902, 0.0056178453378379345, -0.02804022654891014, 0.020488273352384567, -0.014723424799740314, 0.0800161063671112, 0.010590028017759323, 0.01706395298242569, -0.008866338059306145, 0.04053841903805733, -0.0065373387187719345, 0.00188222317956388, -0.01600322127342224, 0.005367074627429247, 0.04351308196783066, -0.02707173116505146, -0.018159274011850357, 0.0034444972407072783, -0.006819816306233406, 0.010319080203771591, 0.039616044610738754, -0.03041534312069416, -0.027256205677986145, 0.04452769458293915, -0.0334361232817173, 0.055019721388816833, -0.025618989020586014, 0.09491247683763504, -0.016268404200673103, -0.06959325820207596, -0.005802320782095194, -0.013489746488630772, -0.05045396089553833, 0.07517363131046295, 0.008866338059306145, 0.0009648916311562061, 0.06438183784484863, -0.06115351989865303, 0.03249068930745125, 0.027671275660395622, 0.06825581192970276, -0.0039114500395953655, 0.0011508079478517175, -0.012417485006153584, -0.07706449925899506, 0.04521947726607323, -0.03585736081004143, -0.01709854230284691, 0.07789464294910431, -0.04383591189980507, 0.04515029862523079, 0.004796354565769434, -0.06747179478406906, -0.042659882456064224, -0.01185252983123064, 0.07051563262939453, -0.0163260530680418, 0.03318247199058533, -0.029838858172297478, -0.020200030878186226, 0.01737525500357151, 0.01033060997724533, -0.018781878054142, -0.03232927247881889, 0.006710284389555454, -0.029285432770848274, -0.012601960450410843, 0.02142217941582203, -0.04934711009263992, -0.06216813251376152, 0.022586679086089134, 0.03770211338996887, 0.001728013507090509, 0.051699165254831314, -0.01641828939318657, 0.05760237202048302, -0.02910095825791359, 0.009563884697854519, -0.027256205677986145, 0.0823681652545929, 0.03249068930745125, -0.036295488476753235, -0.017455963417887688, 0.047963544726371765, -0.013605044223368168, -0.03106100670993328, -0.05156081169843674, -0.03551147133111954, 0.0013014146825298667, -0.030553700402379036, 0.032905757427215576, -0.03133771941065788, -0.05183752253651619, 0.008664567954838276, 0.008578095585107803, -0.02375117875635624, 0.07927820831537247, -0.04851697012782097, 0.01201394572854042, -0.03784047067165375, -0.033643659204244614, -0.036595262587070465, 0.021237704902887344, -0.039984993636608124, -0.03913179412484169, 0.05109962075948715, 0.06461242586374283, 0.02774045430123806, 0.002071022056043148, 0.09011612087488174, 0.012060063891112804, -0.03546535223722458, 0.03601877763867378, -0.03403566777706146, 0.0007451067212969065, -0.06627270579338074, -0.02169889211654663, -0.0047300588339567184, 0.012555841356515884, -0.012555841356515884, -0.03807106241583824, -0.05511195585131645, -0.037886589765548706, -0.05880146101117134, -0.020834164693951607, -0.021272292360663414, 0.013074677437543869, 0.029239315539598465, 0.0020652571693062782, 0.02672583982348442, -0.018263041973114014, -0.03922403231263161, 0.01018648874014616, -0.019231537356972694, -0.026564424857497215, -0.06415124237537384, -0.014515889808535576, 0.011898648925125599, 0.03887814283370972, 0.010843681171536446, 0.01633758284151554, -0.0000985428923740983, -0.01388175692409277, 0.004905886482447386, -0.06479690223932266, -0.0028564827516674995, 0.019208477810025215, 0.005231600720435381, 0.04388203099370003, -0.013166915625333786, 0.04713340476155281, -0.017986329272389412, 0.05156081169843674, 0.09601932764053345, -0.014146939851343632, -0.04171444848179817, -0.01202547550201416, -0.015011667273938656, 0.012544311583042145, 0.03880896419286728, -0.07973939180374146, -0.04971605911850929, 0.041968099772930145, -0.04086124897003174, 0.005191246513277292, 0.019957907497882843, -0.013950934633612633, 0.06013890728354454, -0.041276320815086365, 0.035303935408592224, 0.039662159979343414, -0.02275962382555008, 0.029170136898756027, 0.04916263371706009, -0.0009612885769456625, 0.01677571050822735, -0.05409734323620796, -0.05239094793796539, 0.011299104429781437, 0.033966489136219025, 0.06761015206575394, -0.017859501764178276, 0.0029343082569539547, 0.02034991793334484, -0.017951739951968193, 0.05257542431354523, -0.031153244897723198, 0.007292534224689007, 0.009321761317551136, -0.06585763394832611, -0.017525142058730125, -0.0020191383082419634, 0.0010448788525536656, -0.048978157341480255, 0.004110337235033512, -0.04671833664178848, -0.061015162616968155, -0.037609875202178955, -0.03922403231263161, 0.04505806043744087, -0.0007890637498348951, -0.009765654802322388, -0.0008207703940570354, -0.02610323764383793, 0.020926402881741524, -0.008797159418463707, -0.008704922161996365, 0.02175654098391533, -0.005237365607172251, 0.02009626477956772, -0.01339750923216343, 0.01154699269682169, 0.03977745771408081, -0.058340273797512054, -0.04611879214644432, 0.04203727841377258, 0.023555172607302666, 0.009045048616826534, -0.023278459906578064, 0.03839389607310295, 0.07212979346513748, -0.011587346903979778, -0.020891813561320305, 0.008416679687798023, -0.08891703188419342, -0.025987939909100533, 0.0010607322910800576, -0.035234756767749786, 0.0004280400462448597, 0.007021586410701275, 0.018562814220786095, 0.013662692159414291, 0.014285296201705933, 0.04980829730629921, 0.014158469624817371, -0.018159274011850357, -0.02838611789047718, -0.021214645355939865, 0.01769808679819107, -0.010232606902718544, 0.0018461928702890873, 0.06613434851169586, 0.02074192650616169, -0.03705644980072975, 0.04383591189980507, 0.03071511536836624, -0.01540367677807808, -0.011570052243769169, 0.0005624330951832235, 0.025480633601546288, -0.05917041003704071, -0.02603405900299549, 0.016556646674871445, -0.009275642223656178, 0.015887923538684845, -0.02637995034456253, -0.0020076087675988674, 0.02007320523262024, -0.020223090425133705, -0.001287002582103014, 0.05552702769637108, -0.012221479788422585, 0.014100820757448673, 0.020234620198607445, -0.019565897062420845, -0.06004666909575462, -0.01664888486266136, 0.019877199083566666, -0.053359441459178925, -0.03509639948606491, -0.04344390332698822, 0.018920235335826874, 0.02439684048295021, -0.06853252649307251, 0.01641828939318657, -0.006099210120737553, 0.05792520195245743, -0.0038220949936658144, 0.08910150825977325, -0.03719480708241463, -0.05188364163041115, 0.002230996498838067, 0.0441356860101223, -0.052021998912096024, 0.007546187378466129, 0.027325384318828583, 0.027878809720277786, -0.044274039566516876, 0.01607239991426468, 0.020984049886465073, 0.021883366629481316, -0.005908970255404711, 0.017213840037584305, -0.04971605911850929, -0.008860573172569275, 0.04985441640019417, -0.006295215338468552, -0.03654914349317551, -0.01803244836628437, -0.009586944244801998, 0.03380507603287697, -0.024166246876120567, -0.003274434246122837, -0.04155303165316582, -0.014077761210501194, 0.07526586949825287, 0.03908567875623703, -0.0016530704451724887, -0.014054701663553715, -0.0011868382571265101, 0.0016184813575819135, 0.008237969130277634, -0.01902400143444538, 0.021814189851284027, -0.07314440608024597, -0.024281544610857964, -0.058294154703617096, -0.005914735142141581, 0.06304439157247543, 0.025526752695441246, 0.025549810379743576, 0.05091514810919762, 0.02075345627963543, 0.006508514750748873, 0.0058657340705394745, -0.005871498957276344, 0.007096529472619295, -0.035926539450883865, 0.0280863456428051, -0.00592626491561532, 0.01202547550201416, -0.026310771703720093, -0.019784962758421898, -0.0072406502440571785, -0.0022828802466392517, 0.08808689564466476, 0.03246762976050377, -0.03011557087302208, 0.0035626767203211784, -0.04920875281095505, -0.04791742563247681, -0.02508862316608429, 0.022275377064943314, -0.025273097679018974, 0.028916483744978905, 0.0529443733394146, -0.015957102179527283, -0.038647547364234924, 0.0021704656537622213, 0.04874756559729576, -0.03235233202576637, -0.021837247535586357, 0.021802660077810287, 0.03883202373981476, 0.0003383245784789324, 0.009661886841058731, 0.03571900352835655, -0.04773294925689697, -0.012878673151135445, -0.009782948531210423, 0.003003486432135105, -0.04309801012277603, -0.0011291898554190993, 0.036295488476753235, 0.013143856078386307, -0.014458241872489452, 0.04206033796072006, 0.07494303584098816, 0.060692332684993744, -0.012394425459206104, 0.045611485838890076, 0.043974269181489944, -0.03244457021355629, -0.03138383850455284, -0.018516695126891136, -0.01705242320895195, -0.0037183277308940887, -0.03818636015057564, 0.03375895693898201, 0.04344390332698822, -0.0026590365450829268, 0.007298299111425877, -0.012555841356515884, -0.06558092683553696, -0.023151634261012077, -0.021468298509716988, -0.0159916914999485, 0.02169889211654663, -0.01639523170888424, -0.004706999287009239, 0.07102294266223907, -0.033989548683166504, 0.02009626477956772, -0.025964880362153053, -0.038601428270339966, -0.006623811554163694, -0.04810190200805664, 0.04236011207103729, 0.032260093837976456, 0.055665381252765656, -0.026241593062877655, 0.05880146101117134, 0.0010837916051968932, -0.01322456356137991, 0.002568240277469158, -0.011921707540750504, 0.021329941228032112, 0.04365143924951553, -0.001987431664019823, 0.09565037488937378, -0.013801048509776592, -0.05345167964696884, -0.06046173721551895, 0.009160345420241356, -0.02437378279864788, 0.04044618085026741, -0.005825379863381386, 0.04773294925689697, 0.04611879214644432, -0.02508862316608429, 0.00023167487233877182, 0.017536671832203865, -0.07231426984071732, -0.012544311583042145, 0.0071080587804317474, -0.03641078621149063, 0.04637244716286659, -0.05151469260454178, 0.004649350885301828, -0.01904706098139286, -0.03207562118768692, -0.003934509586542845, 0.08167637884616852, -0.0038941556122153997, 0.02005014568567276, 0.017559729516506195, -0.0310379471629858, 0.07337500154972076, -0.08186085522174835, 0.013605044223368168, 0.03373589739203453, 0.054650768637657166, 0.032582927495241165, 0.0023808826226741076, -0.031545255333185196, 0.004802119452506304, -0.058663103729486465, -0.015242260880768299, 0.002412589266896248, 0.034658271819353104, 0.041299380362033844, 0.0016718062106519938, 0.02144523896276951, 0.01188711915165186, 0.034658271819353104 ]
42,984
linearmodels.asset_pricing.model
__init__
null
def __init__( self, portfolios: IVDataLike, factors: IVDataLike, *, risk_free: bool = False ) -> None: super().__init__(portfolios, factors, risk_free=risk_free)
(self, portfolios: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], factors: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, risk_free: bool = False) -> NoneType
[ 0.020931128412485123, -0.057587169110774994, -0.037293534725904465, 0.006096058525145054, -0.052062198519706726, -0.02810296230018139, -0.008181203156709671, -0.020878003910183907, 0.0033623503986746073, 0.017292087897658348, 0.009589007124304771, 0.0228436179459095, -0.04097684845328331, 0.03175085783004761, -0.029200872406363487, 0.01670771650969982, 0.043880995362997055, 0.04504974186420441, 0.00890281330794096, 0.010589522309601307, -0.0015406161546707153, 0.05666634067893028, -0.06778711080551147, 0.030139409005641937, 0.009925463236868382, 0.11085353046655655, 0.030475866049528122, 0.0014089111937209964, 0.0010414653224870563, -0.016247302293777466, -0.04430599510669708, 0.05468301847577095, -0.027217552065849304, 0.07083292305469513, 0.01364419236779213, 0.014529603533446789, 0.004340730141848326, 0.056772589683532715, -0.06003090366721153, 0.09583694487810135, 0.02888212539255619, -0.013059820048511028, 0.039949771016836166, -0.02218841388821602, -0.05808299779891968, 0.005467416252940893, -0.0011455011554062366, 0.018239477649331093, 0.04164975881576538, 0.0011067644227296114, -0.02445506677031517, 0.017699377611279488, 0.057162169367074966, -0.008991354145109653, -0.053974688053131104, 0.0876203253865242, 0.03189252316951752, 0.054470520466566086, 0.0009396430104970932, 0.04699764400720596, -0.038497693836688995, -0.014494187198579311, 0.04650181531906128, -0.061801727861166, -0.027447758242487907, 0.028935249894857407, -0.06176631152629852, -0.0006269820732995868, 0.01694677770137787, 0.07968703657388687, 0.025057146325707436, 0.0286342091858387, -0.05464760214090347, 0.05673717334866524, 0.04901638254523277, -0.008455680683255196, -0.004050757735967636, -0.030847739428281784, -0.012457740493118763, -0.05347885936498642, 0.05496634915471077, -0.009854630567133427, -0.05365594103932381, 0.010943686589598656, 0.011005666106939316, -0.040516432374715805, 0.02376444637775421, -0.05978298932313919, 0.01946134679019451, 0.05666634067893028, -0.06371421366930008, 0.01937280409038067, -0.013148361817002296, -0.004484609700739384, 0.0733829066157341, -0.023180074989795685, -0.0174426082521677, -0.03398209437727928, -0.0513184554874897, -0.002532277023419738, 0.006578607950359583, 0.011129623278975487, -0.01923113875091076, -0.0071496982127428055, -0.024348817765712738, -0.05255803093314171, -0.042110174894332886, -0.03637270629405975, 0.017903022468090057, -0.034601882100105286, -0.06750378012657166, 0.09498695284128189, -0.0322289802134037, 0.032193563878536224, -0.10192857682704926, 0.03309668228030205, -0.024667566642165184, -0.010509835556149483, 0.007468446623533964, 0.001653506071306765, -0.027500882744789124, 0.01921343058347702, -0.0171327143907547, 0.047493476420640945, 0.021480083465576172, 0.01398064848035574, -0.0038913837634027004, 0.03281335160136223, 0.016796257346868515, -0.016282718628644943, 0.03194564953446388, -0.04030393436551094, -0.041472677141427994, -0.024933189153671265, 0.012130138464272022, -0.07777455449104309, 0.08209536224603653, 0.00961556937545538, -0.03038732521235943, 0.05333719402551651, 0.002024272223934531, -0.006348400842398405, -0.031148778274655342, 0.033539388328790665, -0.04072893038392067, 0.0569496713578701, -0.01053639780730009, -0.03357480466365814, -0.051672618836164474, -0.0009805932641029358, -0.004196850582957268, 0.020984254777431488, -0.06162464618682861, -0.0023153512738645077, 0.025836309418082237, 0.015857720747590065, 0.009925463236868382, -0.05089345574378967, 0.02326861582696438, -0.007765059359371662, -0.04398724436759949, -0.0034442509058862925, 0.007742924150079489, 0.03690395504236221, -0.01645980030298233, 0.009509320370852947, -0.038639359176158905, -0.10433689504861832, 0.006631732452660799, 0.057587169110774994, 0.035540420562028885, -0.06537879258394241, -0.03977268561720848, 0.007525998167693615, -0.010306190699338913, 0.03853311017155647, 0.030458157882094383, -0.019939469173550606, 0.05082262307405472, 0.025092562660574913, -0.006109339650720358, -0.030900863930583, -0.058932993561029434, -0.003827191423624754, 0.02379986271262169, -0.04512057453393936, -0.0039334408938884735, 0.016955630853772163, 0.039560187608003616, -0.021834248676896095, -0.015680639073252678, 0.005799445789307356, 0.020063426345586777, -0.003796202130615711, -0.018646767362952232, -0.06038506701588631, 0.01074889674782753, -0.008916093967854977, -0.04891013354063034, -0.0035792761482298374, 0.02135612629354, 0.04752889275550842, 0.00038736755959689617, -0.05500176548957825, -0.02875816822052002, 0.07249750196933746, -0.03778936713933945, -0.019957177340984344, -0.015538972802460194, 0.014786372892558575, 0.02484464831650257, 0.011598891578614712, -0.004378360230475664, -0.003163132816553116, -0.007211677264422178, -0.03963102027773857, -0.004652837757021189, -0.05365594103932381, 0.008145785890519619, 0.0475643090903759, 0.0860620066523552, -0.053691357374191284, -0.01752229407429695, -0.015122829005122185, 0.004475755617022514, 0.01290930062532425, 0.05089345574378967, -0.026792554184794426, -0.0610225647687912, -0.009553590789437294, -0.079474538564682, -0.018115520477294922, -0.02339257299900055, 0.020630089566111565, -0.013591067865490913, 0.01692906953394413, -0.018115520477294922, 0.012068159878253937, -0.11446600407361984, -0.0061801727861166, 0.016920214518904686, 0.00047839892795309424, 0.0449080727994442, 0.04837888851761818, -0.039949771016836166, 0.004577577579766512, -0.0150608504191041, 0.06226214021444321, -0.033238351345062256, -0.00797313079237938, -0.014272834174335003, -0.0935702919960022, -0.05082262307405472, 0.019443638622760773, -0.007711934857070446, -0.046147651970386505, -0.03253002092242241, -0.0034331833012402058, 0.03644353896379471, -0.051389288157224655, 0.01680511049926281, -0.022666536271572113, -0.026810262352228165, 0.07997037470340729, -0.0035859167110174894, 0.0108728539198637, -0.017389483749866486, -0.03941852226853371, 0.05266427993774414, -0.0026274588890373707, 0.08549533784389496, 0.0217457078397274, 0.03718728572130203, 0.00597652792930603, -0.0037497179582715034, -0.013909815810620785, -0.00961556937545538, -0.0017542216228321195, -0.04593515023589134, 0.03559354320168495, 0.07005376368761063, -0.020116550847887993, 0.005520541220903397, 0.02457902394235134, 0.0012860603164881468, -0.05524967983365059, -0.0021814326755702496, 0.007552560418844223, -0.02994461916387081, -0.01746031641960144, -0.04260600358247757, 0.09633278101682663, 0.02551756054162979, 0.045616403222084045, 0.07451623678207397, 0.06293505430221558, 0.040906015783548355, -0.012378053739666939, 0.015893137082457542, -0.015574389137327671, 0.03991435468196869, -0.046678896993398666, 0.04122476279735565, -0.019726969301700592, -0.023569656535983086, -0.05843716114759445, 0.04618306830525398, 0.003935654181987047, 0.009000208228826523, 0.030139409005641937, 0.06764544546604156, 0.04126017913222313, -0.002563266549259424, 0.038214363157749176, -0.00873015820980072, -0.06162464618682861, -0.0215155016630888, -0.046041399240493774, 0.030706072226166725, 0.05298302695155144, -0.011165039613842964, -0.059712156653404236, -0.0015218011103570461, -0.041331011801958084, -0.034477926790714264, 0.003787348046898842, 0.027306092903017998, -0.029200872406363487, -0.016017094254493713, 0.0389581099152565, -0.04069351404905319, 0.054222602397203445, 0.030068576335906982, 0.029625870287418365, -0.05723300203680992, -0.016831673681735992, 0.012882738374173641, -0.030334200710058212, 0.022949866950511932, -0.004110523033887148, 0.04087059572339058, -0.03626645728945732, -0.037718530744314194, 0.012324929237365723, 0.013555650599300861, -0.041578926146030426, 0.017106151208281517, -0.06328921765089035, 0.04809555411338806, 0.05790591612458229, -0.015600951388478279, -0.02296757511794567, -0.0005210093804635108, 0.038108114153146744, 0.04338516667485237, 0.014936893247067928, -0.01700875535607338, -0.005440854001790285, -0.006768971215933561, -0.036337289959192276, 0.06325380504131317, 0.020665505900979042, -0.021125920116901398, 0.06314755231142044, -0.010793167166411877, -0.041578926146030426, 0.008256462402641773, -0.019974885508418083, 0.05269969627261162, 0.03399980440735817, 0.008380420506000519, -0.031201902776956558, -0.011244726367294788, -0.010837437584996223, 0.021550917997956276, -0.000639156496617943, -0.01688479818403721, 0.0185405183583498, -0.024401942268013954, -0.016831673681735992, -0.023144658654928207, -0.023144658654928207, -0.0016999902436509728, 0.022790493443608284, -0.06973501294851303, 0.007030167616903782, -0.043739330023527145, -0.002423814032226801, 0.09349945932626724, 0.03240606188774109, 0.02312695048749447, -0.03201648220419884, 0.04072893038392067, -0.0036146927159279585, -0.01708844304084778, -0.030458157882094383, 0.02447277493774891, -0.041862256824970245, -0.007818183861672878, -0.04377474635839462, 0.011873369105160236, -0.04278308525681496, 0.010952540673315525, 0.020346757024526596, -0.008539794012904167, -0.02794358879327774, 0.03736436739563942, -0.017106151208281517, 0.013537942431867123, 0.024012360721826553, 0.04189767315983772, 0.0017376202158629894, -0.022896742448210716, -0.05294761061668396, -0.0038426860701292753, -0.010377023369073868, 0.009996296837925911, -0.04058726504445076, 0.07458706945180893, -0.007344488985836506, 0.05818924680352211, 0.02567693591117859, 0.0050114295445382595, 0.05702050402760506, -0.02070092223584652, 0.027908172458410263, 0.008756720460951328, 0.03934768959879875, 0.014547311700880527, -0.010810875333845615, -0.026296723634004593, 0.033663347363471985, -0.03561125323176384, -0.028705041855573654, 0.00927911326289177, 0.013962940312922001, -0.04352683201432228, -0.026562346145510674, -0.027979005128145218, 0.051672618836164474, 0.03665603697299957, -0.034460216760635376, 0.06123506277799606, -0.014759810641407967, -0.010323898866772652, 0.01450304128229618, -0.059039242565631866, 0.022082164883613586, -0.028687333688139915, -0.02645609714090824, 0.025446727871894836, -0.008114797063171864, -0.012192117050290108, -0.009553590789437294, -0.037824783474206924, -0.04310183599591255, -0.018451977521181107, -0.02661547064781189, 0.045333072543144226, 0.003488521557301283, 0.06251005828380585, 0.031095653772354126, -0.022524870932102203, -0.037435200065374374, 0.00873015820980072, 0.02633213996887207, 0.021480083465576172, -0.032459188252687454, 0.018115520477294922, -0.027483174577355385, 0.016326989978551865, 0.038072697818279266, 0.033132102340459824, -0.07621622830629349, -0.007897871546447277, 0.05471843481063843, 0.011882223188877106, 0.001910275430418551, -0.01688479818403721, -0.012617114931344986, -0.022932158783078194, -0.025429019704461098, 0.022772785276174545, 0.026526929810643196, -0.04579348489642143, -0.036478955298662186, -0.038072697818279266, 0.016548341140151024, -0.002561053028330207, 0.010562960058450699, -0.00869916845113039, -0.006538764573633671, -0.04228725656867027, 0.042818501591682434, 0.04593515023589134, 0.0013436120934784412, 0.05029137805104256, 0.03075919672846794, 0.04738722741603851, 0.005454135127365589, -0.02029363252222538, -0.016920214518904686, -0.020382173359394073, -0.03463729843497276, -0.0043850005604326725, -0.04767055809497833, -0.018018124625086784, -0.008406982757151127, -0.029342539608478546, -0.010713479481637478, 0.02806754596531391, -0.039560187608003616, 0.022418620064854622, -0.020736338570713997, 0.04033935070037842, 0.04048101603984833, -0.05092887207865715, 0.025198813527822495, -0.017327504232525826, 0.006065069232136011, 0.02835087850689888, 0.01855822652578354, 0.060668401420116425, -0.006454650312662125, 0.013715025037527084, -0.016495216637849808, -0.022896742448210716, -0.04246433824300766, 0.010996811091899872, 0.02631443180143833, -0.013679608702659607, -0.07763288170099258, -0.015175954438745975, 0.044801823794841766, -0.0059455386362969875, 0.05305385962128639, -0.024260276928544044, -0.04164975881576538, 0.03591229394078255, -0.017433753237128258, -0.007078865543007851, 0.03396438807249069, 0.05390385538339615, -0.06328921765089035, -0.009650985710322857, -0.04689139500260353, -0.04423516243696213, 0.03438938409090042, 0.022684244439005852, -0.025322770699858665, -0.009704110212624073, -0.014565019868314266, -0.010261920280754566, -0.007906725630164146, 0.03334460034966469, 0.02459673397243023, -0.00272264052182436, -0.0006845337920822203, 0.011775974184274673, -0.024224860593676567, 0.01825718581676483, 0.006193453911691904, 0.032476894557476044, -0.027624839916825294, -0.005299188196659088, -0.04203934222459793, 0.01578688807785511, -0.013458255678415298, -0.02376444637775421, -0.023038409650325775, 0.025057146325707436, -0.046041399240493774, 0.0038603944703936577, 0.07940370589494705, -0.0049848672933876514, -0.028386294841766357, 0.010651500895619392, 0.01430825050920248, -0.02070092223584652, -0.05347885936498642, -0.05312469229102135, -0.015317619778215885, -0.04058726504445076, -0.10809104144573212, -0.01894780807197094, 0.026544637978076935, -0.02806754596531391, 0.028864417225122452, 0.03909977525472641, 0.030582115054130554, 0.006118193734437227, -0.019691552966833115, -0.05337261036038399, -0.04543932154774666, -0.048060137778520584, 0.013794711790978909, -0.03183940052986145, -0.06144756078720093, 0.004759087227284908, 0.006870793644338846, -0.05670175701379776, 0.04781222343444824, -0.0449080727994442, 0.025358187034726143, 0.03106023743748665, -0.00894265715032816, -0.05238094925880432, 0.04246433824300766, -0.008411410264670849, 0.024756107479333878, 0.01923113875091076, 0.028705041855573654, 0.007056730333715677, 0.002735921647399664, 0.010421293787658215, -0.017982708290219307, -0.02057696506381035, -0.021196752786636353, 0.04058726504445076, 0.025712352246046066, -0.0610225647687912, 0.01960301212966442, -0.0049848672933876514, 0.028935249894857407, -0.05698508769273758, -0.017238963395357132, 0.017761355265975, -0.08726616203784943, -0.020754046738147736, -0.055674679577350616, 0.02716442570090294, 0.0344248004257679, -0.004108309745788574, 0.025358187034726143, -0.003583703190088272, 0.035398755222558975, 0.0024260275531560183, 0.020364465191960335, 0.03832061216235161, 0.02190508134663105, 0.0059189763851463795, 0.03934768959879875, 0.017965000122785568, 0.0034575320314615965, -0.009252551011741161, -0.06417462974786758, -0.05620592460036278, -0.014423354528844357, 0.052203863859176636, -0.025730060413479805, -0.055320512503385544, 0.008756720460951328, -0.016096781939268112, -0.018124375492334366, -0.02728838473558426, 0.06449338048696518, 0.007030167616903782, 0.028421711176633835, 0.06470587849617004, -0.025482144206762314, -0.03065294772386551, 0.0050114295445382595, 0.05135387182235718, 0.009686402045190334, 0.058649662882089615, -0.0012927008792757988, 0.04504974186420441, -0.0682121068239212, -0.05868507921695709, 0.05748092010617256, -0.021550917997956276, 0.04150809347629547, 0.013298881240189075, 0.013050965964794159, 0.015096266753971577, 0.0005744107766076922, -0.03754144906997681, 0.031520649790763855, 0.03672686964273453, 0.02645609714090824, 0.03704562038183212, -0.031148778274655342, -0.001109531382098794, -0.013422839343547821, -0.011209310032427311, 0.05439968779683113, -0.09406612068414688, 0.006175745744258165, -0.0524163655936718, -0.062403805553913116, 0.004134871996939182, -0.05121220275759697, 0.026048807427287102, -0.013493672013282776, 0.025429019704461098, -0.019567595794796944, -0.08358284831047058, -0.0088806776329875, 0.032972726970911026, 0.04140184447169304, 0.012537427246570587, 0.014193147420883179, 0.008256462402641773, 0.07359541207551956, -0.05135387182235718, 0.00010694111551856622, -0.006702565588057041, -0.01868218369781971, 0.028173794969916344, -0.030564406886696815, 0.03550500422716141, 0.08223702758550644, 0.009367654100060463, -0.06580378860235214, 0.007844746112823486, 0.06314755231142044, -0.012333783321082592, 0.014033772982656956, -0.04887471720576286, -0.014883768744766712, 0.05546218156814575, -0.025730060413479805, 0.0363018736243248, 0.0032715958077460527, 0.003563781501725316, -0.0152556411921978, -0.01721240021288395, 0.03295501694083214, 0.06350171566009521, -0.014441062696278095, 0.07805788516998291, 0.03693937137722969, -0.04338516667485237, -0.06190797686576843, 0.024030068889260292, -0.032441478222608566, -0.009686402045190334, 0.020878003910183907, 0.03585916757583618, 0.029059207066893578, -0.009447341784834862, -0.0001386222429573536, -0.036213330924510956, 0.009429632686078548, 0.044837240129709244, 0.04473099112510681, 0.014405646361410618, -0.004679400008171797, 0.026402972638607025, 0.012298366986215115, 0.0032228981144726276, 0.00891166739165783, -0.02296757511794567, 0.058260079473257065, 0.022524870932102203, -0.00463512958958745, 0.05305385962128639, 0.003028107574209571, -0.00497158570215106, -0.06513087451457977, -0.032069604843854904, -0.004931742325425148, 0.022117581218481064, 0.019514471292495728, 0.0467851459980011, 0.030936280265450478, 0.052062198519706726, 0.006773398257791996 ]
42,989
linearmodels.asset_pricing.model
_j
Objective function
def _j( self, parameters: Float64Array, excess_returns: bool, w: Float64Array ) -> float: """Objective function""" g = self._moments(parameters, excess_returns) nobs = self.portfolios.shape[0] gbar = g.mean(0)[:, None] return nobs * float(np.squeeze(gbar.T @ w @ gbar))
(self, parameters: numpy.ndarray, excess_returns: bool, w: numpy.ndarray) -> float
[ 0.013045641593635082, -0.005761454347521067, 0.0004655579978134483, -0.0016329314094036818, 0.032200027257204056, -0.03921706974506378, -0.08548679947853088, -0.015485577285289764, 0.008388392627239227, 0.04708898067474365, 0.01658087782561779, 0.0038847518153488636, 0.0074622854590415955, -0.033197373151779175, -0.0435270294547081, 0.033411089330911636, 0.02568165957927704, 0.002328624716028571, 0.0017097359523177147, 0.06133677810430527, -0.028940843418240547, -0.02028530463576317, 0.0015116025460883975, 0.04160357639193535, 0.003196850186213851, -0.032912418246269226, 0.06967174261808395, -0.014301229268312454, -0.02374039590358734, -0.03736485540866852, -0.02518298663198948, -0.012707256712019444, -0.008050006814301014, -0.023045817390084267, 0.0710965245962143, 0.04081994667649269, 0.011603051796555519, 0.03424815088510513, -0.0003358807589393109, 0.007097185589373112, -0.05884341523051262, -0.028744935989379883, 0.004548165015876293, -0.0023931851610541344, -0.01427451428025961, -0.00195684633217752, -0.02402535267174244, 0.07772175222635269, 0.058700937777757645, 0.0028606911655515432, -0.01201267633587122, -0.04067746922373772, 0.03237812593579292, -0.06094496324658394, -0.04577105864882469, 0.13984215259552002, 0.07529962062835693, 0.010739278979599476, 0.02502269856631756, -0.07195138931274414, 0.008562037721276283, -0.036225032061338425, 0.05111398175358772, -0.0070571135729551315, -0.0004424609651323408, 0.048620618879795074, -0.01317031029611826, 0.012030486017465591, 0.019982539117336273, 0.03825534135103226, 0.049831680953502655, -0.02215532958507538, 0.0009951198007911444, -0.031541068106889725, -0.016732260584831238, 0.03832658380270004, -0.027836639434099197, -0.09517530351877213, -0.02176351472735405, -0.027284536510705948, 0.022048469632864, -0.00023959678946994245, -0.05025911331176758, -0.03182602301239967, 0.020570261403918266, -0.027836639434099197, -0.004643892403692007, -0.0228677187114954, -0.03350013867020607, 0.01209282036870718, -0.05724053829908371, 0.028780555352568626, 0.026696816086769104, -0.014853331260383129, -0.0020592522341758013, 0.01757822372019291, -0.04121176153421402, -0.039038971066474915, -0.005396354477852583, 0.012431205250322819, 0.041069284081459045, 0.05560204014182091, -0.006896825507283211, 0.049511104822158813, 0.025467943400144577, -0.015966441482305527, -0.026091283187270164, -0.05111398175358772, 0.03342889994382858, -0.03665246441960335, -0.02407878264784813, 0.07415980100631714, -0.03900335356593132, -0.06696466356515884, -0.019519485533237457, 0.012805210426449776, -0.048406898975372314, 0.05047283321619034, -0.0014091964112594724, 0.05107836425304413, 0.02076616883277893, 0.008526417426764965, 0.02208409085869789, 0.01484442688524723, 0.05403478071093559, -0.011371525004506111, 0.01939481683075428, 0.01209282036870718, 0.024933649227023125, -0.04374074563384056, -0.01573491469025612, -0.03950202465057373, 0.0473739355802536, -0.0013468622928485274, 0.02963542379438877, 0.002729344181716442, -0.030882107093930244, -0.039359547197818756, 0.02126484178006649, -0.006781062111258507, 0.031986311078071594, 0.02452402561903, -0.047195836901664734, -0.008708967827260494, -0.01771179586648941, 0.021407319232821465, 0.0804288312792778, 0.02468431368470192, -0.005970718804746866, -0.029938189312815666, -0.018718047067523003, 0.0026002235244959593, 0.005240519065409899, -0.05905713140964508, -0.01176333986222744, -0.01749807968735695, 0.05649252608418465, -0.028744935989379883, -0.016981596127152443, -0.012110630050301552, -0.014042987488210201, 0.007488999981433153, -0.02049902267754078, 0.010703659616410732, -0.03173697367310524, 0.020125016570091248, -0.02026749588549137, 0.03640313073992729, -0.029706662520766258, -0.021015504375100136, 0.01928795874118805, 0.008860350586473942, 0.0020714965648949146, -0.008410654030740261, -0.02931484766304493, 0.08334963023662567, 0.0005610071239061654, 0.00189005967695266, 0.022333426401019096, 0.029546374455094337, -0.02781882882118225, -0.0391102097928524, -0.04313521459698677, -0.02694615162909031, 0.025254225358366966, 0.03661684691905975, 0.0118434838950634, 0.016625402495265007, -0.008285986259579659, 0.007257473189383745, -0.002709308173507452, -0.05025911331176758, 0.01834404282271862, 0.01010703295469284, -0.02942170761525631, 0.0006956933648325503, 0.04512990638613701, 0.0206593107432127, -0.0012411169009283185, -0.0017631652299314737, -0.03658122569322586, 0.012466824613511562, -0.022849909961223602, 0.028192834928631783, -0.016696641221642494, -0.0003957103763241321, -0.02860245853662491, -0.014461517333984375, 0.028085974976420403, -0.02281429059803486, 0.003379400121048093, 0.012181868776679039, -0.06646598875522614, -0.007640382740646601, 0.008228104561567307, 0.0023019101936370134, 0.04313521459698677, -0.018415281549096107, 0.04124738276004791, -0.024915840476751328, -0.07038412988185883, -0.024595264345407486, 0.009661789052188396, 0.016990501433610916, 0.01994691975414753, -0.028673697263002396, 0.042280346155166626, 0.05050845071673393, 0.012235297821462154, -0.06130116060376167, -0.05645690858364105, -0.01217296440154314, 0.017168598249554634, -0.04505866765975952, -0.0022596120834350586, -0.02220875769853592, -0.05649252608418465, -0.005378544330596924, -0.043776366859674454, 0.010917376726865768, -0.0206593107432127, -0.05414164066314697, 0.012725066393613815, 0.07950272411108017, -0.027569493278861046, -0.026803674176335335, 0.02721329778432846, 0.03982260078191757, -0.004120730794966221, 0.0457354374229908, -0.012538064271211624, -0.035120826214551926, -0.010970805771648884, -0.0034996159374713898, -0.02160322666168213, 0.039359547197818756, 0.029350468888878822, 0.0283709317445755, 0.00629574665799737, -0.035120826214551926, 0.016037680208683014, -0.041567955166101456, 0.003192397765815258, 0.012582588009536266, -0.030668389052152634, 0.040356893092393875, -0.0008175788098014891, -0.005280591081827879, 0.07978767901659012, 0.03547702357172966, -0.004105147439986467, 0.05659938603639603, -0.015245146118104458, -0.08384830504655838, -0.008575394749641418, 0.020534642040729523, 0.04431065917015076, -0.011522908695042133, -0.04342016950249672, 0.03152325749397278, 0.0018310649320483208, -0.036830563098192215, -0.010872852057218552, -0.017836464568972588, -0.036723703145980835, 0.014906760305166245, 0.01731998100876808, -0.007248568348586559, 0.012742876075208187, -0.005329567473381758, 0.016037680208683014, 0.05813102424144745, 0.056385669857263565, 0.031434208154678345, 0.09624388813972473, 0.00010038854816230014, -0.032858990132808685, -0.02860245853662491, 0.08662662655115128, 0.039858222007751465, 0.028353121131658554, 0.024417167529463768, 0.003931502345949411, -0.0755133405327797, -0.02610909380018711, 0.01813032478094101, 0.064435675740242, -0.028691507875919342, 0.0014381372602656484, 0.03658122569322586, -0.006758800242096186, -0.03602912276983261, -0.022938957437872887, 0.049404244869947433, -0.047623272985219955, -0.051434557884931564, -0.027284536510705948, -0.046412207186222076, 0.04092680662870407, 0.05332238972187042, 0.06724961847066879, -0.024114402011036873, 0.04854938015341759, -0.04420379921793938, -0.031202681362628937, -0.05521022528409958, -0.05079340562224388, 0.0407843291759491, -0.01713297888636589, -0.06789076328277588, 0.02092645689845085, -0.02986695058643818, 0.02634062059223652, -0.006856753956526518, -0.04224472865462303, -0.04313521459698677, 0.10023327171802521, -0.008001030422747135, 0.00550766522064805, -0.00044802651973441243, -0.018824905157089233, 0.0003072182007599622, -0.03129173070192337, 0.08313591033220291, -0.004283244721591473, -0.02765854261815548, 0.046412207186222076, -0.04260092228651047, 0.015129382722079754, -0.05218256637454033, -0.026625575497746468, 0.0699923187494278, 0.022778669372200966, 0.03458653390407562, -0.004216458182781935, 0.04537924379110336, 0.007101637776941061, -0.02518298663198948, -0.007569143548607826, -0.006215602625161409, -0.06867439299821854, 0.04252968356013298, -0.014701948501169682, 0.0677482858300209, 0.04114052280783653, -0.0010774899274110794, 0.007822932675480843, -0.021888183429837227, -0.00015959206211846322, -0.05877217650413513, -0.0009138627792708576, -0.031701356172561646, -0.01741793565452099, 0.032698702067136765, -0.01476428285241127, 0.049546726047992706, -0.022564953193068504, -0.04391884431242943, -0.01771179586648941, -0.06803324818611145, -0.027801020070910454, -0.06286841630935669, -0.052859336137771606, -0.007003684062510729, -0.021300461143255234, 0.05139893665909767, -0.024987079203128815, -0.06037505343556404, -0.0181837547570467, -0.013766936957836151, -0.00629574665799737, -0.03228907659649849, 0.006246769800782204, 0.02539670281112194, -0.03797038644552231, 0.015280765481293201, 0.026732435449957848, -0.020837407559156418, -0.06087372452020645, 0.03284117951989174, -0.014586185105144978, -0.05207571014761925, -0.01663430593907833, 0.05200447142124176, -0.05535270273685455, -0.09132839739322662, -0.012226393446326256, 0.050935886800289154, 0.008700062520802021, 0.07031289488077164, -0.05862969532608986, 0.035387974232435226, -0.054569073021411896, 0.007453380152583122, -0.033963192254304886, 0.022493714466691017, -0.011327001266181469, -0.05845160037279129, 0.03503177687525749, 0.01697269082069397, 0.008468535728752613, -0.022938957437872887, 0.10792708396911621, 0.052253805100917816, -0.024221260100603104, -0.023063626140356064, 0.027533873915672302, -0.028638077899813652, -0.027462635189294815, -0.000879912986420095, -0.05221818760037422, -0.01536981388926506, -0.022743050009012222, -0.04000069946050644, -0.004450211301445961, -0.010863947682082653, -0.017542604357004166, -0.053963541984558105, 0.023491060361266136, 0.037721049040555954, 0.01978663168847561, 0.07116775959730148, 0.005000087432563305, 0.0037957029417157173, -0.07280626147985458, 0.003245827043429017, 0.055673278868198395, -0.07180891185998917, -0.07950272411108017, -0.022903338074684143, 0.02626938186585903, 0.01989349164068699, 0.053642965853214264, -0.03073962777853012, 0.028388742357492447, -0.019074242562055588, -0.054070401936769485, -0.06749895215034485, 0.005115850828588009, -0.01966196484863758, 0.046590305864810944, 0.024203449487686157, 0.04149671643972397, 0.011941437609493732, -0.051042743027210236, -0.0007201817934401333, 0.0076581924222409725, -0.03260965272784233, 0.002925251377746463, 0.017640557140111923, 0.05984076112508774, 0.020356543362140656, -0.017462460324168205, -0.06350956857204437, 0.02539670281112194, 0.008744587190449238, -0.043883223086595535, 0.03348233178257942, 0.09467662870883942, -0.011754434555768967, -0.05050845071673393, -0.007787313312292099, 0.012306537479162216, 0.021727895364165306, 0.015129382722079754, 0.03900335356593132, 0.02263619191944599, -0.062405362725257874, 0.09139963984489441, -0.048406898975372314, 0.027017390355467796, 0.036331888288259506, 0.060517530888319016, -0.000006609086995013058, -0.012903164140880108, 0.014737567864358425, 0.03889649361371994, 0.0190030038356781, 0.010552276857197285, 0.023491060361266136, -0.0008498590323142707, 0.015138287097215652, -0.08790892362594604, -0.03246717527508736, -0.02854902856051922, -0.06717837601900101, -0.004866514354944229, -0.009305594488978386, -0.06593169271945953, -0.00969740841537714, -0.03373166546225548, -0.0006127667147666216, -0.02147855795919895, -0.0076581924222409725, 0.00579707371070981, -0.01845090091228485, -0.026198143139481544, 0.06340271234512329, 0.04445313662290573, -0.013125785626471043, 0.020694930106401443, -0.044702474027872086, -0.00781402736902237, 0.01250244490802288, -0.03508520871400833, 0.03180821239948273, -0.00650055892765522, 0.015396528877317905, -0.0016563067911192775, 0.06033943220973015, -0.039145831018686295, -0.021727895364165306, -0.022137518972158432, 0.042885877192020416, -0.061514876782894135, -0.0024577456060796976, -0.006740990560501814, -0.04609163478016853, -0.010872852057218552, 0.059306468814611435, -0.02115798369050026, 0.017854275181889534, 0.03130954131484032, -0.037151139229536057, 0.018032371997833252, 0.05410601943731308, -0.013838175684213638, 0.007431118283420801, 0.036385320127010345, 0.005222709383815527, -0.010267321020364761, 0.0008993923547677696, 0.0034684487618505955, 0.08228104561567307, 0.05962704122066498, 0.04441751539707184, -0.03268089145421982, -0.04128300026059151, 0.007074923254549503, 0.01300111785531044, 0.009928935207426548, -0.0314163975417614, 0.04698212072253227, -0.019038623198866844, -0.056884340941905975, 0.04616287350654602, 0.07358988374471664, 0.012573683634400368, -0.022956768050789833, 0.02594880573451519, -0.0034818060230463743, 0.038433440029621124, -0.02379382587969303, -0.010009079240262508, 0.003726690076291561, -0.018593378365039825, 0.052040088921785355, -0.016589781269431114, -0.05984076112508774, -0.0037355951499193907, -0.01484442688524723, -0.034907110035419464, -0.004483604338020086, -0.00786745734512806, 0.03310832381248474, 0.03481806069612503, -0.100304514169693, -0.0009366815211251378, 0.03013409674167633, 0.01928795874118805, -0.0015394302317872643, 0.041069284081459045, -0.07800670713186264, -0.03825534135103226, 0.004915491212159395, 0.0361003614962101, -0.06322461366653442, -0.00045275723095983267, 0.06105182319879532, -0.0011465026764199138, -0.026251571252942085, -0.04224472865462303, -0.0440613217651844, 0.016224682331085205, 0.0063135563395917416, 0.012983308173716068, -0.026750244200229645, -0.001421440625563264, 0.036064743995666504, -0.03768543154001236, 0.03310832381248474, -0.03740047663450241, -0.016928168013691902, -0.013490885496139526, -0.04666154459118843, 0.03529892489314079, 0.029884761199355125, -0.013348408043384552, 0.044096939265728, 0.0007313128444366157, -0.01686583273112774, -0.007511261850595474, 0.009759742766618729, -0.021905992180109024, 0.025646040216088295, -0.05531708523631096, 0.0457354374229908, -0.04285025969147682, 0.015556816942989826, 0.0004950553993694484, -0.017622748389840126, 0.03675932437181473, 0.02352667972445488, 0.0023753754794597626, -0.009127496741712093, 0.013624458573758602, -0.008464084006845951, -0.018575569614768028, -0.047195836901664734, 0.0058594075962901115, -0.014648519456386566, 0.06717837601900101, 0.011585242114961147, 0.004586010705679655, -0.002751606283709407, -0.018575569614768028, -0.02958199381828308, 0.01779193989932537, 0.027142059057950974, -0.01427451428025961, -0.04637658968567848, 0.0015127155929803848, -0.02005377784371376, 0.07472971081733704, -0.008357224985957146, 0.02518298663198948, -0.005017897114157677, 0.01049884781241417, 0.03508520871400833, -0.022511523216962814, -0.003205755027011037, -0.04655468463897705, -0.02407878264784813, -0.04876309633255005, 0.02358010970056057, -0.04552172124385834, -0.022458095103502274, -0.0903310552239418, -0.0031322897411882877, -0.011638671159744263, 0.011442764662206173, -0.008250366896390915, 0.04402570053935051, 0.0008320492343045771, 0.00892268493771553, 0.005685762502253056, 0.015601340681314468, 0.09232574701309204, 0.013392931781709194, -0.014986904338002205, 0.09517530351877213, -0.015040334314107895, 0.023206103593111038, -0.026963962242007256, 0.03992946073412895, -0.057988546788692474, -0.025859756395220757, 0.022351237013936043, 0.012689447030425072, 0.017693987116217613, -0.07522838562726974, 0.0033237445168197155, 0.00035842120996676385, 0.05927084758877754, 0.0677839070558548, -0.004305507056415081, -0.033802904188632965, 0.05253876373171806, 0.017961133271455765, -0.0018633450381457806, 0.038148485124111176, 0.037436094135046005, 0.008410654030740261, 0.031202681362628937, 0.012368871830403805, 0.026518717408180237, 0.04028565436601639, -0.04826442152261734, 0.02055245079100132, -0.05535270273685455, -0.004808632656931877, 0.04491619020700455, 0.023241722956299782, -0.004094016272574663, 0.012484634295105934, 0.06810448318719864, -0.03524549677968025, 0.020142827183008194, -0.010507752187550068, 0.03982260078191757, 0.0038157389499247074, 0.0051514701917767525, 0.049226149916648865, -0.0016362707829102874, -0.032093171030282974, -0.03700866177678108, 0.02749825455248356, -0.03244936466217041, 0.007765050977468491, 0.020801788195967674, -0.002838428830727935, -0.003350459272041917, -0.006861206144094467, -0.041959770023822784, -0.012725066393613815, -0.0020603653974831104, 0.010881757363677025, -0.015565721318125725, 0.02407878264784813, 0.04712459817528725, -0.04060623049736023, 0.0661454126238823, 0.013820366002619267, -0.04010755568742752, 0.056278809905052185, 0.03150544688105583, -0.036723703145980835, -0.004879871383309364, 0.047908227890729904, -0.023384202271699905, 0.05449783429503441, -0.006558440625667572, 0.050330352038145065, -0.027890069410204887, 0.052253805100917816, 0.05029473453760147, 0.02281429059803486, -0.028459981083869934, -0.019092051312327385, -0.02171008475124836, -0.04171043261885643, 0.04060623049736023, -0.011193428188562393, 0.07423103600740433, -0.0402144156396389, 0.030258765444159508, 0.003239148296415806, 0.011656481772661209 ]
42,990
linearmodels.asset_pricing.model
_j_cue
CUE Objective function
def _j_cue( self, parameters: Float64Array, excess_returns: bool, weight_est: HeteroskedasticWeight | KernelWeight, ) -> float: """CUE Objective function""" g = self._moments(parameters, excess_returns) gbar = g.mean(0)[:, None] nobs = self.portfolios.shape[0] w = weight_est.w(g) return nobs * float(np.squeeze(gbar.T @ w @ gbar))
(self, parameters: numpy.ndarray, excess_returns: bool, weight_est: linearmodels.asset_pricing.covariance.HeteroskedasticWeight | linearmodels.asset_pricing.covariance.KernelWeight) -> float
[ 0.001594275119714439, -0.011820090003311634, -0.0070642102509737015, -0.02516709268093109, 0.039915259927511215, -0.02482578158378601, -0.06854933500289917, 0.02135879546403885, 0.05744779482483864, 0.008110594004392624, 0.033376485109329224, 0.012179363518953323, 0.008945903740823269, -0.041136790066957474, -0.023388689383864403, 0.01923908293247223, 0.04846596345305443, -0.04613068699836731, 0.0321190282702446, 0.023334797471761703, -0.05119644105434418, -0.062226127833127975, -0.014577512629330158, 0.03783147409558296, -0.019670210778713226, -0.025741929188370705, 0.07020199298858643, -0.015152350068092346, -0.01450565829873085, -0.05723223090171814, -0.045771412551403046, 0.012799110263586044, -0.0628368929028511, 0.008541721850633621, 0.05611848458647728, 0.05432211607694626, 0.024125199764966965, -0.0025620674714446068, 0.006448954809457064, 0.04896894469857216, -0.05317244306206703, 0.0035702779423445463, 0.012502709403634071, -0.015224204398691654, -0.039017077535390854, 0.00825879443436861, -0.014640385285019875, 0.08119575679302216, 0.07138759642839432, -0.013867948204278946, -0.011523690074682236, -0.09010573476552963, -0.0038891329895704985, -0.02164621464908123, -0.04674145206809044, 0.09513556212186813, 0.0531005896627903, 0.030987318605184555, 0.009781214408576488, -0.019993556663393974, 0.007535756565630436, -0.01612238772213459, 0.06463325768709183, 0.014038602821528912, -0.021466577425599098, 0.03662790730595589, 0.04095715284347534, 0.036681801080703735, 0.0368255078792572, -0.003585996339097619, 0.026586221531033516, -0.024843746796250343, 0.015116422437131405, -0.005083716474473476, 0.01740678958594799, -0.027735896408557892, -0.04825039952993393, -0.05805855989456177, -0.022292906418442726, 0.004805279895663261, 0.03272979333996773, -0.0038060510996729136, -0.025670073926448822, -0.0474240705370903, 0.0745132714509964, -0.030358590185642242, 0.003783596446737647, -0.010427906177937984, -0.07181872427463531, 0.09714748710393906, -0.025472473353147507, -0.012960783205926418, -0.0034849506337195635, -0.00830819457769394, 0.04357984662055969, 0.05184313282370567, -0.0346878319978714, -0.03298128396272659, 0.03520878031849861, -0.02254439704120159, 0.06951937824487686, 0.07523182034492493, 0.03508303314447403, 0.0016796025447547436, 0.003920569550246, -0.001304610981605947, -0.028184987604618073, -0.008124066516757011, 0.05892081558704376, -0.040130823850631714, -0.01662537083029747, 0.029927462339401245, -0.017146315425634384, -0.07321988791227341, -0.030771754682064056, -0.0212510135024786, -0.018107371404767036, 0.029981354251503944, -0.026226947084069252, 0.034220777451992035, -0.0019243573769927025, -0.034669868648052216, 0.010535688139498234, 0.014685294590890408, 0.02304738014936447, 0.0064265006221830845, -0.012350018136203289, 0.03894522041082382, 0.009156976826488972, -0.04451395571231842, -0.0027641586493700743, -0.05349578708410263, 0.07961495220661163, -0.0472085066139698, 0.012709291651844978, 0.008254303596913815, -0.02080192230641842, -0.045986976474523544, 0.05629811808466911, 0.015179295092821121, 0.04803483560681343, 0.029478371143341064, -0.05543586239218712, 0.002541858237236738, 0.0023959034588187933, 0.0016055023297667503, 0.06657333672046661, -0.025364691391587257, -0.03262201324105263, 0.003251422895118594, -0.0346878319978714, 0.050118621438741684, 0.014388893730938435, -0.03662790730595589, 0.0169666800647974, -0.037400346249341965, 0.056477755308151245, -0.0069474466145038605, -0.024556327611207962, 0.019777992740273476, 0.02416112646460533, 0.016328969970345497, -0.012592528015375137, 0.038406312465667725, -0.007383065298199654, -0.0027170039247721434, -0.02220308780670166, 0.029190951958298683, -0.04979527369141579, -0.012448818422853947, -0.00730672013014555, -0.012188345193862915, -0.035226743668317795, 0.02270607091486454, 0.017505589872598648, 0.04983120039105415, 0.01829599030315876, -0.0022903671488165855, 0.01878999173641205, -0.00979019608348608, -0.0062648276798427105, -0.016760097816586494, -0.05902859568595886, 0.02164621464908123, 0.031436409801244736, 0.011335071176290512, 0.03646623715758324, 0.014200275763869286, 0.014415839686989784, -0.051232367753982544, 0.008415976539254189, 0.005811245180666447, 0.0015246658585965633, 0.05195091292262077, 0.028490370139479637, -0.016427770256996155, 0.07099239528179169, 0.01503558550029993, -0.0476396344602108, -0.01074227038770914, -0.057268157601356506, 0.004035087767988443, -0.0032087592408061028, -0.01026623323559761, 0.026119165122509003, -0.013212273828685284, -0.003956496715545654, 0.005901063326746225, -0.01294281892478466, -0.05442989990115166, -0.015430786646902561, 0.03603510931134224, -0.03675365447998047, 0.002253317041322589, 0.016023587435483932, -0.006655537057667971, 0.04735221713781357, -0.025957493111491203, -0.00447519775480032, -0.03484950587153435, -0.06086089089512825, -0.011667398735880852, 0.02805924229323864, 0.025310801342129707, -0.022274943068623543, -0.037005145102739334, 0.024682072922587395, 0.05967528745532036, 0.014721222221851349, -0.050729382783174515, -0.06678889691829681, 0.00015998887829482555, 0.0008880785899236798, -0.018772028386592865, -0.021897705271840096, 0.02281385287642479, -0.05417840927839279, 0.04397504776716232, -0.06941159069538116, 0.03434652462601662, -0.023137198761105537, -0.0730043277144432, 0.007904011756181717, 0.063591368496418, 0.0025463493075221777, -0.046058833599090576, 0.05601070076227188, 0.04623846709728241, -0.031598083674907684, 0.05924415960907936, 0.0018165754154324532, -0.06754337251186371, -0.0006427623447962105, -0.02135879546403885, -0.05148385837674141, 0.017873844131827354, 0.008249811828136444, 0.02710716798901558, 0.019508538767695427, -0.04066973179578781, -0.018664246425032616, -0.02002948336303234, 0.04210682585835457, 0.07666891068220139, -0.02620898373425007, 0.026640111580491066, 0.007603120524436235, 0.018313953652977943, 0.03761591017246246, 0.030592117458581924, -0.03865780308842659, 0.024807818233966827, 0.007818683981895447, -0.0632680207490921, -0.026765858754515648, -0.011272198520600796, -0.00023310659162234515, 0.006085190922021866, -0.05177127569913864, 0.06330394744873047, -0.0066241007298231125, -0.024017417803406715, -0.006044772453606129, -0.01656249724328518, -0.01330209244042635, 0.0007163010886870325, 0.008959377184510231, -0.034112997353076935, 0.013320055790245533, 0.01388591155409813, -0.033771686255931854, 0.013607474975287914, 0.02811313234269619, 0.030160989612340927, 0.08263284713029861, -0.017891807481646538, -0.034220777451992035, -0.029981354251503944, 0.06639369577169418, 0.0323345921933651, 0.035118959844112396, 0.0033547140192240477, 0.002093889517709613, -0.07436956465244293, -0.06104052811861038, -0.005766335874795914, 0.04490915685892105, -0.035999178886413574, -0.012870964594185352, 0.035280633717775345, -0.014308057725429535, -0.028292769566178322, -0.014604457654058933, 0.049507856369018555, -0.05795077607035637, 0.00643099145963788, 0.012107509188354015, -0.04868152737617493, 0.07559109479188919, 0.043148718774318695, 0.06265725940465927, -0.0692678838968277, 0.05744779482483864, -0.007607611361891031, -0.020496539771556854, -0.04167569801211357, -0.05741186812520027, 0.024304836988449097, 0.01014946959912777, -0.07487254589796066, -0.00286520435474813, -0.027933495119214058, 0.008892012760043144, -0.04361577332019806, -0.04494508355855942, -0.059998635202646255, 0.059603434056043625, -0.01790079101920128, -0.00007038107287371531, -0.01834988221526146, 0.009906959719955921, -0.018700173124670982, -0.022849779576063156, 0.07178279757499695, -0.02554432861506939, -0.020119301974773407, 0.03247830271720886, -0.053747281432151794, 0.025759892538189888, -0.04519657790660858, -0.02310127019882202, 0.01519725937396288, 0.04146013408899307, 0.06387878209352493, -0.013409874401986599, 0.04009489715099335, 0.020065411925315857, -0.044370248913764954, 0.009305177256464958, -0.03280165046453476, -0.031490299850702286, 0.023227015510201454, -0.003898114897310734, 0.024789854884147644, 0.019993556663393974, 0.007832157425582409, 0.017379844561219215, 0.003316541202366352, 0.018215155228972435, -0.04684923216700554, -0.011864999309182167, 0.007136065047234297, 0.007998321205377579, 0.01886184699833393, -0.014415839686989784, -0.0025979948695749044, -0.030053207650780678, -0.019939666613936424, -0.0171822439879179, -0.05270538851618767, -0.015296058729290962, -0.03833445534110069, -0.13946987688541412, -0.02655029483139515, -0.04408282786607742, 0.02487967349588871, -0.040418241173028946, -0.026191020384430885, -0.04544806852936745, 0.005151080433279276, 0.007243847008794546, -0.05087309330701828, 0.025059310719370842, -0.025203019380569458, -0.024789854884147644, 0.0210354495793581, 0.04860967397689819, -0.014963731169700623, -0.0418553352355957, 0.03833445534110069, -0.03084360994398594, -0.052453894168138504, -0.005425026174634695, 0.038514092564582825, -0.04322057217359543, -0.03224477544426918, 0.009188413619995117, 0.0339333601295948, 0.017703190445899963, 0.041639771312475204, -0.04340020939707756, 0.03303517773747444, -0.08011793345212936, 0.029442444443702698, -0.07717189937829971, 0.0045627704821527, -0.05507659167051315, -0.1110154390335083, 0.005514844320714474, 0.016436751931905746, -0.017981626093387604, -0.02297552488744259, 0.09319548308849335, 0.030035244300961494, 0.0067498465068638325, 0.00041063810931518674, 0.02543654665350914, -0.009960850700736046, -0.0010991516755893826, -0.007050737738609314, -0.07559109479188919, 0.011487762443721294, -0.04074158892035484, -0.058202266693115234, -0.023334797471761703, -0.005016352981328964, -0.04038231447339058, -0.031382519751787186, 0.031490299850702286, 0.03267590329051018, -0.004248406272381544, 0.07131574302911758, 0.0001658832043176517, 0.003850960172712803, -0.03515489026904106, 0.024358727037906647, 0.015915805473923683, -0.0633758008480072, -0.09305177628993988, -0.037400346249341965, 0.007540247403085232, 0.014631403610110283, 0.005442989990115166, -0.03134659305214882, 0.03096935525536537, -0.008182448334991932, -0.04656181484460831, -0.01931093819439411, 0.028687970712780952, -0.026316765695810318, 0.0021309396252036095, 0.003011158900335431, 0.044046901166439056, 0.007953411899507046, -0.04681330546736717, 0.016975661739706993, 0.018700173124670982, -0.03855001926422119, -0.010796161368489265, 0.05019047483801842, 0.060501616448163986, -0.00005304894148139283, 0.008249811828136444, -0.045376211404800415, 0.0061390819028019905, 0.01979595609009266, -0.06068125367164612, 0.01037401519715786, 0.09175839275121689, 0.032101064920425415, -0.01385896559804678, -0.010679397732019424, 0.007486356422305107, -0.013373946771025658, 0.037184782326221466, 0.05751964822411537, 0.00248123100027442, -0.06923195719718933, 0.07745931297540665, -0.06951937824487686, -0.024017417803406715, 0.016113406047225, 0.013158382847905159, 0.023406652733683586, 0.009466850198805332, 0.012583546340465546, 0.04221460968255997, 0.00315262284129858, -0.026029348373413086, 0.03508303314447403, 0.008263285271823406, 0.027933495119214058, -0.041747551411390305, -0.0693756639957428, -0.029424479231238365, -0.09901571273803711, 0.019490573555231094, 0.00000765297681937227, -0.030538227409124374, -0.02387370727956295, -0.01051772478967905, 0.014182312414050102, 0.02347850799560547, -0.029298733919858932, 0.0009677923517301679, -0.03937634825706482, -0.02453836426138878, 0.05137607455253601, 0.049292292445898056, 0.0028068223036825657, 0.010778198018670082, -0.03267590329051018, 0.005326225887984037, 0.059818997979164124, 0.0019097619224339724, 0.03553212434053421, -0.012448818422853947, -0.006745355669409037, 0.009394995868206024, 0.06488475203514099, -0.06596256792545319, -0.03267590329051018, -0.029406515881419182, 0.08155503123998642, -0.08694412559270859, -0.012197326868772507, 0.013706275261938572, -0.023622216656804085, -0.0003864994505420327, 0.03242441266775131, -0.026406584307551384, 0.023909635841846466, 0.07189057767391205, 0.004899588879197836, 0.023963525891304016, 0.041029006242752075, 0.0238198172301054, 0.00202315766364336, -0.00643099145963788, 0.004565015900880098, -0.030466372147202492, 0.012736236676573753, -0.021179158240556717, 0.0636991485953331, 0.08780638128519058, 0.04656181484460831, -0.0022757714614272118, -0.0427175909280777, 0.00441906088963151, 0.019813919439911842, 0.01907741092145443, -0.016885843127965927, 0.05349578708410263, -0.04508879408240318, -0.012260200455784798, 0.05227426066994667, 0.06653741002082825, 0.015116422437131405, -0.028598152101039886, -0.0074773747473955154, -0.00948481447994709, 0.04907672852277756, 0.015529586933553219, 0.017586426809430122, -0.03073582798242569, -0.026119165122509003, 0.0292268805205822, 0.001191215356811881, -0.03251422941684723, -0.011281180195510387, -0.029442444443702698, -0.0646691843867302, 0.0030021772254258394, -0.020658211782574654, 0.059208232909440994, 0.02281385287642479, -0.04462173953652382, 0.018592391163110733, 0.016266096383333206, 0.006924991961568594, 0.01997559331357479, 0.003056068206205964, -0.05511251837015152, -0.03357408568263054, 0.019275009632110596, 0.021376758813858032, -0.06395064294338226, 0.030807681381702423, 0.005981899797916412, 0.030035244300961494, -0.035729724913835526, -0.04613068699836731, 0.0018379072425886989, 0.03330463171005249, 0.009871033020317554, -0.0016818479634821415, 0.010032705962657928, 0.0023914126213639975, 0.02877778746187687, -0.023280907422304153, 0.025670073926448822, 0.006570209749042988, -0.04458581283688545, 0.02241865172982216, -0.023891672492027283, 0.023676108568906784, 0.012817073613405228, -0.03926856815814972, 0.015188276767730713, 0.056262191385030746, -0.020280975848436356, 0.009156976826488972, -0.006166027393192053, -0.00154487497638911, 0.017882825806736946, -0.0375799834728241, 0.021215086802840233, -0.059387870132923126, -0.01263743732124567, -0.011622490361332893, 0.023191088810563087, 0.025634147226810455, -0.0014348475961014628, -0.005999863613396883, -0.028813716024160385, 0.019436683505773544, 0.017604390159249306, -0.0016346933552995324, -0.01878999173641205, 0.03470579534769058, -0.00931415893137455, 0.05683702975511551, 0.005380116868764162, 0.03118491917848587, -0.011775180697441101, 0.007670484017580748, -0.029658008366823196, -0.011981762945652008, 0.011972781270742416, -0.00012567547673825175, -0.015511622652411461, 0.0371488556265831, 0.002188198734074831, 0.02514912746846676, -0.02410723641514778, 0.03346630558371544, 0.02275996096432209, 0.01984984800219536, 0.0077558113262057304, -0.0013562565436586738, -0.00839801225811243, -0.014676312915980816, 0.010697361081838608, -0.02008337527513504, 0.060321979224681854, -0.0534239336848259, 0.03502914309501648, -0.056872956454753876, -0.037292566150426865, -0.007984847761690617, 0.004778334405273199, -0.029298733919858932, 0.022957561537623405, -0.03319684788584709, -0.010670416057109833, 0.03197532147169113, -0.005487898830324411, 0.10296771675348282, 0.0473162867128849, -0.015233186073601246, 0.10799754410982132, 0.025364691391587257, 0.0013293110532686114, -0.016490641981363297, 0.054968807846307755, -0.05755557492375374, -0.04904080182313919, 0.01087699830532074, -0.03362797573208809, -0.05651368200778961, -0.03969969600439072, 0.016589442268013954, -0.038406312465667725, 0.018664246425032616, 0.0478551983833313, 0.011029688641428947, -0.04167569801211357, 0.0632680207490921, -0.0014236202696338296, 0.023191088810563087, 0.04792705178260803, 0.02994542568922043, -0.019724102690815926, 0.01941872015595436, 0.010463833808898926, 0.05439397320151329, 0.056585539132356644, -0.05381913483142853, 0.01979595609009266, -0.06847748160362244, 0.011945836246013641, 0.049220435321331024, 0.00046593250590376556, 0.006309736520051956, -0.027376621961593628, 0.0678667202591896, -0.03317888453602791, 0.021664177998900414, 0.012556600384414196, 0.0371488556265831, 0.0024767399299889803, 0.01729002594947815, 0.05863339453935623, 0.019167227670550346, -0.024610217660665512, -0.018340900540351868, 0.043256498873233795, -0.0052858078852295876, 0.045268431305885315, 0.0032267230562865734, 0.0032783683855086565, -0.015439768321812153, -0.04171162471175194, -0.026586221531033516, -0.025418583303689957, -0.03317888453602791, 0.00276864948682487, -0.030556190758943558, 0.03750813007354736, -0.006116627249866724, -0.05629811808466911, 0.023891672492027283, 0.019957629963755608, -0.05047789216041565, 0.036609943956136703, 0.04171162471175194, -0.03192142769694328, 0.002031016629189253, 0.07023791968822479, -0.012062599882483482, 0.03808296471834183, 0.021376758813858032, 0.029981354251503944, -0.03134659305214882, 0.06610628217458725, -0.008645012974739075, 0.007607611361891031, -0.004737915936857462, -0.02153843268752098, -0.008442921563982964, -0.012565582059323788, 0.016436751931905746, -0.001013824250549078, 0.06301652640104294, -0.03339444845914841, 0.050226401537656784, 0.02716105803847313, 0.017891807481646538 ]
42,991
linearmodels.asset_pricing.model
_jacobian
Jacobian matrix for inference
def _jacobian(self, params: Float64Array, excess_returns: bool) -> Float64Array: """Jacobian matrix for inference""" nobs, k = self.factors.shape n = self.portfolios.shape[1] nrf = int(bool(not excess_returns)) jac = np.zeros((n * k + n + k, params.shape[0])) s1, s2 = (n * k), (n * k) + k + nrf betas = params[:s1] betas = np.reshape(betas, (n, k)) lam = params[s1:s2] mu = params[-k:] lam_tilde = lam if excess_returns else lam[1:] f = self.factors.ndarray fe = f - mu.T + lam_tilde.T f_aug = np.c_[np.ones((nobs, 1)), f] fef = f_aug.T @ fe / nobs r1 = n * (k + 1) jac[:r1, :s1] = np.kron(np.eye(n), fef) jac12 = np.zeros((r1, (k + nrf))) jac13 = np.zeros((r1, k)) iota = np.ones((nobs, 1)) for i in range(n): if excess_returns: b = betas[[i]] else: b = np.c_[[1], betas[[i]]] jac12[(i * (k + 1)) : (i + 1) * (k + 1)] = f_aug.T @ (iota @ b) / nobs b = betas[[i]] jac13[(i * (k + 1)) : (i + 1) * (k + 1)] = -f_aug.T @ (iota @ b) / nobs jac[:r1, s1:s2] = jac12 jac[:r1, s2:] = jac13 jac[-k:, -k:] = np.eye(k) return jac
(self, params: numpy.ndarray, excess_returns: bool) -> numpy.ndarray
[ -0.010356931015849113, -0.008256318978965282, 0.027326224371790886, 0.017572076991200447, -0.0314178504049778, -0.05264316871762276, -0.09651856124401093, 0.007694633677601814, 0.004817708395421505, 0.014923479408025742, 0.02294233813881874, 0.02252221666276455, 0.03828594088554382, -0.01168123073875904, -0.021627172827720642, 0.04062401130795479, 0.06550256907939911, -0.005598587915301323, -0.012585407122969627, 0.04599427431821823, -0.028312599286437035, -0.05943819135427475, 0.015206605195999146, 0.09732227772474289, -0.027088765054941177, 0.009726747870445251, 0.046176936477422714, -0.013580914586782455, -0.0010948299895972013, -0.01033866498619318, -0.026613842695951462, 0.0029773893766105175, -0.037737954407930374, 0.006265304051339626, 0.04365620017051697, 0.04946485161781311, 0.01590985432267189, -0.006648894399404526, -0.041939180344343185, 0.009671948850154877, 0.03927231580018997, -0.04135465994477272, 0.022156892344355583, -0.07069016993045807, -0.03580173850059509, -0.020622530952095985, -0.05541962757706642, 0.07299170643091202, 0.015845922753214836, 0.011352438479661942, 0.0037559859920293093, -0.07832543551921844, 0.05034162849187851, -0.051254935562610626, 0.010795320384204388, 0.08650869131088257, 0.07087282836437225, 0.008206087164580822, 0.04632306471467018, -0.03335407003760338, 0.00985461100935936, -0.05088961496949196, 0.041719984263181686, 0.005676219239830971, -0.013717911206185818, 0.03344539925456047, -0.02358165569603443, -0.055821485817432404, 0.05870754271745682, 0.031235190108418465, 0.04361966997385025, 0.014329828321933746, -0.010923183523118496, 0.011160643771290779, -0.006146573927253485, 0.019124703481793404, -0.03466923534870148, -0.08015205711126328, -0.06521030515432358, -0.05300849303603172, -0.02425750344991684, -0.0341760478913784, -0.05110880732536316, -0.024622827768325806, 0.039016589522361755, -0.016804898157715797, -0.0017524128779768944, -0.005342861637473106, -0.010229067876935005, 0.0610821507871151, -0.05373913794755936, -0.03788408264517784, 0.02654077857732773, 0.01622951216995716, 0.023837381973862648, -0.015023943968117237, 0.016046850010752678, -0.0452636256814003, 0.006580396089702845, 0.03180144354701042, 0.05468898266553879, 0.019617890939116478, -0.0018003616714850068, 0.019764021039009094, 0.03474229946732521, -0.004963838029652834, -0.0370255745947361, -0.016494372859597206, 0.04234103485941887, -0.06447966396808624, -0.04804008826613426, 0.05172985792160034, -0.005036902613937855, -0.10229068249464035, -0.04705371335148811, 0.018567584455013275, -0.0564790703356266, 0.006644327659159899, -0.033390600234270096, 0.022924073040485382, 0.03693424165248871, -0.007315610069781542, 0.026065858080983162, 0.021407978609204292, 0.019416963681578636, -0.01072225533425808, 0.03445003926753998, 0.05078001692891121, 0.014485090970993042, -0.05143759772181511, -0.005886280443519354, -0.010439129546284676, 0.014923479408025742, 0.0016382491448894143, 0.019453495740890503, -0.025152547284960747, -0.020659064874053, -0.05315462127327919, -0.004603080451488495, -0.014795616269111633, 0.043254345655441284, -0.0008704982465133071, -0.036221861839294434, 0.007105548866093159, 0.009626283310353756, -0.003029904793947935, 0.10265600681304932, -0.018019599840044975, -0.042487163096666336, 0.0175264123827219, -0.00005501263512996957, 0.027125297114253044, -0.07291863858699799, -0.06849822402000427, -0.006274437066167593, -0.004587097559124231, 0.05706358700990677, 0.01797393336892128, 0.00915136281400919, 0.025298677384853363, -0.0207686610519886, -0.007977759465575218, -0.022430885583162308, 0.012320547364652157, -0.019946683198213577, 0.01667703501880169, -0.04610387235879898, -0.008032558485865593, -0.04599427431821823, -0.03419431298971176, -0.010585258714854717, -0.02327113039791584, -0.005890847183763981, -0.012347946874797344, -0.028422195464372635, 0.003217133227735758, 0.007429773919284344, -0.021718503907322884, 0.021572373807430267, 0.022997137159109116, 0.0030139219015836716, -0.027746347710490227, -0.06995952129364014, -0.002066363114863634, 0.0454828217625618, 0.03466923534870148, 0.0013962221564725041, 0.006091775372624397, 0.04157385602593422, -0.00516476621851325, -0.02155410684645176, 0.012430144473910332, 0.06553909927606583, 0.037189967930316925, -0.03898005560040474, -0.045519351959228516, 0.05607721209526062, 0.028495261445641518, 0.005945645738393068, -0.011261108331382275, 0.011772560887038708, 0.008562278002500534, -0.0005377110792323947, -0.0017809538403525949, 0.03348193317651749, 0.025590935721993446, -0.030139219015836716, -0.026157189160585403, -0.010420863516628742, 0.01277720183134079, 0.0115898996591568, 0.01326125580817461, -0.03386552259325981, -0.06411433964967728, -0.03832247108221054, -0.027307959273457527, 0.07774091511964798, -0.01874111406505108, 0.0224126186221838, -0.012923331931233406, -0.008018858730793, -0.015489731915295124, 0.014256763271987438, 0.005511823575943708, 0.012000888586044312, -0.016311710700392723, 0.048003554344177246, 0.058305688202381134, -0.012676738202571869, -0.04277942329645157, -0.0692288726568222, -0.004890772979706526, 0.0022821323946118355, -0.06678120046854019, 0.015069609507918358, -0.014366360381245613, -0.032331161201000214, -0.03455963730812073, -0.04646919667720795, 0.0359296016395092, -0.02412964031100273, -0.00876777246594429, 0.0650276467204094, 0.08190561085939407, 0.014667753130197525, -0.00179351179394871, 0.040222156792879105, 0.058086492121219635, -0.022577013820409775, 0.044021524488925934, -0.026577310636639595, -0.038906991481781006, 0.017060624435544014, -0.008265452459454536, -0.009909410029649734, -0.017562944442033768, 0.05593108385801315, 0.04851500689983368, 0.05271623283624649, -0.008046258240938187, 0.025919727981090546, -0.030449744313955307, -0.0012135602300986648, -0.018868977203965187, -0.03781101852655411, 0.01656743697822094, -0.009580617770552635, 0.01028386689722538, 0.04643266275525093, 0.05498123914003372, 0.006114608142524958, 0.06590442359447479, -0.004753776825964451, -0.02296060509979725, 0.03379245847463608, 0.00789556186646223, 0.041427724063396454, -0.023672986775636673, -0.06338369101285934, 0.02553613856434822, 0.0007557637291029096, -0.06279917061328888, 0.002737645758315921, 0.04157385602593422, -0.03627666085958481, -0.02261354774236679, 0.017151955515146255, -0.005183032248169184, 0.02316153235733509, -0.01276806928217411, 0.032002370804548264, 0.04029522091150284, 0.0452636256814003, 0.028330864384770393, 0.06637934595346451, 0.0011690363753587008, -0.02294233813881874, -0.014384627342224121, 0.045702014118433, -0.005068868398666382, -0.00606437586247921, 0.008644475601613522, 0.06758491694927216, -0.06342022120952606, 0.002655447693541646, -0.035345084965229034, -0.010658323764801025, -0.0003370683407410979, 0.003217133227735758, 0.046396128833293915, 0.012685870751738548, -0.026248518377542496, 0.008872803300619125, -0.01098711509257555, -0.02089652419090271, -0.087020143866539, -0.01343478448688984, -0.05129146948456764, 0.09410742670297623, 0.046834517270326614, 0.0365871861577034, -0.028988448902964592, 0.007228845730423927, -0.03105252794921398, -0.023563388735055923, -0.01456728857010603, 0.016603969037532806, 0.021700236946344376, -0.0006638619233854115, -0.0287875197827816, 0.01784607023000717, 0.01806526444852352, -0.004945571534335613, 0.009461888112127781, -0.050597354769706726, -0.021060921251773834, 0.02423923835158348, -0.07379542291164398, 0.005799516104161739, 0.0007694633677601814, 0.020695596933364868, -0.06652547419071198, -0.06707345694303513, 0.007598736323416233, -0.01580939069390297, 0.0050460356287658215, 0.04796702414751053, 0.026759972795844078, -0.02986522577702999, 0.0408797413110733, -0.02294233813881874, 0.03180144354701042, 0.030340146273374557, 0.08490126579999924, 0.005598587915301323, 0.06009577587246895, -0.01936216466128826, -0.07584123313426971, 0.005151066463440657, -0.007694633677601814, 0.01255800761282444, 0.05271623283624649, 0.005913679953664541, 0.04128159582614899, 0.04135465994477272, -0.027435822412371635, -0.02023894153535366, 0.005644253455102444, 0.05242397263646126, -0.07353968918323517, 0.03795715048909187, 0.0005205865018069744, 0.024714158847928047, 0.013599180616438389, -0.03474229946732521, 0.017608610913157463, -0.03194757178425789, -0.017462480813264847, -0.018759381026029587, -0.033920321613550186, -0.025371741503477097, -0.08716627210378647, -0.05804996192455292, 0.006534730549901724, -0.022796208038926125, 0.013325187377631664, 0.03673331439495087, -0.06360288709402084, 0.019891884177923203, -0.0054113594815135, -0.01369051169604063, -0.0011073879431933165, 0.01666790060698986, 0.011982622556388378, -0.012347946874797344, 0.0003950064128730446, 0.10718601942062378, 0.01538013480603695, -0.01579112373292446, 0.02338072657585144, -0.008804305456578732, -0.03908965364098549, -0.009388823062181473, 0.006274437066167593, -0.04522709548473358, -0.05297195911407471, 0.024969885125756264, -0.007525671273469925, 0.01970922201871872, 0.08314771205186844, -0.005397660192102194, 0.018476253375411034, -0.014010169543325901, -0.032422494143247604, -0.024860288947820663, 0.05885367467999458, -0.06959419697523117, -0.08818917721509933, 0.0599861778318882, -0.006292703561484814, 0.05067041888833046, -0.02456802874803543, 0.05297195911407471, 0.02643118053674698, 0.01831185817718506, 0.008649042807519436, 0.015243138186633587, 0.011964356526732445, -0.07956753671169281, -0.008160421624779701, 0.019069906324148178, -0.027454087510704994, -0.012667604722082615, -0.017352882772684097, -0.013955371454358101, 0.024951620027422905, -0.01186389196664095, -0.030979463830590248, 0.025079483166337013, 0.02663210965692997, 0.013462183997035027, 0.05257010459899902, -0.02650424651801586, -0.025097748264670372, -0.05388526991009712, 0.00876320619136095, 0.046615324914455414, -0.0712016224861145, -0.09001579880714417, -0.04343700781464577, 0.02067732997238636, 0.026376383379101753, 0.02001974731683731, -0.02358165569603443, -0.014338961802423, -0.019782286137342453, -0.005123666953295469, -0.07664494216442108, 0.0028381096199154854, 0.030358413234353065, 0.05965738743543625, -0.006393167655915022, 0.0725167840719223, 0.027198361232876778, 0.019764021039009094, -0.012366212904453278, 0.024823756888508797, -0.00581778259947896, 0.009571485221385956, -0.011799960397183895, 0.01885071024298668, -0.0024476698599755764, -0.019764021039009094, -0.040989335626363754, 0.009544085711240768, -0.015106141567230225, -0.07810623943805695, 0.008361349813640118, 0.018996840342879295, 0.01023820135742426, -0.09841825067996979, 0.033061809837818146, 0.0029317240696400404, 0.005566622130572796, 0.007023351266980171, -0.04668838903307915, 0.02155410684645176, -0.014813882298767567, 0.05965738743543625, -0.030486276373267174, -0.042706359177827835, 0.014987410977482796, 0.037281300872564316, 0.09330371022224426, -0.012220082804560661, 0.015608461573719978, 0.030997728928923607, -0.0007922961376607418, -0.0103295324370265, 0.013498716987669468, 0.0026280484162271023, 0.013325187377631664, -0.08409754931926727, 0.007489139214158058, -0.052789296954870224, -0.07218799740076065, -0.01700582541525364, -0.028531793504953384, -0.040112558752298355, 0.0018483103485777974, -0.02336246147751808, -0.0010640057735145092, -0.039674170315265656, -0.0007426349329762161, -0.03799368068575859, 0.03563734143972397, -0.04471563920378685, 0.012010022066533566, 0.03205716982483864, -0.01755381189286709, 0.0024727857671678066, -0.0036007233429700136, 0.035144153982400894, 0.024403633549809456, -0.0021908015478402376, 0.06447966396808624, 0.005808649584650993, -0.03368286043405533, -0.012284014374017715, 0.0359296016395092, -0.12355253100395203, -0.024220971390604973, 0.008338517509400845, 0.07730253040790558, -0.06667160242795944, -0.03474229946732521, 0.005831481888890266, -0.016329975798726082, -0.02489682100713253, -0.009018932469189167, -0.010192535817623138, 0.04445991292595863, 0.02252221666276455, -0.05366607382893562, -0.02889711782336235, 0.0002865509013645351, -0.016503505408763885, 0.008238052949309349, 0.02458629570901394, -0.008023425005376339, -0.022248223423957825, 0.02381911501288414, 0.0474555678665638, 0.06670814007520676, 0.03755529224872589, 0.028020339086651802, -0.016092516481876373, -0.013416518457233906, 0.023563388735055923, 0.015179206617176533, -0.016293443739414215, 0.014521623030304909, 0.042706359177827835, -0.07240718603134155, -0.04928218945860863, 0.060570694506168365, 0.0916232243180275, 0.00958975125104189, 0.019106438383460045, 0.016914494335651398, 0.008744940161705017, -0.01980055309832096, -0.008571411482989788, 0.009690215811133385, -0.036422789096832275, -0.03759182617068291, 0.03399338573217392, -0.04073360934853554, -0.03377418965101242, 0.010667456313967705, 0.006854388862848282, -0.04310821369290352, -0.013663112185895443, -0.018923776224255562, 0.03529028594493866, 0.04829581454396248, -0.09571485221385956, -0.004886206705123186, 0.01938043162226677, -0.020056279376149178, -0.048661138862371445, 0.03982030227780342, -0.054944708943367004, -0.04869766905903816, -0.018056131899356842, 0.025810129940509796, -0.07397808134555817, 0.026266785338521004, 0.032659951597452164, -0.004203507676720619, -0.045628949999809265, -0.03580173850059509, -0.022376086562871933, -0.005109967663884163, 0.005762984044849873, 0.014320694841444492, -0.026175454258918762, -0.012101353146135807, 0.014804749749600887, 0.023307662457227707, 0.01304206158965826, -0.0009903701720759273, 0.023088468238711357, -0.014960012398660183, -0.04950138181447983, 0.002783311065286398, -0.005347427912056446, -0.010393464006483555, 0.028403930366039276, 0.030376678332686424, -0.05878061056137085, 0.017900869250297546, 0.012914198450744152, 0.02728969231247902, -0.035564277321100235, -0.02339899353682995, 0.05074348300695419, -0.07701026648283005, 0.032733019441366196, 0.014905213378369808, 0.008142155595123768, 0.07920221239328384, 0.029408570379018784, 0.019398696720600128, 0.0023266563657671213, 0.005991311278194189, 0.01710628904402256, -0.013398252427577972, 0.006201372481882572, 0.021572373807430267, -0.015553663484752178, 0.020732128992676735, -0.0018688598647713661, -0.000717518909368664, -0.011626431718468666, 0.0025937994942069054, -0.019435228779911995, -0.017562944442033768, 0.03516242280602455, -0.021462777629494667, -0.052131716161966324, 0.013626580126583576, -0.0465787909924984, 0.0595477893948555, 0.024969885125756264, 0.00451631611213088, -0.008037124760448933, 0.0872393399477005, 0.006594095844775438, -0.018905509263277054, 0.0370255745947361, -0.05121840536594391, -0.02654077857732773, -0.07266291230916977, 0.009608017280697823, -0.009397956542670727, 0.012850266881287098, -0.04668838903307915, -0.028878850862383842, -0.004664728883653879, 0.02078692801296711, -0.004657879006117582, -0.016074249520897865, -0.024823756888508797, 0.05578495189547539, 0.007959493435919285, -0.030888132750988007, 0.051474131643772125, 0.019837085157632828, 0.003696620697155595, 0.06831555813550949, 0.003164618043228984, 0.004740077070891857, 0.0346144363284111, 0.030888132750988007, -0.04760169982910156, 0.02210209332406521, 0.0478939563035965, -0.0606437623500824, -0.03488842770457268, -0.021060921251773834, -0.007991459220647812, 0.04471563920378685, 0.044752173125743866, 0.0643700659275055, 0.05826915428042412, -0.08731240034103394, 0.04445991292595863, -0.008101056329905987, 0.0032331161201000214, 0.03211196884512901, 0.016476105898618698, 0.0006764199351891875, 0.07226105779409409, -0.005799516104161739, 0.045628949999809265, 0.045080963522195816, -0.03770142048597336, -0.013325187377631664, -0.024750690907239914, -0.004150992259383202, 0.045080963522195816, 0.03919925168156624, -0.026485979557037354, -0.04318128153681755, 0.04007602855563164, -0.009046331979334354, -0.030486276373267174, 0.0016450990224257112, 0.05078001692891121, -0.013051195070147514, 0.012311413884162903, 0.052752766758203506, -0.01033866498619318, -0.035564277321100235, -0.03941844403743744, 0.025170814245939255, -0.039783768355846405, 0.007466306444257498, 0.014549022540450096, 0.028056873008608818, 0.021700236946344376, 0.02023894153535366, 0.0026577310636639595, -0.013005529530346394, -0.05476204678416252, -0.012631072662770748, -0.014667753130197525, -0.0220838263630867, 0.05242397263646126, -0.03302527591586113, 0.035546012222766876, 0.003057304071262479, 0.015827655792236328, 0.011169777251780033, 0.07017870992422104, -0.03357326239347458, -0.00811018981039524, 0.0630548968911171, -0.036441054195165634, 0.015873322263360023, -0.022029029205441475, -0.015087875537574291, 0.006027843803167343, 0.021188784390687943, -0.011069312691688538, 0.03759182617068291, -0.018558451905846596, -0.03898005560040474, -0.02977389469742775, -0.039454977959394455, 0.0608629547059536, -0.013306921347975731, 0.07627962529659271, -0.0015868755290284753, 0.020951323211193085, 0.0029248741921037436, 0.02522561326622963 ]
42,992
linearmodels.asset_pricing.model
_moments
Calculate nobs by nmoments moment conditions
def _moments(self, parameters: Float64Array, excess_returns: bool) -> Float64Array: """Calculate nobs by nmoments moment conditions""" nrf = int(not excess_returns) p = np.asarray(self.portfolios.ndarray, dtype=float) nobs, n = p.shape f = np.asarray(self.factors.ndarray, dtype=float) k = f.shape[1] s1, s2 = n * k, n * k + k + nrf betas = parameters[:s1] lam = parameters[s1:s2] mu = parameters[s2:] betas = np.reshape(betas, (n, k)) expected = np.c_[np.ones((n, nrf)), betas] @ lam fe = f - mu.T eps = p - expected.T - fe @ betas.T f = np.column_stack((np.ones((nobs, 1)), f)) f = np.tile(f, (1, n)) eps = np.reshape(np.tile(eps, (k + 1, 1)).T, (n * (k + 1), nobs)).T g = np.c_[eps * f, fe] return g
(self, parameters: numpy.ndarray, excess_returns: bool) -> numpy.ndarray
[ 0.013314577750861645, 0.05082773044705391, -0.007591096684336662, -0.03592255339026451, 0.007345357909798622, -0.04761078581213951, -0.07070130109786987, -0.013109050691127777, 0.012331622652709484, 0.08399800956249237, -0.019855700433254242, 0.025253018364310265, -0.015334105119109154, -0.017594901844859123, -0.004001075401902199, 0.046860165894031525, 0.010169120505452156, -0.006067515816539526, -0.004615422338247299, -0.0015861325664445758, 0.00759556470438838, 0.04568061977624893, -0.04339301586151123, 0.014494124799966812, -0.009963593445718288, -0.02453814260661602, 0.011688233353197575, -0.021839482709765434, -0.052865128964185715, 0.02339433878660202, 0.013546912930905819, 0.005786032881587744, -0.005316895432770252, -0.02500281110405922, -0.014601356349885464, 0.016960449516773224, 0.01235843077301979, 0.03992586210370064, -0.10186992585659027, 0.027344033122062683, -0.01671024225652218, -0.03992586210370064, 0.03946119174361229, 0.054330628365278244, -0.030024820938706398, -0.07245275378227234, -0.0042736222967505455, 0.05636802688241005, 0.00804236251860857, 0.03831738978624344, -0.0002136252587661147, -0.02746913582086563, 0.050613269209861755, -0.04178453981876373, -0.0008997393306344748, 0.10115505009889603, 0.04089094698429108, 0.03544001281261444, 0.03567234426736832, -0.028380604460835457, -0.0007372165564447641, 0.009320205077528954, 0.032723478972911835, -0.03181201219558716, -0.030149923637509346, -0.0010784585028886795, 0.004074797034263611, 0.004302664194256067, 0.04732483625411987, 0.025610456243157387, -0.015888134017586708, 0.01064272690564394, -0.005964752286672592, -0.0011583236046135426, -0.00877511128783226, 0.05479529872536659, 0.013171602971851826, -0.05472381040453911, 0.021213965490460396, -0.000221723472350277, -0.0307039525359869, 0.03567234426736832, -0.04593082517385483, -0.010347839444875717, 0.02257223054766655, -0.013761376030743122, -0.009749130345880985, 0.010124441236257553, -0.01690683327615261, -0.011009100824594498, -0.07692073285579681, -0.001517995959147811, 0.00917722936719656, 0.006147939246147871, -0.03102564811706543, 0.03118649497628212, -0.03878206014633179, -0.011375474743545055, 0.002159151015803218, -0.002718765288591385, 0.048790331929922104, 0.044429585337638855, 0.015334105119109154, 0.07963725924491882, 0.030578849837183952, 0.00942743569612503, -0.045573387295007706, -0.06626906991004944, 0.056939925998449326, 0.006608141120523214, -0.0985100045800209, 0.06812774389982224, -0.025253018364310265, -0.06616183370351791, -0.0166030116379261, -0.017282143235206604, -0.021660763770341873, 0.015637926757335663, -0.02759424038231373, 0.013940094970166683, -0.0068404763005673885, 0.01755022257566452, 0.029917588457465172, 0.009918914176523685, 0.01689789816737175, -0.003520767670124769, 0.04857587069272995, -0.022196920588612556, 0.008953830227255821, -0.080638088285923, -0.04049776494503021, -0.007180042564868927, 0.0666622519493103, 0.016960449516773224, -0.0070906830951571465, -0.003974267281591892, 0.009713387116789818, -0.04857587069272995, 0.02762998268008232, -0.025789175182580948, -0.018390202894806862, 0.027683598920702934, -0.05007711052894592, -0.015843454748392105, -0.0774211436510086, 0.0012007694458588958, 0.079279825091362, -0.0043294718489050865, -0.030292898416519165, -0.015298360958695412, -0.023430082947015762, -0.027004465460777283, -0.006018368061631918, -0.030024820938706398, -0.04096243157982826, 0.01606685295701027, 0.048790331929922104, -0.00886000320315361, -0.012778420932590961, 0.0568326972424984, -0.051328144967556, 0.006433890201151371, 0.03036438673734665, -0.004762866068631411, -0.018300842493772507, -0.0021390451584011316, -0.02988184429705143, -0.047181859612464905, -0.03072182461619377, -0.023197747766971588, 0.027236800640821457, 0.07020089030265808, 0.034510672092437744, -0.04875458776950836, -0.011062716133892536, -0.011884824372828007, 0.030435875058174133, -0.045394670218229294, -0.023340722545981407, 0.02893463335931301, -0.0006869517965242267, -0.06676948070526123, -0.031275853514671326, -0.039639912545681, -0.009128081612288952, 0.03426046296954155, -0.017174912616610527, 0.003873737994581461, -0.039890117943286896, -0.01885487139225006, 0.013940094970166683, -0.034671518951654434, 0.016174085438251495, 0.030024820938706398, -0.03334899619221687, 0.015128578059375286, 0.016129404306411743, 0.010052952915430069, 0.005732417106628418, -0.03749528154730797, -0.03342048451304436, 0.05182855948805809, -0.05390170216560364, -0.0006199321360327303, 0.000856176542583853, -0.005996027961373329, -0.05182855948805809, -0.021213965490460396, -0.03270560875535011, -0.004910309333354235, -0.00759556470438838, -0.006031772121787071, -0.012251199223101139, -0.004559572786092758, 0.003328644437715411, -0.014002647250890732, 0.06884262710809708, 0.007372165564447641, 0.019444646313786507, -0.03946119174361229, -0.03529703617095947, -0.06040707975625992, -0.0012867780169472098, 0.04707463085651398, -0.02144630067050457, 0.04925500229001045, 0.01671024225652218, 0.06491079926490784, 0.013609464280307293, -0.03172265365719795, -0.04339301586151123, 0.03254476189613342, -0.03381366655230522, -0.06533972918987274, 0.05525996536016464, -0.015673670917749405, 0.0040055434219539165, -0.017273208126425743, -0.02309051714837551, 0.0240556001663208, -0.051757071167230606, -0.05847691372036934, 0.022822437807917595, 0.08042362332344055, 0.04160582274198532, -0.03585106506943703, -0.007747475989162922, 0.02030249685049057, -0.015870261937379837, 0.06029984727501869, -0.035350650548934937, -0.00869021937251091, 0.03579745069146156, 0.01802382804453373, 0.029613766819238663, -0.028184013441205025, -0.023019028827548027, 0.07027237862348557, 0.04696739837527275, -0.033384740352630615, 0.07002217322587967, -0.09372033178806305, -0.03152606263756752, 0.003927353769540787, 0.0035162996500730515, 0.03579745069146156, -0.03275922313332558, 0.02857719548046589, 0.05651099979877472, -0.001552622765302658, 0.02825549989938736, 0.04728909209370613, -0.018819129094481468, -0.08128147572278976, 0.03992586210370064, 0.01800595596432686, 0.046073801815509796, -0.06669799238443375, -0.07202382385730743, 0.032419655472040176, -0.012206519022583961, -0.05722587928175926, 0.009195101447403431, -0.030328642576932907, -0.012983947992324829, 0.028648681938648224, -0.005160516127943993, -0.030507361516356468, 0.03363494575023651, 0.013448617421090603, 0.02080291137099266, 0.039532680064439774, -0.0060273041017353535, 0.023144131526350975, 0.0451444610953331, -0.023769648745656013, -0.05118516832590103, -0.02516365982592106, 0.03606553003191948, 0.01372563187032938, 0.02046334557235241, 0.019230183213949203, 0.07188084721565247, -0.030668210238218307, -0.025413865223526955, 0.007756412029266357, 0.06694819778203964, -0.017192784696817398, 0.06494654715061188, 0.014333277009427547, 0.029202712699770927, -0.002687489613890648, 0.0013727865880355239, -0.026915106922388077, 0.06433890014886856, -0.024466654285788536, -0.0198199562728405, -0.025717688724398613, 0.05372298136353493, 0.03392089903354645, 0.06684096902608871, -0.006308786571025848, 0.04732483625411987, 0.005209663882851601, 0.005732417106628418, -0.020213138312101364, -0.020034419372677803, 0.02241138368844986, 0.0015939516015350819, -0.029309943318367004, 0.001446508220396936, -0.0382816456258297, -0.025217274203896523, 0.0366731733083725, -0.022536486387252808, -0.051435377448797226, 0.05543868616223335, -0.051220912486314774, 0.050756242126226425, -0.012215455062687397, 0.03853185102343559, -0.027987422421574593, -0.04375045374035835, 0.02759424038231373, 0.03329538181424141, -0.0022540956269949675, 0.10623067617416382, -0.0050264764577150345, -0.006420486140996218, 0.049147769808769226, -0.06444612890481949, 0.09464967250823975, 0.040998175740242004, 0.0451444610953331, 0.014324340969324112, 0.05540294200181961, -0.009865297935903072, -0.05747608467936516, -0.029667381197214127, -0.007443653419613838, -0.061157699674367905, 0.10279926657676697, 0.030596721917390823, 0.016924705356359482, 0.010839317925274372, -0.031597547233104706, -0.016048980876803398, 0.006304318550974131, 0.03931821882724762, -0.030149923637509346, -0.011670361272990704, 0.004758398048579693, -0.005173919722437859, 0.041677311062812805, 0.016960449516773224, 0.019855700433254242, -0.00016685109585523605, -0.050934962928295135, -0.0276121124625206, 0.0002754788438323885, -0.040068838745355606, -0.057082902640104294, -0.05218599736690521, -0.011581001803278923, 0.014234981499612331, 0.036959122866392136, 0.068949855864048, -0.0389607772231102, -0.0025266422890126705, -0.016629818826913834, -0.008837662637233734, -0.04089094698429108, 0.029685253277420998, 0.03056097775697708, -0.02938143163919449, 0.013913286849856377, 0.05007711052894592, -0.025699816644191742, -0.06995068490505219, -0.017157040536403656, 0.013850735500454903, -0.021964585408568382, -0.03279496729373932, 0.04267813637852669, -0.0779215544462204, -0.08807280659675598, -0.016960449516773224, -0.016924705356359482, 0.0012309282319620252, 0.04711037129163742, -0.037352304905653, 0.048325661569833755, -0.023590929806232452, -0.03166903555393219, 0.0146102923899889, 0.017755748704075813, -0.04764652997255325, -0.10044017434120178, 0.05404467508196831, 0.009731258265674114, 0.025610456243157387, -0.046860165894031525, 0.0435359887778759, 0.04528743773698807, 0.02582491934299469, 0.01998080313205719, 0.0019938356708735228, -0.0042244745418429375, -0.09936785697937012, -0.014985602349042892, 0.010249543935060501, 0.02970312535762787, -0.042999833822250366, -0.045430414378643036, 0.002196011831983924, -0.014083070680499077, -0.041999004781246185, -0.05404467508196831, -0.017192784696817398, 0.0272725448012352, -0.012063544243574142, 0.07684924453496933, 0.0481112003326416, -0.00812725443392992, -0.01127717923372984, 0.0008673464762978256, 0.0448942556977272, -0.09815257042646408, -0.03460003063082695, -0.04889756441116333, -0.031150750815868378, 0.021696507930755615, 0.03363494575023651, -0.02957802265882492, 0.045215949416160583, -0.009382756426930428, -0.03197285905480385, -0.045215949416160583, -0.04696739837527275, 0.011026972904801369, 0.006438358221203089, 0.0194803886115551, 0.022768821567296982, 0.0428568571805954, -0.009892106056213379, -0.037459537386894226, 0.022983284667134285, -0.047860994935035706, -0.025914279744029045, 0.019587621092796326, 0.06319509446620941, -0.002468558494001627, 0.010231672786176205, -0.025235146284103394, -0.006165811326354742, -0.021321196109056473, -0.035314906388521194, -0.02612874284386635, 0.046717189252376556, 0.01703193597495556, 0.004691378213465214, 0.014654971659183502, 0.02762998268008232, -0.006094323471188545, -0.035011086612939835, 0.01535197626799345, 0.007564289029687643, -0.023126261308789253, 0.05929902195930481, -0.06619758158922195, -0.015602183528244495, -0.00870362389832735, 0.05990666523575783, -0.004481383133679628, 0.02455601468682289, 0.027397649362683296, 0.050613269209861755, 0.022500744089484215, 0.05118516832590103, -0.02191096916794777, -0.028184013441205025, 0.027254672721028328, -0.01835445873439312, -0.009311269037425518, -0.054151907563209534, -0.007738539949059486, -0.010276352055370808, -0.014646035619080067, -0.04042627662420273, -0.007287274114787579, -0.012546085752546787, -0.02825549989938736, -0.002913122531026602, 0.00043618647032417357, -0.022357767447829247, 0.003652573097497225, -0.06169385835528374, 0.01184908114373684, -0.0030404599383473396, -0.0036927848123013973, 0.012733740732073784, -0.020499087870121002, -0.013770312070846558, -0.029989076778292656, -0.04092669114470482, 0.012349494732916355, -0.04400065913796425, -0.0032996025402098894, 0.009606155566871166, -0.021303324028849602, -0.005468806717544794, -0.020695678889751434, 0.028952505439519882, 0.029989076778292656, -0.01935528591275215, -0.04221346601843834, 0.020749295130372047, -0.036816149950027466, 0.0009332491317763925, 0.06809200346469879, -0.017755748704075813, -0.011706105433404446, 0.017800429835915565, 0.006496441550552845, -0.011250372044742107, 0.005218599922955036, 0.04771801829338074, 0.0070906830951571465, 0.051328144967556, 0.012724804691970348, 0.020695678889751434, -0.010767829604446888, -0.017255336046218872, 0.05057752504944801, 0.028344860300421715, 0.010741022415459156, -0.016129404306411743, -0.017174912616610527, 0.015611119568347931, 0.0037374645471572876, -0.004559572786092758, -0.018318714573979378, 0.06080026179552078, 0.016460034996271133, -0.07052258402109146, 0.04428660869598389, 0.03513618931174278, 0.0046288263984024525, -0.019122950732707977, 0.0897885113954544, 0.034850236028432846, 0.037423793226480484, -0.026772132143378258, 0.007032599300146103, 0.02612874284386635, -0.015691542997956276, 0.016674498096108437, -0.05186430364847183, -0.0290954802185297, 0.014494124799966812, 0.012572893872857094, -0.06744861602783203, -0.011035908944904804, -0.03551149740815163, 0.027058081701397896, 0.049648184329271317, -0.11009100824594498, -0.0047449939884245396, 0.07084427773952484, 0.04657421633601189, -0.045394670218229294, 0.06108621135354042, -0.010615918785333633, -0.028166141360998154, -0.0037642724346369505, 0.027218928560614586, -0.050291575491428375, -0.018568921834230423, -0.0222326647490263, 0.012251199223101139, 0.005620718002319336, 0.010660598054528236, -0.05229322984814644, 0.03292006999254227, 0.0021747888531535864, -0.045537643134593964, -0.02419857494533062, -0.007541948929429054, 0.036476582288742065, 0.018979975953698158, 0.004517126828432083, -0.013957967050373554, 0.0008818674250505865, 0.015789838507771492, 0.037602514028549194, -0.006237299181520939, 0.03806718438863754, -0.019927186891436577, 0.04400065913796425, 0.010044016875326633, 0.0067913285456597805, -0.012126095592975616, -0.01153632253408432, -0.037280820310115814, 0.020856527611613274, -0.07985172420740128, 0.013359257951378822, -0.07027237862348557, -0.02516365982592106, -0.06441038846969604, -0.010535495355725288, 0.07288167625665665, -0.03460003063082695, -0.02712957002222538, -0.015450271777808666, 0.031400956213474274, -0.014976666308939457, -0.05307959392666817, -0.023340722545981407, 0.01381499134004116, 0.00249536638148129, 0.04142710193991661, -0.02096375823020935, 0.0002862299152184278, -0.04210623726248741, 0.004673506133258343, -0.014520931988954544, 0.012608637101948261, 0.07813601940870285, 0.036959122866392136, -0.040176067501306534, 0.0026048319414258003, -0.021857354789972305, 0.05182855948805809, 0.01930166967213154, -0.01056230254471302, -0.04146284610033035, 0.04610954597592354, 0.014583484269678593, -0.04267813637852669, 0.0190157201141119, -0.040533509105443954, -0.012849908322095871, -0.04242793098092079, 0.022822437807917595, -0.05136388912796974, -0.012260135263204575, -0.05851265415549278, -0.00941850058734417, 0.03317027911543846, 0.018461689352989197, -0.011831209063529968, 0.0490405410528183, 0.021732250228524208, 0.014243917539715767, 0.03456428647041321, -0.030739696696400642, 0.0861426368355751, 0.027254672721028328, 0.036923378705978394, 0.05265066772699356, 0.03644083812832832, 0.004293728154152632, -0.030328642576932907, 0.023841137066483498, -0.03442131355404854, 0.0008142892038449645, 0.017818301916122437, -0.033849410712718964, 0.040176067501306534, -0.03860333934426308, 0.0023345190566033125, 0.03935395926237106, 0.06319509446620941, 0.040211811661720276, 0.04943372309207916, -0.07227402925491333, 0.05218599736690521, -0.00924871675670147, 0.025664072483778, 0.017907660454511642, 0.020356113091111183, -0.0182114839553833, 0.03072182461619377, -0.024895580485463142, -0.025735560804605484, 0.036297861486673355, -0.018238291144371033, -0.029274199157953262, 0.01800595596432686, -0.011750785633921623, 0.0467529334127903, 0.07949428260326385, -0.00900297798216343, 0.021053118631243706, 0.03638722375035286, 0.034224722534418106, 0.04210623726248741, -0.00029013940365985036, -0.017300015315413475, 0.010508687235414982, 0.006657288875430822, 0.07037960737943649, 0.017943404614925385, -0.03767400234937668, -0.0364229679107666, 0.017612773925065994, -0.027201058343052864, 0.02698659524321556, -0.030972031876444817, -0.004651166498661041, 0.02502068318426609, 0.00917722936719656, -0.04664570465683937, -0.03542213886976242, -0.035350650548934937, -0.022929668426513672, 0.0021390451584011316, -0.042999833822250366, 0.03270560875535011, -0.053830213844776154, 0.04968392848968506, 0.026253845542669296, -0.014324340969324112, 0.045752108097076416, 0.046395495533943176, -0.04982690513134003, -0.02471686154603958, 0.03329538181424141, -0.034546416252851486, 0.0694502666592598, -0.059227533638477325, 0.02421644702553749, -0.030149923637509346, 0.011312923394143581, 0.060335591435432434, 0.03992586210370064, -0.02632533386349678, 0.022322023287415504, -0.02986397221684456, -0.03342048451304436, 0.03359920531511307, 0.030918415635824203, 0.06294488906860352, -0.05054178088903427, 0.013752439990639687, -0.02373390644788742, 0.00617027934640646 ]
42,996
linearmodels.asset_pricing.model
fit
Estimate model parameters Parameters ---------- center : bool Flag indicating to center the moment conditions before computing the weighting matrix. use_cue : bool Flag indicating to use continuously updating estimator steps : int Number of steps to use when estimating parameters. 2 corresponds to the standard efficient GMM estimator. Higher values will iterate until convergence or up to the number of steps given disp : int Number of iterations between printed update. 0 or negative values suppresses output max_iter : int Maximum number of iterations when minimizing objective. Must be positive. cov_type : str Name of covariance estimator debiased : bool Flag indicating whether to debias the covariance estimator using a degree of freedom adjustment starting : array_like Starting values to use in optimization. If not provided, 2SLS estimates are used. opt_options : dict Additional options to pass to scipy.optimize.minimize when optimizing the objective function. If not provided, defers to scipy to choose an appropriate optimizer. All minimize inputs except ``fun``, ``x0``, and ``args`` can be overridden. **cov_config Additional covariance-specific options. See Notes. Returns ------- GMMFactorModelResults Results class with parameter estimates, covariance and test statistics Notes ----- The kernel covariance estimator takes the optional arguments ``kernel``, one of "bartlett", "parzen" or "qs" (quadratic spectral) and ``bandwidth`` (a positive integer).
def fit( self, *, center: bool = True, use_cue: bool = False, steps: int = 2, disp: int = 10, max_iter: int = 1000, cov_type: str = "robust", debiased: bool = True, starting: ArrayLike | None = None, opt_options: dict[str, Any] | None = None, **cov_config: bool | int | str, ) -> GMMFactorModelResults: """ Estimate model parameters Parameters ---------- center : bool Flag indicating to center the moment conditions before computing the weighting matrix. use_cue : bool Flag indicating to use continuously updating estimator steps : int Number of steps to use when estimating parameters. 2 corresponds to the standard efficient GMM estimator. Higher values will iterate until convergence or up to the number of steps given disp : int Number of iterations between printed update. 0 or negative values suppresses output max_iter : int Maximum number of iterations when minimizing objective. Must be positive. cov_type : str Name of covariance estimator debiased : bool Flag indicating whether to debias the covariance estimator using a degree of freedom adjustment starting : array_like Starting values to use in optimization. If not provided, 2SLS estimates are used. opt_options : dict Additional options to pass to scipy.optimize.minimize when optimizing the objective function. If not provided, defers to scipy to choose an appropriate optimizer. All minimize inputs except ``fun``, ``x0``, and ``args`` can be overridden. **cov_config Additional covariance-specific options. See Notes. Returns ------- GMMFactorModelResults Results class with parameter estimates, covariance and test statistics Notes ----- The kernel covariance estimator takes the optional arguments ``kernel``, one of "bartlett", "parzen" or "qs" (quadratic spectral) and ``bandwidth`` (a positive integer). """ nobs, n = self.portfolios.shape k = self.factors.shape[1] excess_returns = not self._risk_free nrf = int(not bool(excess_returns)) # 1. Starting Values - use 2 pass mod = LinearFactorModel( self.portfolios, self.factors, risk_free=self._risk_free ) res = mod.fit() betas = np.asarray(res.betas).ravel() lam = np.asarray(res.risk_premia) mu = self.factors.ndarray.mean(0) sv = np.r_[betas, lam, mu][:, None] if starting is not None: starting = np.asarray(starting) if starting.ndim == 1: starting = starting[:, None] if starting.shape != sv.shape: raise ValueError(f"Starting values must have {sv.shape} elements.") sv = starting g = self._moments(sv, excess_returns) g -= g.mean(0)[None, :] if center else 0 kernel: str | None = None bandwidth: float | None = None if cov_type not in ("robust", "heteroskedastic", "kernel"): raise ValueError(f"Unknown weight: {cov_type}") if cov_type in ("robust", "heteroskedastic"): weight_est_instance = HeteroskedasticWeight(g, center=center) cov_est = HeteroskedasticCovariance else: # "kernel": kernel = get_string(cov_config, "kernel") bandwidth = get_float(cov_config, "bandwidth") weight_est_instance = KernelWeight( g, center=center, kernel=kernel, bandwidth=bandwidth ) cov_est = KernelCovariance w = weight_est_instance.w(g) args = (excess_returns, w) # 2. Step 1 using w = inv(s) from SV callback = callback_factory(self._j, args, disp=disp) _default_options: dict[str, Any] = {"callback": callback} options = {"disp": bool(disp), "maxiter": max_iter} opt_options = {} if opt_options is None else opt_options options.update(opt_options.get("options", {})) _default_options.update(opt_options) _default_options["options"] = options opt_res = minimize( fun=self._j, x0=np.squeeze(sv), args=args, **_default_options, ) params = opt_res.x last_obj = opt_res.fun iters = 1 # 3. Step 2 using step 1 estimates if not use_cue: while iters < steps: iters += 1 g = self._moments(params, excess_returns) w = weight_est_instance.w(g) args = (excess_returns, w) # 2. Step 1 using w = inv(s) from SV callback = callback_factory(self._j, args, disp=disp) opt_res = minimize( self._j, params, args=args, callback=callback, options={"disp": bool(disp), "maxiter": max_iter}, ) params = opt_res.x obj = opt_res.fun if np.abs(obj - last_obj) < 1e-6: break last_obj = obj else: cue_args = (excess_returns, weight_est_instance) callback = callback_factory(self._j_cue, cue_args, disp=disp) opt_res = minimize( self._j_cue, params, args=cue_args, callback=callback, options={"disp": bool(disp), "maxiter": max_iter}, ) params = opt_res.x # 4. Compute final S and G for inference g = self._moments(params, excess_returns) s = g.T @ g / nobs jac = self._jacobian(params, excess_returns) if cov_est is HeteroskedasticCovariance: cov_est_inst = HeteroskedasticCovariance( g, jacobian=jac, center=center, debiased=debiased, df=self.factors.shape[1], ) else: cov_est_inst = KernelCovariance( g, jacobian=jac, center=center, debiased=debiased, df=self.factors.shape[1], kernel=kernel, bandwidth=bandwidth, ) full_vcv = cov_est_inst.cov sel = slice((n * k), (n * k + k + nrf)) rp = params[sel] rp_cov = full_vcv[sel, sel] sel = slice(0, (n * (k + 1)), (k + 1)) alphas = g.mean(0)[sel, None] alpha_vcv = s[sel, sel] / nobs stat = self._j(params, excess_returns, w) jstat = WaldTestStatistic( stat, "All alphas are 0", n - k - nrf, name="J-statistic" ) # R2 calculation betas = np.reshape(params[: (n * k)], (n, k)) resids = self.portfolios.ndarray - self.factors.ndarray @ betas.T resids -= resids.mean(0)[None, :] residual_ss = (resids**2).sum() total = self.portfolios.ndarray total = total - total.mean(0)[None, :] total_ss = (total**2).sum() r2 = 1.0 - residual_ss / total_ss param_names = [] for portfolio in self.portfolios.cols: for factor in self.factors.cols: param_names.append(f"beta-{portfolio}-{factor}") if not excess_returns: param_names.append("lambda-risk_free") param_names.extend([f"lambda-{f}" for f in self.factors.cols]) param_names.extend([f"mu-{f}" for f in self.factors.cols]) rp_names = list(self.factors.cols)[:] if not excess_returns: rp_names.insert(0, "risk_free") params = np.c_[alphas, betas] # 5. Return values res_dict = AttrDict( params=params, cov=full_vcv, betas=betas, rp=rp, rp_cov=rp_cov, alphas=alphas, alpha_vcv=alpha_vcv, jstat=jstat, rsquared=r2, total_ss=total_ss, residual_ss=residual_ss, param_names=param_names, portfolio_names=self.portfolios.cols, factor_names=self.factors.cols, name=self._name, cov_type=cov_type, model=self, nobs=nobs, rp_names=rp_names, iter=iters, cov_est=cov_est_inst, ) return GMMFactorModelResults(res_dict)
(self, *, center: bool = True, use_cue: bool = False, steps: int = 2, disp: int = 10, max_iter: int = 1000, cov_type: str = 'robust', debiased: bool = True, starting: Union[numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, opt_options: Optional[dict[str, Any]] = None, **cov_config: bool | int | str) -> linearmodels.asset_pricing.results.GMMFactorModelResults
[ 0.04251181706786156, -0.05399959906935692, -0.028310013934969902, 0.0006324422429315746, 0.0038282861933112144, -0.040569890290498734, -0.046980585902929306, -0.05371883884072304, 0.03256821632385254, 0.028614172711968422, -0.015500318259000778, 0.0007859831093810499, 0.005041990429162979, 0.030977239832282066, -0.03677962347865105, 0.12727808952331543, 0.02732735313475132, -0.01637769490480423, 0.007603929378092289, 0.03771549090743065, -0.04955422505736351, -0.014447466470301151, -0.05905328691005707, 0.08071863651275635, 0.005126803182065487, -0.010195114649832249, 0.035188645124435425, -0.03956383094191551, 0.014938796870410442, -0.0022168378345668316, -0.029082106426358223, 0.03259161114692688, -0.023689165711402893, -0.02625110372900963, 0.028333410620689392, 0.002651139395311475, 0.03872155025601387, 0.01097305491566658, -0.04220765829086304, 0.029105503112077713, -0.01086192112416029, -0.02660205587744713, 0.034954678267240524, -0.014295388013124466, -0.04281597211956978, -0.0030503456946462393, -0.02681262604892254, 0.07500983774662018, 0.041552551090717316, -0.019746819511055946, 0.00841111596673727, -0.0556841604411602, 0.020612498745322227, -0.03341049700975418, -0.023958226665854454, 0.02718697302043438, 0.003951118793338537, 0.026508469134569168, 0.05259579420089722, -0.05881932005286217, 0.04354127123951912, -0.028543982654809952, 0.023244628682732582, 0.01732526160776615, -0.05844497308135033, 0.023981623351573944, 0.011183626018464565, -0.018038861453533173, 0.014494259841740131, 0.05413997918367386, 0.0026394410524517298, 0.008843954652547836, -0.010633802972733974, 0.02662545256316662, 0.017617719247937202, 0.014002928510308266, 0.02246083877980709, -0.1080927848815918, -0.064621701836586, -0.058117419481277466, 0.0662594735622406, 0.046723224222660065, -0.05877252668142319, -0.07674119621515274, 0.0057234191335737705, -0.003977440297603607, 0.025759773328900337, -0.04421977698802948, -0.0070658051408827305, 0.040850650519132614, -0.06424735486507416, 0.01661166176199913, 0.05928725376725197, 0.026134120300412178, 0.030415717512369156, -0.0017079595709219575, -0.0216770488768816, -0.04861835762858391, -0.01669354923069477, -0.06541719287633896, 0.02746773324906826, 0.035095058381557465, 0.01661166176199913, 0.07678799331188202, -0.004857741296291351, -0.041833311319351196, -0.041154805570840836, -0.02716357633471489, 0.03818342462182045, -0.035399217158555984, -0.06373263150453568, 0.06850555539131165, -0.04419637843966484, -0.010487573221325874, -0.05105161294341087, -0.019629836082458496, -0.08053146302700043, 0.0326618030667305, -0.03392522409558296, 0.04316692426800728, -0.025549203157424927, 0.010534367524087429, -0.02739754319190979, 0.020343435928225517, -0.020378531888127327, -0.02805265039205551, 0.03479090332984924, 0.04765909165143967, 0.06382621824741364, -0.026110723614692688, -0.028988519683480263, -0.05353166535496712, -0.025268442928791046, -0.028193030506372452, 0.01734865829348564, -0.01617882214486599, 0.00395696796476841, -0.024145400151610374, 0.0166233591735363, 0.025011079385876656, 0.04433675855398178, 0.05437394604086876, -0.07763027399778366, -0.013979531824588776, -0.015418429858982563, 0.01707959547638893, 0.10500441491603851, -0.02235555276274681, -0.03968081250786781, 0.02160685881972313, -0.014973891898989677, -0.02147817611694336, -0.02157176285982132, -0.02213328517973423, -0.009633594192564487, -0.02664884924888611, 0.030977239832282066, -0.023689165711402893, -0.01641278900206089, 0.028801346197724342, -0.03951703757047653, -0.011803638190031052, -0.001179340179078281, 0.03249802440404892, 0.025923550128936768, 0.030766669660806656, -0.02151327207684517, -0.0009227076079696417, -0.03724755719304085, 0.02725716307759285, -0.010282852686941624, -0.0320768840610981, -0.03404220938682556, -0.009855862706899643, -0.04552999138832092, 0.046723224222660065, 0.06162692606449127, -0.046021319925785065, 0.014096515253186226, 0.012014208361506462, 0.018705666065216064, -0.04936705157160759, -0.03738793730735779, -0.041084617376327515, -0.03951703757047653, 0.02681262604892254, 0.014482561498880386, 0.020425325259566307, 0.01354669313877821, -0.04903949797153473, -0.020284945145249367, -0.020191358402371407, 0.03914269059896469, 0.012259874492883682, -0.035960737615823746, -0.003658659989014268, 0.041248392313718796, 0.023115945979952812, 0.024519748985767365, -0.05470149964094162, -0.01354669313877821, 0.01726676896214485, -0.01582787185907364, -0.0556841604411602, -0.04861835762858391, -0.019700026139616966, -0.04410279169678688, -0.035305630415678024, 0.046816810965538025, 0.041786517947912216, -0.03820682317018509, 0.019115108996629715, -0.0046003772877156734, -0.005340298172086477, 0.018857745453715324, -0.04414958506822586, 0.04761229828000069, 0.0010864845244213939, 0.015441826544702053, 0.026391485705971718, -0.029784006997942924, -0.06981576979160309, -0.028356807306408882, 0.011622314341366291, -0.018682269379496574, -0.01663505844771862, 0.023759355768561363, 0.02269480563700199, 0.013184044510126114, -0.07533739507198334, -0.023759355768561363, -0.01724337227642536, 0.028076047077775, -0.024005020037293434, -0.015441826544702053, 0.02174723893404007, -0.03830040991306305, 0.06377942115068436, -0.06260958313941956, 0.01612033136188984, 0.00041894728201441467, -0.031024033203721046, 0.02103363908827305, 0.057789865881204605, -0.00831167958676815, 0.008931692689657211, 0.07271696627140045, 0.0345335379242897, -0.011926471255719662, 0.025900153443217278, 0.009978694841265678, -0.0333637036383152, -0.03420598432421684, 0.012903283350169659, -0.04885232448577881, -0.05390601232647896, 0.020741179585456848, 0.01661166176199913, 0.06897348910570145, -0.03401881083846092, 0.023934829980134964, -0.035492803901433945, -0.0008357011247426271, 0.06733571738004684, -0.029292676597833633, 0.02250763215124607, -0.022987263277173042, -0.017336959019303322, 0.04978819191455841, 0.015605603344738483, 0.007159392349421978, 0.07889369130134583, -0.03170253708958626, -0.004155839793384075, -0.003252142108976841, 0.03830040991306305, -0.03813663125038147, -0.023314818739891052, -0.012599126435816288, 0.0636858344078064, 0.029947783797979355, -0.029924387112259865, -0.018085654824972153, 0.0033895978704094887, 0.01116607803851366, 0.009048676118254662, -0.023654069751501083, -0.024987682700157166, 0.03799625113606453, 0.0011522878194227815, 0.0162139181047678, 0.0016947989352047443, 0.031164413318037987, -0.021115528419613838, 0.09531818330287933, 0.004594528116285801, 0.001725507085211575, -0.03720076382160187, 0.03720076382160187, 0.023115945979952812, 0.026321295648813248, 0.023069152608513832, 0.07973597198724747, -0.012681014835834503, -0.02240234613418579, -0.0071886382065713406, 0.06855235248804092, -0.06172051280736923, 0.024894095957279205, 0.013113853521645069, 0.0006503553013317287, 0.014248594641685486, 0.03696679696440697, 0.0003089096280746162, -0.009206604212522507, -0.05849176645278931, 0.00009541469626128674, -0.05947442725300789, 0.057789865881204605, 0.03804304450750351, -0.006592022255063057, -0.030556099489331245, 0.0424182303249836, -0.029409660026431084, 0.0044073546305298805, -0.019992485642433167, -0.024426162242889404, 0.05563736706972122, -0.012482143007218838, -0.02721036970615387, -0.01726676896214485, -0.026438279077410698, 0.020320039242506027, 0.05343807861208916, -0.04960101842880249, -0.013839151710271835, 0.05385921895503998, -0.023958226665854454, 0.0763668492436409, -0.02271820232272148, 0.08708254247903824, -0.014587846584618092, -0.07201506197452545, 0.015465223230421543, -0.03738793730735779, -0.029643626883625984, 0.07734951376914978, -0.0054631307721138, 0.01634259894490242, 0.03135158494114876, -0.057462312281131744, 0.04819721356034279, 0.03362106531858444, 0.09442910552024841, -0.017746401950716972, 0.04316692426800728, -0.020542308688163757, -0.0860062912106514, 0.051425959914922714, -0.05348487198352814, -0.033831637352705, 0.10060583800077438, -0.06195447966456413, 0.05633926764130592, 0.01664675585925579, -0.05530981346964836, -0.040593285113573074, -0.029737213626503944, 0.08132695406675339, -0.041926898062229156, 0.024940889328718185, -0.01707959547638893, -0.020296642556786537, 0.017477339133620262, 0.014599544927477837, -0.0034012962132692337, -0.062422413378953934, 0.0027418015524744987, -0.003506581299006939, 0.0007004389190115035, 0.014810115098953247, -0.03399541601538658, -0.0989212766289711, 0.01121287140995264, 0.01737205497920513, -0.017734702676534653, 0.015535413287580013, -0.026227707043290138, 0.05058367922902107, -0.026040533557534218, 0.00400668615475297, -0.0022153756581246853, 0.09096639603376389, 0.018471699208021164, 0.018565285950899124, 0.01631920225918293, 0.04756550490856171, -0.0005231357063166797, -0.031047429889440536, -0.019360775128006935, -0.0313749834895134, -0.0033047848846763372, 0.00013882655184715986, 0.029713816940784454, -0.030860256403684616, -0.07547777146100998, 0.034580331295728683, 0.010078131221234798, -0.009557554498314857, 0.0885799303650856, -0.04899270460009575, 0.00011881139653269202, -0.06616588681936264, -0.045342817902565, -0.06733571738004684, 0.040803857147693634, -0.04810362681746483, -0.008645082823932171, 0.07898727804422379, 0.019302282482385635, 0.03972760587930679, -0.007457700092345476, 0.0890478640794754, 0.03909589722752571, -0.01677543856203556, 0.02739754319190979, -0.01705619879066944, -0.002200752729550004, -0.035024870187044144, -0.026461675763130188, -0.01606183871626854, 0.012903283350169659, 0.001724044792354107, -0.035960737615823746, -0.04225445166230202, -0.01371046993881464, -0.06504284590482712, -0.024192193523049355, -0.009054525755345821, 0.04005516320466995, 0.015090875327587128, 0.024168796837329865, 0.008814709261059761, -0.01656486839056015, -0.03174933046102524, 0.030041370540857315, -0.008493004366755486, -0.03401881083846092, -0.07837896794080734, -0.02150157280266285, 0.02132609859108925, 0.019337378442287445, 0.01565239578485489, -0.00815375242382288, 0.00803676899522543, -0.025128062814474106, -0.0317259356379509, -0.024332575500011444, -0.013324424624443054, -0.00845790933817625, 0.015523714944720268, -0.004810947924852371, -0.00851055234670639, 0.01593315787613392, -0.020554006099700928, 0.026555262506008148, 0.0559181272983551, -0.014962193556129932, -0.021138925105333328, -0.02105703577399254, -0.023385008797049522, 0.00023250476806424558, 0.02812284044921398, -0.056666821241378784, 0.002478588605299592, 0.023092549294233322, -0.04941384494304657, 0.0015105498023331165, 0.009189056232571602, 0.011756844818592072, 0.02685941942036152, -0.023864639922976494, 0.023466896265745163, 0.03212367743253708, 0.00016743267769925296, -0.034861091524362564, 0.020612498745322227, 0.008884899318218231, 0.031164413318037987, -0.01724337227642536, -0.026227707043290138, 0.005635681562125683, 0.03469731658697128, 0.08198206126689911, -0.0109262615442276, 0.017968671396374702, 0.04805683344602585, -0.0018834348302334547, 0.04955422505736351, -0.04424317181110382, 0.035001471638679504, -0.01392104011029005, -0.041365377604961395, -0.024472955614328384, -0.03343389183282852, -0.024823905900120735, -0.05095802620053291, -0.030649686232209206, -0.03881513699889183, -0.0284269992262125, -0.012985171750187874, -0.019629836082458496, 0.03390182927250862, -0.04815042018890381, -0.0016055989544838667, 0.014271991327404976, -0.02772509679198265, 0.0346505232155323, -0.011593068018555641, -0.02126760594546795, 0.018530191853642464, -0.020179659128189087, 0.04234803840517998, 0.019992485642433167, 0.02793566696345806, 0.045646972954273224, -0.03163234889507294, -0.03399541601538658, 0.052315033972263336, 0.02814623713493347, -0.035095058381557465, -0.05395280569791794, 0.01601504534482956, 0.04326051101088524, 0.014973891898989677, -0.025455616414546967, 0.005232088267803192, -0.07786423712968826, -0.034907884895801544, -0.015219557099044323, -0.01699770800769329, 0.011569671332836151, -0.0010813665576279163, -0.024870699271559715, 0.018483398482203484, 0.003301860298961401, 0.03338709846138954, -0.0006938586011528969, -0.0023221231531351805, -0.04319031909108162, -0.0018205562373623252, 0.008048467338085175, 0.025642789900302887, 0.041505757719278336, 0.04316692426800728, 0.03345729038119316, -0.010101527906954288, 0.01622561551630497, 0.025689583271741867, -0.0068610841408371925, -0.012096096761524677, 0.001668477663770318, 0.018132448196411133, -0.06050388142466545, -0.03944684565067291, 0.0212091151624918, 0.03858117014169693, 0.02688281610608101, -0.011517028324306011, -0.01723167486488819, 0.02110382914543152, 0.01613202877342701, -0.0161554254591465, 0.05371883884072304, -0.02202799916267395, -0.011493631638586521, 0.05409318581223488, -0.011031546629965305, -0.0447578988969326, 0.009346984326839447, 0.0162139181047678, -0.0740271806716919, 0.007761857472360134, -0.06106540560722351, -0.0031790274661034346, 0.0446409173309803, -0.07182788848876953, 0.0038048892747610807, 0.0017459791852161288, 0.052221447229385376, -0.012903283350169659, 0.06658702343702316, -0.05881932005286217, -0.05259579420089722, 0.002374765696004033, 0.025595996528863907, -0.0424182303249836, 0.006802592426538467, 0.0327787846326828, 0.020647592842578888, -0.05633926764130592, -0.010335494764149189, 0.02697640284895897, 0.030415717512369156, -0.01112513430416584, -0.008966787718236446, -0.03198329731822014, 0.01313725020736456, 0.04316692426800728, 0.02669564262032509, 0.0075980802066624165, -0.02664884924888611, 0.02090495638549328, 0.007516191806644201, 0.00835847295820713, -0.0068610841408371925, 0.0014279301976785064, -0.03212367743253708, 0.06878631561994553, 0.02199290320277214, -0.01565239578485489, 0.018073955550789833, 0.00807771272957325, 0.01650637574493885, -0.0019082939252257347, -0.009440571069717407, 0.04017214477062225, -0.08263716846704483, -0.009341134689748287, -0.08310510218143463, -0.01664675585925579, 0.057509105652570724, 0.029784006997942924, 0.015020685270428658, 0.025829963386058807, 0.040406111627817154, 0.047425124794244766, 0.009306039661169052, -0.014798416756093502, 0.007013162598013878, 0.01619052141904831, 0.040780458599328995, 0.03128139674663544, 0.02788887359201908, -0.02728055976331234, 0.0035650732461363077, 0.0013036351883783937, -0.002120326505973935, 0.0648556724190712, 0.04796324670314789, -0.03413579612970352, 0.003693755017593503, -0.06523001939058304, -0.03907249867916107, -0.0110724912956357, 0.01352329645305872, 0.017524132505059242, 0.056526441127061844, 0.05507584661245346, 0.0023367460817098618, -0.03245123103260994, -0.014353879727423191, 0.02239064872264862, -0.052876558154821396, -0.0032550666946917772, 0.011745146475732327, 0.02250763215124607, -0.017980368807911873, -0.02669564262032509, 0.007995824329555035, -0.03729435056447983, -0.0026920835953205824, -0.0012707336572930217, 0.0012129730312153697, -0.025900153443217278, 0.0221449825912714, -0.01658826507627964, 0.01730186492204666, 0.005717569962143898, 0.012575729750096798, 0.0834326520562172, 0.04791645333170891, -0.024285782128572464, 0.030228544026613235, 0.06064426153898239, -0.041061218827962875, -0.053110525012016296, -0.02186422236263752, -0.026227707043290138, -0.001748903770931065, -0.057462312281131744, 0.014564449898898602, 0.006007104180753231, 0.0058228555135428905, 0.025081269443035126, -0.009136414155364037, -0.058211006224155426, -0.007282224949449301, 0.011815336532890797, -0.00211009057238698, 0.023162739351391792, -0.02146647870540619, 0.018565285950899124, 0.057883452624082565, -0.023069152608513832, 0.042231056839227676, -0.002257782267406583, -0.03813663125038147, 0.03820682317018509, -0.033831637352705, 0.025104666128754616, 0.04815042018890381, 0.03956383094191551, -0.03177272900938988, 0.008785462938249111, 0.03305954486131668, -0.04361145943403244, -0.0071535431779921055, -0.018424905836582184, 0.03661584481596947, 0.031117619946599007, 0.004907459020614624, 0.057555899024009705, -0.004512639716267586, -0.051238786429166794, -0.0442899651825428, 0.007592231035232544, -0.0013072909787297249, 0.05025612562894821, 0.0001520785881439224, 0.040569890290498734, 0.025151459500193596, -0.05989556759595871, -0.0017723004566505551, -0.017570925876498222, -0.06363904476165771, 0.02265970967710018, 0.007773555815219879, -0.036054324358701706, 0.04316692426800728, -0.03736453875899315, 0.041880104690790176, -0.041482359170913696, -0.035726770758628845, -0.009616046212613583, 0.08525759726762772, -0.008972637355327606, -0.019723422825336456, 0.051285579800605774, -0.05465470626950264, 0.07968918234109879, -0.057415518909692764, 0.009569252841174603, 0.04772927984595299, 0.040312524884939194, 0.011253816075623035, 0.02746773324906826, -0.018857745453715324, -0.000012338106898823753, -0.04492167755961418, -0.012084398418664932, -0.014728226698935032, 0.025174856185913086, 0.0634518712759018, -0.005366619676351547, 0.024192193523049355, 0.025479013100266457, 0.0007786716450937092 ]
42,997
linearmodels.iv.model
_OLS
Computes OLS estimates when required Private class used when model reduces to OLS. Should use the statsmodels version when neeeding a supported public API. Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) weights : array_like Observation weights used in estimation Notes ----- Uses IV2SLS internally by setting endog and instruments to None. Uses IVLIML with kappa=0 to estimate OLS models. See Also -------- statsmodels.regression.linear_model.OLS, statsmodels.regression.linear_model.GLS
class _OLS(IVLIML): """ Computes OLS estimates when required Private class used when model reduces to OLS. Should use the statsmodels version when neeeding a supported public API. Parameters ---------- dependent : array_like Endogenous variables (nobs by 1) exog : array_like Exogenous regressors (nobs by nexog) weights : array_like Observation weights used in estimation Notes ----- Uses IV2SLS internally by setting endog and instruments to None. Uses IVLIML with kappa=0 to estimate OLS models. See Also -------- statsmodels.regression.linear_model.OLS, statsmodels.regression.linear_model.GLS """ def __init__( self, dependent: IVDataLike, exog: IVDataLike, *, weights: IVDataLike | None = None, ): super().__init__(dependent, exog, None, None, weights=weights, kappa=0.0) self._result_container = OLSResults
(dependent: 'IVDataLike', exog: 'IVDataLike', *, weights: 'IVDataLike | None' = None)
[ 0.04867830127477646, -0.0857406035065651, -0.0015121218748390675, 0.01700654998421669, 0.04294290021061897, -0.06363390386104584, -0.027442799881100655, -0.04766190052032471, 0.026426400989294052, 0.024066900834441185, -0.0098191499710083, -0.02208855003118515, 0.03909510001540184, 0.0025273875799030066, -0.050711099058389664, 0.1025112047791481, -0.030473850667476654, -0.05180010199546814, 0.005930512677878141, 0.01766902580857277, -0.0030605436768382788, 0.013603425584733486, -0.018531151115894318, 0.03504765033721924, 0.002581837587058544, 0.010009725578129292, -0.00882089976221323, -0.01914825104176998, 0.03136320039629936, -0.08595839887857437, -0.04773449897766113, -0.016089975833892822, -0.055938299745321274, -0.014765025116503239, 0.021090300753712654, -0.028912950307130814, 0.027188699692487717, 0.02032800018787384, -0.008004150353372097, 0.04036559909582138, -0.00041631562635302544, -0.02423025108873844, 0.04784340038895607, -0.027134250849485397, -0.04159979894757271, 0.013249499723315239, -0.06229080259799957, 0.029384849593043327, 0.08668439835309982, -0.038332801312208176, 0.033795300871133804, 0.0034893376287072897, -0.004283400252461433, -0.04308810085058212, -0.01677059940993786, 0.07673820108175278, 0.01724250055849552, 0.03404939919710159, 0.06817140430212021, -0.04450380057096481, 0.0038046936970204115, -0.028676999732851982, 0.014374800026416779, 0.034285351634025574, -0.011416350491344929, 0.029929351061582565, -0.04726260155439377, 0.018313350155949593, 0.009692099876701832, 0.024466199800372124, -0.0293122511357069, -0.036481499671936035, -0.02595449984073639, 0.031599149107933044, -0.009710250422358513, 0.061455901712179184, -0.011479875072836876, -0.0441771000623703, 0.0030673500150442123, -0.07347120344638824, -0.013476375490427017, -0.012423675507307053, -0.027497250586748123, 0.015808649361133575, -0.028949249535799026, -0.07840800285339355, -0.006520387716591358, -0.04628250002861023, 0.051291901618242264, 0.02364945039153099, -0.0854502022266388, 0.05691840127110481, -0.02344980090856552, 0.012242174707353115, 0.037461601197719574, 0.0061528501100838184, -0.046645499765872955, -0.07387050241231918, -0.002171193715184927, -0.033994950354099274, -0.005181825254112482, -0.0029221500735729933, -0.006075712386518717, 0.06965970247983932, 0.0021224156953394413, -0.05604720115661621, -0.0027406499721109867, -0.011425425298511982, 0.042688801884651184, -0.0635249987244606, -0.043959300965070724, 0.0753588005900383, -0.04827900230884552, -0.018640050664544106, -0.07760939747095108, 0.007913400419056416, 0.00505931256338954, 0.041999101638793945, -0.03807869926095009, -0.007613925263285637, -0.04969470202922821, -0.017024699598550797, -0.057099901139736176, 0.047625601291656494, 0.0487871989607811, -0.06152850016951561, 0.007768200244754553, -0.02580930106341839, 0.003178518731147051, -0.06719130277633667, 0.006298050284385681, -0.05092890188097954, -0.024956250563263893, 0.021471450105309486, 0.019583851099014282, -0.013476375490427017, 0.01940234936773777, 0.01167952548712492, -0.017133601009845734, 0.05521230027079582, 0.007754587568342686, 0.02188890054821968, -0.04163610190153122, 0.017687175422906876, 0.02662605047225952, 0.06367020308971405, 0.02658975124359131, 0.0314721018075943, 0.023431649431586266, 0.004705387633293867, -0.005086537450551987, -0.018984900787472725, -0.0023685749620199203, -0.041019000113010406, -0.024665851145982742, -0.020273549482226372, 0.007123874966055155, -0.03934920206665993, 0.009583200328052044, -0.04780710116028786, -0.06080250069499016, -0.010200300253927708, -0.04704480245709419, -0.05691840127110481, 0.017605500295758247, 0.009673950262367725, -0.031798798590898514, -0.03675375133752823, -0.004126856103539467, 0.021943349391222, -0.026371950283646584, -0.058080002665519714, -0.013113374821841717, -0.01236014999449253, -0.002570493845269084, 0.07056719809770584, 0.023613151162862778, 0.048061199486255646, 0.011670449748635292, 0.007083037402480841, 0.02936669997870922, 0.017333250492811203, -0.1241459995508194, -0.009456150233745575, -0.0453387014567852, 0.05078370124101639, 0.008262787945568562, -0.020255399867892265, -0.03891360014677048, -0.020219100639224052, 0.037534199655056, -0.033014848828315735, 0.05259869992733002, -0.01737862452864647, -0.018258899450302124, 0.026226749643683434, -0.013149674981832504, 0.021489599719643593, -0.04159979894757271, 0.06653790175914764, 0.0015869906637817621, 0.0502392016351223, -0.003630000166594982, -0.002854087622836232, -0.055284902453422546, 0.048206400126218796, -0.02838660031557083, -0.044830501079559326, -0.02335905097424984, -0.010200300253927708, 0.0381150022149086, 0.029457449913024902, -0.04406820237636566, 0.04958580061793327, 0.03865950182080269, 0.0759396031498909, -0.026426400989294052, 0.027642451226711273, -0.006175537593662739, -0.017678100615739822, 0.02199780009686947, -0.06127440184354782, -0.07666560262441635, -0.01344007533043623, 0.013503599911928177, 0.0024502500891685486, 0.0756492018699646, -0.013939199969172478, 0.02150775119662285, 0.01914825104176998, -0.003423543879762292, -0.04686329886317253, 0.027043500915169716, -0.03201660141348839, -0.006969599984586239, 0.015300449915230274, -0.05691840127110481, 0.04276140034198761, -0.04025670140981674, -0.010536075569689274, -0.03214364871382713, -0.01746937446296215, -0.021870750933885574, 0.02375834994018078, -0.018467625603079796, -0.045120902359485626, 0.014211449772119522, 0.034430552273988724, -0.02023725025355816, -0.010345499962568283, 0.054704099893569946, -0.05223570019006729, -0.017777925357222557, 0.0004894828307442367, 0.015164325013756752, -0.04257990047335625, -0.014547225087881088, 0.008494200184941292, 0.026154151186347008, -0.08370780199766159, -0.017487525939941406, -0.000838303123600781, -0.04261619970202446, 0.05038440227508545, -0.02486550062894821, 0.018658200278878212, 0.00864847470074892, -0.029929351061582565, 0.07394310086965561, 0.05895119905471802, 0.06762690097093582, 0.02297789976000786, -0.05317950248718262, 0.019275300204753876, 0.022905299440026283, 0.0666830986738205, -0.01608090102672577, -0.04370519891381264, 0.02820510044693947, 0.027678750455379486, 0.05121929943561554, 0.009192975237965584, -0.03306930139660835, 0.008149350062012672, 0.00369579391553998, 0.0014951062621548772, -0.042979199439287186, -0.07405199855566025, 0.03098205104470253, -0.012886499986052513, 0.03410385176539421, 0.07060349732637405, 0.04798860102891922, 0.01708822511136532, 0.04486680030822754, 0.050856299698352814, 0.012051600031554699, 0.032325152307748795, 0.07354380190372467, -0.007377975154668093, -0.016217024996876717, -0.018295200541615486, 0.02809620089828968, -0.030473850667476654, -0.02506515011191368, -0.05546640232205391, 0.03165360167622566, -0.0577533021569252, -0.030873149633407593, 0.023486100137233734, -0.004818825051188469, 0.08334480226039886, -0.016643550246953964, -0.029729699715971947, 0.01568160019814968, -0.009401700459420681, -0.006302587687969208, -0.01387567538768053, 0.036281850188970566, 0.048896100372076035, -0.014883000403642654, 0.013303950428962708, 0.01974719949066639, -0.05332469940185547, 0.010690350085496902, -0.013866600580513477, 0.05223570019006729, -0.006257212720811367, 0.07140210270881653, -0.024756601080298424, -0.018549300730228424, -0.06301680207252502, 0.027769500389695168, 0.004024762660264969, -0.020164649933576584, -0.01582680083811283, 0.0646866038441658, -0.005018474999815226, 0.041563499718904495, 0.022651201114058495, 0.040873799473047256, -0.029747851192951202, -0.05067479982972145, 0.010327350348234177, -0.03851430118083954, -0.055684201419353485, 0.02390355058014393, -0.03297854959964752, -0.008022299967706203, -0.003101381240412593, -0.05238090083003044, 0.02009204961359501, 0.015863100066781044, 0.030074549838900566, 0.009592275135219097, 0.019474949687719345, -0.005912362597882748, 0.028277700766921043, 0.055139701813459396, -0.06196410208940506, -0.0384053997695446, -0.0030673500150442123, -0.02174369990825653, -0.00626628752797842, 0.017777925357222557, -0.037316400557756424, 0.04610100015997887, -0.05267130210995674, 0.02355870045721531, -0.019620150327682495, -0.06740909814834595, -0.05586570128798485, 0.005435924977064133, -0.007754587568342686, 0.018730800598859787, 0.027479100972414017, -0.03092760033905506, -0.045774299651384354, -0.012432750314474106, -0.04501200094819069, 0.0389862023293972, -0.015481949783861637, 0.02277825027704239, 0.01619887538254261, 0.036917101591825485, -0.00003679628935060464, 0.022941600531339645, 0.054268501698970795, 0.040873799473047256, 0.0012897844426333904, 0.002609062474220991, 0.0066701252944767475, 0.018585599958896637, 0.005136450286954641, -0.004827899858355522, -0.006606600247323513, -0.0029697937425225973, -0.014837625436484814, -0.024901799857616425, -0.027787650004029274, -0.0035347125958651304, -0.0016108124982565641, -0.0026725875213742256, 0.020926950499415398, -0.052017901092767715, -0.022832700982689857, -0.015055425465106964, 0.024556949734687805, -0.02658975124359131, -0.010254750028252602, -0.04076490178704262, 0.010100475512444973, -0.008539575152099133, -0.06933300197124481, -0.012378300540149212, 0.026317499577999115, 0.0254100002348423, 0.08552280068397522, 0.015590850263834, 0.02560964971780777, 0.0773916020989418, 0.0057762376964092255, 0.06773579865694046, 0.051001500338315964, -0.0284410510212183, 0.004179037641733885, -0.009891750290989876, -0.028604401275515556, -0.008208337239921093, -0.0067926375195384026, -0.03078239969909191, 0.06820770353078842, -0.040728598833084106, -0.04290660098195076, -0.005240812432020903, -0.037534199655056, -0.038187600672245026, -0.00007231640483951196, -0.01068127527832985, 0.038732100278139114, 0.03586440160870552, 0.04915020242333412, 0.01568160019814968, 0.05132820084691048, 0.002511506201699376, -0.01270500011742115, -0.017405850812792778, 0.029548199847340584, -0.014011800289154053, -0.0317624993622303, 0.07673820108175278, -0.0050502377562224865, 0.04704480245709419, 0.05350619927048683, -0.06711870431900024, -0.047770801931619644, 0.030364951118826866, -0.04094640165567398, -0.020745450630784035, 0.005163675174117088, -0.04671810194849968, -0.02517404966056347, 0.02653530053794384, -0.023231999948620796, -0.025192201137542725, -0.008997862227261066, 0.05945939943194389, -0.043124400079250336, -0.006933300290256739, -0.0007532250019721687, 0.026989050209522247, -0.006184612400829792, 0.07935179769992828, -0.04105529934167862, 0.02668050117790699, 0.047770801931619644, -0.03738899901509285, -0.014084400609135628, 0.029530050233006477, -0.05183640122413635, -0.00835807528346777, 0.008099437691271305, 0.020799899473786354, 0.00942892488092184, -0.019474949687719345, 0.013966425321996212, 0.023576850071549416, -0.030110850930213928, 0.0032851500436663628, -0.03459389880299568, -0.024302849546074867, 0.09713879972696304, -0.004215337336063385, 0.006742725148797035, 0.03559214994311333, 0.04207170009613037, -0.004827899858355522, 0.0006675797048956156, 0.04123679921030998, -0.017260650172829628, 0.02188890054821968, -0.04573800042271614, -0.014765025116503239, -0.04787969961762428, 0.03548325225710869, -0.009900825098156929, -0.03199845179915428, -0.014147925190627575, -0.027878399938344955, -0.015835875645279884, -0.025355549529194832, -0.023976150900125504, 0.05154599994421005, 0.007005900144577026, 0.0044059124775230885, -0.023830950260162354, -0.024556949734687805, 0.0788436010479927, 0.0048959627747535706, -0.011797499842941761, 0.016552800312638283, -0.05815260112285614, -0.028223250061273575, -0.0006318468949757516, -0.0017605500761419535, -0.021816300228238106, -0.07259999960660934, -0.0038455312605947256, 0.03343230113387108, 0.01723342575132847, -0.0072963000275194645, -0.05887860059738159, -0.03920400142669678, 0.0293122511357069, -0.015336750075221062, 0.047335200011730194, 0.001454268814995885, -0.03337785229086876, 0.006506775040179491, -0.010599600151181221, -0.042144302278757095, 0.03640890121459961, -0.0029697937425225973, 0.03225255012512207, 0.020999550819396973, 0.013213200494647026, -0.032179951667785645, 0.04464900121092796, -0.06305310130119324, -0.017832376062870026, -0.04900500178337097, 0.011007974855601788, 0.0196382999420166, 0.01844947598874569, -0.008439750410616398, -0.004258443601429462, -0.037116751074790955, 0.006869775243103504, -0.020836200565099716, 0.009782849811017513, -0.022397100925445557, 0.015291375108063221, 0.051001500338315964, -0.036681149154901505, 0.022487850859761238, 0.05927789956331253, 0.10650420188903809, -0.0005518734687939286, -0.0018785250140354037, 0.028513649478554726, 0.025573350489139557, -0.04348739981651306, 0.01576327532529831, -0.02408505044877529, -0.016761524602770805, 0.03851430118083954, 0.02312310039997101, -0.005449537653476, 0.00449666241183877, -0.03537435084581375, -0.03256110101938248, -0.032524801790714264, 0.0020305311772972345, -0.05303430184721947, 0.06428729742765427, -0.02061839960515499, -0.024847351014614105, 0.07935179769992828, -0.006479550153017044, 0.06980489939451218, -0.013884750194847584, -0.011761200614273548, -0.03455759957432747, 0.0017061000689864159, 0.0017106374725699425, -0.012940949760377407, -0.06171000003814697, -0.020273549482226372, 0.028005450963974, 0.021780000999569893, -0.05488559976220131, 0.048351600766181946, -0.0014951062621548772, -0.0051046875305473804, -0.013231350108981133, 0.01250535063445568, -0.01867634989321232, -0.004333312623202801, 0.01309522520750761, 0.02677125111222267, 0.013040775433182716, 0.022197449579834938, 0.027588000521063805, -0.004396837670356035, 0.02116290107369423, 0.03891360014677048, -0.038478001952171326, 0.051291901618242264, 0.06690090149641037, -0.021344400942325592, 0.01842224970459938, -0.0027588000521063805, -0.007432424928992987, -0.00603487528860569, -0.058080002665519714, 0.02639009989798069, 0.054123301059007645, -0.03395865112543106, 0.020836200565099716, -0.022941600531339645, -0.006856162566691637, 0.02018279954791069, 0.06269010156393051, -0.010526999831199646, 0.049948800355196, 0.017478451132774353, 0.025627801194787025, 0.028513649478554726, 0.021725550293922424, 0.040293000638484955, -0.011107800528407097, -0.01346729975193739, 0.049331702291965485, 0.024411750957369804, 0.01250535063445568, 0.02707980014383793, -0.00641602510586381, 0.012459974735975266, 0.016044599935412407, 0.01613534986972809, -0.006134700030088425, 0.012387375347316265, -0.047335200011730194, -0.02217929996550083, -0.040547098964452744, -0.01576327532529831, -0.004478512331843376, -0.039893701672554016, 0.08094900101423264, -0.010644975118339062, -0.055139701813459396, 0.006847087759524584, 0.024974400177598, 0.03568290174007416, 0.06112920120358467, 0.018086474388837814, 0.03192584961652756, 0.02315939962863922, 0.044685300439596176, -0.00916574988514185, 0.00175941560883075, 0.021344400942325592, 0.015282300300896168, 0.06523109972476959, -0.03826019912958145, -0.02315939962863922, 0.019075650721788406, 0.015118950046598911, -0.00027196641894988716, 0.02511960081756115, 0.020636551082134247, 0.05415960028767586, 0.012242174707353115, -0.08407080173492432, -0.011797499842941761, -0.0701678991317749, -0.01196992490440607, 0.0053996252827346325, 0.009583200328052044, -0.10229340195655823, -0.05401439964771271, 0.030582750216126442, 0.009673950262367725, -0.04308810085058212, 0.03855060040950775, -0.10120440274477005, -0.03557400032877922, -0.042398400604724884, 0.0386958010494709, -0.019293449819087982, 0.06141960248351097, 0.0028926562517881393, 0.004319699946790934, 0.03054645098745823, 0.037116751074790955, 0.034811701625585556, -0.03967589884996414, -0.06276270002126694, 0.03629999980330467, -0.046935901045799255, 0.007868025451898575, 0.019420500844717026, 0.003654956351965666, -0.03742530196905136, 0.07350750267505646, 0.02159850113093853, -0.010962599888443947, 0.0017866406124085188, -0.07056719809770584, 0.021580349653959274, 0.043523699045181274, -0.04915020242333412, 0.08944319933652878, -0.03412200137972832, -0.030274201184511185, 0.01383030042052269, 0.032905951142311096, 0.06312569975852966, 0.03573735058307648, 0.04827900230884552, -0.007945162244141102, 0.002500162459909916, -0.03297854959964752, -0.004591950215399265, 0.014719650149345398, -0.02639009989798069, -0.08537760376930237, 0.006171000190079212, -0.02531925030052662, 0.004959487356245518, 0.014765025116503239, -0.018458550795912743, -0.009592275135219097, -0.015454725362360477, -0.041273102164268494, 0.027188699692487717, 0.015545475296676159, 0.0021428344771265984, 0.04639140143990517, -0.0017219813307747245, 0.03341415151953697, -0.02272379957139492, 0.05590200051665306, -0.009320025332272053, 0.04944059997797012, -0.0065703000873327255, 0.022941600531339645, 0.005000324919819832, -0.0190575011074543, -0.039857398718595505, -0.01482855062931776, -0.02595449984073639, 0.06878849864006042, 0.02726130001246929, 0.01694302447140217, 0.01775977574288845, -0.02468400076031685, 0.00568094989284873 ]
42,998
linearmodels.iv.model
__init__
null
def __init__( self, dependent: IVDataLike, exog: IVDataLike, *, weights: IVDataLike | None = None, ): super().__init__(dependent, exog, None, None, weights=weights, kappa=0.0) self._result_container = OLSResults
(self, dependent: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, weights: Union[linearmodels.iv.data.IVData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None)
[ 0.047751374542713165, -0.08064044266939163, -0.01126228366047144, -0.0022622346878051758, 0.007777820341289043, -0.036071307957172394, -0.04376912862062454, -0.02225789986550808, 0.045618027448654175, 0.03514685854315758, -0.0035777974408119917, 0.047929152846336365, 0.006586703006178141, 0.00992894358932972, -0.0335824079811573, 0.06158256158232689, 0.00422891229391098, 0.03148461878299713, 0.018115654587745667, 0.043058015406131744, -0.03164461627602577, -0.01365340780466795, -0.045333582907915115, 0.08419601619243622, -0.000606114452239126, 0.028924603015184402, -0.03216017782688141, -0.0395735502243042, 0.03443574532866478, -0.05610697343945503, -0.03523574769496918, -0.0124000683426857, -0.0739559605717659, 0.03379574045538902, 0.037795763462781906, -0.008893381804227829, 0.01948455162346363, 0.045653585344552994, -0.014346745796501637, 0.05831143260002136, 0.023786796256899834, -0.04849804565310478, 0.014080077409744263, -0.008386712521314621, -0.03498685732483864, 0.023200126364827156, -0.020426778122782707, 0.0011555618839338422, 0.05447141081094742, -0.050595834851264954, -0.004933360498398542, 0.011546730063855648, 0.014080077409744263, 0.001384451985359192, -0.026435701176524162, 0.08213378489017487, 0.028924603015184402, 0.04764470458030701, 0.04138689488172531, -0.018222322687506676, -0.014568968676030636, -0.018826769664883614, 0.025777919217944145, 0.021369006484746933, -0.006471146829426289, 0.04917360469698906, -0.040924668312072754, 0.016773425042629242, 0.011626730673015118, 0.027733486145734787, 0.05511141195893288, -0.026009032502770424, -0.040426887571811676, 0.037866875529289246, 0.01712898351252079, 0.05500474572181702, -0.011715619824826717, -0.040640223771333694, -0.003817798802629113, -0.06396479904651642, -0.010275611653923988, -0.017893431708216667, -0.09806276112794876, -0.008435601368546486, -0.015395640395581722, -0.0628625676035881, -0.025813475251197815, -0.04945804923772812, 0.014986748807132244, 0.028835713863372803, -0.10396501421928406, 0.04600914195179939, -0.0395735502243042, 0.02247123420238495, 0.060373663902282715, 0.013795631006360054, -0.021333450451493263, -0.0854049101471901, 0.009591164067387581, -0.009315606206655502, 0.021546784788370132, -0.013760075904428959, 0.030542390421032906, 0.035271305590867996, -0.010284501127898693, -0.07701375335454941, -0.026275699958205223, -0.032906848937273026, 0.025457916781306267, -0.05955588072538376, -0.05653364211320877, 0.1070939227938652, -0.042666900902986526, 0.011973398737609386, -0.05710253491997719, 0.025066804140806198, 0.01087117101997137, 0.023360127583146095, -0.020657891407608986, 0.0535469613969326, 0.016622314229607582, 0.015502307564020157, -0.045795805752277374, 0.05358251556754112, 0.021671229973435402, -0.0015455640386790037, -0.0058755879290401936, -0.01760898530483246, -0.011804508976638317, -0.060195885598659515, 0.05130694806575775, -0.040391333401203156, -0.04017799720168114, 0.023377906531095505, 0.01697787083685398, 0.028391266241669655, 0.05464918911457062, 0.028142375871539116, -0.003735576057806611, 0.03143128380179405, 0.03404463082551956, 0.002886682515963912, -0.009377828799188137, -0.005213362164795399, 0.023644573986530304, 0.04849804565310478, -0.005128916818648577, -0.007933377288281918, 0.008257823064923286, 0.006102255545556545, 0.0006438924465328455, 0.01104006078094244, -0.020800113677978516, -0.060302551835775375, -0.03146683797240257, -0.020106777548789978, 0.03729798272252083, -0.03719131648540497, 0.045795805752277374, -0.043271347880363464, -0.02170678600668907, -0.028924603015184402, 0.02700459212064743, -0.02499569207429886, -0.012977848760783672, 0.02915571630001068, -0.05393807217478752, -0.028551267459988594, -0.020373445004224777, -0.0009972277330234647, -0.011520063504576683, -0.09422273933887482, -0.024071242660284042, -0.005111139267683029, -0.023840131238102913, 0.05482696741819382, 0.033386848866939545, 0.027911264449357986, 0.028053486719727516, -0.0025600141379982233, 0.023786796256899834, -0.021422339603304863, -0.09863165020942688, -0.006026699673384428, -0.010435612872242928, -0.006026699673384428, 0.015102305449545383, 0.016124533489346504, 0.002054455690085888, 0.005333362612873316, 0.026080142706632614, -0.02462235651910305, 0.016515646129846573, 0.009280051104724407, 0.005844476632773876, 0.002257790183648467, 0.028657935559749603, -0.02481791377067566, -0.0447646901011467, 0.03964466229081154, -0.010640058666467667, 0.016248978674411774, 0.010364501737058163, -0.02716459333896637, -0.025902364403009415, 0.04426690936088562, -0.04120911657810211, -0.010853393003344536, 0.002043344546109438, -0.047822482883930206, 0.048213597387075424, 0.011377840302884579, -0.017786763608455658, 0.00990227609872818, 0.00669781444594264, 0.011768953874707222, -0.04448024556040764, -0.011146727949380875, 0.03232017904520035, -0.014728969894349575, 0.05226695165038109, -0.04664914309978485, -0.03736909478902817, -0.01757342927157879, 0.009040049277245998, 0.009795608930289745, 0.06862259656190872, -0.027715707197785378, -0.0345601886510849, -0.017893431708216667, -0.013368962332606316, -0.03640908747911453, 0.0024000131525099277, -0.06140477955341339, -0.016017865389585495, 0.014035632833838463, -0.04864026606082916, 0.021209005266427994, -0.07722709327936172, -0.031235726550221443, 0.010195611044764519, -0.010071166791021824, -0.0014055633218958974, -0.03498685732483864, -0.021262338384985924, -0.05198250710964203, -0.0007016705349087715, 0.05216028541326523, -0.02197345346212387, -0.02711126022040844, 0.04465802386403084, -0.053049180656671524, -0.01736009493470192, -0.02177789807319641, 0.024160131812095642, -0.032960180193185806, 0.018720103427767754, -0.04362690448760986, 0.047715816646814346, -0.07850709557533264, -0.014942304231226444, -0.004706692416220903, -0.033635739237070084, 0.07530707865953445, -0.04988471791148186, 0.03189350664615631, -0.02179567515850067, -0.03505796939134598, 0.05418696254491806, 0.007573375012725592, 0.05987588316202164, 0.058133650571107864, 0.008373379707336426, -0.014648969285190105, -0.007426707539707422, 0.025440139696002007, -0.015502307564020157, -0.030560167506337166, -0.02693348191678524, 0.055324748158454895, 0.04988471791148186, -0.025653474032878876, -0.012124511413276196, -0.016435645520687103, -0.01368896383792162, -0.024035686627030373, -0.027644596993923187, -0.030062386766076088, 0.002010011114180088, -0.05016916245222092, 0.0067733703181147575, 0.09969832748174667, 0.04696914553642273, 0.025742363184690475, 0.03278240188956261, 0.0036822424735873938, 0.012142288498580456, 0.02458680234849453, 0.03914688155055046, 0.016728980466723442, -0.004933360498398542, -0.0397513285279274, 0.06136922538280487, -0.03719131648540497, -0.06090700253844261, -0.02673792466521263, 0.09585830569267273, -0.02976016327738762, -0.007195595186203718, 0.008777826093137264, 0.037795763462781906, 0.08305823057889938, -0.01731565035879612, 0.023040127009153366, -0.004028910771012306, -0.04195578396320343, 0.015084527432918549, -0.0546136312186718, 0.02474680170416832, 0.07416929304599762, -0.02430235594511032, -0.006973371375352144, -0.01991122029721737, -0.0598047710955143, -0.026097921654582024, 0.002644459018483758, 0.048391375690698624, -0.013315628282725811, 0.0399291068315506, -0.018737880513072014, -0.012871181592345238, -0.048071373254060745, 0.032942403107881546, -0.014151188544929028, -0.0390402153134346, -0.023520128801465034, 0.043342459946870804, -0.004102244507521391, 0.03744020685553551, 0.00737781822681427, 0.03918243572115898, -0.06456924229860306, -0.03708464652299881, 0.03857798874378204, -0.005368918180465698, -0.06108478084206581, 0.014275633729994297, -0.07480929791927338, 0.03480907902121544, -0.025813475251197815, -0.042844679206609726, 0.04675581306219101, 0.015128972008824348, 0.05660475417971611, 0.06154700368642807, 0.013875631615519524, -0.0248001366853714, 0.03783131763339043, 0.01206228882074356, -0.03907576948404312, -0.0390402153134346, 0.0004080577928107232, -0.033457960933446884, 0.030275721102952957, 0.0220267865806818, -0.040569111704826355, 0.06538702547550201, -0.030595723539590836, 0.0028777935076504946, 0.00990227609872818, -0.02460457943379879, -0.08170711249113083, -0.04426690936088562, 0.030720168724656105, 0.04920915886759758, 0.00857782457023859, -0.06666703522205353, -0.04135133698582649, -0.005106694530695677, -0.01968010887503624, 0.01471119187772274, -0.006444479804486036, 0.02472902461886406, 0.0003372240753378719, -0.03722687065601349, -0.012293401174247265, 0.021155672147870064, 0.02737792767584324, 0.04682692512869835, 0.021102337166666985, -0.0038666878826916218, -0.03498685732483864, 0.032995738089084625, 0.020622335374355316, 0.007560041267424822, 0.010906726121902466, 0.0005705587100237608, -0.031040171161293983, -0.05664031207561493, -0.01959121786057949, -0.011751175858080387, -0.038471322506666183, 0.00309335021302104, 0.04696914553642273, -0.02451569028198719, -0.05934254825115204, -0.018275655806064606, 0.035644639283418655, -0.0025955697055906057, -0.013662297278642654, -0.04430246353149414, -0.0014877859503030777, 0.0006155589362606406, -0.0124889574944973, -0.060089219361543655, 0.012657847255468369, 0.0219378974288702, 0.018826769664883614, 0.03694242611527443, 0.004355579614639282, 0.06456924229860306, 0.021546784788370132, 0.09856054186820984, 0.04615136608481407, 0.020871225744485855, 0.023235682398080826, 0.0040511335246264935, -0.035893529653549194, 0.03260462358593941, -0.04824915528297424, -0.05258695408701897, 0.05358251556754112, -0.020693447440862656, -0.05447141081094742, 0.028266821056604385, 0.01125339511781931, -0.03943132609128952, -0.016524534672498703, 0.023875687271356583, 0.04152911528944969, 0.008346712216734886, -0.005093361251056194, 0.05212473124265671, 0.0016833426197990775, -0.040462445467710495, 0.0015655641909688711, -0.017742319032549858, 0.03168017417192459, -0.021173449233174324, -0.0542580746114254, 0.09486274421215057, -0.02940460667014122, 0.05614253133535385, 0.01998233236372471, -0.05841809883713722, -0.02186678722500801, -0.025155693292617798, -0.035786863416433334, 0.0030089053325355053, 0.011440062895417213, -0.038400210440158844, -0.02972460724413395, 0.009360051713883877, -0.05688920244574547, -0.04401801899075508, 0.007973376661539078, 0.0335824079811573, -0.04117355868220329, 0.0057600317522883415, -0.0042711347341537476, 0.03475574776530266, 0.03690686821937561, 0.0673425942659378, -0.047893594950437546, 0.03370685130357742, 0.023822352290153503, -0.012417846359312534, -0.03900465741753578, 0.045155804604291916, -0.031093504279851913, 0.009431162849068642, 0.016017865389585495, 0.04910249263048172, -0.00014277856098487973, -0.01674675941467285, 0.014560080133378506, -0.008862270973622799, -0.028604600578546524, 0.04000021889805794, -0.004382246173918247, -0.04992027208209038, 0.10247167199850082, 0.002123344922438264, 0.027929041534662247, 0.015377862378954887, 0.04661358892917633, 0.04376912862062454, 0.02485346980392933, 0.06926260143518448, 0.007266706321388483, 0.03603575378656387, -0.02967127412557602, -0.027733486145734787, -0.05223139747977257, 0.010657836683094501, -0.05084472522139549, -0.043129123747348785, -0.02743126079440117, -0.04252467676997185, 0.0011522285640239716, -0.025457916781306267, -0.01992899738252163, 0.0496002733707428, -0.009048938751220703, 0.007155594881623983, -0.02716459333896637, -0.06328923255205154, 0.05660475417971611, -0.012791180983185768, -0.012577846646308899, 0.01704898290336132, 0.03413351997733116, 0.005928921513259411, -0.000738892937079072, 0.00498669408261776, -0.014604524709284306, -0.033546850085258484, -0.03729798272252083, 0.028960159048438072, 0.04142244905233383, -0.05112916976213455, -0.09493385255336761, -0.04448024556040764, 0.06631147861480713, -0.02199123241007328, 0.03530685976147652, -0.0032000176142901182, -0.0269512590020895, -0.0018677880289033055, -0.0067733703181147575, -0.013013404794037342, 0.0343824103474617, 0.0034711300395429134, -0.05635586380958557, 0.02958238497376442, 0.002244456671178341, -0.04106689244508743, 0.09692497551441193, -0.035449083894491196, -0.011973398737609386, -0.03173350915312767, -0.04448024556040764, -0.009706719778478146, 0.037795763462781906, 0.0049155824817717075, 0.011066727340221405, -0.008915604092180729, -0.023733463138341904, 0.023822352290153503, 0.03160906210541725, 0.03857798874378204, -0.009057827293872833, 0.03496908023953438, -0.014391190372407436, 0.04156467318534851, 0.02922682650387287, 0.0592714361846447, -0.010791170410811901, -0.045155804604291916, -0.012915626168251038, 0.015626752749085426, -0.043058015406131744, 0.01458674669265747, 0.009297829121351242, -0.022933458909392357, 0.003233351046219468, 0.010417834855616093, 0.01240895688533783, -0.020871225744485855, -0.03971577435731888, -0.050418052822351456, -0.012133399955928326, -0.015955643728375435, -0.06353812664747238, 0.04952916130423546, 0.013048960827291012, -0.04391135275363922, 0.04451579973101616, 0.017955653369426727, 0.03722687065601349, -0.01116450596600771, -0.00874671433120966, -0.04757359251379967, 0.0390402153134346, -0.011688953265547752, 0.002348901703953743, -0.06122700124979019, -0.03388462960720062, 0.05223139747977257, 0.009297829121351242, -0.05095139145851135, 0.04359135031700134, -0.008942271582782269, 0.012088955380022526, -0.006280034314841032, -0.0057600317522883415, -0.03971577435731888, 0.05077361315488815, -0.012942293658852577, 0.021191228181123734, 0.04721803590655327, 0.0054178074933588505, 0.025493472814559937, -0.010195611044764519, 0.0064044794999063015, -0.023111237213015556, -0.040711335837841034, 0.02945793978869915, 0.03719131648540497, -0.011928954161703587, -0.0003261129022575915, 0.0006550035905092955, 0.01343118492513895, 0.040853556245565414, -0.04608025401830673, 0.01228451170027256, 0.043378014117479324, -0.08049821853637695, 0.0077555980533361435, -0.010888949036598206, 0.015048971399664879, 0.0077555980533361435, 0.01685342565178871, 0.0011283395579084754, 0.026151254773139954, 0.018595658242702484, 0.05137806013226509, 0.015182305127382278, 0.038257986307144165, 0.0009522274485789239, -0.01116450596600771, 0.01934232749044895, 0.05251584202051163, 0.05208917334675789, 0.0108800595626235, -0.020746780559420586, -0.043449126183986664, 0.0027155703864991665, 0.0009394495864398777, 0.027769040316343307, -0.016471201553940773, 0.002297790488228202, -0.05585808306932449, 0.0029933496844023466, -0.024071242660284042, 0.024035686627030373, -0.0197867751121521, -0.015848975628614426, 0.06129811331629753, 0.01339562889188528, -0.04707581549882889, 0.028960159048438072, 0.023324571549892426, 0.021031226962804794, 0.06993816047906876, 0.0050489166751503944, 0.01766231842339039, -0.05191139504313469, 0.006368923932313919, 0.024160131812095642, -0.008880048990249634, 0.004117800388485193, 0.0196089968085289, 0.02917349338531494, 0.0006461146404035389, -0.008840048685669899, -0.006471146829426289, 0.04480024427175522, 0.015182305127382278, -0.0044200243428349495, 0.03907576948404312, 0.030293500050902367, 0.03754687309265137, -0.07850709557533264, -0.011946732178330421, -0.020231222733855247, -0.05852476507425308, 0.033120181411504745, 0.023449016734957695, -0.06097811087965965, -0.07424040883779526, -0.0036622423212975264, 0.030720168724656105, -0.022844569757580757, 0.006435590796172619, -0.06574258208274841, -0.0701870545744896, -0.11178728193044662, 0.025724586099386215, -0.0003977799497079104, 0.05240917578339577, 0.02945793978869915, -0.0108800595626235, 0.04842693358659744, 0.021084560081362724, 0.02225789986550808, -0.03635575622320175, -0.03397351875901222, 0.045440249145030975, -0.0750226303935051, 0.05084472522139549, 0.031004615128040314, -0.011920065619051456, -0.05969810485839844, 0.030400166288018227, 0.07687152922153473, 0.007933377288281918, 0.022862346842885017, -0.06709370017051697, 0.01109339389950037, 0.02001788839697838, -0.050133608281612396, 0.08248934149742126, 0.004173356108367443, -0.004113356117159128, 0.01112006139010191, 0.008248934522271156, 0.0019877885933965445, 0.05617808550596237, 0.0386846549808979, 0.010213389061391354, 0.00498669408261776, -0.026346812024712563, -0.026471257209777832, 0.0003277795622125268, -0.04227578639984131, -0.01492452621459961, 0.028497934341430664, 0.038329098373651505, 0.028675712645053864, -0.016097865998744965, -0.015600085258483887, -0.00984894298017025, -0.002065566834062338, 0.0008188933716155589, 0.015493418090045452, 0.011457840912044048, 0.0017888987204059958, 0.04252467676997185, -0.0017222316237166524, 0.014008965343236923, 0.00018805658328346908, 0.04636469855904579, 0.04241801053285599, 0.0494224950671196, 0.020871225744485855, 0.05585808306932449, -0.016871202737092972, -0.02238234505057335, -0.08078266680240631, -0.011573396623134613, -0.03911132737994194, 0.03450685739517212, -0.0008211156236939132, 0.03198239952325821, 0.028569046407938004, 0.05976921692490578, 0.011191172525286674 ]
43,010
linearmodels.panel.model
PanelOLS
One- and two-way fixed effects estimator for panel data Parameters ---------- dependent : array_like Dependent (left-hand-side) variable (time by entity). exog : array_like Exogenous or right-hand-side variables (variable by time by entity). weights : array_like Weights to use in estimation. Assumes residual variance is proportional to inverse of weight to that the residual time the weight should be homoskedastic. entity_effects : bool Flag whether to include entity (fixed) effects in the model time_effects : bool Flag whether to include time effects in the model other_effects : array_like Category codes to use for any effects that are not entity or time effects. Each variable is treated as an effect. singletons : bool Flag indicating whether to drop singleton observation drop_absorbed : bool Flag indicating whether to drop absorbed variables check_rank : bool Flag indicating whether to perform a rank check on the exogenous variables to ensure that the model is identified. Skipping this check can reduce the time required to validate a model specification. Results may be numerically unstable if this check is skipped and the matrix is not full rank. Notes ----- Many models can be estimated. The most common included entity effects and can be described .. math:: y_{it} = \alpha_i + \beta^{\prime}x_{it} + \epsilon_{it} where :math:`\alpha_i` is included if ``entity_effects=True``. Time effect are also supported, which leads to a model of the form .. math:: y_{it}= \gamma_t + \beta^{\prime}x_{it} + \epsilon_{it} where :math:`\gamma_i` is included if ``time_effects=True``. Both effects can be simultaneously used, .. math:: y_{it}=\alpha_i + \gamma_t + \beta^{\prime}x_{it} + \epsilon_{it} Additionally , arbitrary effects can be specified using categorical variables. If both ``entity_effect`` and ``time_effects`` are ``False``, and no other effects are included, the model reduces to :class:`PooledOLS`. Model supports at most 2 effects. These can be entity-time, entity-other, time-other or 2 other.
class PanelOLS(_PanelModelBase): r""" One- and two-way fixed effects estimator for panel data Parameters ---------- dependent : array_like Dependent (left-hand-side) variable (time by entity). exog : array_like Exogenous or right-hand-side variables (variable by time by entity). weights : array_like Weights to use in estimation. Assumes residual variance is proportional to inverse of weight to that the residual time the weight should be homoskedastic. entity_effects : bool Flag whether to include entity (fixed) effects in the model time_effects : bool Flag whether to include time effects in the model other_effects : array_like Category codes to use for any effects that are not entity or time effects. Each variable is treated as an effect. singletons : bool Flag indicating whether to drop singleton observation drop_absorbed : bool Flag indicating whether to drop absorbed variables check_rank : bool Flag indicating whether to perform a rank check on the exogenous variables to ensure that the model is identified. Skipping this check can reduce the time required to validate a model specification. Results may be numerically unstable if this check is skipped and the matrix is not full rank. Notes ----- Many models can be estimated. The most common included entity effects and can be described .. math:: y_{it} = \alpha_i + \beta^{\prime}x_{it} + \epsilon_{it} where :math:`\alpha_i` is included if ``entity_effects=True``. Time effect are also supported, which leads to a model of the form .. math:: y_{it}= \gamma_t + \beta^{\prime}x_{it} + \epsilon_{it} where :math:`\gamma_i` is included if ``time_effects=True``. Both effects can be simultaneously used, .. math:: y_{it}=\alpha_i + \gamma_t + \beta^{\prime}x_{it} + \epsilon_{it} Additionally , arbitrary effects can be specified using categorical variables. If both ``entity_effect`` and ``time_effects`` are ``False``, and no other effects are included, the model reduces to :class:`PooledOLS`. Model supports at most 2 effects. These can be entity-time, entity-other, time-other or 2 other. """ def __init__( self, dependent: PanelDataLike, exog: PanelDataLike, *, weights: PanelDataLike | None = None, entity_effects: bool = False, time_effects: bool = False, other_effects: PanelDataLike | None = None, singletons: bool = True, drop_absorbed: bool = False, check_rank: bool = True, ) -> None: super().__init__(dependent, exog, weights=weights, check_rank=check_rank) self._entity_effects = entity_effects self._time_effects = time_effects self._other_effect_cats: PanelData | None = None self._singletons = singletons self._other_effects = self._validate_effects(other_effects) self._has_effect = entity_effects or time_effects or self.other_effects self._drop_absorbed = drop_absorbed self._singleton_index = None self._drop_singletons() def _collect_effects(self) -> NumericArray: if not self._has_effect: return np.empty((self.dependent.shape[0], 0)) effects = [] if self.entity_effects: effects.append(np.asarray(self.dependent.entity_ids).squeeze()) if self.time_effects: effects.append(np.asarray(self.dependent.time_ids).squeeze()) if self.other_effects: assert self._other_effect_cats is not None other = self._other_effect_cats.dataframe for col in other: effects.append(np.asarray(other[col]).squeeze()) return np.column_stack(effects) def _drop_singletons(self) -> None: if self._singletons or not self._has_effect: return effects = self._collect_effects() retain = in_2core_graph(effects) if np.all(retain): return import warnings as warn nobs = retain.shape[0] ndropped = nobs - retain.sum() warn.warn( f"{ndropped} singleton observations dropped", SingletonWarning, stacklevel=3, ) drop = ~retain self._singleton_index = cast(BoolArray, drop) self.dependent.drop(drop) self.exog.drop(drop) self.weights.drop(drop) if self.other_effects: assert self._other_effect_cats is not None self._other_effect_cats.drop(drop) # Reverify exog matrix self._check_exog_rank() def __str__(self) -> str: out = super().__str__() additional = ( "\nEntity Effects: {ee}, Time Effects: {te}, Num Other Effects: {oe}" ) oe = 0 if self.other_effects: assert self._other_effect_cats is not None oe = self._other_effect_cats.nvar additional = additional.format( ee=self.entity_effects, te=self.time_effects, oe=oe ) out += additional return out def _validate_effects(self, effects: PanelDataLike | None) -> bool: """Check model effects""" if effects is None: return False effects = PanelData(effects, var_name="OtherEffect", convert_dummies=False) if effects.shape[1:] != self._original_shape[1:]: raise ValueError( "other_effects must have the same number of " "entities and time periods as dependent." ) num_effects = effects.nvar if num_effects + self.entity_effects + self.time_effects > 2: raise ValueError("At most two effects supported.") cats = {} effects_frame = effects.dataframe for col in effects_frame: cat = Categorical(effects_frame[col]) # TODO: Bug in pandas-stube # https://github.com/pandas-dev/pandas-stubs/issues/111 cats[col] = cat.codes.astype(np.int64) # type: ignore cats_df = DataFrame(cats, index=effects_frame.index) cats_df = cats_df[effects_frame.columns] other_effects = PanelData(cats_df) other_effects.drop(~self.not_null) self._other_effect_cats = other_effects cats_array = other_effects.values2d nested = False nesting_effect = "" if cats_array.shape[1] == 2: nested = self._is_effect_nested(cats_array[:, [0]], cats_array[:, [1]]) nested |= self._is_effect_nested(cats_array[:, [1]], cats_array[:, [0]]) nesting_effect = "other effects" elif self.entity_effects: nested = self._is_effect_nested( cats_array[:, [0]], self.dependent.entity_ids ) nested |= self._is_effect_nested( self.dependent.entity_ids, cats_array[:, [0]] ) nesting_effect = "entity effects" elif self.time_effects: nested = self._is_effect_nested(cats_array[:, [0]], self.dependent.time_ids) nested |= self._is_effect_nested( self.dependent.time_ids, cats_array[:, [0]] ) nesting_effect = "time effects" if nested: raise ValueError( "Included other effects nest or are nested " "by {effect}".format(effect=nesting_effect) ) return True @property def entity_effects(self) -> bool: """Flag indicating whether entity effects are included""" return self._entity_effects @property def time_effects(self) -> bool: """Flag indicating whether time effects are included""" return self._time_effects @property def other_effects(self) -> bool: """Flag indicating whether other (generic) effects are included""" return self._other_effects @classmethod def from_formula( cls, formula: str, data: PanelData
(dependent: 'PanelDataLike', exog: 'PanelDataLike', *, weights: 'PanelDataLike | None' = None, entity_effects: 'bool' = False, time_effects: 'bool' = False, other_effects: 'PanelDataLike | None' = None, singletons: 'bool' = True, drop_absorbed: 'bool' = False, check_rank: 'bool' = True) -> 'None'
[ 0.011971335858106613, -0.04016255959868431, -0.030565112829208374, 0.058114469051361084, 0.02563394233584404, -0.04686650633811951, -0.06830283999443054, -0.016984013840556145, 0.018084358423948288, 0.0034131042193621397, -0.008925013244152069, 0.030870763584971428, 0.0189198050647974, 0.013285635970532894, -0.031420934945344925, 0.028160657733678818, -0.02247554622590542, 0.021721607074141502, 0.026652779430150986, -0.03606683388352394, -0.005603604018688202, -0.009678952395915985, -0.02899610437452793, -0.010407420806586742, 0.014284096658229828, -0.0011417343048378825, -0.0426688976585865, 0.012012089602649212, -0.025144899263978004, -0.050249047577381134, -0.01944960094988346, -0.018298314884305, -0.04319869354367256, -0.020081279799342155, -0.0017574940575286746, -0.04446205124258995, 0.009174628183245659, 0.03241939842700958, 0.0004489251004997641, 0.018369633704423904, 0.02536904439330101, -0.04927096143364906, 0.0643090009689331, -0.0061181169003248215, -0.06891414523124695, -0.004103366285562515, -0.01414145901799202, 0.09275493025779724, -0.007799197919666767, -0.021762359887361526, 0.014946340583264828, -0.014997282065451145, 0.028364425525069237, 0.017401738092303276, 0.035964950919151306, 0.06007063388824463, 0.006347354967147112, 0.0643090009689331, 0.05945933237671852, -0.06047816947102547, 0.0314616896212101, 0.04808911308646202, 0.014294284395873547, -0.006204717792570591, -0.005231728311628103, -0.013693170621991158, -0.00021570692479144782, 0.014396168291568756, 0.001148102106526494, -0.0044344887137413025, -0.050045277923345566, -0.009923473000526428, 0.02840517833828926, 0.024941131472587585, -0.013550533913075924, -0.05925556644797325, 0.04307643324136734, -0.0489041805267334, 0.03798224776983261, -0.004144120030105114, -0.003863939782604575, -0.010178182274103165, -0.04101838171482086, 0.032134123146533966, 0.02418719232082367, -0.0705442801117897, -0.007814480923116207, 0.03730981424450874, 0.02498188614845276, -0.06928092241287231, -0.028384801000356674, 0.04193533584475517, 0.01708589866757393, -0.002142105018720031, 0.012837347574532032, 0.03620947152376175, -0.008252580650150776, -0.05607679486274719, 0.012297363951802254, -0.008466536179184914, -0.0292813777923584, 0.03117641620337963, -0.0327046699821949, 0.041588932275772095, -0.022088387981057167, -0.009052367880940437, -0.052286721765995026, 0.018461327999830246, -0.04089612141251564, -0.05314254388213158, -0.010544964112341404, 0.037880364805459976, -0.030605867505073547, -0.01602630689740181, -0.01564933732151985, -0.04348396882414818, -0.050656579434871674, -0.004431941546499729, -0.04368773475289345, 0.021028798073530197, -0.019317151978611946, 0.004679009318351746, -0.0574624128639698, 0.03376426175236702, 0.06145625561475754, 0.006602064240723848, 0.007162424735724926, -0.012022278271615505, 0.02604147605597973, -0.05028979852795601, -0.06333091109991074, -0.01935790479183197, -0.009037084877490997, 0.02781425230205059, 0.03779885545372963, 0.005134939216077328, -0.009464996866881847, -0.02854781597852707, -0.03064662031829357, 0.030748503282666206, 0.0189198050647974, 0.036250222474336624, -0.010942310094833374, 0.022740444168448448, -0.006561310961842537, -0.010443080216646194, 0.036902278661727905, -0.06202680245041847, -0.028690453618764877, 0.015506700612604618, -0.028649698942899704, -0.032134123146533966, -0.02463548071682453, -0.018940182402729988, 0.0034487636294215918, -0.002722842153161764, -0.025185653939843178, -0.04069235548377037, 0.0146406888961792, -0.0021026250906288624, -0.09503712505102158, -0.06708023697137833, 0.005593415815383196, 0.024085309356451035, -0.007055446971207857, 0.017014579847455025, -0.0009647113620303571, -0.07184839248657227, 0.016158755868673325, 0.0462552048265934, 0.0032297135330736637, 0.007687125820666552, 0.028975727036595345, -0.021354826167225838, -0.0904727354645729, 0.09650424867868423, -0.01371354702860117, -0.025022638961672783, -0.009551597759127617, -0.004638256039470434, -0.014070140197873116, 0.006347354967147112, -0.0758422315120697, 0.004429394379258156, -0.03162470459938049, -0.002911326941102743, 0.02563394233584404, -0.034721966832876205, 0.032602787017822266, 0.06500180810689926, -0.03235826641321182, -0.011655496433377266, 0.04230211675167084, -0.011543424800038338, 0.009240852668881416, 0.002676994539797306, 0.02404455654323101, -0.044828832149505615, 0.08631587773561478, -0.001253806403838098, -0.038878824561834335, -0.012939231470227242, 0.018053794279694557, 0.014029387384653091, -0.05208295211195946, 0.04927096143364906, 0.002521621761843562, 0.023555513471364975, -0.07282647490501404, -0.04177232086658478, -0.035964950919151306, 0.0020414949394762516, 0.0053845541551709175, 0.009964226745069027, 0.0887610912322998, -0.014671253971755505, 0.009082932956516743, -0.00007219416147563607, 0.0012283354299142957, 0.008889353834092617, -0.005858313292264938, -0.0001137436120188795, -0.10000904649496078, 0.04478807747364044, 0.004770704545080662, 0.006036609876900911, 0.007136953994631767, 0.07103332132101059, 0.08378916233778, -0.019256021827459335, -0.01354034524410963, 0.03832865133881569, 0.003094717627391219, -0.02549130469560623, 0.08501176536083221, 0.009989697486162186, -0.008792564272880554, 0.0006730692693963647, 0.021028798073530197, -0.002901138737797737, -0.04140553995966911, -0.076942577958107, 0.01380524318665266, -0.014131270349025726, -0.012898477725684643, -0.009948944672942162, 0.053224049508571625, 0.0583997443318367, -0.016036495566368103, -0.004103366285562515, 0.04466581717133522, 0.014090517535805702, -0.019042065367102623, 0.026795415207743645, 0.010111958719789982, -0.06349392980337143, 0.06561310589313507, 0.007340721320360899, 0.008288240060210228, -0.08277032524347305, -0.012603014707565308, -0.01723872311413288, -0.02392229437828064, -0.004380999598652124, -0.0531017892062664, -0.009011614136397839, 0.011105324141681194, -0.027202950790524483, 0.036963410675525665, 0.019622802734375, -0.06414598226547241, 0.037696972489356995, -0.04421753063797951, -0.0016632515471428633, -0.029892681166529655, -0.001650516060180962, 0.02781425230205059, -0.03331597149372101, 0.027467848733067513, 0.04299492761492729, -0.009678952395915985, -0.0387769415974617, -0.024350207298994064, 0.015802163630723953, 0.0020389477722346783, -0.06777304410934448, -0.0404885858297348, -0.03237864375114441, 0.04486958682537079, 0.009449713863432407, -0.024472467601299286, 0.026673154905438423, 0.07180763781070709, -0.007682031951844692, -0.0353536456823349, -0.017727766185998917, -0.006917904131114483, 0.0014098158571869135, -0.01420258916914463, -0.02630637399852276, 0.02430945262312889, 0.010030451230704784, 0.036250222474336624, 0.003145659575238824, -0.011910205706954002, -0.04923021048307419, 0.06924016773700714, -0.05147165060043335, 0.05342781916260719, 0.01809454709291458, 0.03633173182606697, 0.02952589839696884, -0.026917675510048866, 0.05742165818810463, 0.02854781597852707, -0.012042654678225517, -0.026530517265200615, -0.019908076152205467, 0.04605143889784813, 0.10392138361930847, 0.01909300684928894, -0.031808093190193176, 0.002255450701341033, 0.03382539004087448, 0.0295870304107666, -0.020081279799342155, 0.08162923157215118, -0.007768632844090462, 0.032949190586805344, -0.013071680441498756, -0.09471109509468079, -0.04275040328502655, 0.02359626814723015, 0.03900108486413956, 0.015628961846232414, -0.059622347354888916, -0.009490467607975006, -0.035964950919151306, 0.09552616626024246, -0.0015932065434753895, 0.05713638663291931, 0.010392138734459877, -0.0549764484167099, 0.03932711109519005, 0.06614290177822113, -0.06092645972967148, 0.07005523890256882, 0.0348849818110466, 0.04128327965736389, 0.050575073808431625, 0.03323446586728096, -0.0007093653548508883, 0.013407896272838116, 0.0506158284842968, -0.008364652283489704, 0.036372482776641846, -0.001972723286598921, 0.031074531376361847, -0.026469387114048004, -0.006230188999325037, 0.052490487694740295, -0.03671889007091522, -0.005970385391265154, 0.035700052976608276, 0.009521032683551311, -0.0002112494985340163, 0.024920755997300148, -0.03851204365491867, 0.003499705344438553, -0.039673518389463425, -0.011472105979919434, -0.018817922100424767, 0.019694121554493904, -0.006041704211384058, -0.030809633433818817, 0.056525081396102905, 0.015506700612604618, -0.00416194973513484, 0.06536858528852463, -0.0593370720744133, 0.04861890524625778, -0.03759508952498436, -0.06834359467029572, 0.03025946207344532, 0.019643180072307587, 0.017187781631946564, 0.03462008386850357, -0.029566653072834015, 0.01770738884806633, -0.03510912507772446, 0.08232203871011734, -0.030177954584360123, 0.04193533584475517, -0.05477268248796463, -0.028364425525069237, -0.009495561942458153, -0.014834268018603325, 0.04140553995966911, -0.026510141789913177, 0.001994373742491007, -0.012735463678836823, -0.03739131987094879, 0.048863425850868225, 0.011176642961800098, -0.07221517711877823, -0.03464046120643616, 0.006479803938418627, 0.08065114170312881, -0.03963276371359825, 0.0696069523692131, 0.009261229075491428, 0.03614833950996399, -0.048537399619817734, -0.019836759194731712, 0.017096087336540222, -0.026449011638760567, -0.008853694424033165, -0.024492843076586723, 0.051634665578603745, 0.013336577452719212, 0.0319303534924984, 0.045358628034591675, 0.06691721826791763, 0.029057234525680542, -0.0266324020922184, 0.0013219411484897137, -0.08122169226408005, 0.051634665578603745, -0.02946476824581623, 0.037167176604270935, -0.002353513613343239, -0.004737592302262783, -0.06944393366575241, -0.06092645972967148, 0.046744246035814285, -0.03763584420084953, -0.018369633704423904, 0.02926100231707096, -0.015751222148537636, 0.04772232845425606, -0.003863939782604575, 0.04519561305642128, 0.03329559788107872, 0.02412606216967106, -0.020132221281528473, -0.016810812056064606, -0.0060926456935703754, 0.00805900152772665, -0.05134939029812813, -0.007529206108301878, 0.0489041805267334, 0.06337166577577591, 0.02115105837583542, 0.022557053714990616, -0.01188982930034399, -0.006051892414689064, 0.03111528605222702, -0.04075348377227783, -0.021721607074141502, -0.024676235392689705, -0.03991803899407387, -0.021843867376446724, -0.00772787956520915, 0.01903187669813633, 0.0030157577712088823, -0.013856184668838978, 0.019663555547595024, -0.055669259279966354, -0.025980345904827118, 0.0244520902633667, -0.0014200041769072413, -0.005837936419993639, 0.024329829961061478, -0.037106048315763474, -0.05240898206830025, 0.005140033084899187, -0.0018211713759228587, 0.012541884556412697, 0.02060088701546192, 0.003122735768556595, 0.03278617933392525, -0.04032557085156441, -0.010616282932460308, -0.01424334291368723, -0.013469026423990726, -0.02483924850821495, 0.038613926619291306, -0.010677413083612919, 0.0531017892062664, -0.006184341385960579, -0.04114064201712608, -0.020040525123476982, 0.035577792674303055, 0.022434793412685394, -0.03957163169980049, 0.011074759066104889, -0.009291794151067734, -0.03184884786605835, 0.03138018399477005, -0.040081050246953964, 0.02846630848944187, 0.003204242791980505, -0.04902644082903862, -0.007203178480267525, 0.00044160219840705395, -0.07698333263397217, 0.00591434957459569, 0.007554677315056324, -0.0175953172147274, -0.02490037865936756, 0.006454333197325468, -0.04413602501153946, 0.016077250242233276, -0.030626242980360985, 0.029159117490053177, -0.027773499488830566, 0.0011716627050191164, 0.05424288660287857, 0.002664258936420083, -0.014508239924907684, 0.017839837819337845, -0.05848124995827675, 0.005127297714352608, 0.012022278271615505, 0.010983063839375973, 0.020040525123476982, -0.030809633433818817, 0.002091163070872426, 0.011523047462105751, -0.00925104133784771, -0.018308503553271294, -0.06997372955083847, 0.007992777042090893, 0.06862886995077133, -0.006836397107690573, -0.017197970300912857, -0.002717748051509261, -0.07649429142475128, -0.02648976445198059, 0.0383082740008831, -0.016607044264674187, 0.0001252851216122508, 0.027528978884220123, -0.011166454292833805, 0.011767568998038769, -0.032215628772974014, 0.021578969433903694, 0.001879754476249218, -0.05383535102009773, 0.020376741886138916, -0.03453857824206352, -0.0007329259533435106, 0.00045274573494680226, 0.011533236131072044, 0.07971381396055222, -0.026530517265200615, 0.002641335129737854, 0.010911745019257069, -0.037044916301965714, 0.030666997656226158, -0.023759281262755394, -0.06500180810689926, 0.05126788467168808, -0.03724868595600128, -0.015924423933029175, 0.0016008478123694658, 0.02972966618835926, 0.02035636454820633, -0.028853466734290123, 0.003937805537134409, 0.02689730003476143, 0.03602607920765877, -0.02669353224337101, 0.04059046879410744, -0.026999182999134064, -0.004956642631441355, 0.05391686037182808, -0.017401738092303276, -0.006428861990571022, -0.001696363789960742, 0.002720294985920191, -0.008415594696998596, -0.024024179205298424, -0.017330419272184372, 0.04262814298272133, 0.039143722504377365, -0.004699386190623045, 0.07364154607057571, 0.05261274799704552, 0.0019154137698933482, 0.006602064240723848, 0.028894219547510147, -0.020234104245901108, -0.014671253971755505, 0.007799197919666767, 0.058440495282411575, -0.025593187659978867, 0.003599042072892189, 0.03464046120643616, 0.016933072358369827, -0.014070140197873116, -0.0016428747912868857, 0.030707750469446182, -0.02430945262312889, 0.006021327339112759, -0.055587753653526306, 0.027855006977915764, 0.021171435713768005, 0.03537402302026749, -0.0004097635392099619, -0.022557053714990616, -0.005807371344417334, 0.013092056848108768, -0.04389150068163872, 0.009755365550518036, -0.06047816947102547, -0.05261274799704552, 0.024696610867977142, 0.06170077621936798, -0.03358086943626404, -0.0079825883731246, 0.02345363050699234, -0.03692265599966049, 0.022231025621294975, -0.02292383462190628, -0.03190997987985611, 0.028833089396357536, -0.11720702052116394, 0.02384078875184059, -0.06324940919876099, 0.011380410753190517, 0.05954084172844887, -0.004421752877533436, -0.02642863430082798, 0.014284096658229828, 0.03256203234195709, 0.023637020960450172, 0.020845407620072365, 0.018125111237168312, 0.007926552556455135, 0.024676235392689705, -0.026469387114048004, -0.0012480755103752017, 0.03879731521010399, -0.02147708646953106, 0.010667224414646626, -0.02451322041451931, -0.009729894809424877, 0.014834268018603325, 0.012694709934294224, -0.01321431715041399, -0.0009768101153895259, -0.05852200463414192, -0.013387519866228104, 0.04022368788719177, 0.024146439507603645, 0.0513901449739933, -0.017197970300912857, 0.047803837805986404, 0.0029928339645266533, 0.01906244270503521, 0.022964587435126305, 0.03380501642823219, 0.03282693028450012, 0.1167994886636734, -0.011991712264716625, 0.032663919031620026, 0.00804371852427721, 0.08089566975831985, 0.05240898206830025, -0.0020007414277642965, -0.050452813506126404, -0.02412606216967106, 0.017748141661286354, 0.019052254036068916, -0.045562393963336945, 0.07176688313484192, 0.08154772222042084, 0.011777756735682487, -0.0027686897665262222, 0.06577612459659576, 0.0380026251077652, -0.005517003126442432, -0.056321315467357635, 0.07282647490501404, -0.0007068182458169758, 0.0010602273978292942, -0.019632991403341293, 0.0023254957050085068, -0.05725864693522453, -0.02404455654323101, 0.016535725444555283, -0.00925104133784771, -0.0091491574421525, 0.03417179733514786, -0.09397753328084946, -0.024146439507603645, -0.033866144716739655, 0.01567990332841873, 0.017075709998607635, 0.002898591570556164, -0.0014289190294221044, -0.025593187659978867, 0.024411337450146675, 0.0007583968690596521, 0.06178228184580803, -0.046214450150728226, 0.00448543019592762, 0.06186378747224808, -0.07914326339960098, -0.025124523788690567, 0.1048179641366005, 0.06060042977333069, 0.0009233211167156696, 0.023351745679974556, -0.02121218852698803, 0.0265508946031332, 0.010504210367798805, -0.05171617120504379, 0.01741192676126957, 0.013672794215381145, 0.053753845393657684, 0.00483183516189456, 0.01294941920787096, -0.03209336847066879, 0.006856773514300585, 0.007519017904996872, -0.02265893667936325, 0.04804835841059685, -0.04336170852184296, 0.03553703799843788, 0.01315318699926138, -0.011227584443986416, -0.047926098108291626, 0.004819099325686693, -0.07914326339960098, -0.0032704670447856188, -0.01988770067691803, -0.05803295969963074, -0.014233154244720936, -0.06357543170452118, -0.08631587773561478, -0.03851204365491867, -0.04146667197346687, -0.02265893667936325, 0.04262814298272133, 0.032276760786771774, 0.017992664128541946, 0.00035945847048424184, -0.016953449696302414, 0.06487954407930374, -0.017014579847455025, -0.003960729110985994, -0.0059500085189938545, 0.062271323055028915, 0.007758444640785456, 0.022821951657533646, -0.024024179205298424, -0.0395512580871582, -0.06854736059904099, -0.022944211959838867, -0.024003801867365837, 0.0699329823255539, 0.04063122346997261, 0.04150742292404175, 0.003958181943744421, -0.012990172952413559, 0.028792336583137512 ]
43,011
linearmodels.panel.model
__init__
null
def __init__( self, dependent: PanelDataLike, exog: PanelDataLike, *, weights: PanelDataLike | None = None, entity_effects: bool = False, time_effects: bool = False, other_effects: PanelDataLike | None = None, singletons: bool = True, drop_absorbed: bool = False, check_rank: bool = True, ) -> None: super().__init__(dependent, exog, weights=weights, check_rank=check_rank) self._entity_effects = entity_effects self._time_effects = time_effects self._other_effect_cats: PanelData | None = None self._singletons = singletons self._other_effects = self._validate_effects(other_effects) self._has_effect = entity_effects or time_effects or self.other_effects self._drop_absorbed = drop_absorbed self._singleton_index = None self._drop_singletons()
(self, dependent: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], exog: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series], *, weights: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, entity_effects: bool = False, time_effects: bool = False, other_effects: Union[linearmodels.panel.data.PanelData, numpy.ndarray, pandas.core.frame.DataFrame, pandas.core.series.Series, NoneType] = None, singletons: bool = True, drop_absorbed: bool = False, check_rank: bool = True) -> NoneType
[ -0.0026051714085042477, -0.04283758997917175, -0.038831714540719986, 0.0615316703915596, -0.007141102105379105, -0.01684452034533024, -0.05038018152117729, 0.009599662385880947, -0.0018495589029043913, 0.017665544524788857, 0.004583297297358513, 0.09426435083150864, 0.016564831137657166, 0.009527483955025673, -0.034122105687856674, 0.015635540708899498, 0.018820390105247498, 0.06030464544892311, -0.0020198537968099117, -0.013894247822463512, -0.000541898247320205, 0.010844730772078037, -0.03854300454258919, 0.033941663801670074, -0.004786297678947449, 0.05211245268583298, -0.08791269361972809, 0.034013841301202774, -0.010943975299596786, -0.038939982652664185, -0.007668903097510338, -0.00826888158917427, -0.05268987640738487, 0.031577836722135544, 0.029051609337329865, -0.0032795837614685297, 0.0022194706834852695, 0.07535374164581299, -0.05846410617232323, 0.05167938396334648, 0.06791941076517105, -0.05528828129172325, 0.08560299873352051, 0.012748423032462597, -0.035060420632362366, 0.023024752736091614, 0.027535872533917427, 0.046302128583192825, -0.024450266733765602, -0.04810657724738121, 0.005453943274915218, 0.010050773620605469, 0.05189591646194458, 0.008535037748515606, 0.02980947680771351, 0.06355264782905579, 0.04164665564894676, 0.07535374164581299, 0.05157111585140228, -0.030152322724461555, -0.015058116987347603, 0.029105743393301964, 0.02834787406027317, -0.01979479193687439, -0.007971148006618023, 0.010249263606965542, -0.060954246670007706, -0.014958871528506279, -0.012116867117583752, 0.009536506608128548, 0.01171086635440588, 0.014625049196183681, -0.004596830811351538, 0.040130916982889175, -0.01668212004005909, -0.027463695034384727, 0.052617695182561874, -0.03249810263514519, 0.028113296255469322, -0.022717997431755066, 0.007001257501542568, -0.02242928557097912, -0.08488122373819351, 0.05265378579497337, 0.011638687923550606, -0.06831639260053635, -0.014895716682076454, 0.005877988412976265, 0.014625049196183681, -0.046302128583192825, -0.07621987164020538, 0.027481740340590477, -0.0041750408709049225, -0.014228071086108685, 0.05272596329450607, 0.02611035853624344, -0.008801193907856941, -0.053556010127067566, 0.01299202349036932, 0.017900122329592705, -0.030260588973760605, 0.002368337707594037, -0.0186760351061821, 0.015274650417268276, -0.01990305818617344, -0.04323456808924675, -0.031090635806322098, -0.012874734587967396, -0.08856229484081268, -0.07127568870782852, -0.01689865253865719, 0.05095760524272919, -0.026778005063533783, 0.0247028898447752, -0.027463695034384727, -0.017070075497031212, -0.02089550532400608, -0.03312966227531433, -0.022916486486792564, 0.007150124292820692, -0.014065670780837536, 0.020624838769435883, -0.05070498213171959, 0.06860510259866714, 0.0495140478014946, 0.017936211079359055, 0.004224663134664297, -0.010050773620605469, 0.0034126618411391973, -0.03792949020862579, -0.009762062691152096, -0.03233570232987404, -0.042657144367694855, 0.01245068944990635, 0.025478802621364594, 0.00551258772611618, 0.04965840280056, 0.004962231498211622, -0.05416952073574066, 0.020029369741678238, 0.026326892897486687, -0.006892990320920944, -0.01298300176858902, 0.04179101064801216, -0.019469991326332092, 0.016709186136722565, -0.01181011088192463, -0.06885772943496704, 0.008882394060492516, 0.026290804147720337, -0.021310528740286827, -0.007817770354449749, -0.04027527570724487, -0.022663863375782967, -0.027770450338721275, -0.00458780862390995, -0.024486355483531952, -0.03345446288585663, 0.03430255129933357, 0.021887950599193573, -0.07138395309448242, -0.03495215252041817, 0.017070075497031212, 0.00560732139274478, -0.036522023379802704, 0.01968652568757534, 0.004206618759781122, -0.09108852595090866, 0.02858245186507702, 0.032714638859033585, 0.023728488013148308, -0.03818211331963539, 0.04604950547218323, 0.009328994899988174, -0.09383128583431244, 0.04594124108552933, 0.007434324827045202, 0.009008705615997314, 0.005968211218714714, -0.025677291676402092, 0.00522838719189167, -0.008277904242277145, -0.05954677611589432, -0.025460757315158844, 0.001263113459572196, -0.014327315613627434, 0.02955685369670391, 0.0038885849062353373, 0.04651866480708122, 0.0617842897772789, 0.0040442184545099735, -0.01231535617262125, 0.008774126879870892, -0.020733105018734932, 0.018206877633929253, 0.007903480902314186, 0.025460757315158844, -0.059979844838380814, 0.014733316376805305, 0.025496846064925194, -0.016294162720441818, -0.003417172934859991, 0.026886271312832832, -0.007488458417356014, -0.022555597126483917, 0.08300459384918213, 0.008805705234408379, 0.05409734323620796, -0.05308685451745987, -0.055035658180713654, 0.012586022727191448, -0.026597559452056885, 0.01979479193687439, 0.009527483955025673, 0.04226016625761986, -0.040239185094833374, -0.042584966868162155, 0.001752569922246039, 0.03569197654724121, 0.002731482731178403, 0.009825218468904495, 0.011467265896499157, -0.08776833862066269, 0.04965840280056, 0.006342634093016386, 0.015175405889749527, 0.03356272727251053, 0.02354804426431656, 0.02329542115330696, -0.018288077786564827, -0.03338228538632393, 0.011665754951536655, 0.01107930950820446, -0.03208308294415474, 0.05633486062288284, 0.01284766849130392, -0.013370958156883717, -0.02367435395717621, -0.020209815353155136, 0.004240452311933041, -0.011169531382620335, -0.05056062713265419, 0.028708763420581818, -0.042693234980106354, -0.0008074903744272888, -0.016691142693161964, 0.028780942782759666, 0.06571798771619797, -0.01666407473385334, -0.0060539222322404385, 0.004186318721622229, 0.006662923377007246, -0.036305490881204605, -0.016086651012301445, 0.010429708287119865, -0.02466680109500885, 0.026705827564001083, -0.040239185094833374, -0.0077230362221598625, -0.09996640682220459, -0.011575532145798206, -0.0058464109897613525, -0.03540326654911041, 0.028185473755002022, -0.04060007631778717, -0.002456304617226124, 0.002458560047671199, -0.02948467619717121, 0.0245044007897377, 0.000943387858569622, -0.026850182563066483, 0.035349130630493164, 0.030260588973760605, -0.011259754188358784, -0.04161056503653526, -0.007262902334332466, 0.026543427258729935, -0.045111194252967834, 0.019036924466490746, 0.04417288303375244, 0.038759537041187286, -0.031686101108789444, -0.017313675954937935, 0.02356608770787716, 0.016050562262535095, -0.05157111585140228, -0.02230297401547432, -0.012243177741765976, 0.016393408179283142, -0.01845950074493885, -0.015834029763936996, 0.07593116164207458, 0.06467140465974808, 0.03242592513561249, -0.029322275891900063, -0.029863610863685608, 0.00177399767562747, 0.034086018800735474, -0.005183276254683733, 0.013695758767426014, 0.03675660118460655, -0.048611823469400406, 0.016366342082619667, 0.007488458417356014, -0.04420896992087364, -0.05185982957482338, 0.09058327972888947, -0.02598404698073864, 0.04655475169420242, 0.015400961972773075, 0.07578680664300919, 0.05092151463031769, 0.0005909566534683108, 0.08459251374006271, 0.01614980772137642, -0.03832647204399109, 0.0012383023276925087, -0.05575743690133095, 0.003047261154279113, 0.11909355223178864, 0.0156535841524601, -0.029881654307246208, -0.04287368059158325, -0.005354698747396469, -0.012342422269284725, -0.00047479532076977193, 0.06943514943122864, -0.018008388578891754, 0.053808633238077164, 0.027806540951132774, -0.10011076182126999, -0.041357941925525665, 0.018107634037733078, 0.004790809005498886, -0.015942296013236046, -0.05351991951465607, 0.00007760534936096519, -0.00030929362401366234, 0.07279141992330551, -0.022808220237493515, 0.026182537898421288, -0.02212253026664257, -0.04529163986444473, 0.03915651515126228, 0.05474694445729256, -0.06589843332767487, 0.04565252736210823, -0.029051609337329865, 0.047493066638708115, 0.06496012210845947, 0.03821820393204689, -0.009256817400455475, -0.013361935503780842, 0.029033564031124115, 0.03958958387374878, 0.019000835716724396, -0.027662184089422226, 0.031451523303985596, -0.030495166778564453, -0.005882499739527702, 0.06542927771806717, -0.026362981647253036, -0.007520035840570927, 0.04529163986444473, 0.018197854980826378, -0.0309643242508173, 0.043739814311265945, -0.0491170696914196, -0.013731847517192364, -0.008480904623866081, -0.012973979115486145, -0.04406461492180824, -0.023926977068185806, 0.018766256049275398, 0.0056028105318546295, 0.02955685369670391, -0.0004742314340546727, -0.004984786733984947, 0.07946787774562836, -0.06402180343866348, 0.02363826520740986, -0.024919424206018448, -0.02607426978647709, 0.025496846064925194, -0.05070498213171959, 0.005778743885457516, 0.013939359225332737, 0.010348508134484291, 0.05438605695962906, 0.00354799535125494, 0.06961559504270554, -0.03368904069066048, 0.0617842897772789, -0.041141409426927567, -0.026579516008496284, -0.012396556325256824, 0.022645819932222366, 0.01686256378889084, -0.049261424690485, 0.012631134130060673, -0.009410195052623749, -0.04781786724925041, 0.02858245186507702, 0.015337806195020676, -0.028726808726787567, -0.031325213611125946, -0.018062522634863853, 0.08401508629322052, 0.00009395815868629143, 0.06055726855993271, 0.013379979878664017, 0.021960129961371422, -0.01660994254052639, -0.01115148700773716, 0.006365189328789711, -0.049874935299158096, 0.021960129961371422, -0.004912609234452248, 0.02952076494693756, -0.0007691458449698985, 0.027788495644927025, 0.04453377053141594, 0.08221063762903214, 0.013100290670990944, 0.0037983625661581755, 0.028853120282292366, -0.05694837123155594, 0.02363826520740986, -0.007844836451113224, -0.002542015863582492, -0.05914979800581932, 0.027770450338721275, -0.056298770010471344, -0.03419428691267967, 0.08942843228578568, -0.00922072771936655, -0.018856478855013847, 0.02327737584710121, -0.018008388578891754, 0.04034745320677757, -0.010637219995260239, 0.00836812611669302, 0.03690095618367195, 0.003529950976371765, -0.048684000968933105, -0.0044186413288116455, 0.004120907746255398, 0.0365942008793354, -0.005350187420845032, -0.03217330202460289, 0.07304404675960541, 0.05305076390504837, 0.0249013788998127, 0.000373295129975304, -0.019506080076098442, -0.03556566685438156, -0.03220939263701439, -0.0372798927128315, 0.015870118513703346, -0.029105743393301964, -0.022916486486792564, -0.037496425211429596, -0.045002926141023636, -0.04684346541762352, -0.043956346809864044, -0.012784512713551521, 0.05218463018536568, -0.04601341858506203, -0.0015969362575560808, -0.004226918797940016, 0.03251614794135094, 0.02710280567407608, 0.05416952073574066, -0.037496425211429596, -0.019397813826799393, -0.010655264370143414, 0.0029029054567217827, -0.032534193247556686, 0.04081660881638527, -0.00860721617937088, 0.03455517441034317, 0.022537551820278168, 0.00895457249134779, -0.021671418100595474, -0.03843473643064499, -0.02731934003531933, -0.005210342817008495, -0.011620643548667431, 0.0495862253010273, 0.02354804426431656, -0.019397813826799393, 0.0064644343219697475, 0.020751148462295532, 0.009365083649754524, 0.001586786238476634, 0.026128403842449188, 0.003390106139704585, -0.01298300176858902, 0.05586570128798485, -0.036287445574998856, 0.006058433558791876, -0.02212253026664257, -0.028149385005235672, -0.02114812843501568, -0.029394453391432762, -0.08350984007120132, -0.0023299932945519686, -0.006879457272589207, -0.03491606563329697, 0.0036449844483286142, 0.03590850904583931, -0.014967894181609154, -0.004867497831583023, -0.004682541824877262, 0.057453617453575134, -0.03471757471561432, -0.029123786836862564, 0.08026183396577835, -0.006103544495999813, -0.008986149914562702, 0.047565244138240814, 0.007993703708052635, 0.035132598131895065, 0.033851440995931625, -0.0017176087712869048, -0.029195964336395264, -0.026399070397019386, -0.004754719790071249, 0.023151064291596413, -0.0026344936341047287, -0.02446831203997135, -0.08733527362346649, -0.047493066638708115, 0.06311958283185959, -0.004398341290652752, -0.0015281416708603501, 0.007853859104216099, -0.01165673229843378, -0.014047625474631786, 0.022555597126483917, 0.005535143427550793, 0.004265263210982084, 0.026272758841514587, -0.06600669771432877, -0.013975447975099087, -0.015996430069208145, -0.00035412286524660885, 0.05167938396334648, -0.04200754314661026, 0.004513374995440245, -0.033779263496398926, -0.03803775832056999, -0.04666301980614662, 0.01161162182688713, 0.05673183873295784, -0.033923618495464325, -0.010050773620605469, -0.0008153848466463387, -0.02473897859454155, 0.06589843332767487, -0.014634071849286556, -0.03486192971467972, 0.04233234375715256, -0.013542380183935165, -0.005941144190728664, -0.03208308294415474, 0.05510783568024635, -0.013542380183935165, -0.018468523398041725, 0.008769616484642029, 0.005232898518443108, 0.04110531881451607, -0.011160509660840034, 0.057417526841163635, -0.02217666245996952, -0.013948380947113037, 0.06340829282999039, -0.005557699128985405, -0.003994596190750599, -0.02979143336415291, -0.018784301355481148, -0.017115186899900436, -0.04594124108552933, -0.0060539222322404385, 0.021851861849427223, 0.026254715397953987, 0.01058308593928814, 0.06420224905014038, 0.03690095618367195, -0.022627774626016617, 0.019253456965088844, 0.027860673144459724, -0.022844308987259865, 0.006699012126773596, -0.006017833482474089, 0.00865232665091753, -0.028925297781825066, -0.03177632391452789, 0.032822903245687485, 0.025641202926635742, -0.05301467701792717, 0.028672674670815468, 0.01295593474060297, -0.007849347777664661, 0.008796682581305504, -0.06467140465974808, -0.0054900324903428555, 0.02975534275174141, -0.023078886792063713, -0.025460757315158844, 0.002025492722168565, -0.0038885849062353373, 0.008837282657623291, -0.03074778988957405, 0.015040071681141853, -0.06571798771619797, -0.07073435187339783, 0.021761640906333923, 0.053844720125198364, -0.015563362278044224, -0.024089377373456955, 0.014092736877501011, -0.019506080076098442, 0.03966176137328148, -0.037640780210494995, -0.05640703812241554, 0.056190501898527145, -0.11187576502561569, 0.0186940785497427, -0.01237851195037365, 0.016375362873077393, 0.052365075796842575, -0.021274439990520477, -0.04345110058784485, 0.0021179704926908016, 0.01979479193687439, 0.014516782015562057, 0.021310528740286827, 0.04449768364429474, -0.005589277017861605, 0.027716318145394325, -0.0046915640123188496, 0.037568602710962296, 0.024269822984933853, -0.011476287618279457, -0.024269822984933853, -0.023656310513615608, -0.008034303784370422, -0.02094963937997818, -0.01348824705928564, -0.00794859230518341, 0.014029581099748611, -0.06575407832860947, 0.004452474880963564, 0.021364660933613777, 0.03349054977297783, 0.0367385558784008, -0.034140150994062424, 0.07134786248207092, 0.00712305773049593, 0.007944080978631973, 0.025334445759654045, 0.06496012210845947, 0.037604689598083496, 0.10711202025413513, 0.008868861012160778, 0.024973556399345398, -0.04835920035839081, 0.029881654307246208, 0.015121271833777428, -0.020137637853622437, -0.02352999895811081, -0.03423037379980087, 0.011413131840527058, -0.00871548242866993, -0.027662184089422226, 0.03580024465918541, 0.07084261626005173, 0.0307658351957798, -0.005178764928132296, 0.03821820393204689, 0.011792066507041454, -0.003958507440984249, -0.06939905881881714, 0.041249677538871765, 0.019433902576565742, -0.04485857114195824, -0.01620394177734852, 0.0037848292849957943, -0.0489366240799427, -0.029033564031124115, 0.018306123092770576, 0.014985938556492329, -0.013289758004248142, 0.009135017171502113, -0.11418545246124268, -0.05229289457201958, -0.0858917161822319, 0.04226016625761986, 0.0025803602766245604, 0.02242928557097912, 0.005530632566660643, -0.02611035853624344, 0.03861518204212189, -0.010231219232082367, 0.01957825757563114, -0.05413343384861946, -0.006008810829371214, 0.11837176978588104, -0.057453617453575134, -0.031253036111593246, 0.08805704861879349, 0.021761640906333923, -0.016366342082619667, 0.009572595357894897, 0.0011920633260160685, 0.04698782041668892, 0.017169320955872536, -0.08120015263557434, 0.0123514449223876, 0.00446826359257102, 0.01362358033657074, 0.016925720497965813, 0.010610152967274189, -0.0072132800705730915, -0.019127145409584045, 0.04431723803281784, -0.027788495644927025, 0.05409734323620796, -0.06012419983744621, 0.015265627764165401, -0.004046474117785692, -0.025587068870663643, -0.03850691393017769, 0.0122792674228549, -0.041466210037469864, 0.02461266703903675, -0.0007494097226299345, -0.027932850643992424, 0.013118335045874119, -0.03240788355469704, -0.06293913722038269, -0.03074778988957405, -0.023096932098269463, 0.0009315461502410471, 0.024342000484466553, 0.02217666245996952, 0.014390471391379833, 0.02607426978647709, -0.017259543761610985, 0.03128912299871445, 0.01061917468905449, 0.024035243317484856, 0.010943975299596786, 0.05218463018536568, 0.003557017771527171, 0.02703062817454338, -0.023818710818886757, -0.04168274253606796, -0.11440198868513107, -0.0373159795999527, -0.03552957624197006, 0.06254216283559799, -0.012134911492466927, 0.037676870822906494, 0.023151064291596413, 0.048539645969867706, 0.01744901016354561 ]
43,013
linearmodels.panel.model
__str__
null
def __str__(self) -> str: out = super().__str__() additional = ( "\nEntity Effects: {ee}, Time Effects: {te}, Num Other Effects: {oe}" ) oe = 0 if self.other_effects: assert self._other_effect_cats is not None oe = self._other_effect_cats.nvar additional = additional.format( ee=self.entity_effects, te=self.time_effects, oe=oe ) out += additional return out
(self) -> str
[ -0.02218814194202423, -0.04648943990468979, 0.03832828253507614, 0.004841132089495659, 0.030148912221193314, -0.07013493031263351, -0.011339998804032803, -0.051808763295412064, 0.058002498000860214, -0.04925840348005295, -0.005442288238555193, 0.018417250365018845, -0.03133300691843033, 0.021441249176859856, 0.008908047340810299, 0.002167806960642338, -0.018389925360679626, -0.08999131619930267, 0.025121057406067848, -0.005496939178556204, 0.033737633377313614, 0.060334257781505585, -0.01282467320561409, -0.07217521965503693, 0.033701200038194656, 0.05104365572333336, -0.03916626051068306, -0.042700331658124924, -0.01323455199599266, -0.025139274075627327, -0.03601474314928055, -0.05319324508309364, -0.012423901818692684, -0.015675611793994904, -0.029219850897789, 0.01681416667997837, -0.05242813751101494, -0.008038192056119442, -0.015047130174934864, 0.024191996082663536, 0.038838356733322144, 0.00027282602968625724, -0.006403227802366018, 0.00003289353844593279, -0.06317608803510666, -0.038401152938604355, 0.03319112956523895, 0.05585290864109993, 0.025740429759025574, -0.06813107430934906, 0.036615896970033646, 0.014546167105436325, -0.007865131832659245, -0.027088478207588196, -0.03858331963419914, -0.017187612131237984, 0.03131479024887085, -0.011658793315291405, 0.004217204172164202, 0.03271748870611191, 0.0006381595740094781, 0.04896693304181099, 0.030094260349869728, -0.03351903334259987, -0.020639708265662193, -0.03173377737402916, -0.0363972969353199, 0.041170116513967514, 0.032626405358314514, 0.05891334265470505, 0.05250100418925285, -0.043793343007564545, 0.001171572133898735, 0.022406743839383125, -0.023791225627064705, -0.01956491358578205, -0.020894743502140045, -0.04393908008933067, 0.04616153612732887, -0.031077971681952477, -0.009864432737231255, -0.03541358560323715, -0.02592259831726551, -0.0032676502596586943, 0.05417695641517639, -0.07862398773431778, -0.05916837602853775, -0.04816539213061333, -0.02898303233087063, -0.025995466858148575, -0.0341748371720314, 0.04550572857260704, -0.048894066363573074, 0.008466288447380066, -0.019109491258859634, 0.00930426362901926, 0.0113855404779315, -0.08445338904857635, 0.03140587359666824, -0.006621830631047487, 0.008566481061279774, -0.009213179349899292, -0.03147874400019646, -0.011567709036171436, -0.021149780601263046, -0.027361731976270676, -0.017570165917277336, 0.017123853787779808, -0.0007041956996545196, 0.03100510500371456, 0.012414793483912945, 0.014801202341914177, 0.009591178968548775, -0.0485297292470932, 0.03559575229883194, -0.028746213763952255, -0.053994785994291306, -0.002798565896227956, 0.046125102788209915, -0.013562455773353577, 0.02703382819890976, -0.02867334522306919, -0.011531275697052479, 0.01572115533053875, -0.027143128216266632, 0.029602404683828354, -0.06871401518583298, -0.017406214028596878, 0.03696201741695404, -0.12394754588603973, 0.004469963256269693, -0.014582600444555283, -0.009709589183330536, 0.0068768663331866264, 0.06517994403839111, 0.00745069794356823, -0.0003740150132216513, 0.011012095026671886, 0.056472282856702805, 0.11185155063867569, -0.004094240255653858, -0.007195661775767803, -0.01075705885887146, 0.028035754337906837, -0.03568683937191963, -0.014801202341914177, 0.014582600444555283, 0.046380139887332916, -0.012524094432592392, -0.039639897644519806, 0.03047681413590908, 0.025740429759025574, -0.04375690966844559, -0.02867334522306919, 0.0241373460739851, 0.01972886547446251, -0.0030672645661979914, -0.05629011243581772, 0.031114405021071434, -0.00576108368113637, -0.030713634565472603, -0.04645300656557083, 0.02346332184970379, 0.0005325586535036564, 0.0316973440349102, 0.020220719277858734, 0.02162341959774494, -0.025740429759025574, 0.041170116513967514, 0.006576288025826216, -0.02080366015434265, -0.04437628388404846, -0.014154504053294659, 0.03891122341156006, -0.0033723970409482718, 0.07643796503543854, -0.020585058256983757, 0.04288249835371971, -0.04299180209636688, -0.007464360445737839, 0.0026346140075474977, -0.029893875122070312, -0.06463343650102615, 0.019400961697101593, 0.03767247498035431, -0.10660509020090103, 0.021204430609941483, -0.012387468479573727, 0.03350081294775009, 0.023827658966183662, 0.055087801069021225, 0.037599608302116394, -0.00999195035547018, 0.031096188351511955, -0.019765298813581467, -0.04539642855525017, 0.03395623713731766, -0.12263593822717667, 0.07585502415895462, -0.038838356733322144, -0.050387848168611526, 0.03497638180851936, -0.028782647103071213, 0.0383647158741951, 0.016076384112238884, 0.02728886343538761, 0.013799275271594524, -0.013781058602035046, -0.06201021000742912, -0.011066745035350323, -0.007883348502218723, 0.021678069606423378, -0.003877915209159255, -0.026432670652866364, 0.053011078387498856, -0.025485394522547722, 0.0034224935807287693, 0.03681628406047821, -0.08401618152856827, 0.048602595925331116, -0.008589251898229122, -0.038838356733322144, -0.005537927150726318, 0.008384312503039837, -0.04772818461060524, 0.03147874400019646, 0.030039610341191292, 0.02703382819890976, 0.0030536020640283823, 0.0240098275244236, -0.0071091316640377045, 0.02539430931210518, -0.044339850544929504, 0.033865153789520264, -0.025685779750347137, 0.08037281036376953, -0.03300895914435387, -0.022825730964541435, -0.027471031993627548, -0.01887267269194126, -0.02634158730506897, 0.0004687996406573802, 0.019109491258859634, -0.026942742988467216, 0.04521425813436508, -0.0639047622680664, 0.03020356222987175, 0.03566862270236015, -0.030167128890752792, 0.014345780946314335, 0.043501872569322586, 0.015548094175755978, -0.02220635861158371, 0.011203371919691563, 0.0018592587439343333, -0.018098454922437668, -0.010675082914531231, -0.016923466697335243, 0.004718168172985315, -0.03641551360487938, -0.012232624925673008, 0.02676057443022728, -0.04718168079853058, -0.011258022859692574, -0.0024661081843078136, -0.009176746010780334, -0.03586900606751442, -0.017879853025078773, -0.014937829226255417, 0.0036206019576638937, 0.030968669801950455, 0.010447371751070023, -0.05148085951805115, -0.0063030351884663105, -0.03989493474364281, -0.021295515820384026, -0.002985288854688406, 0.009782456792891026, -0.07192018628120422, 0.00176589738111943, 0.022698214277625084, -0.00545139703899622, -0.01804380491375923, -0.01876337081193924, 0.05782032757997513, -0.06521637737751007, 0.007796818390488625, -0.014956045895814896, 0.0268698763102293, 0.01945561170578003, 0.010893684811890125, 0.01806202158331871, 0.019073057919740677, -0.000012782048543158453, 0.03437522426247597, -0.04466775432229042, 0.0782596543431282, 0.005424071568995714, -0.009582070633769035, 0.009399902075529099, 0.012423901818692684, 0.005255565512925386, 0.041170116513967514, -0.01846279203891754, -0.046671606600284576, -0.025321442633867264, 0.04535999521613121, -0.02193310484290123, 0.0430646687746048, 0.0017647588392719626, -0.01985638216137886, 0.014154504053294659, 0.020749008283019066, 0.030167128890752792, 0.021459467709064484, 0.05486919730901718, -0.041170116513967514, -0.018945539370179176, 0.03073185123503208, 0.06671015918254852, 0.0160217322409153, -0.012287275865674019, -0.0040418668650090694, 0.02027537114918232, 0.059350546449422836, -0.07556355744600296, -0.02233387716114521, 0.00800175778567791, 0.06248384714126587, -0.017888961359858513, -0.06674659252166748, -0.08379758149385452, -0.003026276594027877, 0.009081107564270496, 0.02690630964934826, -0.027143128216266632, 0.02346332184970379, -0.02246139384806156, -0.008930818177759647, -0.006649155635386705, 0.060735028237104416, 0.0016030841507017612, -0.03351903334259987, 0.04073290899395943, 0.022588912397623062, 0.0025275899097323418, -0.00807917956262827, -0.0041716620326042175, 0.0215323343873024, 0.04452201724052429, -0.016586456447839737, -0.03942129388451576, 0.04674447700381279, 0.0021575598511844873, 0.006521637551486492, 0.030130695551633835, -0.005524264182895422, 0.009126649238169193, -0.030531466007232666, 0.05086148530244827, 0.04328327253460884, -0.009490986354649067, 0.04769175127148628, 0.06208307668566704, -0.008530046790838242, -0.005852167960256338, 0.05720095708966255, -0.012396576814353466, 0.06306678801774979, -0.0005783854867331684, -0.03789107874035835, -0.0009051504894159734, 0.006025228183716536, -0.015174648724496365, -0.021441249176859856, 0.05847613513469696, 0.02605011686682701, -0.0013229998294264078, 0.028764430433511734, -0.11491198092699051, 0.0032061683014035225, 0.007391492836177349, -0.05916837602853775, 0.04510495811700821, -0.008602914400398731, 0.04153445363044739, 0.03279035538434982, 0.0020197948906570673, 0.006963396444916725, 0.02898303233087063, 0.02122264727950096, -0.023354019969701767, 0.03942129388451576, -0.05213666707277298, -0.05337541550397873, -0.016914358362555504, -0.037308137863874435, -0.023809442296624184, -0.04437628388404846, 0.022989682853221893, 0.0242648646235466, -0.037854645401239395, -0.01405431143939495, -0.01543879322707653, -0.051772329956293106, -0.00785146839916706, 0.0032995296642184258, 0.03561397269368172, -0.005984240211546421, 0.03916626051068306, -0.03821898251771927, -0.016367852687835693, -0.05465059354901314, -0.017306022346019745, 0.0639047622680664, -0.022169925272464752, -0.020366454496979713, -0.030385730788111687, -0.011494841426610947, 0.0021029093768447638, -0.035504668951034546, 0.048056088387966156, 0.05250100418925285, 0.07428837567567825, -0.0057975174859166145, -0.0022258732933551073, -0.06871401518583298, 0.047363847494125366, 0.045578595250844955, 0.04692664369940758, -0.026541972532868385, -0.0017101082485169172, -0.02096761204302311, 0.007664746139198542, 0.0742519423365593, -0.055780041962862015, 0.021167997270822525, -0.021040478721261024, -0.01795271970331669, 0.02949310466647148, 0.018690504133701324, -0.016103709116578102, 0.009746022522449493, 0.06011565402150154, -0.012979515828192234, -0.007391492836177349, -0.04106081277132034, -0.02111334726214409, 0.01696901023387909, 0.00937257707118988, 0.046525873243808746, 0.060917194932699203, -0.034429874271154404, -0.023244719952344894, 0.05683661997318268, -0.024793153628706932, 0.0204211063683033, -0.04492278769612312, -0.009190408512949944, -0.032207418233156204, -0.04965917393565178, 0.035632189363241196, -0.021022262051701546, 0.07457984238862991, 0.026815224438905716, -0.07490774989128113, 0.019911034032702446, -0.01400876883417368, -0.06623651832342148, -0.010511131025850773, 0.025285009294748306, 0.02344510518014431, -0.009071998298168182, 0.0030900356359779835, -0.006394119467586279, 0.04900336638092995, -0.0069770594127476215, -0.024447033181786537, -0.005843059625476599, 0.007459806278347969, -0.0027234212029725313, -0.04452201724052429, -0.035796139389276505, 0.011039420031011105, -0.0069770594127476215, 0.06375902891159058, 0.0075508905574679375, 0.04900336638092995, 0.01062043197453022, 0.023536190390586853, 0.014837636612355709, 0.002400072058662772, -0.05457772687077522, -0.036998454481363297, -0.028582261875271797, 0.029183417558670044, -0.024173779413104057, -0.038546886295080185, -0.058439701795578, 0.05446842685341835, 0.0026710478123277426, -0.02288038283586502, 0.008470842614769936, 0.0017340178601443768, 0.0035545658320188522, -0.021277299150824547, 0.02260712906718254, 0.033591900020837784, 0.015329492278397083, -0.005405854899436235, 0.03945773094892502, -0.0639047622680664, 0.04714524745941162, -0.009336143732070923, -0.018125779926776886, -0.042153824120759964, -0.008174818009138107, 0.0752720832824707, 0.0175155159085989, 0.02608655020594597, -0.010456480085849762, -0.010101251304149628, -0.0648520365357399, -0.01655912958085537, -0.015666503459215164, 0.04164375364780426, -0.0059432522393763065, 0.039785634726285934, -0.04455845057964325, 0.04663517326116562, -0.021295515820384026, -0.014965154230594635, 0.004709059372544289, 0.03679806739091873, -0.02508462220430374, 0.07811391353607178, -0.037453874945640564, -0.007746721617877483, 0.014956045895814896, -0.00406691525131464, 0.039384860545396805, -0.007582770194858313, 0.014327564276754856, -0.07348683476448059, 0.013462263159453869, -0.031915947794914246, 0.04576076567173004, 0.016468046233057976, 0.014846744947135448, -0.009167637676000595, -0.022097056731581688, -0.022115273401141167, -0.03348259627819061, -0.028436526656150818, 0.03807324916124344, 0.024993538856506348, 0.03180664777755737, 0.007473468780517578, 0.00599334854632616, 0.04342900589108467, 0.002094939583912492, -0.0010594245977699757, 0.04120654985308647, -0.007910673506557941, -0.01876337081193924, 0.042700331658124924, 0.013125251047313213, 0.009627613238990307, -0.054832763969898224, -0.010930119082331657, 0.0012228070991113782, -0.024046260863542557, 0.003581891069188714, 0.02716134488582611, -0.07410620898008347, 0.008930818177759647, 0.0391298271715641, 0.03803681582212448, 0.051918063312768936, 0.056326545774936676, -0.03472134470939636, 0.005328433122485876, -0.0042695775628089905, -0.026505539193749428, 0.02840009331703186, 0.05002351105213165, -0.018854456022381783, 0.011084962636232376, 0.05920480936765671, 0.0016907528042793274, -0.020749008283019066, -0.029602404683828354, 0.0025389755610376596, -0.0057155415415763855, 0.06277531385421753, 0.00399860180914402, 0.01655002124607563, 0.020202502608299255, -0.0010514546884223819, 0.030094260349869728, 0.008083733730018139, -0.0013457708992064, 0.01792539469897747, 0.07549069076776505, 0.02497532218694687, -0.00350219220854342, 0.030786501243710518, 0.03568683937191963, -0.03749030828475952, 0.03299074247479439, -0.03142409026622772, 0.021878454834222794, -0.04576076567173004, -0.06109936535358429, -0.019145924597978592, -0.05796606466174126, -0.0026710478123277426, 0.012587853707373142, -0.035377152264118195, -0.015666503459215164, -0.0014767046086490154, 0.051808763295412064, -0.10813531279563904, 0.027634983882308006, 0.0017465419368818402, 0.014883178286254406, -0.008320553228259087, -0.07862398773431778, 0.02204240672290325, -0.10522060841321945, -0.0034703128039836884, 0.044485583901405334, -0.016304094344377518, -0.05996992066502571, -0.05381261929869652, 0.029474887996912003, 0.020330021157860756, 0.043501872569322586, -0.035103898495435715, 0.005150818731635809, 0.01833527535200119, 0.03626977652311325, -0.07818678766489029, 0.026450887322425842, -0.06350398808717728, 0.01983816549181938, -0.0639047622680664, -0.057455990463495255, -0.005478722043335438, -0.04831112548708916, -0.020311804488301277, -0.00010012160055339336, 0.0010998431826010346, 0.011057636700570583, 0.008234023116528988, 0.04510495811700821, 0.028928382322192192, 0.00561534846201539, 0.004394818563014269, -0.005282890982925892, -0.009117540903389454, -0.005036963149905205, 0.020730791613459587, -0.03601474314928055, 0.11993984133005142, -0.006480649579316378, -0.004358384758234024, -0.01737888902425766, 0.06743883341550827, -0.02246139384806156, -0.005583469290286303, 0.00461797509342432, -0.047509584575891495, 0.017570165917277336, -0.032079897820949554, 0.01476476900279522, 0.0391298271715641, 0.06164586916565895, 0.05395835265517235, -0.06525281071662903, 0.058257535099983215, -0.010930119082331657, -0.011913829483091831, -0.05406765639781952, 0.025886164978146553, 0.023936960846185684, -0.042554598301649094, 0.04692664369940758, -0.018107563257217407, -0.022370310500264168, -0.04933127015829086, -0.05639941245317459, -0.027270646765828133, -0.0005029562744311988, 0.11680653691291809, -0.0029830115381628275, 0.03115083836019039, -0.041862357407808304, 0.002223595976829529, -0.01571204513311386, 0.021987756714224815, 0.04342900589108467, -0.004900336731225252, 0.0015552648110315204, -0.019510261714458466, 0.002314680488780141, 0.047363847494125366, -0.037854645401239395, 0.004795589484274387, -0.030586116015911102, 0.033992670476436615, 0.11097714304924011, 0.012851998209953308, -0.007719396613538265, -0.0334097295999527, -0.04106081277132034, 0.058257535099983215, 0.021131563931703568, -0.020475756376981735, -0.026378020644187927, -0.015129106119275093, 0.058658305555582047, -0.002223595976829529, -0.010775275528430939, 0.015329492278397083, 0.07002563029527664, 0.004572432953864336, -0.005528818350285292, 0.03155161067843437, -0.05308394506573677, -0.0004400511388666928, 0.015648286789655685, 0.0017180780414491892, -0.06368616223335266, 0.03501281514763832, -0.0017419876530766487, -0.015757588669657707, -0.0017863913672044873, -0.0046134209260344505, -0.02564934641122818, -0.0014243311015889049, 0.039785634726285934, 0.030932236462831497, -0.014373106881976128, 0.02470206841826439, 0.041716620326042175, 0.04055074229836464, 0.022679997608065605, -0.03213455155491829, 0.017187612131237984, 0.04521425813436508, 0.0391298271715641, 0.01068419124931097, -0.014518841169774532, 0.07097290456295013, -0.03967633098363876, 0.03472134470939636, 0.00951831229031086, 0.007263974752277136, -0.03142409026622772, -0.021860238164663315, -0.06842254102230072, 0.06845898181200027, 0.04729098081588745, 0.009909974411129951, 0.055670738220214844, -0.012032239697873592, -0.025703996419906616 ]
43,016
linearmodels.panel.model
_choose_twoway_algo
null
def _choose_twoway_algo(self) -> bool: if not (self.entity_effects and self.time_effects): return False nentity, nobs = self.dependent.nentity, self.dependent.nobs nreg = min(nentity, nobs) if nreg < self.exog.shape[1]: return False # MiB reg_size = 8 * nentity * nobs * nreg // 2**20 low_memory = reg_size > 2**10 if low_memory: import warnings warnings.warn( "Using low-memory algorithm to estimate two-way model. Explicitly set " "low_memory=True to silence this message. Set low_memory=False to use " "the standard algorithm that creates dummy variables for the smaller " "of the number of entities or number of time periods.", MemoryWarning, stacklevel=3, ) return low_memory
(self) -> bool
[ 0.03830273449420929, -0.015423920005559921, 0.0010483445366844535, 0.06096120923757553, -0.004455034155398607, -0.04763053357601166, -0.06173240393400192, -0.019647136330604553, -0.029415618628263474, -0.045610733330249786, 0.058060042560100555, 0.004096978809684515, -0.017104025930166245, -0.008561193943023682, -0.011623025871813297, 0.024145780131220818, -0.025339297950267792, -0.005026545375585556, 0.01308278925716877, -0.015561633743345737, -0.003401525318622589, 0.01714993081986904, -0.03508941829204559, -0.008809078484773636, -0.0057977414689958096, 0.04351748898625374, -0.018389351665973663, -0.014450743794441223, -0.009456331841647625, 0.025100594386458397, -0.005044907331466675, -0.040432706475257874, 0.02662462368607521, -0.004264530260115862, 0.0668737068772316, 0.007133563049137592, 0.04770398139953613, 0.10708606988191605, -0.02398052252829075, -0.0425993986427784, -0.011127256788313389, -0.09078078716993332, 0.03666853532195091, 0.0371459424495697, -0.07425516098737717, -0.05754591152071953, -0.05012774094939232, 0.06000639498233795, 0.020106181502342224, -0.0343182235956192, 0.024513015523552895, -0.0863739550113678, 0.013872346840798855, 0.06052052602171898, -0.033345047384500504, 0.015708528459072113, 0.021189527586102486, 0.09011976420879364, -0.020565226674079895, 0.005733475089073181, -0.0035966194700449705, -0.004819975234568119, 0.057105228304862976, 0.01589214615523815, -0.017700783908367157, 0.023760180920362473, -0.053359419107437134, 0.03565863519906998, 0.010199985466897488, 0.06048380210995674, -0.014845523051917553, 0.012339135631918907, -0.025743257254362106, 0.029525790363550186, -0.07139071822166443, -0.04674916714429855, -0.03240859508514404, -0.008786126039922237, -0.027193840593099594, 0.003422182286158204, -0.021832192316651344, -0.0025775390677154064, -0.026661347597837448, -0.05526904761791229, -0.04480281472206116, -0.021079357713460922, 0.04366438463330269, 0.03299617022275925, 0.021832192316651344, -0.06683699041604996, -0.032096441835165024, 0.0355851873755455, 0.053800102323293686, 0.01940843276679516, 0.0491362027823925, -0.01794866845011711, -0.042636122554540634, 0.010594763793051243, -0.004505529068410397, -0.06235670670866966, -0.021226251497864723, 0.031435418874025345, 0.012972618453204632, 0.043554212898015976, 0.015488185919821262, 0.010319337248802185, -0.008556603454053402, -0.011852548457682133, -0.03925754874944687, -0.0762382298707962, -0.04366438463330269, -0.010824286378920078, -0.01553409080952406, 0.01578197441995144, -0.050678595900535583, -0.00488424114882946, 0.01640627719461918, 0.03859652206301689, -0.015148492529988289, 0.028111930936574936, -0.014606819488108158, 0.00874940212816, -0.05023791268467903, -0.049246374517679214, 0.0165715329349041, -0.02251157909631729, 0.09511417150497437, -0.010328518226742744, -0.05883123725652695, 0.0031926597002893686, -0.014469105750322342, 0.02835063450038433, 0.03988185152411461, 0.06511097401380539, -0.039330996572971344, 0.004312729928642511, -0.030958011746406555, 0.021703658625483513, 0.019298261031508446, 0.0030159272719174623, -0.037751879543066025, 0.009162543341517448, -0.005448867101222277, -0.009713397361338139, 0.022144341841340065, 0.02930544875562191, -0.025027146562933922, -0.0466022714972496, 0.0230073481798172, 0.06195274367928505, 0.010475412011146545, -0.02252994105219841, -0.0347038209438324, -0.0072024199180305, -0.04744691774249077, 0.008400527760386467, -0.03591569885611534, 0.004539957270026207, -0.056664545089006424, -0.008033291436731815, -0.06819576025009155, -0.015001598745584488, -0.021226251497864723, -0.034722182899713516, -0.010016366839408875, -0.017875222489237785, -0.04061632230877876, 0.013220502994954586, 0.05236788094043732, 0.05174357816576958, -0.04458247497677803, 0.028570976108312607, -0.0007298819255083799, -0.012724733911454678, -0.004659309051930904, 0.06867317110300064, 0.021464955061674118, -0.05780297517776489, 0.0324636809527874, 0.011072170920670033, -0.01905955746769905, -0.021666934713721275, -0.08453777432441711, -0.03800894692540169, -0.015570814721286297, 0.04873224347829819, 0.050348080694675446, -0.04028581082820892, 0.007932301610708237, 0.07300655543804169, -0.046859338879585266, 0.010842648334801197, 0.017379453405737877, -0.052257709205150604, 0.02219942770898342, 0.001331231207586825, 0.030627498403191566, 0.014799618162214756, -0.0009295666241087019, 0.05324924737215042, -0.037751879543066025, -0.015001598745584488, 0.004243873059749603, 0.008506108075380325, 0.0028208328876644373, 0.02678987942636013, -0.02078556828200817, 0.024513015523552895, -0.022291237488389015, 0.03244531899690628, -0.025339297950267792, -0.05299218371510506, -0.03624621033668518, 0.062173087149858475, 0.0804247260093689, 0.0662861317396164, 0.010135718621313572, 0.04491298645734787, -0.05626058578491211, -0.023117518052458763, 0.016516447067260742, -0.04190164804458618, -0.03251876309514046, 0.020271437242627144, 0.06165895611047745, -0.027616161853075027, -0.011209884658455849, 0.08284848183393478, 0.04076321795582771, -0.023282773792743683, -0.0074365329928696156, 0.07102347910404205, 0.011163979768753052, 0.002041603671386838, 0.07961680740118027, 0.006458766292780638, 0.026863327249884605, 0.001038589864037931, 0.02489861287176609, -0.026532813906669617, 0.003206430934369564, -0.03958806023001671, -0.026844965294003487, -0.052882011979818344, -0.05930864438414574, -0.06048380210995674, 0.03226169943809509, -0.02882804162800312, -0.005930864717811346, -0.017572252079844475, -0.027359096333384514, -0.0340244323015213, -0.017939487472176552, -0.027689609676599503, -0.004622585605829954, -0.044509027153253555, 0.005655437242239714, -0.021373147144913673, -0.04068977013230324, -0.04164458438754082, 0.016167573630809784, 0.06287083774805069, -0.04068977013230324, 0.04818138852715492, -0.07587099820375443, 0.018214914947748184, 0.0054213241674005985, -0.015837060287594795, -0.005155078135430813, 0.013881527818739414, -0.015378015115857124, -0.026844965294003487, -0.0866677388548851, -0.023392945528030396, -0.002547701122239232, 0.00145861622877419, 0.03907392919063568, 0.008556603454053402, -0.041534412652254105, 0.03896376118063927, -0.05813349038362503, -0.009254352189600468, 0.022162703797221184, -0.0280752070248127, -0.06654319912195206, -0.02965432219207287, -0.04774070531129837, -0.034593649208545685, 0.07403481751680374, -0.02945234254002571, 0.004239282570779324, 0.05952898785471916, 0.08086541295051575, 0.03340013325214386, 0.017416175454854965, -0.00776245491579175, 0.014257945120334625, -0.024696633219718933, 0.05794987082481384, -0.018646417185664177, -0.0029952700715512037, 0.04076321795582771, -0.04164458438754082, -0.015414739027619362, 0.07660546898841858, 0.022731920704245567, 0.03973495587706566, -0.05155996233224869, 0.07113365083932877, 0.027487628161907196, -0.045610733330249786, -0.025082232430577278, 0.004092388320714235, 0.02552291564643383, 0.025412743911147118, 0.033491939306259155, -0.027359096333384514, 0.02739582024514675, -0.021979086101055145, 0.06474374234676361, -0.004012055229395628, 0.01719583384692669, -0.024219226092100143, -0.05471819266676903, -0.02365001104772091, -0.03984512761235237, 0.044692642986774445, -0.05890468508005142, -0.0024099876172840595, -0.03969823196530342, -0.007165696006268263, -0.03940444439649582, 0.04807121679186821, 0.06228325888514519, -0.014836342073976994, -0.0362645722925663, 0.027193840593099594, -0.01687450334429741, 0.026404282078146935, -0.016745969653129578, 0.01653480902314186, 0.01939007081091404, -0.022970624268054962, -0.014799618162214756, 0.10165097564458847, -0.0488424152135849, 0.005113763734698296, 0.007950663566589355, 0.042342331260442734, 0.0011172014055773616, -0.03764170780777931, 0.023539839312434196, 0.03264729678630829, 0.05835383012890816, 0.032224975526332855, 0.043113529682159424, -0.04491298645734787, 0.04678589105606079, 0.034905798733234406, 0.04741019383072853, -0.04491298645734787, 0.02003273367881775, -0.05883123725652695, 0.049576885998249054, 0.015809517353773117, -0.01016326155513525, 0.04237905517220497, 0.026349196210503578, -0.02616557851433754, -0.06070414185523987, -0.07763373106718063, -0.03121507540345192, 0.045794352889060974, 0.03277583047747612, 0.03720102459192276, 0.01905955746769905, -0.053506314754486084, 0.010952819138765335, 0.032830916345119476, -0.0004337977443356067, 0.050641871988773346, 0.03233514726161957, -0.027138754725456238, 0.009291076101362705, 0.013551015406847, 0.010502954944968224, 0.02063867449760437, 0.008556603454053402, 0.03532811999320984, -0.036797065287828445, 0.027340734377503395, -0.019885839894413948, -0.02221778966486454, -0.014827161096036434, 0.018012935295701027, 0.040653046220541, -0.03745809197425842, 0.05747246369719505, -0.0544978491961956, 0.03167412057518959, -0.02051014080643654, 0.0042966632172465324, -0.007895577698946, 0.02302570827305317, -0.11031775176525116, -0.013899889774620533, 0.00013749839854426682, 0.07961680740118027, -0.02445792965590954, 0.060263458639383316, -0.07285965979099274, 0.006449585780501366, -0.018692322075366974, -0.03644819185137749, -0.03793549910187721, 0.01814146712422371, 0.03374900668859482, 0.02188727632164955, 0.08079196512699127, 0.04678589105606079, 0.06801214069128036, 0.03106818161904812, -0.007982796989381313, -0.02568817138671875, 0.009538959711790085, -0.012779819779098034, -0.02901165932416916, 0.035530101507902145, -0.023117518052458763, 0.024017246440052986, 0.007441123481839895, -0.0005703637143597007, -0.0063669574446976185, -0.03352866321802139, 0.028772955760359764, 0.013734633103013039, -0.003807780332863331, -0.06478046625852585, 0.03027862310409546, -0.014955693855881691, -0.0057426560670137405, 0.02174038253724575, 0.0065872990526258945, -0.009020239114761353, 0.0225666631013155, -0.08424398303031921, 0.013872346840798855, 0.006605661008507013, -0.006339414976537228, -0.01893102563917637, 0.011944357305765152, 0.001895856810733676, -0.025743257254362106, -0.006959125865250826, 0.03747645393013954, -0.03384081646800041, 0.06092448532581329, -0.030370432883501053, -0.02175874449312687, 0.017434537410736084, -0.046381931751966476, -0.01345920655876398, 0.015543271787464619, 0.028277186676859856, 0.022640110924839973, -0.06143861636519432, -0.04550056532025337, -0.024972060695290565, 0.029746131971478462, 0.02491697482764721, -0.04417851194739342, -0.026863327249884605, 0.032555487006902695, -0.05960243567824364, 0.025155678391456604, -0.005600351840257645, -0.011944357305765152, 0.040873389691114426, 0.05464474484324455, -0.032096441835165024, -0.013661186210811138, -0.007711960002779961, 0.02254830300807953, -0.014707809314131737, 0.02473335713148117, -0.017765050753951073, -0.022438131272792816, -0.026349196210503578, 0.03198627382516861, -0.020748844370245934, 0.0034152965527027845, -0.007418171036988497, 0.043590936809778214, 0.01364282425493002, -0.0033395541831851006, 0.03136197105050087, -0.0048245652578771114, 0.020914101973176003, 0.01815064810216427, 0.010374422185122967, -0.001750109950080514, -0.01513931155204773, -0.010135718621313572, -0.03751317784190178, -0.004269120749086142, 0.014909788966178894, -0.03310634195804596, -0.03407951816916466, -0.059859499335289, 0.05993294715881348, -0.0041589499451220036, -0.07157433032989502, 0.04707967862486839, -0.0061053019016981125, 0.09269041568040848, 0.012348316609859467, 0.001964713679626584, -0.04149768874049187, 0.03516286611557007, -0.012091252021491528, -0.004464215133339167, -0.025596361607313156, 0.03059077449142933, -0.024311035871505737, 0.015368834137916565, -0.04788760095834732, -0.03690723702311516, 0.03310634195804596, 0.04046942666172981, -0.028240462765097618, 0.04509660601615906, -0.05659109726548195, 0.014634362421929836, 0.06452339887619019, 0.0023571972269564867, -0.05754591152071953, -0.0013392644468694925, -0.01625020056962967, 0.026202302426099777, -0.04950343817472458, -0.016351191326975822, -0.08901805430650711, 0.01734272949397564, -0.01972058415412903, -0.005526904482394457, 0.053212523460388184, 0.02157512679696083, 0.04046942666172981, -0.03692559897899628, -0.002208007499575615, -0.027450906112790108, 0.02963596023619175, 0.08732876926660538, 0.011044627986848354, 0.08887115865945816, -0.0671674981713295, 0.0066882893443107605, 0.049246374517679214, -0.021997448056936264, 0.027450906112790108, -0.02535765990614891, -0.0671674981713295, -0.01766405999660492, 0.0018373285420238972, -0.03328996151685715, 0.0012130270479246974, 0.0030113367829471827, 0.004898012615740299, 0.032867640256881714, 0.06290756165981293, 0.023870352655649185, 0.020124543458223343, -0.0011361369397491217, -0.012706371955573559, 0.032371871173381805, 0.019022835418581963, -0.015488185919821262, -0.02381526678800583, -0.0355851873755455, -0.037568263709545135, -0.00858414638787508, -0.0035254673566669226, -0.03228006139397621, 0.008795307017862797, 0.04193837195634842, -0.015809517353773117, 0.009630769491195679, 0.01872904598712921, -0.007987387478351593, -0.022970624268054962, -0.017902763560414314, 0.009392065927386284, 0.013551015406847, -0.019665498286485672, 0.00031042934278957546, 0.0381191149353981, -0.042966634035110474, 0.009594045579433441, 0.03429986163973808, 0.01763651892542839, 0.02394380047917366, 0.007092249114066362, 0.007404399570077658, -0.042011819779872894, 0.027836503461003304, -0.014276307076215744, -0.05203736945986748, -0.04726329818367958, 0.0182791817933321, -0.030958011746406555, 0.037292834371328354, -0.005641665775328875, 0.03732955828309059, -0.03422641381621361, -0.0046868519857525826, 0.027505990117788315, -0.012183060869574547, -0.021538402885198593, 0.021354785189032555, -0.01401924155652523, -0.008418889716267586, 0.04164458438754082, 0.054424405097961426, 0.007399809081107378, -0.05310235172510147, -0.05409388989210129, 0.08835702389478683, -0.04645537957549095, -0.003153640776872635, -0.04149768874049187, -0.008689726702868938, -0.023888714611530304, 0.04983394965529442, -0.0061053019016981125, 0.00266246241517365, -0.005995130632072687, 0.02554127760231495, 0.060263458639383316, 0.009667492471635342, 0.018334267660975456, -0.07072968780994415, 0.08240780234336853, -0.014753714203834534, -0.009392065927386284, -0.034722182899713516, -0.04083666577935219, 0.018839215859770775, 0.04013891518115997, 0.0022871929686516523, 0.03534648194909096, -0.039918575435876846, 0.012155517935752869, 0.002963137114420533, -0.020271437242627144, 0.016268562525510788, -0.004409129731357098, 0.03606259450316429, -0.017122387886047363, 0.07032573223114014, -0.07924956828355789, 0.02678987942636013, 0.021666934713721275, 0.03264729678630829, -0.004519300535321236, 0.06176912784576416, -0.008414299227297306, -0.003892703680321574, 0.00010923841909971088, 0.009185494855046272, -0.009713397361338139, -0.014386477880179882, 0.0012864742893725634, 0.01609412580728531, 0.0041038645431399345, 0.020253075286746025, -0.007106020115315914, -0.0008693169220350683, 0.035695359110832214, -0.018554609268903732, -0.016938770189881325, 0.08439087867736816, -0.0013954974710941315, -0.010971181094646454, -0.04021236300468445, 0.026606261730194092, 0.013927432708442211, -0.010861010290682316, 0.036962322890758514, 0.008134281262755394, -0.050164464861154556, -0.035989146679639816, -0.05831710621714592, 0.040432706475257874, 0.032867640256881714, 0.047520361840724945, -0.04190164804458618, -0.023099156096577644, 0.022621748968958855, 0.044986434280872345, -0.04054287448525429, 0.033014532178640366, -0.024513015523552895, -0.022291237488389015, -0.02915855310857296, -0.0309029258787632, 0.059859499335289, -0.07888233661651611, -0.024200864136219025, 0.04300335794687271, -0.04333386942744255, -0.04807121679186821, -0.015029140748083591, 0.05574645474553108, 0.03530975803732872, 0.017719145864248276, -0.023246051743626595, -0.02460482530295849, 0.02614721655845642, 0.010401965118944645, 0.002061113016679883, -0.014716990292072296, 0.022585025057196617, -0.004305844195187092, -0.005462638568133116, -0.07168450206518173, 0.023576563224196434, 0.013385758735239506, -0.06228325888514519, 0.040910109877586365, -0.014515010640025139, -0.015414739027619362, -0.04887913540005684, 0.006334824487566948, 0.007464075461030006, -0.008368394337594509, -0.002566062845289707, 0.007918530143797398, -0.012917532585561275, 0.018389351665973663, -0.007624741643667221, -0.02631247229874134, -0.005586580373346806, 0.042011819779872894, 0.028313910588622093, 0.0023778544273227453, 0.0032592210918664932, 0.039294272661209106, 0.00018605677178129554, 0.009382884949445724, -0.026679709553718567, 0.06019001081585884, -0.004457329399883747, 0.07131727039813995, 0.005701341666281223, 0.0905604436993599, 0.07113365083932877, -0.009075324051082134, -0.01765487901866436, -0.03070094622671604, -0.03024190105497837, -0.0048796506598591805, -0.010282613337039948, 0.014459924772381783, 0.03250040113925934, -0.02140986919403076, -0.03294108808040619, 0.01813228614628315, 0.04480281472206116 ]
43,017
linearmodels.panel.model
_collect_effects
null
def _collect_effects(self) -> NumericArray: if not self._has_effect: return np.empty((self.dependent.shape[0], 0)) effects = [] if self.entity_effects: effects.append(np.asarray(self.dependent.entity_ids).squeeze()) if self.time_effects: effects.append(np.asarray(self.dependent.time_ids).squeeze()) if self.other_effects: assert self._other_effect_cats is not None other = self._other_effect_cats.dataframe for col in other: effects.append(np.asarray(other[col]).squeeze()) return np.column_stack(effects)
(self) -> numpy.ndarray
[ -0.029309771955013275, -0.014073696918785572, -0.029613777995109558, 0.006540603470057249, 0.03487129509449005, -0.01352827437222004, -0.008816178888082504, -0.026108765974640846, 0.06655947118997574, 0.0056867036037147045, 0.01032726839184761, 0.0357833132147789, 0.009147008880972862, -0.04935629665851593, -0.0015557962469756603, 0.0055570537224411964, -0.041130244731903076, 0.004267263226211071, -0.0030042962171137333, -0.007452621590346098, 0.006773078814148903, 0.0014876184286549687, -0.05067961663007736, -0.04992854222655296, 0.010577626526355743, 0.01841919682919979, -0.03869819641113281, -0.03168817237019539, -0.0032233595848083496, -0.042417801916599274, -0.027181727811694145, 0.0032993610948324203, -0.03769676387310028, -0.01992134563624859, -0.033190321177244186, 0.0033172438852488995, 0.01879473403096199, -0.011319759301841259, 0.0698498860001564, 0.026752542704343796, 0.03748217225074768, -0.04495714604854584, 0.0030199436005204916, 0.017265761271119118, -0.04062952846288681, -0.022585870698094368, 0.007662743795663118, 0.0000028421991373761557, -0.013000734150409698, -0.017444590106606483, 0.022871993482112885, -0.0028858233708888292, 0.03581907972693443, 0.02444567158818245, 0.095207579433918, 0.057904232293367386, -0.004204673692584038, 0.021226784214377403, 0.015021481551229954, -0.019420629367232323, 0.0463162325322628, 0.06337634474039078, 0.044384900480508804, -0.012061892077326775, 0.014011107385158539, -0.009173832833766937, 0.0030467677861452103, 0.04163096100091934, -0.010345150716602802, 0.013492508791387081, -0.033887747675180435, 0.007689567748457193, -0.010631274431943893, 0.007738745305687189, -0.009299011901021004, -0.04692424461245537, 0.061373479664325714, 0.00002207397665188182, 0.04359805956482887, -0.0034379521384835243, -0.020743951201438904, 0.04045070335268974, -0.02571534551680088, 0.053862739354372025, 0.06012168899178505, -0.042095914483070374, -0.04774685204029083, 0.02262163534760475, -0.07646649330854416, -0.0751074030995369, -0.02444567158818245, 0.03823324665427208, -0.028522931039333344, 0.011838357895612717, 0.012687786482274532, 0.04649506136775017, -0.03131263703107834, -0.04574398696422577, 0.005400580354034901, 0.04796144366264343, -0.020690301433205605, 0.01619279943406582, 0.019939228892326355, 0.0454578623175621, -0.002914882730692625, 0.02194209210574627, 0.005203870125114918, -0.041022948920726776, -0.012607314623892307, 0.013876987621188164, 0.0351395383477211, 0.04703154414892197, 0.013492508791387081, -0.0697425901889801, -0.03966386243700981, -0.06605875492095947, -0.02864811010658741, -0.01949216052889824, -0.06924187391996384, 0.05586560443043709, -0.021101605147123337, -0.042739689350128174, 0.034477874636650085, 0.044063013046979904, -0.022120919078588486, -0.0012350250035524368, -0.041130244731903076, -0.018705321475863457, -0.003762076376006007, -0.04324040561914444, -0.06301868706941605, -0.041666727513074875, -0.02065453678369522, 0.013966401107609272, -0.0002506374439690262, -0.00931689515709877, 0.030257554724812508, -0.037768296897411346, 0.046244703233242035, -0.011874123476445675, -0.01826719380915165, 0.03140204772353172, -0.016165975481271744, 0.019831931218504906, -0.028469283133745193, 0.030543679371476173, 0.05325472727417946, -0.017167408019304276, -0.07975691556930542, -0.024874858558177948, -0.05042925849556923, -0.00519045814871788, -0.02076183259487152, -0.030007196590304375, 0.03429904952645302, 0.005624114070087671, -0.03183123469352722, -0.03553295508027077, 0.006375188007950783, -0.01922391913831234, -0.10650945454835892, -0.046030111610889435, -0.03576543182134628, -0.016997521743178368, 0.0006163948564790189, 0.015996089205145836, 0.02474967949092388, -0.042417801916599274, -0.038626667112112045, 0.031437814235687256, -0.005874472204595804, -0.008033810183405876, 0.03705298528075218, -0.01841919682919979, -0.06648793816566467, 0.051573753356933594, -0.038841258734464645, 0.000018214523151982576, 0.01884838193655014, 0.05879836902022362, 0.0006404247833415866, -0.016148092225193977, -0.03866242989897728, -0.010094793513417244, 0.014806888997554779, -0.05214599892497063, 0.026108765974640846, -0.051681049168109894, 0.04606587439775467, 0.04073682799935341, 0.029810486361384392, 0.01815989799797535, 0.02587628923356533, 0.010345150716602802, 0.032081592828035355, -0.00578952906653285, -0.035336244851350784, -0.02964954264461994, -0.01334050577133894, -0.05336202308535576, -0.025536518543958664, -0.05611596256494522, -0.027396321296691895, 0.03290419653058052, -0.03454940766096115, 0.0715666264295578, -0.03344067931175232, 0.0035228950437158346, -0.0759657770395279, -0.013143796473741531, -0.023515772074460983, -0.007635919842869043, 0.016416333615779877, -0.02272893115878105, 0.04306158050894737, 0.027664560824632645, 0.0038447838742285967, 0.029792604967951775, 0.01105151791125536, 0.0052530476823449135, -0.05160951614379883, -0.021495023742318153, -0.07213887572288513, 0.029095178470015526, -0.03952080011367798, 0.03327973559498787, -0.007144144736230373, 0.06123041734099388, 0.036766864359378815, -0.03029332123696804, -0.007510740775614977, 0.0077342744916677475, -0.05479264259338379, -0.052110232412815094, 0.034048691391944885, 0.04295428469777107, 0.047103073447942734, 0.02199574001133442, 0.06280409544706345, -0.004430443048477173, -0.029703190550208092, -0.02896999940276146, 0.026502184569835663, 0.0011137578403577209, 0.010917398147284985, -0.005601760931313038, 0.030257554724812508, 0.04756802320480347, 0.014306172728538513, 0.05014313384890556, -0.00642883637920022, -0.014020049013197422, -0.001107051852159202, -0.04184555634856224, 0.02875540778040886, -0.08483560383319855, 0.033476442098617554, 0.015128777362406254, 0.0023001644294708967, -0.05371967703104019, 0.03220677003264427, 0.005208340939134359, 0.008132165297865868, -0.016121268272399902, -0.05650938302278519, -0.005396109540015459, 0.015692083165049553, -0.014306172728538513, -0.05525759235024452, 0.04238203540444374, -0.0473891980946064, -0.004439384210854769, -0.04227473959326744, -0.030597327277064323, -0.02705654874444008, 0.02991778403520584, 0.013492508791387081, -0.0120350681245327, -0.012920262292027473, 0.0934908390045166, 0.008494289591908455, -0.020833363756537437, -0.008968181908130646, -0.0068669626489281654, 0.012061892077326775, -0.05236059054732323, -0.044384900480508804, -0.037839826196432114, 0.0038671372458338737, 0.029095178470015526, 0.004586916416883469, 0.07460668683052063, 0.003563131205737591, -0.058440715074539185, 0.0018933325773105025, -0.06151654198765755, -0.005436345469206572, -0.014896302483975887, 0.0081947548314929, 0.030597327277064323, 0.018329784274101257, 0.036874160170555115, -0.0014663826441392303, 0.02711019665002823, -0.050178900361061096, -0.001205965643748641, 0.07789710909128189, -0.03499647602438927, 0.013912753202021122, 0.005105515476316214, 0.013501450419425964, 0.013170620426535606, -0.0015300898812711239, 0.0028858233708888292, 0.00667025288566947, -0.024248963221907616, -0.010640216059982777, 0.0019134505419060588, 0.02875540778040886, 0.08383417129516602, 0.02038629539310932, -0.0238018948584795, 0.009272187948226929, 0.04027187451720238, 0.02337270975112915, 0.06140924617648125, 0.03429904952645302, -0.016228564083576202, 0.03497859090566635, -0.01683657616376877, -0.06698865443468094, -0.01731046847999096, -0.012026126496493816, 0.044706787914037704, 0.08276120573282242, -0.030168142169713974, 0.015557962469756603, -0.04420607164502144, 0.048533689230680466, -0.0355687215924263, -0.02795068547129631, -0.012178129516541958, -0.04495714604854584, 0.062374912202358246, 0.07861241698265076, -0.010559743270277977, 0.04277545586228371, 0.028451401740312576, 0.02870175801217556, 0.0224606916308403, 0.005561524536460638, -0.018294017761945724, -0.006366246845573187, 0.09449227154254913, -0.0027427615132182837, 0.037839826196432114, -0.013465684838593006, 0.020904894918203354, -0.02945283241569996, 0.06620181351900101, 0.09856952726840973, 0.04034340754151344, 0.06022898852825165, 0.02194209210574627, 0.03966386243700981, 0.0053826975636184216, 0.03099074587225914, -0.015182425267994404, -0.03748217225074768, -0.023390593007206917, 0.005016101989895105, 0.02539345622062683, -0.015620552003383636, 0.05650938302278519, -0.03587272763252258, -0.016326919198036194, 0.027771858498454094, -0.05003583803772926, 0.08912745863199234, -0.0063707176595926285, -0.06509308516979218, -0.01884838193655014, -0.06241067871451378, 0.001661974936723709, -0.0042471447959542274, 0.042417801916599274, 0.020672420039772987, -0.07077978551387787, -0.006755196023732424, 0.011203521862626076, 0.05979980155825615, -0.05972827225923538, -0.017373058944940567, -0.06527191400527954, -0.009862317703664303, -0.009079948998987675, 0.00019195977074559778, 0.010953163728117943, 0.0068848454393446445, 0.03733910992741585, -0.03254654258489609, -0.027217494323849678, -0.009164892137050629, 0.016765046864748, -0.09828340262174606, -0.03994998708367348, -0.05096574127674103, 0.0467454195022583, -0.0034111279528588057, 0.02162020280957222, 0.003335126442834735, 0.03472823277115822, -0.02251433953642845, -0.013778632506728172, 0.0342811644077301, -0.05536488816142082, 0.014234641566872597, -0.05972827225923538, 0.051037270575761795, 0.04356229677796364, 0.04724613577127457, 0.03544354438781738, 0.019778283312916756, 0.036123085767030716, -0.017560826614499092, 0.009763962589204311, -0.059620972722768784, 0.0655580386519432, -0.011212462559342384, -0.003786665154621005, 0.011310817673802376, 0.056795503944158554, -0.06695288419723511, -0.07074402272701263, 0.033154554665088654, -0.017337292432785034, 0.011838357895612717, 0.05894143134355545, -0.00019251860794611275, 0.038626667112112045, -0.04023611173033714, 0.06398435682058334, 0.04034340754151344, 0.00648248428478837, 0.015772555023431778, -0.05132339522242546, -0.029953548684716225, 0.02011805586516857, -0.07746792584657669, -0.05250365287065506, 0.026537951081991196, 0.026216061785817146, 0.06380552798509598, -0.0014473822666332126, 0.027181727811694145, 0.06173113361001015, 0.021602321416139603, -0.03023967146873474, -0.014654885977506638, -0.01418993528932333, -0.0234263576567173, -0.016800811514258385, -0.025786876678466797, -0.0018776851939037442, 0.018186721950769424, -0.05128762871026993, 0.007376620080322027, -0.050286196172237396, -0.046351999044418335, 0.046673886477947235, 0.05683127045631409, 0.014306172728538513, 0.020690301433205605, -0.043311938643455505, -0.006178478244692087, -0.012884496711194515, -0.01472641620784998, 0.0004772449901793152, 0.035282596945762634, 0.050178900361061096, 0.04041493684053421, -0.03741064295172691, -0.0673820748925209, -0.026591598987579346, -0.03744640573859215, 0.02076183259487152, 0.025464987382292747, -0.016747163608670235, 0.05221753194928169, -0.01070280559360981, -0.008333345875144005, 0.0068669626489281654, 0.036337677389383316, -0.020618772134184837, 0.020243234932422638, 0.0365343876183033, 0.02482120878994465, -0.0009964025812223554, 0.0234263576567173, 0.05650938302278519, 0.0065629566088318825, 0.00005347351179807447, -0.044492196291685104, 0.008829590864479542, -0.060837000608444214, -0.06967105716466904, 0.03733910992741585, 0.006603193003684282, 0.008793825283646584, -0.0025348749477416277, 0.026162413880228996, -0.0488913431763649, -0.04431337118148804, -0.028898468241095543, -0.005655408836901188, -0.028451401740312576, -0.04767531901597977, 0.01917027123272419, -0.019563691690564156, 0.017489295452833176, -0.026287592947483063, -0.006460131146013737, -0.04206014797091484, 0.029309771955013275, 0.005901296157389879, 0.017534002661705017, -0.0673820748925209, -0.0007432503625750542, -0.009844435378909111, -0.03494282811880112, -0.04016457870602608, -0.06080123409628868, 0.027771858498454094, 0.03758946806192398, -0.026162413880228996, -0.013716042973101139, 0.039592333137989044, -0.0481402724981308, -0.05819035694003105, 0.00034144811797887087, 0.01714058220386505, 0.017265761271119118, 0.02288987673819065, 0.004566798452287912, -0.0027494675014168024, -0.03433481603860855, -0.009290071204304695, -0.0067015476524829865, 0.0016507982509210706, 0.0120350681245327, -0.04023611173033714, 0.012097657658159733, -0.018115190789103508, -0.0009528134251013398, 0.0911303162574768, -0.01602291315793991, 0.04488561674952507, -0.04370535910129547, -0.05261094868183136, 0.03349432721734047, 0.018562259152531624, -0.06809738278388977, 0.036427091807127, -0.04191708564758301, -0.0934908390045166, 0.016201740130782127, 0.02609088271856308, 0.059620972722768784, -0.030311202630400658, -0.03372680023312569, -0.004399148281663656, -0.006223184987902641, -0.048211801797151566, 0.0453505665063858, 0.019670987501740456, 0.00652272067964077, 0.049857012927532196, -0.03848360478878021, 0.03733910992741585, 0.0042113796807825565, 0.016550453379750252, -0.023515772074460983, -0.025089450180530548, 0.0015714436303824186, 0.036874160170555115, -0.006777549162507057, -0.03508588671684265, 0.029792604967951775, 0.09141644090414047, 0.01315273717045784, 0.018142014741897583, -0.009325835853815079, -0.008297580294311047, 0.012571549043059349, 0.02017170377075672, 0.030168142169713974, -0.04184555634856224, 0.025268277153372765, -0.0449213832616806, -0.006326010916382074, 0.07138780504465103, -0.008498760871589184, 0.05532912164926529, 0.022532222792506218, -0.020958542823791504, -0.06698865443468094, -0.014082638546824455, 0.02501791901886463, 0.00564199686050415, 0.020797599107027054, -0.06219608709216118, -0.04077259078621864, -0.009164892137050629, -0.0123301325365901, 0.0337446853518486, -0.034370578825473785, -0.03226041793823242, 0.04978547990322113, 0.019402746111154556, 0.04256086423993111, -0.005275401286780834, -0.01756976917386055, -0.02837987057864666, -0.0006694842013530433, 0.04291851818561554, -0.04796144366264343, 0.011892005801200867, -0.08691000193357468, 0.010148441419005394, 0.008212637156248093, 0.0028165278490632772, 0.031008629128336906, 0.03844783827662468, -0.025858407840132713, -0.005905766971409321, 0.03379833325743675, -0.0025147569831460714, 0.03354797512292862, 0.02939918451011181, -0.02827257290482521, 0.012044008821249008, 0.02215668559074402, -0.008744647726416588, -0.00889665074646473, -0.030490029603242874, -0.05743928253650665, -0.05075114592909813, -0.02501791901886463, -0.01736411638557911, 0.009406308643519878, 0.00338206859305501, -0.04828333109617233, -0.0452432706952095, 0.0081947548314929, 0.003310537664219737, 0.03934197500348091, -0.01954580843448639, 0.027467850595712662, -0.004756802227348089, -0.006196361035108566, 0.004016905091702938, 0.0751074030995369, 0.026591598987579346, 0.010675981640815735, 0.0975680947303772, -0.014261465519666672, 0.01511983573436737, -0.025482870638370514, 0.05193140730261803, 0.05411309748888016, 0.040486469864845276, 0.010148441419005394, -0.02113736979663372, 0.04381265491247177, -0.012714611366391182, 0.009272187948226929, 0.05511453002691269, 0.09163103252649307, 0.0751074030995369, 0.0033664212096482515, 0.0484621599316597, 0.01731046847999096, 0.017498238012194633, -0.011301876045763493, 0.0730687752366066, -0.034048691391944885, 0.0033686566166579723, -0.0022353394888341427, -0.016371626406908035, -0.01683657616376877, 0.016094444319605827, 0.030311202630400658, 0.029953548684716225, -0.012303308583796024, 0.016890225932002068, 0.010228913277387619, -0.005861060228198767, -0.06427048146724701, 0.04152366518974304, 0.04291851818561554, 0.020010758191347122, 0.002456638030707836, -0.04012881591916084, -0.021119486540555954, -0.005704586394131184, 0.010309386067092419, 0.01997499354183674, 0.0069966125302016735, 0.032135240733623505, -0.009710314683616161, -0.012938144616782665, 0.06559380143880844, -0.0016463275533169508, 0.04152366518974304, -0.018115190789103508, -0.013644511811435223, 0.03508588671684265, 0.030042963102459908, -0.03199217841029167, 0.002434284659102559, 0.02496427111327648, 0.07517893612384796, 0.013438860885798931, 0.024946387857198715, -0.048533689230680466, 0.05075114592909813, 0.0686696320772171, 0.013912753202021122, 0.05046502500772476, -0.07067248970270157, -0.005740351974964142, -0.03050791285932064, 0.03392351046204567, -0.034370578825473785, -0.020994307473301888, -0.04445642977952957, -0.019778283312916756, -0.021709617227315903, -0.05901296064257622, -0.026484301313757896, -0.10193148255348206, -0.0715666264295578, -0.01581726223230362, 0.0238018948584795, 0.01004114467650652, 0.0016753869131207466, 0.03841207176446915, -0.024195315316319466, -0.0025818170979619026, -0.04327617213129997, 0.02533980831503868, 0.0467454195022583, 0.005177046172320843, -0.025733228772878647, 0.029810486361384392, 0.019688870757818222, 0.029059413820505142, -0.06480696052312851, -0.021387727931141853, -0.06645217537879944, -0.03744640573859215, 0.008261814713478088, -0.010729629546403885, 0.029899900779128075, 0.0072737946175038815, -0.0009142538183368742, 0.041344840079545975, 0.011856240220367908 ]
43,018
linearmodels.panel.model
_determine_df_adjustment
null
def _determine_df_adjustment( self, cov_type: str, **cov_config: bool | float | str | IntArray | DataFrame | PanelData, ) -> bool: if cov_type != "clustered" or not self._has_effect: return True num_effects = self.entity_effects + self.time_effects if self.other_effects: assert self._other_effect_cats is not None num_effects += self._other_effect_cats.shape[1] clusters = cov_config.get("clusters", None) if clusters is None: # No clusters return True effects = self._collect_effects() if num_effects == 1: return not self._is_effect_nested(effects, cast(IntArray, clusters)) return True # Default case for 2-way -- not completely clear
(self, cov_type: str, **cov_config: bool | float | str | numpy.ndarray | pandas.core.frame.DataFrame | linearmodels.panel.data.PanelData) -> bool
[ 0.007975875400006771, -0.0003337059752084315, 0.02497255988419056, 0.06987378746271133, 0.022168437018990517, -0.027847224846482277, 0.001866108039394021, 0.012230557389557362, -0.03400218486785889, -0.011754386126995087, 0.004514812957495451, 0.009902607649564743, 0.01858833059668541, -0.03915189206600189, -0.0028239625971764326, -0.004109185189008713, -0.03844645246863365, -0.011939563788473606, 0.10045459121465683, -0.046911727637052536, 0.0003323281416669488, -0.025007830932736397, -0.009470525197684765, -0.02756504900753498, 0.002187964739277959, 0.019311407580971718, -0.004309794399887323, -0.006891262251883745, 0.027829589322209358, 0.0306337121874094, -0.020563561469316483, -0.010493412613868713, -0.004682354629039764, -0.001437333063222468, 0.02899356372654438, -0.0373530238866806, -0.01022887323051691, 0.028235217556357384, 0.06324265152215958, -0.011569208465516567, -0.04013950750231743, -0.0011375212343409657, -0.0037123754154890776, 0.004651491995900869, -0.037811558693647385, 0.00828009657561779, -0.06729893386363983, 0.03527197614312172, -0.021233730018138885, -0.013156447559595108, 0.020440110936760902, -0.04416051506996155, 0.031903501600027084, 0.03266185149550438, 0.05431884154677391, -0.039116621017456055, 0.02521946281194687, 0.02306787297129631, -0.021709902212023735, -0.0285350289195776, 0.03844645246863365, 0.02982245571911335, -0.0034522446803748608, -0.01857069507241249, -0.02805885672569275, -0.047864072024822235, 0.01883523538708687, 0.017838802188634872, 0.0007919661002233624, -0.023579316213726997, -0.009726247750222683, 0.00038771616527810693, -0.0025572183076292276, 0.025378186255693436, -0.022432977333664894, -0.09960806369781494, 0.005546518135815859, 0.012918361462652683, 0.04532448947429657, 0.03784682974219322, -0.0008503852877765894, -0.013332807458937168, -0.008121372200548649, -0.026330530643463135, 0.0653589740395546, -0.013403351418673992, -0.04828733578324318, 0.015951750800013542, 0.053437042981386185, -0.01764480583369732, 0.032820574939250946, -0.0026806702371686697, 0.05276687815785408, -0.043737251311540604, 0.021216094493865967, 0.07251918315887451, 0.0007263822481036186, -0.03622432053089142, 0.022327160462737083, -0.00049518549349159, 0.014417420141398907, 0.08542872965335846, 0.0730835348367691, 0.007680472917854786, -0.002740191761404276, -0.03384346142411232, -0.018605967983603477, -0.00933825597167015, -0.04624155908823013, -0.01788289286196232, 0.004252477549016476, -0.04250273108482361, -0.018553059548139572, -0.014293968677520752, -0.000780392496380955, -0.04310235381126404, -0.024231847375631332, -0.04172674939036369, -0.0577402263879776, 0.03229149430990219, 0.0034720851108431816, -0.0011507482267916203, 0.034372542053461075, -0.007314526010304689, 0.014108790084719658, 0.008006738498806953, 0.01408233679831028, 0.0135532571002841, 0.01883523538708687, 0.029734276235103607, 0.016771825030446053, -0.03558942303061485, -0.04105658084154129, 0.030492624267935753, 0.03915189206600189, 0.05929219350218773, -0.036965031176805496, 0.04641792178153992, -0.0421147383749485, -0.0007048883708193898, 0.027071241289377213, 0.040068965405225754, 0.0285350289195776, -0.011181216686964035, -0.024549296125769615, 0.06119687855243683, -0.01461141649633646, -0.034019820392131805, -0.08825048804283142, 0.022203709930181503, 0.003388314275071025, -0.023244231939315796, -0.047052815556526184, -0.03795264661312103, -0.0031259788665920496, -0.020775193348526955, -0.04832260683178902, -0.020916281268000603, 0.0012367236195132136, -0.02282096818089485, -0.09036680310964584, -0.012089469470083714, 0.038622815161943436, 0.03183295950293541, 0.008743041194975376, -0.02507837489247322, -0.01954067498445511, -0.07378897070884705, -0.03380819037556648, 0.036506496369838715, -0.008769495412707329, 0.0931885614991188, 0.0774572566151619, 0.01414406206458807, -0.027970677241683006, 0.07639910280704498, 0.012406917288899422, -0.06772219389677048, -0.05086218938231468, -0.04458377882838249, 0.01939958706498146, -0.005581790115684271, -0.019558310508728027, 0.031533148139715195, -0.011886656284332275, 0.01230992004275322, -0.025290006771683693, -0.020863374695181847, 0.043384529650211334, 0.06105579063296318, -0.048110976815223694, -0.005987417884171009, 0.024302391335368156, -0.04511285573244095, 0.03204458951950073, -0.01301535964012146, -0.010123057290911674, -0.02731814607977867, -0.004437655676156282, -0.01835906319320202, -0.010793224908411503, -0.0028812794480472803, 0.025642726570367813, 0.009311801753938198, -0.021339545026421547, 0.0631721094250679, -0.004466313868761063, 0.04447796195745468, -0.03682394325733185, -0.0020678197033703327, -0.061690688133239746, -0.027600321918725967, 0.04426633194088936, 0.00014701249892823398, 0.03040444292128086, -0.013174083083868027, 0.026171807199716568, 0.007349797990173101, -0.009016399271786213, 0.01883523538708687, 0.02461984008550644, 0.012221739627420902, 0.01727445051074028, 0.0449717678129673, 0.024690384045243263, -0.018147431313991547, -0.019928665831685066, 0.06444189697504044, 0.07153157144784927, -0.016666008159518242, -0.031056975945830345, 0.021004462614655495, 0.015211040154099464, -0.016639554873108864, 0.07237809151411057, 0.0007522851228713989, 0.01219528540968895, 0.08352404087781906, 0.03788210079073906, 0.022291889414191246, -0.019470131024718285, 0.03633013367652893, 0.019381951540708542, 0.023491136729717255, -0.04155038669705391, -0.08190152794122696, 0.06264302879571915, 0.008972308598458767, 0.0048278518952429295, 0.012768455781042576, 0.023156052455306053, -0.05795185640454292, -0.07131993770599365, -0.006110869813710451, -0.012151195667684078, -0.010105420835316181, 0.015061133541166782, 0.036047957837581635, -0.01549321599304676, -0.03879917412996292, -0.027018332853913307, 0.014514418318867683, 0.029857728630304337, -0.014232242479920387, -0.11308195441961288, -0.015916479751467705, 0.021462997421622276, -0.04271436482667923, 0.003511766204610467, 0.03386109694838524, -0.05837512016296387, 0.05915110558271408, 0.022926785051822662, -0.008147826418280602, -0.00730570824816823, -0.0158635713160038, 0.02116318605840206, -0.006057961843907833, 0.013738434761762619, 0.05301377922296524, 0.02437293529510498, -0.020634105429053307, -0.04271436482667923, 0.006542951799929142, -0.03834063932299614, -0.06775746494531631, -0.07625801116228104, 0.013235809281468391, 0.023226596415042877, 0.0328734815120697, -0.06564114987850189, -0.007371842861175537, 0.05333122983574867, -0.04599465802311897, -0.028658481314778328, -0.005908056162297726, 0.0858519896864891, -0.04581829532980919, -0.024584567174315453, 0.011031311005353928, -0.01999920979142189, -0.011727931909263134, -0.0007269333582371473, 0.017688896507024765, 0.05537700280547142, 0.006269593723118305, 0.05195562168955803, -0.08676905930042267, 0.037564653903245926, 0.035677604377269745, -0.024778563529253006, 0.0333496518433094, -0.025131283327937126, 0.00011043159611290321, 0.02580145001411438, 0.011877837590873241, 0.005930101033300161, -0.02142772637307644, 0.013570892624557018, 0.06828654557466507, -0.04186783730983734, -0.001100044813938439, -0.0347781702876091, 0.02625998668372631, -0.010255327448248863, 0.03197404742240906, 0.07823324203491211, 0.018015161156654358, 0.007808333728462458, 0.007945012301206589, -0.11322304606437683, -0.02271515317261219, 0.0264892540872097, 0.009470525197684765, 0.005321659613400698, -0.06444189697504044, -0.009770337492227554, -0.05195562168955803, 0.04948658123612404, -0.0038071689195930958, 0.029134651646018028, 0.0010157226352021098, 0.02354404330253601, -0.002687283791601658, 0.08796831220388412, -0.00765842804685235, 0.06902725994586945, 0.054953739047050476, 0.056399889290332794, 0.05766968056559563, -0.04130348563194275, -0.018958687782287598, -0.05333122983574867, 0.045042313635349274, 0.006371000781655312, 0.018411971628665924, 0.020863374695181847, -0.09368237107992172, 0.022697515785694122, -0.016507284715771675, 0.0880388543009758, -0.053895581513643265, 0.051320724189281464, 0.02553691156208515, -0.0326794870197773, 0.0142675144597888, 0.00881799403578043, -0.029205195605754852, 0.008659270592033863, -0.021850990131497383, -0.02368513122200966, 0.009205985814332962, 0.02142772637307644, -0.03664758428931236, 0.00748206814751029, -0.012830181047320366, -0.036859214305877686, -0.007292481139302254, 0.03812900558114052, 0.032961662858724594, 0.00030366965802386403, -0.003815986914560199, -0.0861341655254364, 0.05311959609389305, -0.025836722925305367, -0.023014964535832405, 0.0056082443334162235, -0.031303878873586655, 0.015951750800013542, -0.02165699377655983, 0.09361182153224945, -0.005599426105618477, 0.024178938940167427, -0.03243258222937584, -0.0366828553378582, 0.014214606024324894, -0.05121491104364395, 0.019681762903928757, 0.012204104103147984, 0.04684118553996086, -0.021956805139780045, -0.0028151446022093296, 0.043137628585100174, 0.009064897894859314, -0.06190231814980507, -0.003379496280103922, 0.0020832510199397802, 0.028305761516094208, -0.02283860370516777, 0.03560705855488777, 0.00021066739282105118, 0.005577381234616041, -0.03595978021621704, -0.018253248184919357, 0.005061528645455837, -0.010158329270780087, -0.005233479663729668, -0.057458050549030304, 0.04380779340863228, 0.023261867463588715, 0.052943237125873566, 0.007191074080765247, 0.06606440991163254, 0.007618746720254421, 0.03564233332872391, -0.01461141649633646, -0.03222094848752022, 0.047969888895750046, -0.03185059502720833, 0.012521551921963692, 0.013394532725214958, 0.022574065253138542, -0.0030973204411566257, 0.02497255988419056, 0.04296126589179039, 0.025748543441295624, -0.015696030110120773, 0.0465942807495594, -0.017001092433929443, 0.03985733166337013, -0.02805885672569275, 0.007636382710188627, -0.06331319361925125, 0.012027744203805923, -0.012424553744494915, -0.031056975945830345, 0.009646885097026825, -0.04662955179810524, -0.08359458297491074, -0.018747055903077126, 0.02294442057609558, 0.024073123931884766, -0.040527500212192535, 0.030686618760228157, -0.04179729148745537, 0.02167462930083275, 0.0015861366409808397, 0.012944815680384636, 0.014417420141398907, 0.010449322871863842, -0.043243441730737686, -0.02684197388589382, -0.05015674978494644, -0.005925692152231932, 0.04119766876101494, -0.01715981587767601, -0.011137126944959164, -0.009241257794201374, 0.001534331007860601, 0.023279504850506783, -0.01809452287852764, -0.04387833923101425, 0.006961806211620569, 0.010828496888279915, -0.020687013864517212, -0.00316786440089345, -0.03234440088272095, 0.006115278694778681, 0.017838802188634872, 0.07668127864599228, -0.004801397677510977, 0.0215335413813591, 0.005317250266671181, -0.010440505109727383, 0.00023987700114957988, -0.12366355210542679, -0.042643819004297256, 0.0226269718259573, 0.0062828208319842815, 0.008346231654286385, -0.021004462614655495, 0.0025770587380975485, 0.07114357501268387, 0.02520182728767395, 0.018605967983603477, 0.0211984571069479, 0.0421147383749485, -0.0306337121874094, 0.015881206840276718, 0.006617904640734196, 0.06049143895506859, 0.06641712784767151, -0.03280293941497803, 0.005647925194352865, -0.020334294065833092, -0.06729893386363983, -0.01006133109331131, 0.005841921083629131, -0.018747055903077126, -0.003895348869264126, 0.011322304606437683, 0.03257367014884949, 0.037811558693647385, -0.0017062817933037877, 0.006476816721260548, 0.014629052020609379, 0.010220055468380451, -0.016868822276592255, 0.022327160462737083, -0.02640107460319996, 0.003866690443828702, -0.09135441482067108, -0.009153077378869057, -0.022080257534980774, 0.044442690908908844, 0.014637869782745838, 0.07093194127082825, 0.022450612857937813, -0.012336373329162598, -0.038411181420087814, -0.025836722925305367, -0.017318541184067726, 0.05340177193284035, 0.07428278028964996, 0.014752504415810108, -0.0011816112091764808, -0.05386030673980713, -0.014152880758047104, -0.05572972074151039, -0.007380661088973284, -0.016242744401097298, -0.06310156732797623, 0.02520182728767395, -0.0035448335111141205, 0.018182704225182533, -0.017829984426498413, 0.08225424587726593, -0.05036838352680206, -0.010810860432684422, 0.02899356372654438, 0.01024650875478983, 0.04285545274615288, 0.024461114779114723, 0.04581829532980919, 0.08980245143175125, 0.049521856009960175, 0.03123333491384983, -0.03077480010688305, -0.013085903599858284, 0.01575775444507599, -0.02992827259004116, -0.10172437876462936, 0.06934470683336258, -0.017829984426498413, -0.031762413680553436, -0.006842763163149357, 0.044089969247579575, 0.03643595054745674, -0.01764480583369732, -0.02627762220799923, 0.020898645743727684, -0.027529777958989143, -0.03647122159600258, 0.00005683472772943787, -0.03767047077417374, 0.006564996670931578, 0.005321659613400698, -0.00988497119396925, -0.023261867463588715, -0.019329043105244637, -0.036030322313308716, -0.03347310423851013, -0.009964332915842533, 0.004651491995900869, 0.005542109254747629, 0.0019785373006016016, -0.006666403729468584, 0.008125781081616879, 0.005564154125750065, -0.002607921836897731, -0.05121491104364395, 0.0021548971999436617, -0.025378186255693436, -0.037564653903245926, 0.01939958706498146, 0.014099972322583199, 0.0044552916660904884, -0.012239376083016396, 0.03417854383587837, 0.016745369881391525, -0.007698108907788992, -0.042538002133369446, -0.006794264540076256, -0.017468446865677834, -0.0288701131939888, -0.020898645743727684, -0.017203906551003456, 0.024584567174315453, 0.05572972074151039, -0.04377252236008644, 0.020669378340244293, 0.030792435631155968, -0.006891262251883745, -0.04423105716705322, 0.0012356213992461562, -0.07191956043243408, -0.041127122938632965, -0.019805215299129486, 0.027388690039515495, -0.023385319858789444, 0.001619204180315137, 0.03692976012825966, 0.03368473798036575, -0.0011860202066600323, -0.03340256214141846, 0.022521156817674637, 0.016507284715771675, -0.12669694423675537, 0.007199892308562994, -0.06994432955980301, 0.021709902212023735, 0.0421147383749485, 0.017821166664361954, -0.05428357049822807, 0.01989339478313923, -0.021974440664052963, 0.0036241954658180475, 0.003998960368335247, 0.03326147422194481, -0.03423145413398743, 0.025642726570367813, 0.010846132412552834, 0.009743883274495602, 0.006137324031442404, -0.040633317083120346, -0.03393164277076721, 0.07371842861175537, -0.01633092574775219, 0.009329437278211117, 0.00811255443841219, -0.011013674549758434, 0.005815466865897179, -0.020687013864517212, -0.03393164277076721, 0.01715981587767601, 0.026700885966420174, 0.016366196796298027, 0.031074611470103264, 0.0197699423879385, -0.04507758468389511, 0.0288701131939888, 0.031656596809625626, -0.008033192716538906, 0.028834840282797813, 0.11428119987249374, 0.00047534500481560826, 0.03647122159600258, -0.02234479784965515, 0.06511206924915314, -0.01892341487109661, 0.023279504850506783, 0.005705242045223713, -0.02176280878484249, 0.01939958706498146, 0.03678867220878601, -0.06356009840965271, -0.011331122368574142, 0.05865729600191116, 0.012336373329162598, -0.04888695850968361, 0.008557863533496857, 0.03752938285470009, -0.02874666079878807, 0.015590213239192963, 0.09819718450307846, 0.011886656284332275, 0.014999408274888992, -0.06966215372085571, 0.027371052652597427, -0.030704256147146225, -0.0032604532316327095, 0.00704116839915514, 0.0037211934104561806, 0.02402021549642086, 0.06772219389677048, -0.07886813580989838, -0.056999512016773224, 0.030704256147146225, -0.04059804603457451, 0.030104631558060646, 0.0317271426320076, -0.025148918852210045, -0.03227385878562927, 0.011269396170973778, 0.006353364791721106, 0.023350048810243607, -0.01716863363981247, -0.00024387265148106962, 0.05978599935770035, -0.004334044177085161, -0.06070307269692421, 0.06475935131311417, 0.07001487165689468, -0.01749490015208721, -0.028817204758524895, 0.02107500657439232, -0.0032670667860656977, -0.0019531857687979937, -0.021568814292550087, -0.02049301750957966, -0.02827048860490322, 0.08564035594463348, -0.04327871650457382, 0.015660757198929787, -0.04902804642915726, -0.06532370299100876, 0.02578381448984146, -0.02603071928024292, -0.003280293894931674, -0.021956805139780045, 0.00988497119396925, -0.06338374316692352, 0.04366670548915863, -0.009232440032064915, 0.017900528386235237, -0.0026630342472344637, -0.04024532437324524, -0.004576538689434528, -0.07809215784072876, -0.03671812638640404, -0.02590726688504219, -0.013685526326298714, -0.053084325045347214, -0.03999841958284378, -0.05618825927376747, 0.028305761516094208, 0.00019344475003890693, 0.02200971357524395, 0.060632526874542236, -0.0430670827627182, 0.06624077260494232, -0.020775193348526955, 0.02447875216603279, -0.01954067498445511, 0.014867138117551804, -0.0011066582519561052, 0.007676064036786556, -0.02661270648241043, 0.04684118553996086, 0.017230359837412834, -0.0019531857687979937, -0.020334294065833092, 0.03837591037154198, 0.03357892110943794, 0.006900080479681492, -0.05050947144627571, -0.04140929877758026, 0.026242351159453392 ]