1. The basics of double/debiased machine learning#

In the following we provide a brief summary of and motivation to the double machine learning (DML) framework and show how the corresponding methods provided by the DoubleML package can be applied. For details we refer to Chernozhukov et al. (2018).

1.1. Data generating process#

We consider the following partially linear model

\[ \begin{align}\begin{aligned}y_i = \theta_0 d_i + g_0(x_i) + \zeta_i, & &\zeta_i \sim \mathcal{N}(0,1),\\d_i = m_0(x_i) + v_i, & &v_i \sim \mathcal{N}(0,1),\end{aligned}\end{align} \]

with covariates \(x_i \sim \mathcal{N}(0, \Sigma)\), where \(\Sigma\) is a matrix with entries \(\Sigma_{kj} = 0.7^{|j-k|}\). We are interested in performing valid inference on the causal parameter \(\theta_0\). The true parameter \(\theta_0\) is set to \(0.5\) in our simulation experiment.

The nuisance functions are given by

\[ \begin{align}\begin{aligned}m_0(x_i) &= x_{i,1} + \frac{1}{4} \frac{\exp(x_{i,3})}{1+\exp(x_{i,3})},\\g_0(x_i) &= \frac{\exp(x_{i,1})}{1+\exp(x_{i,1})} + \frac{1}{4} x_{i,3}.\end{aligned}\end{align} \]

Note

In [1]: import numpy as np

In [2]: from doubleml.datasets import make_plr_CCDDHNR2018

In [3]: np.random.seed(1234)

In [4]: n_rep = 1000

In [5]: n_obs = 500

In [6]: n_vars = 20

In [7]: alpha = 0.5

In [8]: data = list()

In [9]: for i_rep in range(n_rep):
   ...:     (x, y, d) = make_plr_CCDDHNR2018(alpha=alpha, n_obs=n_obs, dim_x=n_vars, return_type='array')
   ...:     data.append((x, y, d))
   ...: 
library(DoubleML)
set.seed(1234)
n_rep = 1000
n_obs = 500
n_vars = 20
alpha = 0.5

data = list()
for (i_rep in seq_len(n_rep)) {
    data[[i_rep]] = make_plr_CCDDHNR2018(alpha=alpha, n_obs=n_obs, dim_x=n_vars,
                                        return_type="data.frame")
}

1.2. Regularization bias in simple ML-approaches#

Naive inference that is based on a direct application of machine learning methods to estimate the causal parameter, \(\theta_0\), is generally invalid. The use of machine learning methods introduces a bias that arises due to regularization. A simple ML approach is given by randomly splitting the sample into two parts. On the auxiliary sample indexed by \(i \in I^C\) the nuisance function \(g_0(X)\) is estimated with an ML method, for example a random forest learner. Given the estimate \(\hat{g}_0(X)\), the final estimate of \(\theta_0\) is obtained as (\(n=N/2\)) using the other half of observations indexed with \(i \in I\)

\[\hat{\theta}_0 = \left(\frac{1}{n} \sum_{i\in I} D_i^2\right)^{-1} \frac{1}{n} \sum_{i\in I} D_i (Y_i - \hat{g}_0(X_i)).\]
In [10]: def non_orth_score(y, d, l_hat, m_hat, g_hat, smpls):
   ....:     u_hat = y - g_hat
   ....:     psi_a = -np.multiply(d, d)
   ....:     psi_b = np.multiply(d, u_hat)
   ....:     return psi_a, psi_b
   ....: 
In [11]: from doubleml import DoubleMLData

In [12]: from doubleml import DoubleMLPLR

In [13]: from sklearn.ensemble import RandomForestRegressor

In [14]: from sklearn.base import clone

In [15]: import numpy as np

In [16]: from scipy import stats

In [17]: import matplotlib.pyplot as plt

In [18]: import seaborn as sns

In [19]: face_colors = sns.color_palette('pastel')

In [20]: edge_colors = sns.color_palette('dark')

In [21]: np.random.seed(1111)

In [22]: ml_l = RandomForestRegressor(n_estimators=132, max_features=12, max_depth=5, min_samples_leaf=1)

In [23]: ml_m = RandomForestRegressor(n_estimators=378, max_features=20, max_depth=3, min_samples_leaf=6)

In [24]: ml_g = clone(ml_l)

# to speed up the illustration we hard-code the simulation results
In [25]: theta_nonorth = np.array([0.52328641, 0.57356639, 0.55810707, 0.5977535 , 0.4813668 , 0.5327912 , 0.61704155, 0.54681571, 0.52857031, 0.6247725 , 0.56574599, 0.42765337, 0.46968109, 0.37845713, 0.48736779, 0.54648086, 0.61232815, 0.45526944, 0.58970519, 0.49146413, 0.61463843, 0.60010516, 0.58994949, 0.47546871, 0.53585469, 0.53000956, 0.51277996, 0.54949396, 0.58818701, 0.48921812, 0.49379525, 0.61029898, 0.56305835, 0.58602554, 0.57746665, 0.47510051, 0.42459541, 0.55138846, 0.51448972, 0.49390206, 0.46970825, 0.48389275, 0.5122035 , 0.35942868, 0.54754709, 0.48853634, 0.53462013, 0.57257894, 0.50344216, 0.7003655 , 0.55803537, 0.5603601 , 0.55943751, 0.53039375, 0.57273209, 0.588119  , 0.60273543, 0.57463947, 0.58192052, 0.39363028, 0.5904183 , 0.70081522, 0.5915527 , 0.68069836, 0.60378249, 0.47595378, 0.57105257, 0.57417753, 0.59693217, 0.49271695, 0.54860756, 0.51489703, 0.44138932, 0.50798106, 0.59197585, 0.46038645, 0.61738642, 0.49256698, 0.46462596, 0.5088013 , 0.48879602, 0.40785025, 0.49317757, 0.52101581, 0.36721687, 0.55132674, 0.6145169 , 0.61903097, 0.60885654, 0.60973684, 0.40244356, 0.46518551, 0.6791729 , 0.56333526, 0.55315272, 0.50280275, 0.48186332, 0.45825446, 0.53875985, 0.54707233, 0.55333261, 0.63615035, 0.51991688, 0.55070896, 0.44300732, 0.69778352, 0.64837045, 0.60167985, 0.50493321, 0.55693924, 0.5686461 , 0.6367919 , 0.43807751, 0.42727251, 0.55899025, 0.512766  , 0.42414525, 0.5123373 , 0.54132912, 0.50466702, 0.50510984, 0.63393837, 0.52571856, 0.6110036 , 0.35394133, 0.64759649, 0.426197  , 0.52952409, 0.5371253 , 0.44604935, 0.49752703, 0.57413701, 0.48082096, 0.48286192, 0.48941886, 0.49669565, 0.61011785, 0.5499223 , 0.38338078, 0.5684348 , 0.62734346, 0.51551337, 0.58548162, 0.39843792, 0.51066774, 0.51682297, 0.41662497, 0.51405945, 0.47680314, 0.57564587, 0.55047709, 0.40895692, 0.48507321, 0.48150446, 0.64835334, 0.55744201, 0.4697698 , 0.4778423 , 0.46274545, 0.72789211, 0.47809226, 0.48196451, 0.551625  , 0.54276761, 0.60078249, 0.55327398, 0.62120112, 0.53889818, 0.57168766, 0.59412325, 0.55290987, 0.61479866, 0.45270291, 0.55090591, 0.49514174, 0.52680104, 0.56749322, 0.56505284, 0.4992059 , 0.55127505, 0.57524686, 0.52585235, 0.53229655, 0.47622374, 0.44488789, 0.50545333, 0.56539543, 0.54838977, 0.57060796, 0.62361319, 0.44563308, 0.5003698 , 0.45594423, 0.46606284, 0.45355246, 0.52816031, 0.57419905, 0.5410551 , 0.53759333, 0.56140027, 0.60997517, 0.63110121, 0.43629724, 0.47555077, 0.49690284, 0.54023968, 0.54261783, 0.49963926, 0.65625668, 0.66449324, 0.43884447, 0.57129263, 0.33584012, 0.47511805, 0.34028965, 0.57814497, 0.53450725, 0.61166678, 0.54127341, 0.54147   , 0.55800002, 0.51160151, 0.58028185, 0.59212372, 0.46545939, 0.55286645, 0.49703378, 0.49730541, 0.58857442, 0.56035477, 0.52518858, 0.66457484, 0.73078869, 0.48474359, 0.52586322, 0.60917992, 0.61026355, 0.41290474, 0.51979286, 0.66831908, 0.42185021, 0.48317411, 0.43697095, 0.64413848, 0.55197041, 0.47930367, 0.56469123, 0.44890795, 0.37844697, 0.35164074, 0.50716352, 0.59215554, 0.60447157, 0.60752355, 0.61793807, 0.44814341, 0.64305071, 0.59159908, 0.65125645, 0.58544308, 0.3600717 , 0.45363031, 0.61097706, 0.52458445, 0.42697636, 0.48711005, 0.55300448, 0.37965628, 0.61771679, 0.5089207 , 0.53578385, 0.43862644, 0.56336916, 0.61680458, 0.62323204, 0.47641849, 0.56843699, 0.54752781, 0.59708379, 0.61883269, 0.50909783, 0.43850491, 0.58974292, 0.49420969, 0.58473545, 0.42414872, 0.69756484, 0.55453778, 0.63226348, 0.55137947, 0.54003995, 0.62681415, 0.51932606, 0.50475418, 0.44882915, 0.5472079 , 0.61434172, 0.57540472, 0.61154333, 0.39089563, 0.59718904, 0.57288303, 0.53569031, 0.47663109, 0.4728607 , 0.60943294, 0.67021391, 0.55689497, 0.59862612, 0.5217708 , 0.4728515 , 0.61083456, 0.4769726 , 0.5025934 , 0.59237259, 0.57291053, 0.55393486, 0.47016436, 0.46321853, 0.57593761, 0.59413597, 0.40312949, 0.69317039, 0.58008741, 0.54355454, 0.46655708, 0.53293769, 0.57314345, 0.58849483, 0.46739483, 0.46984072, 0.51811592, 0.34895571, 0.34717479, 0.58424658, 0.34806726, 0.49737285, 0.41588973, 0.49969555, 0.56463711, 0.58363827, 0.44714116, 0.62826166, 0.47811024, 0.43887814, 0.53916079, 0.59560763, 0.5491493 , 0.48654848, 0.46210772, 0.46522759, 0.57971661, 0.38666085, 0.52764583, 0.6287972 , 0.65112072, 0.50850476, 0.46352321, 0.58135214, 0.57978432, 0.58933261, 0.47563279, 0.56898215, 0.4296174 , 0.68463977, 0.64897991, 0.57323481, 0.66167288, 0.553377  , 0.55324918, 0.40643082, 0.49186567, 0.51094983, 0.43758268, 0.45570856, 0.61405943, 0.4608622 , 0.50980897, 0.34744005, 0.46259612, 0.57727937, 0.42545334, 0.58734005, 0.43360918, 0.73543086, 0.53872757, 0.48093209, 0.61192705, 0.61599023, 0.55635875, 0.48847344, 0.50631136, 0.55652377, 0.46278946, 0.54833289, 0.40865905, 0.58969522, 0.50159954, 0.54574829, 0.51228323, 0.47260273, 0.53563636, 0.49616576, 0.5914049 , 0.47119647, 0.64848706, 0.56442955, 0.53782256, 0.59228539, 0.45564465, 0.55603929, 0.40188956, 0.47684626, 0.56215903, 0.45795109, 0.48627697, 0.63027951, 0.48734554, 0.51792059, 0.41021068, 0.49752463, 0.66428508, 0.40135928, 0.48423971, 0.61611091, 0.5681857 , 0.55489614, 0.57716277, 0.50822594, 0.61446625, 0.63694847, 0.47051379, 0.61684335, 0.50454219, 0.46705443, 0.57543441, 0.62874235, 0.61278484, 0.55511877, 0.49467431, 0.57886118, 0.62086825, 0.52985768, 0.57074016, 0.51147937, 0.43235764, 0.54675407, 0.53570403, 0.47359363, 0.54927324, 0.60401485, 0.44723584, 0.52033308, 0.5283196 , 0.56765117, 0.58193342, 0.50924812, 0.53098169, 0.44647117, 0.5860353 , 0.50867477, 0.47155282, 0.48603775, 0.46297341, 0.48213296, 0.42373343, 0.51347689, 0.537851  , 0.47948647, 0.55109115, 0.41575012, 0.57976377, 0.43576637, 0.49168309, 0.48862993, 0.55380779, 0.53885336, 0.60138872, 0.39765241, 0.60137404, 0.53692952, 0.44201017, 0.60829564, 0.52805651, 0.42568115, 0.43395763, 0.51049196, 0.59671629, 0.53932093, 0.61288662, 0.48532588, 0.44755878, 0.39897815, 0.48546131, 0.52340699, 0.62242501, 0.61332726, 0.47966986, 0.39922943, 0.56655363, 0.47240258, 0.70180277, 0.54329484, 0.57983972, 0.48174702, 0.40806803, 0.38012296, 0.53096472, 0.63231761, 0.49852238, 0.58988759, 0.53035235, 0.57124057, 0.54561548, 0.58162089, 0.48705896, 0.41132108, 0.59653803, 0.50096089, 0.51099718, 0.55140545, 0.55798434, 0.53856297, 0.64601571, 0.61537674, 0.61274748, 0.58409855, 0.48583318, 0.53703224, 0.49489112, 0.64557629, 0.42487364, 0.48796559, 0.47811467, 0.48299745, 0.57026384, 0.62516635, 0.50589203, 0.55423402, 0.52439251, 0.58289281, 0.40879611, 0.50295334, 0.44628286, 0.52906527, 0.50026268, 0.54580796, 0.67054523, 0.59118762, 0.5557291 , 0.37692782, 0.61776855, 0.65028869, 0.51684233, 0.44060372, 0.55010748, 0.46544193, 0.57606724, 0.62861932, 0.50409861, 0.49855097, 0.47795148, 0.63604432, 0.4462969 , 0.56485265, 0.47978807, 0.58513272, 0.55038105, 0.52389705, 0.46400566, 0.39643151, 0.40669508, 0.37131903, 0.54409735, 0.52997155, 0.55972177, 0.4513946 , 0.49035362, 0.53726292, 0.70896823, 0.43129426, 0.64302928, 0.53381332, 0.51589647, 0.61336828, 0.49011946, 0.32064252, 0.46011238, 0.48114897, 0.41438599, 0.6162567 , 0.59125858, 0.53468529, 0.62485751, 0.5643462 , 0.43432088, 0.55723546, 0.55677339, 0.51964121, 0.59753128, 0.44999261, 0.54992742, 0.51795846, 0.47951257, 0.57153128, 0.57908496, 0.4626688 , 0.45531525, 0.44313973, 0.54603293, 0.57576854, 0.46361253, 0.527298  , 0.5620756 , 0.46704174, 0.44964006, 0.44489873, 0.59324251, 0.38614873, 0.7052925 , 0.54426546, 0.57456808, 0.44467559, 0.53451817, 0.46977995, 0.62371312, 0.44698664, 0.60374147, 0.47923972, 0.59966241, 0.45159563, 0.59206654, 0.54386941, 0.42658765, 0.53008371, 0.55862966, 0.4920328 , 0.56761111, 0.52064894, 0.39681885, 0.44574245, 0.65423631, 0.49700968, 0.52949852, 0.69074303, 0.47083257, 0.56112144, 0.61171242, 0.57201577, 0.55023754, 0.50197115, 0.54440172, 0.41029551, 0.55578038, 0.59709186, 0.50556125, 0.60242079, 0.54916367, 0.51934554, 0.65992837, 0.37152973, 0.61838874, 0.55014278, 0.5717791 , 0.48307382, 0.53725693, 0.56510068, 0.56899223, 0.47274061, 0.38206639, 0.57567921, 0.58460404, 0.69554675, 0.44126231, 0.5453808 , 0.55469192, 0.51558473, 0.45490972, 0.32829398, 0.57063905, 0.61816149, 0.4851176 , 0.62280177, 0.55124556, 0.54876465, 0.62502545, 0.53016613, 0.55607373, 0.42591779, 0.47576693, 0.54436353, 0.61658262, 0.72634035, 0.41672421, 0.52000937, 0.55465022, 0.52901531, 0.55834794, 0.58534343, 0.51694802, 0.43374908, 0.66757089, 0.47552899, 0.50901742, 0.61552002, 0.58569846, 0.49247126, 0.62729266, 0.45454611, 0.57492484, 0.36653027, 0.57255697, 0.57824612, 0.53146156, 0.53596233, 0.53638362, 0.46116763, 0.62344651, 0.52368548, 0.43118748, 0.39730289, 0.58060133, 0.51892256, 0.50985834, 0.52621487, 0.45318262, 0.42636468, 0.55077814, 0.51755157, 0.50558189, 0.48513592, 0.60846418, 0.56548573, 0.63888894, 0.64851154, 0.54867037, 0.46621769, 0.51043987, 0.72938861, 0.56584276, 0.56401497, 0.45178682, 0.73033294, 0.46287789, 0.45124177, 0.50136769, 0.3687888 , 0.55620501, 0.56414095, 0.50050497, 0.51400812, 0.51195696, 0.49870403, 0.54124953, 0.51817863, 0.58274345, 0.36739039, 0.6223105 , 0.49839431, 0.48262867, 0.60799173, 0.48497077, 0.50533284, 0.52068533, 0.51819816, 0.53736352, 0.43353299, 0.49234493, 0.6137744 , 0.50568935, 0.40132373, 0.5764364 , 0.48163201, 0.41512117, 0.47245353, 0.49395644, 0.58230514, 0.58230577, 0.50858737, 0.54478675, 0.49901037, 0.55797797, 0.51010655, 0.53948516, 0.55935642, 0.39606487, 0.59820544, 0.47212327, 0.62012946, 0.66593186, 0.58616071, 0.54776001, 0.4611425 , 0.62522599, 0.3766581 , 0.51283615, 0.44134182, 0.5182332 , 0.60188039, 0.4490443 , 0.46919351, 0.47447443, 0.49600183, 0.57066395, 0.52439289, 0.56334611, 0.56060475, 0.39914239, 0.3675798 , 0.51564721, 0.49865563, 0.50048977, 0.51907243, 0.48807419, 0.4837173 , 0.54264044, 0.56838568, 0.54979317, 0.51717151, 0.47623781, 0.45639949, 0.49258588, 0.59268146, 0.58045385, 0.573669  , 0.63253715, 0.42660048, 0.51028837, 0.52477234, 0.60977474, 0.48255809, 0.50034024, 0.58582749, 0.56229419, 0.55128857, 0.67506051, 0.50764811, 0.59438154, 0.42687047, 0.45088934, 0.56769317, 0.69933473, 0.64133968, 0.58965277, 0.52414937, 0.47795837, 0.51327079, 0.47880271, 0.51766668, 0.56479121, 0.42850267, 0.70736401, 0.36848061, 0.56501167, 0.4173219 , 0.59616084, 0.63402178, 0.59863361, 0.40275257, 0.61610026, 0.55072114, 0.54363882, 0.55507125, 0.40734622, 0.54603062, 0.48360112, 0.37964225, 0.49283026, 0.59018895, 0.59009867, 0.4508418 , 0.56922331, 0.61952373, 0.48797082, 0.53357994, 0.463265  , 0.51038265, 0.59259957, 0.40175384, 0.54355008, 0.48951247, 0.51671369, 0.48761615, 0.45277739, 0.60093516, 0.42003811, 0.51235   , 0.59074681, 0.50383085, 0.30816788, 0.58677263, 0.52795737, 0.55613922, 0.53170224, 0.30069634, 0.57035186, 0.57304229, 0.50054292, 0.47112149, 0.5553012 , 0.45457155, 0.59640452, 0.50753294, 0.60960469, 0.54302708, 0.45963418, 0.64439113, 0.40809175, 0.50408166, 0.57626158, 0.54048658, 0.5797436 , 0.58846209, 0.48535104, 0.47475958, 0.62056536, 0.55518476, 0.5876704 , 0.60219568, 0.61776265, 0.65848052, 0.5299857 , 0.51399049, 0.56802533, 0.509565  , 0.48821165, 0.4238927 , 0.57421096, 0.51616527, 0.65465229, 0.46116782, 0.33355847, 0.58515526, 0.55622069, 0.63010995, 0.49775216, 0.54856983, 0.57677015, 0.52546157, 0.53642151, 0.57683734, 0.51020746, 0.45510774, 0.42469847, 0.42367087, 0.38633576, 0.56000824, 0.51460849, 0.57506362, 0.49294988, 0.64173013, 0.45438165, 0.40507967, 0.58082999, 0.4938575 , 0.53151652, 0.61474763, 0.35312902, 0.53849575, 0.48628075, 0.59266678, 0.52805816, 0.52097269, 0.53184868, 0.63211204, 0.66178091, 0.58451712, 0.49163581, 0.61183509, 0.57385018, 0.56755006, 0.58717042, 0.47939109, 0.46031912, 0.41769586, 0.5317388 , 0.57788374, 0.57080485, 0.49382667, 0.63281403, 0.50398231, 0.60290742, 0.43699714, 0.49636521, 0.5053502 , 0.37261477, 0.48081627, 0.50270047, 0.66441706, 0.42627842, 0.53421282, 0.57808942, 0.44486317, 0.58220927, 0.57082553, 0.52144876, 0.5852739 , 0.60581384, 0.47197106, 0.58540418])

In [26]: se_nonorth = np.array([0.04831872, 0.04832813, 0.0440032 , 0.04114123, 0.04031513, 0.04924838, 0.04834419, 0.04662809, 0.04292674, 0.04538775, 0.04924342, 0.04409527, 0.0417032 , 0.05194798, 0.05030047, 0.0367301 , 0.05075158, 0.05003675, 0.04019231, 0.0408118 , 0.03840654, 0.05299583, 0.04520576, 0.04644108, 0.04959359, 0.03872031, 0.04183655, 0.05109119, 0.05050073, 0.04835535, 0.04488573, 0.0381961 , 0.04422992, 0.04346715, 0.05144883, 0.04486199, 0.04513496, 0.04031142, 0.04932358, 0.04871112, 0.0440838 , 0.03665062, 0.04599354, 0.04412655, 0.04248635, 0.04130969, 0.04234649, 0.05137093, 0.04609058, 0.05068716, 0.0416494 , 0.03860875, 0.04452859, 0.04575008, 0.03959878, 0.04713601, 0.04416249, 0.04282636, 0.04742508, 0.04341061, 0.04468596, 0.04133775, 0.05035144, 0.0429771 , 0.04869872, 0.04490033, 0.04602814, 0.04482479, 0.04350321, 0.0507471 , 0.04018135, 0.04230126, 0.03655288, 0.0468958 , 0.04503343, 0.04182587, 0.04241048, 0.04675773, 0.04176107, 0.04655241, 0.049157  , 0.04956828, 0.04646219, 0.04328973, 0.04411666, 0.04837818, 0.04206927, 0.04889302, 0.05010237, 0.04739132, 0.04636621, 0.04739799, 0.04309182, 0.04921978, 0.04310753, 0.04744372, 0.04151646, 0.04221348, 0.04493263, 0.03779441, 0.04688649, 0.03919651, 0.04590451, 0.05016068, 0.03819017, 0.04131799, 0.04337898, 0.0392395 , 0.04348177, 0.04323946, 0.05393595, 0.04038024, 0.04830559, 0.04124088, 0.05180402, 0.05567998, 0.04244997, 0.03911898, 0.04337131, 0.04624824, 0.04949055, 0.04985597, 0.04326196, 0.04212764, 0.04842716, 0.04561389, 0.04082098, 0.04448624, 0.0448946 , 0.05293593, 0.04388315, 0.04321804, 0.04614838, 0.04602541, 0.04429507, 0.04405809, 0.05071437, 0.05146057, 0.04623581, 0.048504  , 0.04321356, 0.04723778, 0.03439781, 0.04850456, 0.04551087, 0.04798238, 0.03911667, 0.03747808, 0.04200668, 0.04340506, 0.04620754, 0.05201033, 0.05035776, 0.0456115 , 0.04366328, 0.04285165, 0.04355332, 0.04149404, 0.04189363, 0.04271938, 0.043017  , 0.04975933, 0.04724617, 0.0478123 , 0.04583418, 0.05493124, 0.04423306, 0.04228908, 0.04539415, 0.04335721, 0.03785391, 0.04805826, 0.04607728, 0.04239644, 0.04415323, 0.04616612, 0.04793052, 0.05040471, 0.04690316, 0.04168859, 0.04188572, 0.04151215, 0.04243537, 0.04459925, 0.05220799, 0.04072488, 0.03941964, 0.05134895, 0.0484997 , 0.04823143, 0.05272294, 0.0518343 , 0.04815165, 0.04984051, 0.0464933 , 0.03990746, 0.05754139, 0.04443048, 0.03948512, 0.04694665, 0.04627509, 0.04513908, 0.05028515, 0.03946741, 0.04535004, 0.04954032, 0.04290176, 0.04387563, 0.05135577, 0.0504392 , 0.04766801, 0.05580917, 0.04468912, 0.04505744, 0.04120763, 0.04365832, 0.05030036, 0.04299801, 0.05215436, 0.04222343, 0.04385739, 0.04116473, 0.04945468, 0.04284718, 0.04603566, 0.0459052 , 0.04613431, 0.03829818, 0.04267634, 0.04598015, 0.04513768, 0.04448734, 0.05130906, 0.04129426, 0.04086385, 0.04564178, 0.04209469, 0.04482055, 0.04366908, 0.04894291, 0.05089028, 0.0456697 , 0.04560245, 0.04475189, 0.04815378, 0.04657151, 0.04587175, 0.03997987, 0.04141135, 0.04238376, 0.04364734, 0.04414603, 0.05422814, 0.05288109, 0.04474988, 0.04839057, 0.03951434, 0.04106973, 0.04353691, 0.04514385, 0.04276905, 0.04152265, 0.04575897, 0.05536061, 0.04523277, 0.04283036, 0.04593579, 0.04794558, 0.04065449, 0.04222009, 0.04894703, 0.04746394, 0.04702815, 0.04692336, 0.03422089, 0.04594671, 0.05291489, 0.04307596, 0.04955153, 0.04553489, 0.04901159, 0.04473089, 0.04589466, 0.0441002 , 0.046049  , 0.04348205, 0.05187483, 0.04383983, 0.04346503, 0.04739405, 0.04447819, 0.04102896, 0.0431398 , 0.04656729, 0.03896816, 0.0542891 , 0.04270792, 0.04289141, 0.05348902, 0.0495009 , 0.04643517, 0.04410614, 0.04200152, 0.04493118, 0.04806057, 0.04190507, 0.04127871, 0.04847289, 0.04842111, 0.04833609, 0.04889407, 0.05076527, 0.04744793, 0.05150318, 0.04888322, 0.04992893, 0.04023113, 0.03881747, 0.0386972 , 0.04694449, 0.03855655, 0.0457303 , 0.04371627, 0.04143969, 0.03938361, 0.04876415, 0.04742728, 0.04700492, 0.04762283, 0.0488795 , 0.04395567, 0.04441107, 0.05068248, 0.04547187, 0.04361415, 0.05412799, 0.04036971, 0.04535149, 0.04536353, 0.03678323, 0.04403829, 0.04812895, 0.0457191 , 0.04258916, 0.04280755, 0.05153953, 0.04413582, 0.04770393, 0.05038132, 0.03757377, 0.04973624, 0.04261597, 0.0456351 , 0.04472504, 0.04771097, 0.04373888, 0.04370413, 0.04552507, 0.04293194, 0.04761842, 0.04287779, 0.04733812, 0.04423761, 0.0448224 , 0.04636959, 0.04296324, 0.0477725 , 0.04653299, 0.04201292, 0.05075975, 0.05017969, 0.04138296, 0.04060744, 0.04932747, 0.0400757 , 0.05220853, 0.03915695, 0.04293621, 0.06503597, 0.03595801, 0.03622248, 0.04329143, 0.0445115 , 0.03907058, 0.04102573, 0.04438729, 0.04948462, 0.04521646, 0.04211678, 0.04829002, 0.05505099, 0.03515793, 0.04173115, 0.04445393, 0.05032834, 0.05006664, 0.04629111, 0.04772484, 0.04092481, 0.04156632, 0.04229721, 0.04327583, 0.04579568, 0.04716264, 0.04178555, 0.04428462, 0.04725546, 0.04493506, 0.05485039, 0.0442419 , 0.03824128, 0.048013  , 0.04400902, 0.03878737, 0.04157463, 0.03909924, 0.04262371, 0.04611657, 0.03955994, 0.04055998, 0.04706018, 0.04562143, 0.04247859, 0.03936683, 0.04726424, 0.04247808, 0.04722227, 0.05177304, 0.05076287, 0.04027302, 0.038523  , 0.04700016, 0.04626175, 0.04963526, 0.04924924, 0.04556549, 0.03992306, 0.04264629, 0.04201707, 0.0421803 , 0.04335506, 0.04803246, 0.04784608, 0.04146418, 0.03996568, 0.05063166, 0.04452316, 0.04521715, 0.04285809, 0.04856424, 0.04510337, 0.04772573, 0.04363936, 0.04424811, 0.04980449, 0.04387433, 0.04367579, 0.04510261, 0.043214  , 0.0401914 , 0.05182074, 0.03951072, 0.0477948 , 0.04673033, 0.04689404, 0.04998034, 0.04552733, 0.04831458, 0.04267216, 0.04826833, 0.04793905, 0.05178392, 0.04410214, 0.03943804, 0.04291292, 0.0406942 , 0.04885506, 0.04308423, 0.04549851, 0.04976944, 0.05076628, 0.04412881, 0.04532336, 0.04897802, 0.0469969 , 0.04439076, 0.04942879, 0.04328135, 0.04629906, 0.0459189 , 0.03818804, 0.04568807, 0.04147959, 0.05170615, 0.05463537, 0.04573667, 0.04900106, 0.04359653, 0.03808469, 0.04496064, 0.03948091, 0.04690949, 0.04154617, 0.0474799 , 0.04454476, 0.04736569, 0.05066139, 0.04207634, 0.0479254 , 0.04132016, 0.04558345, 0.044382  , 0.04258322, 0.04245783, 0.04792109, 0.03685759, 0.04711378, 0.04406799, 0.04270924, 0.05258154, 0.04412806, 0.04270278, 0.04686045, 0.04326495, 0.04031116, 0.04062513, 0.04254267, 0.0404767 , 0.04825754, 0.04323409, 0.05539793, 0.04773133, 0.04162422, 0.04661492, 0.04853648, 0.03979454, 0.04288096, 0.04452497, 0.04612258, 0.04615601, 0.04294166, 0.05242546, 0.04947169, 0.05055515, 0.04491648, 0.04057551, 0.04777092, 0.04561228, 0.04684564, 0.04517448, 0.04342776, 0.04343005, 0.04704644, 0.04112438, 0.03617482, 0.04135897, 0.05115549, 0.04477676, 0.04699584, 0.05039405, 0.04516071, 0.04827367, 0.04621755, 0.04747895, 0.0479186 , 0.0460015 , 0.04309225, 0.04366407, 0.0392787 , 0.03586747, 0.04604356, 0.03884698, 0.05004952, 0.04139646, 0.04689492, 0.04140696, 0.04730347, 0.04878515, 0.04813615, 0.04342726, 0.05762307, 0.04489961, 0.04359375, 0.04612299, 0.04854138, 0.04527062, 0.04472304, 0.0395711 , 0.0405797 , 0.04505481, 0.04728124, 0.04570094, 0.04527361, 0.03862806, 0.04442718, 0.04443652, 0.04895133, 0.04588046, 0.04839031, 0.04469987, 0.05000096, 0.03906171, 0.051967  , 0.03978374, 0.04194069, 0.04661182, 0.03479072, 0.04340331, 0.04006326, 0.05954248, 0.04160275, 0.04321778, 0.04882777, 0.04787445, 0.04925952, 0.05323071, 0.04701163, 0.05337292, 0.04709804, 0.04334403, 0.04061232, 0.04478596, 0.04398654, 0.04274207, 0.05090697, 0.04455623, 0.04872436, 0.0421355 , 0.04898239, 0.04857274, 0.05415483, 0.04700655, 0.04014555, 0.0480144 , 0.03973658, 0.05139387, 0.04163909, 0.04686196, 0.03972785, 0.04952517, 0.04355752, 0.04586151, 0.04503243, 0.04574733, 0.04706773, 0.05015332, 0.04530172, 0.04176983, 0.04060019, 0.04704383, 0.04182002, 0.03868631, 0.04489151, 0.04019074, 0.04062664, 0.04333441, 0.04373353, 0.0441841 , 0.04185141, 0.04855307, 0.03711605, 0.04173668, 0.05377995, 0.04700167, 0.04350333, 0.04455046, 0.04259438, 0.04334646, 0.04146749, 0.04634779, 0.04688937, 0.04008222, 0.0391518 , 0.04666003, 0.04264922, 0.04064489, 0.04484932, 0.04550754, 0.05596455, 0.04654242, 0.04698534, 0.05086802, 0.04602974, 0.04597451, 0.04194012, 0.04508152, 0.0533805 , 0.04400257, 0.04563091, 0.04757315, 0.04725896, 0.04570736, 0.0478959 , 0.04467469, 0.04802436, 0.04367885, 0.04876105, 0.04211308, 0.04510159, 0.04371484, 0.04133507, 0.04158446, 0.04393359, 0.04355243, 0.04995303, 0.04931508, 0.0381846 , 0.04688839, 0.03784551, 0.04850098, 0.05309496, 0.04718066, 0.04085384, 0.04463436, 0.04367085, 0.04746603, 0.047315  , 0.03405395, 0.04403485, 0.0502298 , 0.04417355, 0.03596471, 0.04452519, 0.04578993, 0.04632251, 0.03958637, 0.04449887, 0.03931985, 0.04310929, 0.03709216, 0.04151165, 0.04229465, 0.04899224, 0.0489364 , 0.04226488, 0.03964909, 0.04748648, 0.04178246, 0.05107194, 0.04452271, 0.05032763, 0.04413235, 0.04676899, 0.04810656, 0.04573807, 0.04076975, 0.05570845, 0.0443732 , 0.04552938, 0.0496156 , 0.04152792, 0.04781586, 0.04225201, 0.0495326 , 0.0443289 , 0.05493486, 0.04521976, 0.0468836 , 0.04401311, 0.04912803, 0.04230038, 0.04714092, 0.03973136, 0.04395779, 0.04519541, 0.04936377, 0.04713223, 0.04564903, 0.04156458, 0.04433356, 0.0505021 , 0.04753149, 0.04174502, 0.056807  , 0.0496208 , 0.04767351, 0.04489522, 0.04642526, 0.05266117, 0.04438333, 0.04227131, 0.05097436, 0.04070389, 0.04836683, 0.04708687, 0.05225942, 0.03992956, 0.04902233, 0.04267317, 0.04477181, 0.03611383, 0.05027674, 0.03796292, 0.05075041, 0.04374405, 0.04413964, 0.0406099 , 0.04255497, 0.04242483, 0.04303759, 0.04170372, 0.04663662, 0.04296794, 0.05192534, 0.0449956 , 0.04730325, 0.0450723 , 0.04445592, 0.04766065, 0.0490991 , 0.04479711, 0.05232366, 0.04572643, 0.04847861, 0.04174633, 0.04394398, 0.0432659 , 0.04822833, 0.04773257, 0.04472821, 0.05111633, 0.04862911, 0.04401816, 0.04236195, 0.04526448, 0.05078418, 0.03735922, 0.04876512, 0.04758175, 0.04562471, 0.04335687, 0.04624443, 0.04618243, 0.04639856, 0.03822104, 0.0572194 , 0.04308923, 0.0419536 , 0.03811534, 0.03959254, 0.04130681, 0.05258445, 0.04986443, 0.04372495, 0.05031003, 0.05073988, 0.04547629, 0.050313  , 0.05054227, 0.04252951, 0.05065258, 0.04641125, 0.04230864, 0.04063602, 0.04855955, 0.04236878, 0.04650167, 0.03732677, 0.05326182, 0.04636859, 0.04556033, 0.04708447, 0.04356933, 0.04375771, 0.05121428, 0.04205749, 0.0518704 , 0.04518894, 0.04231454, 0.04398824, 0.05386235, 0.04887486, 0.04226957, 0.03547307, 0.04334838, 0.05197605, 0.04584531, 0.04269476, 0.04454851, 0.04730934, 0.05087434, 0.04269729, 0.04609613, 0.04301385, 0.04510682, 0.04449971, 0.04376506, 0.04954276, 0.04427552, 0.03896203, 0.04919564, 0.04771758, 0.04393024, 0.03870266, 0.0406708 , 0.0469429 , 0.04648953, 0.04738561, 0.04893255, 0.04408171, 0.04506601, 0.05193102, 0.04054061, 0.05030557, 0.04590494, 0.04596106, 0.04486667, 0.04068828, 0.0439199 , 0.0445398 , 0.05113532, 0.04578913, 0.0427432 , 0.04100801, 0.04285793, 0.04261937, 0.04108686, 0.04369689, 0.04362722, 0.03982833, 0.04838574, 0.05134018, 0.04221049, 0.04859673, 0.04196777, 0.05194669, 0.05153446, 0.04606078, 0.04232377, 0.0469268 , 0.04235938, 0.04001685, 0.04145275, 0.05063048, 0.04944555, 0.0413224 , 0.04250659, 0.04647227, 0.04430456, 0.04549796, 0.04603226, 0.04760732, 0.03799237, 0.0473626 , 0.04558186, 0.0486614 , 0.04415898, 0.04871813, 0.04439888, 0.044249  , 0.04096636, 0.04800334, 0.04382408, 0.04466881, 0.04820415, 0.04541524, 0.04297626, 0.04546258, 0.04837869, 0.04856685, 0.04739173, 0.04542921, 0.04363037, 0.04663879, 0.03848235, 0.04428369, 0.04391203, 0.04583622, 0.04338766, 0.04707669, 0.04744157, 0.03843356, 0.04494826, 0.05118331, 0.04920233, 0.04636591, 0.04606445, 0.04217975, 0.04145861, 0.04620102, 0.04249437, 0.03885329, 0.04489372, 0.04626471, 0.04990879, 0.04971651, 0.04811536, 0.0440326 , 0.04365409, 0.04810089, 0.04607049, 0.0445267 , 0.04082594, 0.04242013, 0.04945364, 0.04470348, 0.04007413, 0.04396535, 0.05119831, 0.04607697])

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for i_rep in range(n_rep):
In [27]: for i_rep in range(1):
   ....:     (x, y, d) = data[i_rep]
   ....:     obj_dml_data = DoubleMLData.from_arrays(x, y, d)
   ....:     obj_dml_plr_nonorth = DoubleMLPLR(obj_dml_data,
   ....:                                     ml_l, ml_m, ml_g,
   ....:                                     n_folds=2,
   ....:                                     apply_cross_fitting=False,
   ....:                                     score=non_orth_score)
   ....:     obj_dml_plr_nonorth.fit()
   ....:     this_theta = obj_dml_plr_nonorth.coef[0]
   ....:     this_se = obj_dml_plr_nonorth.se[0]
   ....:     print(np.abs(theta_nonorth[i_rep] - this_theta))
   ....:     print(np.abs(se_nonorth[i_rep] - this_se))
   ....:     theta_nonorth[i_rep] = this_theta
   ....:     se_nonorth[i_rep] = this_se
   ....: 
0.0007539758680586983
0.0009132520355995821

In [28]: plt.figure(constrained_layout=True);

In [29]: ax = sns.histplot((theta_nonorth - alpha)/se_nonorth,
   ....:                 color=face_colors[0], edgecolor = edge_colors[0],
   ....:                 stat='density', bins=30, label='Non-orthogonal ML');
   ....: 

In [30]: ax.axvline(0., color='k');

In [31]: xx = np.arange(-5, +5, 0.001)

In [32]: yy = stats.norm.pdf(xx)

In [33]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [34]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [35]: ax.set_xlim([-6., 6.]);

In [36]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/nonorth.png
non_orth_score = function(y, d, l_hat, m_hat, g_hat, smpls) {
u_hat = y - g_hat
psi_a = -1*d*d
psi_b = d*u_hat
psis = list(psi_a = psi_a, psi_b = psi_b)
return(psis)
}
library(ggplot2)
library(mlr3)
library(mlr3learners)
library(data.table)

lgr::get_logger("mlr3")$set_threshold("warn")
options(repr.plot.width=5, repr.plot.height=4)

set.seed(1111)

ml_l = lrn("regr.ranger", num.trees = 132, max.depth = 5, mtry = 12, min.node.size = 1)
ml_m = lrn("regr.ranger", num.trees = 378, max.depth = 3, mtry = 20, min.node.size = 6)
ml_g = ml_l$clone()

# to speed up the illustration we hard-code the simulation results
theta_nonorth = c(0.555490805, 0.626761547, 0.527232714, 0.590215088, 0.379737837, 0.398791295, 0.471529799, 0.447306859, 0.398580212, 0.544042875, 0.580504564, 0.474363062, 0.544946070, 0.492569324, 0.476388613, 0.432095547, 0.463801034, 0.538834518, 0.498974469, 0.541736784, 0.556051749, 0.414388248, 0.465484169, 0.523789310, 0.450045410, 0.462671128, 0.483402627, 0.665449409, 0.444034892, 0.571431921, 0.514748934, 0.504854642, 0.543430321, 0.607804819, 0.425343408, 0.461166556, 0.473782998, 0.626301926, 0.554365067, 0.498898748, 0.539603020, 0.588260718, 0.392087266, 0.563189621, 0.622539334, 0.603381790, 0.537399218, 0.450688767, 0.506590096, 0.375848237, 0.518585287, 0.549772758, 0.621927569, 0.488298153, 0.590428253, 0.696371638, 0.627708633, 0.433970065, 0.425033876, 0.537542890, 0.480869086, 0.458919543, 0.653851249, 0.584819357, 0.587246769, 0.459961246, 0.518142266, 0.511701654, 0.620336868, 0.476887219, 0.481538784, 0.616313409, 0.529185572, 0.618412368, 0.522084966, 0.580750958, 0.477682206, 0.574414735, 0.508342507, 0.371303328, 0.527577838, 0.398635240, 0.494730015, 0.508128512, 0.603642166, 0.655167716, 0.601126516, 0.440808052, 0.544282497, 0.708230201, 0.541813291, 0.378489246, 0.437844992, 0.580074282, 0.426458304, 0.644148033, 0.571626341, 0.600921811, 0.710259470, 0.450440901, 0.540628619, 0.431058282, 0.442400358, 0.561393132, 0.523929900, 0.483505805, 0.519636552, 0.607386052, 0.535609002, 0.510519531, 0.490837474, 0.607186868, 0.475418778, 0.614141891, 0.398599358, 0.474117625, 0.532997363, 0.352785069, 0.599932209, 0.506270174, 0.582559300, 0.573352058, 0.688411509, 0.459070744, 0.633930860, 0.531340117, 0.554952484, 0.476316494, 0.586937919, 0.531143264, 0.531667832, 0.604187114, 0.474454410, 0.634159600, 0.515934881, 0.528853550, 0.561666177, 0.632040507, 0.573736861, 0.634677664, 0.545228666, 0.452539377, 0.602514389, 0.406644548, 0.526514048, 0.484831291, 0.515626324, 0.694950769, 0.558903366, 0.543989664, 0.595270602, 0.544302473, 0.701224740, 0.462491671, 0.721976217, 0.509779134, 0.608551613, 0.511985210, 0.610036501, 0.523291208, 0.571238422, 0.486944282, 0.457603820, 0.605811112, 0.602538755, 0.437573404, 0.572777807, 0.540359885, 0.503639372, 0.643482254, 0.542442515, 0.557072215, 0.548365345, 0.520257386, 0.559477646, 0.589800976, 0.620407048, 0.519814608, 0.515998436, 0.361384876, 0.548933980, 0.501600804, 0.627079396, 0.645484925, 0.495473132, 0.442635400, 0.584397481, 0.585125950, 0.352607330, 0.563273699, 0.503440598, 0.488867579, 0.557098343, 0.612293879, 0.463620892, 0.592306697, 0.546759827, 0.643941943, 0.354424800, 0.598255795, 0.484472850, 0.612693579, 0.410380974, 0.598567337, 0.512124207, 0.466188290, 0.416940820, 0.541944143, 0.586775221, 0.546650192, 0.536563665, 0.576996348, 0.503872606, 0.505680665, 0.555680519, 0.518350769, 0.652987312, 0.627428041, 0.552042874, 0.504864880, 0.611606827, 0.517154197, 0.544605688, 0.406896793, 0.597414935, 0.582586483, 0.590689714, 0.495941043, 0.498246261, 0.543623886, 0.555031880, 0.551186152, 0.478571512, 0.472812207, 0.518706192, 0.563640332, 0.554419638, 0.515959815, 0.458494588, 0.549400619, 0.490260796, 0.597798784, 0.510691719, 0.684161072, 0.506404568, 0.397770673, 0.514802604, 0.655332528, 0.472896035, 0.546293061,
                0.450750417, 0.577340695, 0.547787327, 0.599718155, 0.544373382, 0.516858470, 0.511922800, 0.536369798, 0.499136617, 0.378726334, 0.617034292, 0.478520873, 0.521760931, 0.540347935, 0.655351297, 0.571225200, 0.512656762, 0.483168208, 0.605376870, 0.458754981, 0.422778271, 0.559776438, 0.700760982, 0.552098162, 0.582239482, 0.682263179, 0.534457440, 0.424484890, 0.517715608, 0.515762565, 0.498068539, 0.434358715, 0.671502664, 0.485220049, 0.415942514, 0.534758763, 0.619185459, 0.546414463, 0.568457400, 0.457187636, 0.650218256, 0.485625253, 0.407528701, 0.524748207, 0.454240783, 0.515931350, 0.480874561, 0.484779080, 0.550198966, 0.603725101, 0.576954166, 0.565338393, 0.606319473, 0.515972696, 0.618398708, 0.592751447, 0.589232898, 0.529610016, 0.552006633, 0.554400179, 0.696469507, 0.514473164, 0.576544908, 0.550114416, 0.526571101, 0.511727507, 0.643502178, 0.553529481, 0.631429147, 0.513860803, 0.712015201, 0.395955817, 0.537149164, 0.576820745, 0.472036962, 0.510995078, 0.559692897, 0.712613979, 0.548511940, 0.603141209, 0.646451322, 0.578597740, 0.650072597, 0.595784184, 0.444147267, 0.431644371, 0.470301501, 0.534208588, 0.570610331, 0.555056229, 0.507935162, 0.316119055, 0.557401212, 0.527316271, 0.605040348, 0.538434426, 0.576806205, 0.452004053, 0.544753597, 0.512988932, 0.619476411, 0.396076184, 0.566070831, 0.566438419, 0.450220982, 0.484173158, 0.620380771, 0.457030217, 0.436522912, 0.527267470, 0.495845368, 0.530519106, 0.592038170, 0.493137420, 0.590874952, 0.617868220, 0.486070270, 0.557348301, 0.536603623, 0.442690115, 0.498870579, 0.522430964, 0.586517685, 0.570256169, 0.589559448, 0.571328252, 0.492033061, 0.535250779, 0.512178730, 0.460879072, 0.500807069, 0.600888729, 0.517356646, 0.451303618, 0.587678099, 0.529998865, 0.471530533, 0.559646452, 0.593765971, 0.480317206, 0.466479902, 0.529183809, 0.510594353, 0.466759937, 0.437646506, 0.472243995, 0.482003863, 0.597815242, 0.425598907, 0.561641434, 0.508943548, 0.584697847, 0.636510983, 0.660346903, 0.454066017, 0.462487897, 0.505506043, 0.461258540, 0.535885979, 0.534607554, 0.470024303, 0.562676413, 0.586149433, 0.591356781, 0.455978848, 0.416752953, 0.418661640, 0.419590718, 0.571766706, 0.446425494, 0.588554376, 0.550779772, 0.550332231, 0.582390257, 0.462180960, 0.564796119, 0.607846426, 0.534457252, 0.522840491, 0.445373229, 0.549251612, 0.514152907, 0.501535072, 0.511931118, 0.614990004, 0.546573038, 0.498853768, 0.491775889, 0.637549986, 0.620760302, 0.540748899, 0.545831441, 0.489000728, 0.555212756, 0.516338580, 0.654872002, 0.482842368, 0.564765308, 0.503483424, 0.565809729, 0.623620196, 0.606398633, 0.545202760, 0.434323485, 0.592081701, 0.600379316, 0.552709762, 0.599656634, 0.472034047, 0.533803354, 0.531558379, 0.565841531, 0.350490085, 0.397840404, 0.548444844, 0.561229603, 0.563060424, 0.476912213, 0.564984359, 0.364141386, 0.502445480, 0.498539394, 0.513570785, 0.555188996, 0.448156175, 0.512119255, 0.445386379, 0.549415579, 0.341524411, 0.559606604, 0.593945702, 0.712481162, 0.587995572, 0.547201619, 0.466410676, 0.380301797, 0.562187203, 0.627409297, 0.558438269, 0.485853148, 0.587346549, 0.428806963, 0.655803314, 0.555888423, 0.542544980, 0.481775583, 0.480071956, 0.553643949, 0.552254460, 0.480791541,
                0.560288765, 0.420843103, 0.361128494, 0.580809347, 0.527009418, 0.624330658, 0.532888624, 0.501396826, 0.618831171, 0.580389499, 0.629836529, 0.626352731, 0.571653376, 0.618028332, 0.357476413, 0.633596384, 0.518716872, 0.485010063, 0.574022133, 0.614519740, 0.602180299, 0.539065547, 0.553195187, 0.566421759, 0.478586567, 0.599254258, 0.543793383, 0.494030057, 0.310873684, 0.617009882, 0.404612458, 0.473790800, 0.534740643, 0.467572927, 0.498699660, 0.595133903, 0.455755429, 0.434058956, 0.594241142, 0.500503867, 0.572898720, 0.503342001, 0.532700074, 0.358150489, 0.412343967, 0.593475196, 0.374554699, 0.572783358, 0.442674990, 0.572843680, 0.575662283, 0.430268257, 0.467648882, 0.485725966, 0.579486503, 0.542010045, 0.400613627, 0.599057054, 0.563136422, 0.601306038, 0.500426996, 0.683184450, 0.470516049, 0.542721091, 0.563799526, 0.479949143, 0.636318482, 0.474724140, 0.482722868, 0.478795197, 0.543045187, 0.508977326, 0.547923904, 0.656525818, 0.604179155, 0.617628939, 0.469231387, 0.611045344, 0.667565827, 0.526248076, 0.606692621, 0.456038037, 0.482437027, 0.550598196, 0.454910374, 0.498118203, 0.555453296, 0.388227585, 0.533219722, 0.465068971, 0.557911420, 0.525542619, 0.443990102, 0.652073439, 0.528233460, 0.484280433, 0.541355253, 0.576684202, 0.523036842, 0.408319970, 0.617762803, 0.475120963, 0.662496201, 0.542095207, 0.571554663, 0.598805910, 0.638052186, 0.411580462, 0.557013065, 0.536381225, 0.511820061, 0.597580866, 0.518459700, 0.575230334, 0.696764491, 0.478841907, 0.551567186, 0.442349951, 0.522234760, 0.467536070, 0.513388134, 0.433268867, 0.383600813, 0.510964693, 0.536118893, 0.440663782, 0.579161992, 0.657013957, 0.501574228, 0.563880082, 0.570798093, 0.490814322, 0.582170037, 0.625847586, 0.549656969, 0.584665763, 0.529731144, 0.585040100, 0.507699586, 0.594906651, 0.542939508, 0.398198811, 0.371421696, 0.424559307, 0.521478929, 0.520841332, 0.557020071, 0.632433927, 0.540125247, 0.715177321, 0.635280103, 0.527653695, 0.462895585, 0.493750242, 0.499309380, 0.646233121, 0.535371808, 0.597260111, 0.484279193, 0.513683043, 0.457277699, 0.467642751, 0.499138169, 0.589887038, 0.534180778, 0.545297904, 0.517087020, 0.428642229, 0.464747534, 0.523041568, 0.518719639, 0.584106122, 0.533317756, 0.612415820, 0.461592490, 0.514983428, 0.518066482, 0.601919812, 0.530134121, 0.570187117, 0.528290332, 0.555818843, 0.453708364, 0.565527574, 0.607981783, 0.561120053, 0.669381588, 0.502013841, 0.564757923, 0.649643755, 0.570801738, 0.518847480, 0.468506826, 0.470142833, 0.499153449, 0.570689436, 0.479974005, 0.584116226, 0.488575346, 0.502941116, 0.473483029, 0.600104460, 0.444049959, 0.518093762, 0.616213737, 0.674839602, 0.535144087, 0.526260998, 0.463163914, 0.482726493, 0.460620798, 0.634715728, 0.676769679, 0.627133255, 0.507020514, 0.610770290, 0.532994049, 0.451198382, 0.542620243, 0.499428399, 0.429161177, 0.566230087, 0.678148969, 0.496447356, 0.558217776, 0.463545066, 0.487483001, 0.490059157, 0.431736489, 0.556338926, 0.455109444, 0.513704397, 0.573809102, 0.612380315, 0.503807651, 0.553517819, 0.576927711, 0.615872495, 0.531366945, 0.656660823, 0.517993343, 0.572913412, 0.569664360, 0.523645805, 0.490471201, 0.387093740, 0.564115440, 0.558273802, 0.598239938, 0.419955486,
                0.465388602, 0.507796791, 0.506115556, 0.622283883, 0.596742526, 0.520855930, 0.644617222, 0.448209817, 0.564246989, 0.459447558, 0.715872399, 0.485503115, 0.569842986, 0.553621077, 0.451906806, 0.451427601, 0.540991056, 0.520360361, 0.450443033, 0.581866440, 0.560943492, 0.597019058, 0.494960963, 0.517031056, 0.435453039, 0.534349993, 0.631871756, 0.401181743, 0.597606115, 0.463709582, 0.584207932, 0.578141132, 0.464073722, 0.560488250, 0.542096705, 0.416232294, 0.590416817, 0.515450313, 0.545576702, 0.376863244, 0.480802909, 0.540922995, 0.653557885, 0.669806192, 0.534690873, 0.411004986, 0.578063132, 0.560783860, 0.571479896, 0.512483132, 0.523661488, 0.557963010, 0.445497341, 0.586293496, 0.440482669, 0.417545555, 0.548913084, 0.550121545, 0.368974569, 0.615313747, 0.531380568, 0.501810588, 0.400781748, 0.498819399, 0.543734006, 0.609199732, 0.576704893, 0.604352164, 0.627460052, 0.560995623, 0.603813764, 0.595195256, 0.635549955, 0.500937607, 0.564012122, 0.515636906, 0.635622134, 0.537348045, 0.512691695, 0.511057536, 0.615937193, 0.510478444, 0.518828953, 0.571380267, 0.580241326, 0.537779208, 0.593899836, 0.517439804, 0.589540384, 0.566012500, 0.548740539, 0.502564261, 0.511657997, 0.409964475, 0.589915535, 0.652057794, 0.634579542, 0.496301701, 0.535769343, 0.676293472, 0.607051859, 0.659077347, 0.602118707, 0.550680479, 0.563329950, 0.511840194, 0.577850813, 0.471617247, 0.414955147, 0.563989678, 0.463254931, 0.479894191, 0.623420693, 0.593593868, 0.458635132, 0.613803756, 0.488046496, 0.542319978, 0.350973957, 0.412569564, 0.490260699, 0.700491440, 0.428683103, 0.610299924, 0.524726774, 0.317358994, 0.524104380, 0.490904473, 0.582942177, 0.511242949, 0.589722146, 0.461090940, 0.563778935, 0.509113728, 0.606855462, 0.536871498, 0.535835864, 0.311305684, 0.519460682, 0.617250309, 0.459249686, 0.613208421, 0.689944309, 0.600880392, 0.470012487, 0.473908584, 0.618506078, 0.463854332, 0.424564259, 0.609790770, 0.619358325, 0.566629982, 0.558465168, 0.367649118, 0.590299657, 0.567348639, 0.672643300, 0.537803918, 0.333977141, 0.584732617, 0.648302831, 0.454857335, 0.623665038, 0.462490043, 0.634790342, 0.477715737, 0.547378369, 0.543000665, 0.565847084, 0.661123797, 0.553120335, 0.485868839, 0.502218315, 0.477975844, 0.497536727, 0.627151462, 0.532951470, 0.589626479, 0.543310420, 0.578503587, 0.547612194, 0.670302172, 0.515456325, 0.538013972, 0.454596159, 0.552985860, 0.702189700, 0.574203991, 0.469594424, 0.581663990, 0.440378605, 0.445220423, 0.565606288, 0.469661635, 0.578705416, 0.450488617, 0.667395060, 0.484036907, 0.644102750, 0.519522226, 0.402077245, 0.463575413, 0.552887803, 0.512808224, 0.447670073, 0.591463960, 0.512150833, 0.559739620, 0.578457682, 0.497693480, 0.602815427, 0.541223208, 0.500136941, 0.574870749, 0.522447052, 0.659254938, 0.518345275, 0.581820859, 0.537628623, 0.469688518, 0.490970116, 0.539631057, 0.457655973, 0.570659774, 0.452771742, 0.598276557, 0.473113951, 0.645215405, 0.499805678, 0.538075991, 0.555687688, 0.651869368, 0.499626409, 0.406144900, 0.427681771, 0.457855260, 0.404348940, 0.567678710, 0.598015105, 0.371846343, 0.660219655, 0.496971782, 0.572141968, 0.502629015, 0.463091719, 0.535049004, 0.681186139, 0.492846017, 0.386504347, 0.656911448)
se_nonorth = c(0.0416942713, 0.0407183651, 0.0444523186, 0.0425346420, 0.0444558383, 0.0399894960, 0.0418382112, 0.0512202142, 0.0422534312, 0.0437289855, 0.0496170886, 0.0416615042, 0.0468264920, 0.0461997063, 0.0444825046, 0.0432499219, 0.0437510148, 0.0490838025, 0.0469682703, 0.0446521440, 0.0417557029, 0.0482750833, 0.0450491739, 0.0429404077, 0.0494601912, 0.0484775332, 0.0409040531, 0.0477823535, 0.0448376149, 0.0537685039, 0.0451218632, 0.0421525198, 0.0405617359, 0.0476656050, 0.0443286501, 0.0472993077, 0.0388136573, 0.0470112065, 0.0484876333, 0.0407014787, 0.0415448868, 0.0428025247, 0.0438924214, 0.0478182170, 0.0410469492, 0.0510127368, 0.0474686464, 0.0443057077, 0.0468339705, 0.0473232919, 0.0462538776, 0.0439858438, 0.0465037186, 0.0464214005, 0.0443683801, 0.0427980771, 0.0484656933, 0.0522435665, 0.0460452073, 0.0454639544, 0.0515455624, 0.0412344156, 0.0408156437, 0.0434971046, 0.0376215666, 0.0414815328, 0.0387734453, 0.0466417572, 0.0470888219, 0.0494321834, 0.0404736386, 0.0475966279, 0.0487751816, 0.0486634726, 0.0437035312, 0.0410891602, 0.0452614467, 0.0464142602, 0.0501091573, 0.0412405139, 0.0427498890, 0.0417762646, 0.0423550412, 0.0460234105, 0.0398641824, 0.0421414452, 0.0478292271, 0.0489479360, 0.0461427499, 0.0460249422, 0.0455823647, 0.0452108363, 0.0457211134, 0.0483323986, 0.0527181857, 0.0469950113, 0.0525710347, 0.0396720464, 0.0437818655, 0.0440221527, 0.0419406668, 0.0389232488, 0.0427301013, 0.0390849993, 0.0456962791, 0.0420672659, 0.0449914650, 0.0466148688, 0.0454478670, 0.0466533404, 0.0486936215, 0.0364006041, 0.0426142879, 0.0454636835, 0.0465283379, 0.0459340507, 0.0473761325, 0.0476661830, 0.0459159887, 0.0418073445, 0.0440123549, 0.0442796534, 0.0676434323, 0.0473605677, 0.0354092828, 0.0479795031, 0.0457478011, 0.0432144400, 0.0468389475, 0.0399661007, 0.0427871569, 0.0432939489, 0.0492717801, 0.0428361964, 0.0441044028, 0.0487274650, 0.0410106469, 0.0451210397, 0.0488886283, 0.0475810864, 0.0454722031, 0.0451376826, 0.0454999190, 0.0403121211, 0.0443778939, 0.0426164410, 0.0427421954, 0.0425622191, 0.0488372313, 0.0425927956, 0.0465584086, 0.0467233237, 0.0507913546, 0.0480643340, 0.0535318482, 0.0432534969, 0.0440594081, 0.0462619955, 0.0455910743, 0.0414613637, 0.0476070789, 0.0455846838, 0.0483576070, 0.0444985152, 0.0477921977, 0.0456495523, 0.0508897497, 0.0437550082, 0.0415551073, 0.0477370929, 0.0440603149, 0.0481728048, 0.0475273242, 0.0424167929, 0.0532847025, 0.0512992716, 0.0481748552, 0.0451459126, 0.0510471717, 0.0472198535, 0.0418179134, 0.0443819534, 0.0398429609, 0.0389292671, 0.0432117377, 0.0468339776, 0.0439764387, 0.0457969584, 0.0493033277, 0.0421968064, 0.0520255201, 0.0522945549, 0.0477131749, 0.0440483435, 0.0490376561, 0.0516126310, 0.0442248163, 0.0412546455, 0.0367354793, 0.0438534662, 0.0475180763, 0.0429398205, 0.0463706405, 0.0390414772, 0.0458774038, 0.0474482566, 0.0434896629, 0.0422358214, 0.0497988767, 0.0434132514, 0.0455985023, 0.0486931260, 0.0474450877, 0.0403084870, 0.0458375287, 0.0432554677, 0.0416824887, 0.0505585269, 0.0482389139, 0.0416516380, 0.0448090050, 0.0435162678, 0.0373855753, 0.0404456033, 0.0460920936, 0.0505343302, 0.0441023636, 0.0442842299, 0.0428609066, 0.0400794578, 0.0448480934, 0.0469449477, 0.0417936292, 0.0493436580, 0.0431128129, 0.0454712341, 0.0430130687, 0.0470833089, 0.0422605240, 0.0424348846, 0.0461216695, 0.0489060014, 0.0423069923, 0.0478447765, 0.0404220993, 0.0586981641, 0.0443232220, 0.0388575388, 0.0413215017, 0.0426211671,
            0.0471838924, 0.0388989423, 0.0455790426, 0.0438913234, 0.0383028275, 0.0468147265, 0.0431720131, 0.0482008522, 0.0543839804, 0.0422250358, 0.0464682066, 0.0498224018, 0.0432196416, 0.0432677344, 0.0468795800, 0.0438977953, 0.0461659516, 0.0497379706, 0.0476103774, 0.0442774275, 0.0500619746, 0.0458558863, 0.0397456154, 0.0412716802, 0.0497800508, 0.0440394081, 0.0396038858, 0.0564439287, 0.0555597922, 0.0420128405, 0.0472330029, 0.0496680684, 0.0395024756, 0.0432825606, 0.0469085318, 0.0491087369, 0.0442754952, 0.0409932732, 0.0403405130, 0.0426314318, 0.0389934958, 0.0422365158, 0.0522774036, 0.0475572037, 0.0417722370, 0.0444766319, 0.0463969372, 0.0513068203, 0.0493066368, 0.0416801613, 0.0421615069, 0.0436823115, 0.0430911503, 0.0426003370, 0.0411770611, 0.0473561144, 0.0547397784, 0.0464928763, 0.0455073663, 0.0401664048, 0.0436246303, 0.0461393917, 0.0424488331, 0.0439597172, 0.0509171080, 0.0482319344, 0.0483124905, 0.0364286638, 0.0448411210, 0.0447490233, 0.0555590871, 0.0428486167, 0.0417124416, 0.0474719537, 0.0458114554, 0.0479360604, 0.0363660927, 0.0518490611, 0.0485668638, 0.0497163548, 0.0453206328, 0.0455803082, 0.0479854657, 0.0459699134, 0.0468712259, 0.0449448234, 0.0511424957, 0.0471113059, 0.0433347419, 0.0391208352, 0.0408913894, 0.0470659488, 0.0399841820, 0.0406308572, 0.0542143584, 0.0450145498, 0.0467033471, 0.0516124686, 0.0456065530, 0.0435843876, 0.0499941746, 0.0506719959, 0.0508443416, 0.0495156494, 0.0395405138, 0.0410419238, 0.0514470700, 0.0488962113, 0.0487538055, 0.0414726009, 0.0368267934, 0.0473123550, 0.0485298852, 0.0456861398, 0.0437143319, 0.0428824935, 0.0384520731, 0.0445882610, 0.0463727393, 0.0436154414, 0.0455220525, 0.0415109848, 0.0433445991, 0.0405737652, 0.0456195515, 0.0469804624, 0.0402089500, 0.0369510343, 0.0445247896, 0.0441592102, 0.0468461274, 0.0490547903, 0.0432990337, 0.0465668271, 0.0497264371, 0.0441192165, 0.0431313364, 0.0482525086, 0.0439745154, 0.0436839465, 0.0470566984, 0.0488376254, 0.0461766734, 0.0462701814, 0.0533789686, 0.0385214032, 0.0470878503, 0.0458131715, 0.0441274138, 0.0623588736, 0.0558354639, 0.0507552647, 0.0361639478, 0.0466204676, 0.0388749604, 0.0492020032, 0.0404862240, 0.0458497881, 0.0466700119, 0.0420892063, 0.0440183150, 0.0506405688, 0.0491806559, 0.0442083848, 0.0441417694, 0.0456755901, 0.0551192413, 0.0409182169, 0.0436943445, 0.0424569610, 0.0418949597, 0.0450919899, 0.0440379844, 0.0394901321, 0.0372667880, 0.0449608934, 0.0467084684, 0.0459461881, 0.0505850160, 0.0392913702, 0.0454423262, 0.0455367197, 0.0511507111, 0.0445989706, 0.0432381412, 0.0454507054, 0.0474978923, 0.0455950894, 0.0460462368, 0.0444929558, 0.0431117647, 0.0424168741, 0.0470416143, 0.0419458258, 0.0428595772, 0.0462222860, 0.0403097898, 0.0417097778, 0.0404122960, 0.0500143386, 0.0462261921, 0.0427382211, 0.0523602976, 0.0466083519, 0.0429828128, 0.0419430749, 0.0416151695, 0.0520834213, 0.0385143472, 0.0491620897, 0.0441673021, 0.0468161058, 0.0521244105, 0.0432531652, 0.0431773782, 0.0482408085, 0.0460797071, 0.0475796039, 0.0441044884, 0.0390626583, 0.0480827456, 0.0432076181, 0.0411163678, 0.0398631080, 0.0451781089, 0.0506179206, 0.0483444849, 0.0493423400, 0.0449097787, 0.0451427591, 0.0416698630, 0.0523988996, 0.0414144081, 0.0410177862, 0.0421860966, 0.0457489231, 0.0472401395, 0.0461553633, 0.0506701534, 0.0447794311, 0.0479170684, 0.0432160823, 0.0406424202, 0.0432600513, 0.0489419005, 0.0473253697, 0.0416913096, 0.0493886111, 0.0440630101, 0.0401957469,
            0.0438400485, 0.0469706961, 0.0379419954, 0.0498916208, 0.0421411392, 0.0404144925, 0.0467110555, 0.0439446736, 0.0463083553, 0.0497131722, 0.0484687136, 0.0505424229, 0.0479257700, 0.0474604174, 0.0435021261, 0.0475139088, 0.0386510772, 0.0407415152, 0.0415758675, 0.0457929174, 0.0445308164, 0.0399679240, 0.0479620843, 0.0436231597, 0.0442219275, 0.0422322599, 0.0494076074, 0.0475472135, 0.0438761612, 0.0422145844, 0.0395191281, 0.0420427008, 0.0508861560, 0.0483396730, 0.0398827945, 0.0501383066, 0.0540309624, 0.0409913626, 0.0412386320, 0.0435887472, 0.0443302167, 0.0443502175, 0.0481808945, 0.0473181803, 0.0488766269, 0.0529367635, 0.0428916178, 0.0447638538, 0.0458472612, 0.0404790119, 0.0399257227, 0.0377888836, 0.0386492614, 0.0446937626, 0.0502840660, 0.0437966863, 0.0465801076, 0.0496721460, 0.0489452659, 0.0464502063, 0.0437991473, 0.0494891160, 0.0503485209, 0.0473798105, 0.0458485017, 0.0413926382, 0.0447822677, 0.0441246584, 0.0484195496, 0.0430158347, 0.0454672105, 0.0437217941, 0.0416578277, 0.0456674215, 0.0430853669, 0.0489013653, 0.0472174986, 0.0446444115, 0.0419116187, 0.0449237332, 0.0436448839, 0.0430536200, 0.0438416684, 0.0496886557, 0.0483889357, 0.0436115925, 0.0473577009, 0.0513557121, 0.0492885243, 0.0487500719, 0.0436059358, 0.0492746868, 0.0388168102, 0.0508673325, 0.0451668028, 0.0412011276, 0.0548782211, 0.0479393631, 0.0442228499, 0.0433162070, 0.0443213114, 0.0443725770, 0.0493525004, 0.0405233001, 0.0442736712, 0.0408752068, 0.0417812872, 0.0520464905, 0.0436899010, 0.0415405681, 0.0490416480, 0.0499029777, 0.0445336837, 0.0416151062, 0.0408112066, 0.0428046438, 0.0450605378, 0.0532768714, 0.0396644557, 0.0444696943, 0.0504156986, 0.0443956988, 0.0528172902, 0.0390398316, 0.0466802712, 0.0462500025, 0.0473485596, 0.0460854911, 0.0412017954, 0.0440077856, 0.0415717449, 0.0487651621, 0.0480823967, 0.0455474796, 0.0474422098, 0.0372996608, 0.0539488638, 0.0472896522, 0.0486949128, 0.0432878967, 0.0467050944, 0.0468515101, 0.0469311873, 0.0494697275, 0.0417226496, 0.0448879556, 0.0449673198, 0.0430951188, 0.0622614825, 0.0425694862, 0.0443975843, 0.0455196655, 0.0465424642, 0.0410751939, 0.0469711908, 0.0450505494, 0.0414393933, 0.0496273343, 0.0429266249, 0.0415579401, 0.0506347047, 0.0441589079, 0.0430085648, 0.0391062482, 0.0493892022, 0.0475849965, 0.0430335663, 0.0388700253, 0.0486225382, 0.0386786601, 0.0521838145, 0.0424971130, 0.0476506097, 0.0444575042, 0.0421267772, 0.0406615732, 0.0501312064, 0.0452361956, 0.0406248912, 0.0408469612, 0.0392444290, 0.0455309395, 0.0476790281, 0.0464622391, 0.0425475893, 0.0445142131, 0.0446443886, 0.0436690511, 0.0467629886, 0.0390306459, 0.0447922159, 0.0420200127, 0.0460367286, 0.0495337585, 0.0443241229, 0.0410023677, 0.0413692134, 0.0423467020, 0.0410082263, 0.0451696943, 0.0493794927, 0.0403973911, 0.0488905545, 0.0472538337, 0.0425203525, 0.0413610982, 0.0365841273, 0.0438075830, 0.0454242611, 0.0414027566, 0.0490544717, 0.0422271786, 0.0460426506, 0.0418820975, 0.0479000468, 0.0407397797, 0.0396700663, 0.0416426682, 0.0439507791, 0.0473532784, 0.0467900357, 0.0436291674, 0.0480063679, 0.0429754876, 0.0449870427, 0.0434355341, 0.0431861184, 0.0464974683, 0.0419407774, 0.0491435513, 0.0470466006, 0.0509939175, 0.0453228328, 0.0494626877, 0.0492348281, 0.0455664378, 0.0436146932, 0.0504675435, 0.0466653769, 0.0418666473, 0.0503067258, 0.0383718571, 0.0522584215, 0.0431252691, 0.0400283783, 0.0450449964, 0.0475258218, 0.0400685390, 0.0357934857, 0.0486042528,
            0.0370261877, 0.0393641427, 0.0427189381, 0.0499489653, 0.0400037362, 0.0488202329, 0.0429777500, 0.0448634724, 0.0406805124, 0.0446702644, 0.0481321945, 0.0424083009, 0.0472734733, 0.0475518183, 0.0474519988, 0.0507773212, 0.0448938420, 0.0439749001, 0.0519301415, 0.0462917291, 0.0467769251, 0.0431394745, 0.0511398877, 0.0468973616, 0.0457477577, 0.0453645425, 0.0473912954, 0.0503678343, 0.0431073378, 0.0379354863, 0.0448704311, 0.0390333493, 0.0446870021, 0.0356292568, 0.0519402829, 0.0479014381, 0.0474969074, 0.0485018059, 0.0471529881, 0.0457874882, 0.0514035445, 0.0464573276, 0.0436958739, 0.0471457232, 0.0432730238, 0.0420443922, 0.0425626359, 0.0400757175, 0.0428709057, 0.0523370930, 0.0457095456, 0.0387461239, 0.0454164368, 0.0474067583, 0.0422056453, 0.0423306811, 0.0458742009, 0.0418851150, 0.0375060607, 0.0476444692, 0.0473158918, 0.0437627534, 0.0489777285, 0.0459813410, 0.0485886882, 0.0473717508, 0.0406818520, 0.0462999317, 0.0363856680, 0.0450027066, 0.0492219529, 0.0390316111, 0.0461459314, 0.0509053393, 0.0460205187, 0.0428744223, 0.0421943189, 0.0403611049, 0.0441886496, 0.0496008183, 0.0422805921, 0.0532239884, 0.0416174164, 0.0459029114, 0.0398305637, 0.0467203692, 0.0451460843, 0.0544602119, 0.0420129382, 0.0461996776, 0.0444963448, 0.0491157891, 0.0470482264, 0.0367606777, 0.0444011869, 0.0476917130, 0.0387451532, 0.0484612156, 0.0520540431, 0.0426581207, 0.0530953686, 0.0488003880, 0.0452046344, 0.0456663570, 0.0504463665, 0.0395335748, 0.0418899004, 0.0404035187, 0.0448713245, 0.0476916901, 0.0461400539, 0.0403482903, 0.0420793960, 0.0469157779, 0.0426540095, 0.0411240546, 0.0475006544, 0.0442164510, 0.0427828038, 0.0493846273, 0.0438576577, 0.0406313613, 0.0465298653, 0.0445994443, 0.0463059937, 0.0438992617, 0.0468660278, 0.0411646643, 0.0516189392, 0.0417182243, 0.0447124494, 0.0460886082, 0.0503461423, 0.0495413210, 0.0418845428, 0.0470049760, 0.0398121373, 0.0485289895, 0.0503722920, 0.0435886254, 0.0489487204, 0.0494519494, 0.0438545065, 0.0397148739, 0.0520638856, 0.0406954281, 0.0474046990, 0.0460098363, 0.0407100521, 0.0434347753, 0.0377814424, 0.0450191260, 0.0532696689, 0.0428635977, 0.0462511433, 0.0451252219, 0.0595109881, 0.0415188135, 0.0462933305, 0.0399142707, 0.0457308366, 0.0458449235, 0.0466075330, 0.0459267034, 0.0452804927, 0.0450031724, 0.0405805835, 0.0481327093, 0.0446886594, 0.0407773776, 0.0428498566, 0.0418913126, 0.0416114384, 0.0482691372, 0.0468687012, 0.0475622762, 0.0451409043, 0.0440544641, 0.0466109319, 0.0444994155, 0.0395735845, 0.0489770988, 0.0513474350, 0.0476471824, 0.0474166294, 0.0422779747, 0.0483946630, 0.0460189236, 0.0433891859, 0.0480850303, 0.0505456668, 0.0461110607, 0.0392525139, 0.0440482730, 0.0510736230, 0.0430907766, 0.0513039372, 0.0437664660, 0.0478224785, 0.0387364981, 0.0391934132, 0.0443478705, 0.0468773935, 0.0450421815, 0.0494911337, 0.0413486799, 0.0422647277, 0.0385349835, 0.0561999522, 0.0380104667, 0.0524001385, 0.0497509208, 0.0494165088, 0.0506288203, 0.0499250336, 0.0483102620, 0.0444882253, 0.0432652527, 0.0489046969, 0.0570060453, 0.0359903313, 0.0503936218, 0.0444652977, 0.0449598097, 0.0525180496, 0.0383749194, 0.0522110450, 0.0430210793, 0.0405819589, 0.0393943644, 0.0488834320, 0.0437871919, 0.0419881386, 0.0502366835, 0.0483239506, 0.0454876973, 0.0393104070, 0.0387805425, 0.0507050119, 0.0417782241, 0.0455323571, 0.0439461195, 0.0398420253, 0.0418836739, 0.0478967241, 0.0437425739, 0.0448702453, 0.0396011810, 0.0437846518, 0.0474342375)
# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for (i_rep in seq_len(n_rep)) {
for (i_rep in seq_len(1)) {
    df = data[[i_rep]]
    obj_dml_data = double_ml_data_from_data_frame(df, y_col = "y", d_cols = "d")
    obj_dml_plr_nonorth = DoubleMLPLR$new(obj_dml_data,
                                        ml_l, ml_m, ml_g,
                                        n_folds=2,
                                        score=non_orth_score,
                                        apply_cross_fitting=FALSE)
    obj_dml_plr_nonorth$fit()
    this_theta = obj_dml_plr_nonorth$coef
    this_se = obj_dml_plr_nonorth$se
    print(abs(theta_nonorth[i_rep] - this_theta))
    print(abs(se_nonorth[i_rep] - this_se))
    theta_nonorth[i_rep] = this_theta
    se_nonorth[i_rep] = this_se
}

g_nonorth = ggplot(data.frame(theta_rescaled=(theta_nonorth - alpha)/se_nonorth)) +
                geom_histogram(aes(y=after_stat(density), x=theta_rescaled, colour = "Non-orthogonal ML", fill="Non-orthogonal ML"),
                            bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Non-orthogonal ML", "N(0, 1)"),
                    values=c("Non-orthogonal ML"="dark blue", "N(0, 1)"='black')) +
                scale_fill_manual(name='',
                    breaks=c("Non-orthogonal ML", "N(0, 1)"),
                    values=c("Non-orthogonal ML"="dark blue", "N(0, 1)"=NA)) +
                xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_nonorth
          d 
3.33028e-11 
           d 
5.110218e-12 
../_images/basics_2_2.png

The regularization bias in the simple ML-approach is caused by the slow convergence of \(\hat{\theta}_0\)

\[|\sqrt{n} (\hat{\theta}_0 - \theta_0) | \rightarrow_{P} \infty\]

i.e., slower than \(1/\sqrt{n}\). The driving factor is the bias that arises by learning \(g\) with a random forest or any other ML technique. A heuristic illustration is given by

\[\sqrt{n}(\hat{\theta}_0 - \theta_0) = \underbrace{\left(\frac{1}{n} \sum_{i\in I} D_i^2\right)^{-1} \frac{1}{n} \sum_{i\in I} D_i \zeta_i}_{=:a} + \underbrace{\left(\frac{1}{n} \sum_{i\in I} D_i^2\right)^{-1} \frac{1}{n} \sum_{i\in I} D_i (g_0(X_i) - \hat{g}_0(X_i))}_{=:b}.\]

\(a\) is approximately Gaussian under mild conditions. However, \(b\) (the regularization bias) diverges in general.

1.3. Overcoming regularization bias by orthogonalization#

To overcome the regularization bias we can partial out the effect of \(X\) from \(D\) to obtain the orthogonalized regressor \(V = D - m(X)\). We then use the final estimate

\[\check{\theta}_0 = \left(\frac{1}{n} \sum_{i\in I} \hat{V}_i D_i\right)^{-1} \frac{1}{n} \sum_{i\in I} \hat{V}_i (Y_i - \hat{g}_0(X_i)).\]
In [37]: import numpy as np

In [38]: np.random.seed(2222)

# to speed up the illustration we hard-code the simulation results
In [39]: theta_orth_nosplit = np.array([0.5269861 , 0.48682698, 0.45808479, 0.46591054, 0.47453753, 0.474066  , 0.50998524, 0.45472461, 0.51296185, 0.57402367, 0.49932393, 0.51328342, 0.53728227, 0.38413749, 0.46069765, 0.47095928, 0.49359267, 0.44035397, 0.50447968, 0.47268968, 0.46074218, 0.41151753, 0.434847  , 0.4873961 , 0.46688001, 0.43024809, 0.49051175, 0.45356252, 0.45427558, 0.50022074, 0.48977533, 0.56098269, 0.38961805, 0.41125901, 0.4748894 , 0.42412004, 0.44705749, 0.5231581 , 0.49033896, 0.48503933, 0.43015338, 0.44154682, 0.4902393 , 0.38245209, 0.51450476, 0.47647825, 0.50007773, 0.47903055, 0.49418268, 0.56080375, 0.45953682, 0.46652166, 0.51456846, 0.50829186, 0.54538745, 0.41911111, 0.50936297, 0.53669094, 0.42254389, 0.4544877 , 0.50019279, 0.52443831, 0.52700521, 0.48787306, 0.53024376, 0.44000176, 0.43955207, 0.4733464 , 0.55669921, 0.52731979, 0.43930057, 0.45837929, 0.45972765, 0.4862641 , 0.49900815, 0.51834668, 0.50323945, 0.50786989, 0.47200566, 0.50307507, 0.46898   , 0.47696915, 0.46770453, 0.46545997, 0.4250659 , 0.494894  , 0.52010544, 0.49542341, 0.51601883, 0.49493945, 0.40182449, 0.43205712, 0.53710759, 0.4757337 , 0.5136859 , 0.47012369, 0.47963284, 0.48218851, 0.58030577, 0.51763202, 0.45985742, 0.54198937, 0.4611221 , 0.5098156 , 0.43023138, 0.56368806, 0.48300061, 0.48374618, 0.40530258, 0.47329255, 0.41705756, 0.4606845 , 0.43832176, 0.44102828, 0.44333831, 0.46029671, 0.46405733, 0.47607037, 0.4542386 , 0.44354708, 0.45175568, 0.55117658, 0.47413396, 0.46172446, 0.38677175, 0.54103262, 0.44239398, 0.46169587, 0.45518892, 0.41257724, 0.52436548, 0.43443768, 0.47283858, 0.46127727, 0.44831562, 0.54196493, 0.52168875, 0.5235551 , 0.42356335, 0.47162521, 0.4545478 , 0.44284108, 0.5520522 , 0.49528219, 0.54823811, 0.40642283, 0.39873622, 0.53167736, 0.43939755, 0.5220321 , 0.53124308, 0.49231836, 0.44953381, 0.4603219 , 0.47413766, 0.60070383, 0.45073656, 0.4587013 , 0.42961732, 0.58569857, 0.4786611 , 0.45579044, 0.50914344, 0.5383562 , 0.47894433, 0.45978526, 0.53156866, 0.47936777, 0.4969537 , 0.49535029, 0.50277886, 0.45905374, 0.46699655, 0.44532146, 0.48658664, 0.48709778, 0.49174929, 0.55692821, 0.47684158, 0.46423733, 0.43865106, 0.50698636, 0.48973865, 0.42167159, 0.3957361 , 0.44379821, 0.39898509, 0.45963827, 0.53670471, 0.4993672 , 0.44754017, 0.45666512, 0.46914767, 0.38802663, 0.46365638, 0.46621008, 0.46457694, 0.52799443, 0.45461167, 0.44619208, 0.49933583, 0.52501451, 0.48158253, 0.4880402 , 0.45147875, 0.42344256, 0.46843027, 0.44768437, 0.5329015 , 0.50538285, 0.41877673, 0.58733098, 0.43604415, 0.39121616, 0.40919979, 0.52937176, 0.44574901, 0.52549154, 0.51688899, 0.49038683, 0.524215  , 0.50012394, 0.47773777, 0.51262749, 0.4798687 , 0.52585334, 0.48500928, 0.48475539, 0.56675896, 0.46403703, 0.53489713, 0.56264991, 0.60394943, 0.47180687, 0.50745135, 0.56095857, 0.4994691 , 0.44306861, 0.56434319, 0.50159993, 0.47104477, 0.51991907, 0.45333344, 0.51688131, 0.4593441 , 0.42931374, 0.49392818, 0.4453436 , 0.40615444, 0.40862632, 0.44951026, 0.47870518, 0.51139498, 0.50771963, 0.49280773, 0.39782204, 0.47624009, 0.48449106, 0.56456506, 0.44407961, 0.43908048, 0.42033429, 0.48527659, 0.45935971, 0.42840397, 0.51883242, 0.44761422, 0.52896034, 0.51500774, 0.41552883, 0.41259031, 0.43836491, 0.38030853, 0.55514969, 0.51433095, 0.51124236, 0.49550809, 0.45138244, 0.46332312, 0.49087237, 0.5171917 , 0.45277732, 0.5694115 , 0.46729251, 0.51141906, 0.51404239, 0.54713944, 0.4825544 , 0.55747765, 0.41725985, 0.50233933, 0.509464  , 0.48269443, 0.44506905, 0.44742224, 0.47860412, 0.59143417, 0.41965323, 0.52311822, 0.40899553, 0.50470071, 0.54587067, 0.51466936, 0.45873567, 0.45099424, 0.49444131, 0.50251223, 0.42547873, 0.51704076, 0.4893706 , 0.46876871, 0.42282548, 0.46696793, 0.54961649, 0.41825518, 0.46044238, 0.35542112, 0.50897749, 0.48225231, 0.50376042, 0.57978601, 0.42038623, 0.54424115, 0.50913384, 0.51967352, 0.45558098, 0.47920347, 0.46498909, 0.44171909, 0.44867245, 0.45688495, 0.55573675, 0.43855156, 0.43588202, 0.47434703, 0.4534039 , 0.57217491, 0.37514574, 0.52972952, 0.46987186, 0.48217399, 0.41992847, 0.48096654, 0.43321465, 0.4188434 , 0.53961441, 0.49815367, 0.50685561, 0.47791186, 0.44074012, 0.46634329, 0.45512305, 0.53029002, 0.46238261, 0.56227888, 0.53536169, 0.51079319, 0.41878747, 0.42561402, 0.44543746, 0.50810509, 0.43612899, 0.51354395, 0.49977016, 0.50051541, 0.53551507, 0.49244442, 0.50277678, 0.5160166 , 0.46901205, 0.41402606, 0.47680296, 0.45360224, 0.46301156, 0.43486424, 0.44673988, 0.52310368, 0.4632103 , 0.45214978, 0.40959885, 0.52888551, 0.46164559, 0.51460441, 0.44789535, 0.50312455, 0.44696829, 0.50911277, 0.47995035, 0.43894944, 0.45281734, 0.48133637, 0.48008574, 0.52402988, 0.46908205, 0.43736268, 0.40082123, 0.46024889, 0.47725868, 0.46421821, 0.49376396, 0.46658517, 0.45112352, 0.42877219, 0.51217106, 0.43646888, 0.47200625, 0.46484351, 0.46914844, 0.47738484, 0.45602496, 0.48689799, 0.40210866, 0.4214575 , 0.38249861, 0.46310603, 0.46960364, 0.53381176, 0.45413129, 0.40388998, 0.45762165, 0.46173383, 0.47930384, 0.47416536, 0.46042911, 0.52835253, 0.4808568 , 0.51425763, 0.46488765, 0.51519737, 0.54480274, 0.5512091 , 0.41074881, 0.52537858, 0.44539956, 0.45011978, 0.47728473, 0.52023034, 0.50593401, 0.48986729, 0.45146434, 0.54722046, 0.51931633, 0.51448259, 0.48541474, 0.45924783, 0.42715107, 0.49323281, 0.49868261, 0.49982019, 0.4889621 , 0.46777377, 0.44102073, 0.49832579, 0.45041965, 0.44345536, 0.4837865 , 0.5367405 , 0.46253561, 0.42348893, 0.50155398, 0.52359747, 0.45658634, 0.47784916, 0.39994949, 0.46946692, 0.45305992, 0.49578233, 0.47494601, 0.42032238, 0.51439767, 0.43803864, 0.46185746, 0.50932719, 0.43742352, 0.44015234, 0.51447279, 0.46725811, 0.457112  , 0.46233817, 0.47329737, 0.48512522, 0.45297114, 0.56179915, 0.47435093, 0.4592582 , 0.39308681, 0.51746997, 0.55920064, 0.53658168, 0.49889319, 0.46111205, 0.44999989, 0.40907121, 0.46986319, 0.43990175, 0.55234788, 0.53661098, 0.49330377, 0.4040682 , 0.48534139, 0.42742481, 0.51077351, 0.49533248, 0.42045776, 0.5344603 , 0.40972033, 0.39091224, 0.5215851 , 0.53294953, 0.48338073, 0.47730069, 0.44219701, 0.47943696, 0.56002162, 0.54204664, 0.47793652, 0.44526255, 0.5103111 , 0.46524098, 0.42589576, 0.46350273, 0.43878478, 0.50774426, 0.45034939, 0.47611014, 0.53052248, 0.49346943, 0.51199455, 0.48761231, 0.43072246, 0.55977859, 0.46252589, 0.51027744, 0.49178512, 0.43658063, 0.44140418, 0.54593446, 0.5099492 , 0.48637227, 0.44615891, 0.52222773, 0.49006639, 0.44954301, 0.42483585, 0.45181009, 0.42576419, 0.50461041, 0.51571916, 0.46911646, 0.49450105, 0.49478691, 0.50042925, 0.52024835, 0.55977333, 0.46990362, 0.52257744, 0.46704933, 0.46301227, 0.46681985, 0.40915423, 0.39569977, 0.52492256, 0.44241541, 0.49612922, 0.46483458, 0.47232841, 0.53177213, 0.48038733, 0.55456041, 0.52527035, 0.40861517, 0.47510742, 0.41377477, 0.46857172, 0.5091455 , 0.50210738, 0.4661592 , 0.43931654, 0.45337505, 0.58026336, 0.42008203, 0.57453132, 0.54057293, 0.4936788 , 0.46884728, 0.40872442, 0.3421093 , 0.43545374, 0.47669734, 0.39441519, 0.43645366, 0.47273993, 0.4449061 , 0.52002601, 0.44433336, 0.45906409, 0.50075323, 0.44701585, 0.52082957, 0.480724  , 0.47608199, 0.50947882, 0.51152428, 0.45794717, 0.50034175, 0.50344393, 0.46710402, 0.52115728, 0.47081633, 0.48959728, 0.50418432, 0.517792  , 0.51938963, 0.4133624 , 0.4279831 , 0.44733654, 0.49945796, 0.53871876, 0.46003599, 0.50691651, 0.54157237, 0.51353142, 0.48113239, 0.50680141, 0.41546118, 0.48189775, 0.41209008, 0.50158812, 0.50325101, 0.53988773, 0.48862906, 0.63422704, 0.47889701, 0.4553412 , 0.48044833, 0.56318904, 0.46243581, 0.51149109, 0.46522226, 0.47128073, 0.44339338, 0.57568214, 0.48302812, 0.51718435, 0.54207562, 0.41400792, 0.52320126, 0.45159391, 0.51923563, 0.42497262, 0.52047988, 0.53274828, 0.40228563, 0.45588327, 0.48982012, 0.47352543, 0.47223994, 0.53485516, 0.4118618 , 0.51781447, 0.46538265, 0.52966071, 0.52424753, 0.47217289, 0.46273616, 0.51869698, 0.46317502, 0.48169949, 0.41855489, 0.44349482, 0.54201979, 0.47137472, 0.52945612, 0.44409319, 0.50464629, 0.43547169, 0.47253531, 0.43410852, 0.39608272, 0.51737693, 0.54404677, 0.44838106, 0.47019746, 0.51934514, 0.48196157, 0.5892373 , 0.46130456, 0.48244219, 0.50055673, 0.46595818, 0.49014524, 0.50559026, 0.55906078, 0.43110781, 0.49156007, 0.46765774, 0.52517817, 0.51003126, 0.42910519, 0.4654511 , 0.44930796, 0.52347481, 0.4193886 , 0.48611425, 0.45503422, 0.44758526, 0.51913489, 0.48615427, 0.45915381, 0.48966807, 0.41589988, 0.52822353, 0.49645715, 0.48918748, 0.47859385, 0.48490774, 0.39952061, 0.53175053, 0.50365121, 0.42264625, 0.45147569, 0.50496877, 0.48535063, 0.50744424, 0.51465332, 0.42414122, 0.45978169, 0.46411468, 0.49467868, 0.54409124, 0.47484253, 0.5068238 , 0.49396259, 0.53964916, 0.51172738, 0.47625784, 0.44923915, 0.48536552, 0.53069993, 0.49840198, 0.51187068, 0.46036831, 0.59581793, 0.48621146, 0.51410491, 0.4376168 , 0.52375321, 0.50083837, 0.46521782, 0.43536398, 0.47399854, 0.57235617, 0.48849083, 0.49901722, 0.50293966, 0.57851074, 0.39839549, 0.53103419, 0.54299908, 0.43289476, 0.46317743, 0.50137498, 0.51942289, 0.48557863, 0.4876492 , 0.48626463, 0.43484103, 0.4987074 , 0.56855659, 0.47981524, 0.41360043, 0.48092136, 0.44830716, 0.43753123, 0.45849459, 0.38110897, 0.47937367, 0.49034043, 0.46447731, 0.46973607, 0.49351532, 0.41452509, 0.42686193, 0.42527102, 0.53671829, 0.45457996, 0.46858151, 0.46619171, 0.47110253, 0.52061093, 0.57677477, 0.4699085 , 0.4496484 , 0.51996   , 0.46174003, 0.56715301, 0.42983828, 0.47521886, 0.52808329, 0.44851982, 0.4396226 , 0.43644067, 0.46111939, 0.46671984, 0.47274524, 0.45005976, 0.47461079, 0.44815431, 0.50703117, 0.45689512, 0.55516936, 0.55672735, 0.45293766, 0.48078288, 0.53844884, 0.43451484, 0.4775106 , 0.47762549, 0.50073684, 0.45568321, 0.50863967, 0.46257647, 0.55713696, 0.42439858, 0.53324603, 0.50664103, 0.42667372, 0.48713298, 0.43443033, 0.41249548, 0.43178557, 0.49643472, 0.5357908 , 0.49244275, 0.48560644, 0.57357695, 0.47801147, 0.4656959 , 0.45555179, 0.38060909, 0.44908041, 0.51529283, 0.51116703, 0.51160535, 0.56733604, 0.4637596 , 0.5161148 , 0.49774216, 0.46608273, 0.45297828, 0.35560759, 0.54295982, 0.45633101, 0.47249958, 0.43947559, 0.54984426, 0.43906653, 0.53537798, 0.45456857, 0.48796028, 0.52143596, 0.49293529, 0.53605175, 0.40139111, 0.50600271, 0.51908615, 0.47864096, 0.48689579, 0.50902385, 0.50369694, 0.43217983, 0.50677829, 0.49677785, 0.45289065, 0.41667242, 0.40712091, 0.45834197, 0.5057925 , 0.47651157, 0.54407932, 0.50013731, 0.48122896, 0.51997758, 0.47265008, 0.52992725, 0.40527474, 0.52039882, 0.48131845, 0.4510595 , 0.40413769, 0.52876278, 0.47489569, 0.4596825 , 0.5314986 , 0.42287487, 0.52030867, 0.49836773, 0.42014062, 0.49254797, 0.538642  , 0.42061216, 0.46500315, 0.43892295, 0.43702694, 0.49656952, 0.42301431, 0.51570935, 0.37316705, 0.5071268 , 0.52374101, 0.46331057, 0.48839092, 0.45366578, 0.42403456, 0.55836914, 0.48513398, 0.50529783, 0.45320212, 0.4491557 , 0.53586077, 0.57710138, 0.49492567, 0.47280252, 0.43089228, 0.53389067, 0.48039643, 0.46776854, 0.51406094, 0.42801787, 0.52341148, 0.46519127, 0.43181267, 0.56571248, 0.52404914, 0.49590624, 0.52889378, 0.52266558, 0.49889508, 0.4612402 , 0.47452792, 0.46355367, 0.54064643, 0.5086885 , 0.43543993, 0.47346238, 0.42796893, 0.47182714, 0.4295712 , 0.4643917 , 0.49052014, 0.57363413, 0.48587792, 0.45667329, 0.52436139, 0.39282397, 0.49423503, 0.48071968, 0.44336415, 0.47717448, 0.46242517, 0.51544736, 0.4538936 , 0.48770825, 0.39656014, 0.53140325, 0.52410917, 0.47079746, 0.46092059, 0.5299388 , 0.41879821, 0.49509749, 0.45823221, 0.41639722, 0.48395687, 0.4033108 , 0.47893983, 0.48929843, 0.46444785, 0.43743348, 0.47776494, 0.4557678 , 0.53800864, 0.46523766, 0.48527377, 0.45602462, 0.46100225, 0.57398326, 0.53971796, 0.55100335, 0.49459865, 0.47626581, 0.46692972, 0.36834415, 0.54171753, 0.51124387, 0.46717469, 0.51236106, 0.48676235, 0.45806207, 0.5146505])

In [40]: se_orth_nosplit = np.array([0.03300109, 0.03481441, 0.03023695, 0.03309708, 0.03608485, 0.03213616, 0.03648971, 0.03603703, 0.03801085, 0.03446007, 0.03402841, 0.03384802, 0.02981774, 0.03169046, 0.03356073, 0.03099595, 0.03922716, 0.03448312, 0.03044878, 0.03433093, 0.03455709, 0.04124444, 0.03382217, 0.03354967, 0.03725346, 0.02786431, 0.03397265, 0.03386515, 0.03639662, 0.03304494, 0.03120514, 0.03220385, 0.03133162, 0.03302797, 0.03650748, 0.03161229, 0.03712612, 0.0344661 , 0.03387415, 0.03423439, 0.03472111, 0.03380087, 0.0349508 , 0.03290457, 0.03236628, 0.03372614, 0.03360537, 0.03333013, 0.03117967, 0.03528887, 0.03265259, 0.03079767, 0.03340276, 0.03616061, 0.03364504, 0.0375724 , 0.03255368, 0.03167439, 0.03308361, 0.03185402, 0.03473072, 0.03695189, 0.03641993, 0.0330973 , 0.03363454, 0.0345028 , 0.03639678, 0.03246405, 0.03399911, 0.03587028, 0.03256571, 0.0306337 , 0.031742  , 0.03721978, 0.03176932, 0.03141078, 0.03409519, 0.03513022, 0.03262367, 0.03497397, 0.0360815 , 0.03600124, 0.03243677, 0.0331164 , 0.03149059, 0.03691718, 0.03196211, 0.03608905, 0.03755199, 0.03560633, 0.03318104, 0.03333913, 0.03130253, 0.03838744, 0.03212319, 0.03383321, 0.03205457, 0.03356666, 0.03544808, 0.03182409, 0.03454725, 0.03517473, 0.03614165, 0.03405882, 0.03397554, 0.0320861 , 0.0347675 , 0.03705034, 0.03187931, 0.0335782 , 0.0360765 , 0.03155507, 0.03304993, 0.03317409, 0.03580993, 0.03796723, 0.03467349, 0.03234889, 0.03437548, 0.0342068 , 0.03577822, 0.03535941, 0.03214434, 0.03227508, 0.03595557, 0.0353463 , 0.03429855, 0.03149308, 0.03357296, 0.03478293, 0.03668304, 0.03814905, 0.03689617, 0.03031397, 0.0356352 , 0.03752262, 0.03552895, 0.03582576, 0.03441394, 0.03186472, 0.03521422, 0.03531235, 0.03257761, 0.03639319, 0.03429881, 0.03462154, 0.03072465, 0.03311946, 0.0308567 , 0.03208536, 0.0337658 , 0.03710826, 0.03553074, 0.03607779, 0.03132417, 0.03221319, 0.03311266, 0.03093447, 0.03409707, 0.03604383, 0.0341283 , 0.03440112, 0.03587337, 0.03311389, 0.03730926, 0.03545398, 0.03334088, 0.03262428, 0.03348249, 0.03625748, 0.033844  , 0.03630546, 0.0344714 , 0.03217738, 0.03130945, 0.03101241, 0.03133432, 0.03678077, 0.03668157, 0.03587959, 0.02945016, 0.0339122 , 0.0336982 , 0.03594457, 0.03729026, 0.0333612 , 0.02820126, 0.04043288, 0.03398932, 0.03383912, 0.03688906, 0.03529162, 0.03308525, 0.03710377, 0.03697566, 0.03545765, 0.0393287 , 0.03511189, 0.03734153, 0.0309365 , 0.03599573, 0.03340091, 0.03631366, 0.03222798, 0.03391268, 0.03210976, 0.03517214, 0.03514128, 0.0362618 , 0.03526742, 0.03506047, 0.03744133, 0.03687915, 0.0312038 , 0.03342389, 0.0322474 , 0.03504425, 0.03462889, 0.03503286, 0.03175144, 0.03223341, 0.03574766, 0.03786785, 0.03079034, 0.0384242 , 0.03443336, 0.03509659, 0.0331189 , 0.03253633, 0.03212039, 0.03106236, 0.03329483, 0.03644602, 0.02921328, 0.03308668, 0.03062067, 0.03640539, 0.03360491, 0.03389683, 0.03850131, 0.03817785, 0.03238483, 0.03239908, 0.03544456, 0.03526306, 0.03552583, 0.03512413, 0.03581594, 0.03142119, 0.03688495, 0.03302685, 0.03583831, 0.03554739, 0.03517519, 0.03342819, 0.03240985, 0.0306706 , 0.03516093, 0.03546941, 0.03305869, 0.03444686, 0.03196067, 0.03258359, 0.03225225, 0.03405359, 0.0314135 , 0.03757875, 0.03694918, 0.03637657, 0.03603543, 0.03546733, 0.03470401, 0.03565601, 0.03408186, 0.03189548, 0.03375535, 0.03530298, 0.03328103, 0.03603692, 0.03215662, 0.03455473, 0.03628099, 0.03542867, 0.03459071, 0.03740486, 0.03241454, 0.03699095, 0.03362525, 0.03453697, 0.03560096, 0.03032834, 0.03261881, 0.03519571, 0.03175207, 0.03087034, 0.03661209, 0.0384522 , 0.03349561, 0.03298505, 0.03541992, 0.03483835, 0.0326382 , 0.0331954 , 0.03040188, 0.03141423, 0.03178553, 0.03399286, 0.03670659, 0.03529897, 0.03445289, 0.03910183, 0.03693579, 0.03745123, 0.03544073, 0.03308966, 0.03547556, 0.03707074, 0.03525615, 0.03456536, 0.03722953, 0.03312706, 0.03419826, 0.03419267, 0.03646339, 0.03257063, 0.03177225, 0.03429715, 0.03310622, 0.0358156 , 0.03475818, 0.03237383, 0.03740262, 0.03248381, 0.03041655, 0.03560246, 0.035361  , 0.03596175, 0.03756068, 0.03343584, 0.02914506, 0.03257972, 0.03186928, 0.03444595, 0.03448274, 0.03487147, 0.03307192, 0.03687837, 0.03554501, 0.02969871, 0.02882754, 0.03339066, 0.03207911, 0.03308664, 0.03293925, 0.03573058, 0.02838616, 0.03435363, 0.0370067 , 0.03200265, 0.03037309, 0.03357999, 0.03656119, 0.03843627, 0.03333474, 0.03880846, 0.03059737, 0.03275688, 0.03285129, 0.03220145, 0.03253442, 0.03618327, 0.03462011, 0.03432366, 0.03459524, 0.03157359, 0.03489503, 0.03187288, 0.03052811, 0.03633338, 0.03112468, 0.0328625 , 0.03208614, 0.03383455, 0.03118336, 0.03521309, 0.03375108, 0.03258716, 0.03324911, 0.03317217, 0.03288663, 0.03633928, 0.03324796, 0.02999422, 0.03228744, 0.03726359, 0.03703165, 0.03518771, 0.0349349 , 0.03320673, 0.03414009, 0.03372712, 0.031291  , 0.03871908, 0.0389572 , 0.03480945, 0.03369572, 0.03286408, 0.03432919, 0.03617588, 0.03514486, 0.03164417, 0.03464502, 0.03206587, 0.03142204, 0.03520723, 0.03901041, 0.03472864, 0.03446797, 0.03601697, 0.03129906, 0.03326078, 0.03360178, 0.03040458, 0.03195887, 0.03420034, 0.0362044 , 0.03443136, 0.03663701, 0.0338398 , 0.03190395, 0.03857493, 0.03287289, 0.03439351, 0.03784665, 0.03712634, 0.0350762 , 0.03203719, 0.03249487, 0.03143156, 0.03528639, 0.0366816 , 0.03070296, 0.03364303, 0.03233427, 0.03063859, 0.03310549, 0.03643439, 0.0330483 , 0.03227323, 0.0332104 , 0.03490121, 0.03534769, 0.03526284, 0.0350183 , 0.03454025, 0.03610774, 0.03448665, 0.0351776 , 0.03492046, 0.03587773, 0.03598657, 0.0330358 , 0.03617942, 0.03409603, 0.03405978, 0.03243784, 0.0357111 , 0.03422289, 0.03395089, 0.03419511, 0.03751485, 0.03752663, 0.03583497, 0.03050398, 0.03557723, 0.03388622, 0.03735758, 0.03667404, 0.03525028, 0.03827193, 0.03351546, 0.03367019, 0.03508188, 0.03651116, 0.0323478 , 0.03165301, 0.0352913 , 0.03669054, 0.03384447, 0.03291889, 0.03256246, 0.03364132, 0.03335759, 0.03923671, 0.03611274, 0.03519416, 0.03637248, 0.03100812, 0.02919954, 0.0342526 , 0.03437272, 0.03316797, 0.03233925, 0.03599803, 0.03184775, 0.03229374, 0.03498719, 0.03182368, 0.03486041, 0.03209741, 0.03499238, 0.03355567, 0.03165611, 0.0341816 , 0.03607304, 0.03268691, 0.03477272, 0.03287331, 0.03539434, 0.03271712, 0.03505849, 0.03153159, 0.03890978, 0.0341056 , 0.03538186, 0.03438103, 0.03405756, 0.03129275, 0.03284114, 0.03289583, 0.03842744, 0.03463848, 0.03313342, 0.03575486, 0.03577612, 0.02983565, 0.03523834, 0.03203394, 0.03804164, 0.03472436, 0.03164143, 0.03505926, 0.032858  , 0.03478454, 0.03435101, 0.0328792 , 0.03834945, 0.03813096, 0.03258165, 0.03688323, 0.03380965, 0.03459666, 0.03554661, 0.03254974, 0.02755169, 0.03403197, 0.03686333, 0.03104238, 0.03510361, 0.03461223, 0.03273386, 0.03506437, 0.03576537, 0.03456747, 0.03157396, 0.0356792 , 0.03312858, 0.03533342, 0.03395183, 0.02952398, 0.03133257, 0.0290001 , 0.03676953, 0.03198111, 0.03659722, 0.03297687, 0.03075361, 0.03692363, 0.03547212, 0.03423718, 0.03911962, 0.0337903 , 0.03549648, 0.03114438, 0.03639941, 0.03452909, 0.03333842, 0.03325164, 0.0318147 , 0.03348661, 0.03410641, 0.03684512, 0.03423216, 0.03254072, 0.03454452, 0.0342963 , 0.03554913, 0.03560372, 0.03737662, 0.03501553, 0.03416058, 0.03649484, 0.0353373 , 0.03306659, 0.03383092, 0.03258973, 0.03128851, 0.03535036, 0.0326183 , 0.03313489, 0.03298149, 0.03001876, 0.03292446, 0.0336928 , 0.0353293 , 0.03914796, 0.03681156, 0.03548131, 0.03490516, 0.03623682, 0.03389732, 0.03374424, 0.03564595, 0.0317539 , 0.03420668, 0.03417477, 0.03212741, 0.03260072, 0.03469001, 0.03336305, 0.03773065, 0.03327173, 0.03285666, 0.03506289, 0.03237553, 0.03862934, 0.03316271, 0.03686143, 0.03178891, 0.03681042, 0.03392235, 0.03511499, 0.03274074, 0.03035431, 0.03218739, 0.02936936, 0.03737124, 0.03797012, 0.03170762, 0.03751291, 0.03129583, 0.03430933, 0.03584066, 0.03263332, 0.03347521, 0.0301352 , 0.03149596, 0.03259497, 0.02944742, 0.03743508, 0.02899995, 0.03271523, 0.03931528, 0.03301583, 0.03106761, 0.03268265, 0.0339521 , 0.03190526, 0.03722284, 0.03506228, 0.03461957, 0.03004975, 0.03152583, 0.03188864, 0.03137891, 0.03125911, 0.03443212, 0.03086839, 0.03683474, 0.0362767 , 0.03311872, 0.03572921, 0.03316816, 0.0323083 , 0.03521522, 0.03557253, 0.03365509, 0.03403009, 0.0326287 , 0.03244894, 0.03690506, 0.03537427, 0.03649063, 0.03128687, 0.03721945, 0.03366335, 0.03434353, 0.03885856, 0.03119781, 0.03581426, 0.03252629, 0.03185808, 0.03493191, 0.03395895, 0.03227437, 0.03889401, 0.03115375, 0.03044907, 0.03352168, 0.03725254, 0.04023851, 0.03216466, 0.03268951, 0.03385814, 0.03274238, 0.03196035, 0.0368327 , 0.03088809, 0.03402669, 0.03434839, 0.03245973, 0.03077444, 0.03989451, 0.03465213, 0.03461663, 0.03282729, 0.03283131, 0.02965922, 0.03205531, 0.0327355 , 0.03385212, 0.03641985, 0.03535839, 0.03367922, 0.03383552, 0.03400515, 0.03173495, 0.03555596, 0.03687678, 0.03612996, 0.0335418 , 0.03272114, 0.03485328, 0.03215544, 0.03069584, 0.03557681, 0.03713931, 0.03404416, 0.03707127, 0.03633673, 0.03394292, 0.03453973, 0.03580137, 0.03147122, 0.03635144, 0.03505335, 0.03346194, 0.0352425 , 0.03309578, 0.03361246, 0.03162954, 0.03824726, 0.03128456, 0.03308664, 0.03249983, 0.0362276 , 0.03332539, 0.03361665, 0.03060977, 0.03693433, 0.0366655 , 0.03647699, 0.03065926, 0.03489498, 0.03484303, 0.03671298, 0.03384923, 0.0325788 , 0.04077159, 0.03860608, 0.03624336, 0.03847722, 0.03230998, 0.0378641 , 0.0311665 , 0.03302566, 0.03502139, 0.03389091, 0.03040683, 0.0327089 , 0.02989121, 0.03733698, 0.03252497, 0.0368373 , 0.03775841, 0.03408025, 0.03216691, 0.03484384, 0.03315263, 0.03539599, 0.03259381, 0.03414304, 0.03295092, 0.03846051, 0.03206971, 0.03048838, 0.03200569, 0.03212656, 0.03333666, 0.0348813 , 0.03645685, 0.03917926, 0.03368409, 0.03389568, 0.03244002, 0.03411523, 0.03402238, 0.03634798, 0.03779468, 0.03357757, 0.03237467, 0.03858004, 0.03477383, 0.03394397, 0.03230739, 0.03672567, 0.03409324, 0.03521135, 0.03204122, 0.03561428, 0.03498935, 0.03859978, 0.03507295, 0.03702111, 0.03092078, 0.03511057, 0.02930761, 0.03544484, 0.03255327, 0.03181242, 0.02968715, 0.04256435, 0.03930061, 0.03385781, 0.03310617, 0.03527292, 0.03542688, 0.03528373, 0.03279445, 0.03181911, 0.03577111, 0.03326912, 0.03262289, 0.03629811, 0.0378563 , 0.0312053 , 0.03712152, 0.03346831, 0.03766047, 0.03423268, 0.03298717, 0.03066189, 0.03542913, 0.03547632, 0.03402202, 0.03417251, 0.03692622, 0.036344  , 0.03403163, 0.03608709, 0.03406768, 0.03759235, 0.03547541, 0.03092644, 0.03172698, 0.03815645, 0.0333857 , 0.03187081, 0.03629718, 0.03323217, 0.03266878, 0.03316033, 0.03248826, 0.03524635, 0.03389906, 0.03489943, 0.02924824, 0.03481939, 0.03539659, 0.03357566, 0.03399703, 0.03150613, 0.0364799 , 0.03248547, 0.03047435, 0.03421486, 0.03462341, 0.03470768, 0.03761934, 0.03315931, 0.03509053, 0.03477462, 0.0304219 , 0.03633647, 0.03796296, 0.03736833, 0.03386945, 0.03103569, 0.03055042, 0.03651902, 0.03561151, 0.03592187, 0.03560313, 0.03095704, 0.03515765, 0.03537821, 0.03516444, 0.03394301, 0.03365487, 0.03376338, 0.03625588, 0.03294306, 0.03143146, 0.03241328, 0.03014768, 0.03647779, 0.03977323, 0.03352695, 0.03299449, 0.03759643, 0.03312409, 0.031813  , 0.03387483, 0.03599901, 0.03765133, 0.03177601, 0.03316265, 0.03215408, 0.03199014, 0.03368082, 0.03376967, 0.0316642 , 0.03014013, 0.03350298, 0.03401597, 0.03083467, 0.03712924, 0.03491432, 0.0317063 , 0.03464181, 0.03251904, 0.03534762, 0.03439422, 0.03835411, 0.03623541, 0.0340211 , 0.03545453, 0.03167305, 0.03432224, 0.03212673, 0.03596564, 0.03338769, 0.03552314, 0.03368746, 0.03383131, 0.03705007, 0.03340853, 0.03626988, 0.03358266, 0.03560516, 0.03447281, 0.03138491, 0.03209008, 0.0345985 , 0.03430723, 0.0344173 , 0.03037132, 0.03406071, 0.03662991, 0.03487076, 0.03266249, 0.03427314, 0.03168054, 0.03632044, 0.03633239, 0.03903545, 0.03464841, 0.03560016, 0.03340148, 0.03447032, 0.03320291, 0.02977214, 0.03428828, 0.03499615, 0.03676726, 0.03597865, 0.0333828 , 0.03563908, 0.03401826, 0.03394263])

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for i_rep in range(n_rep):
In [41]: for i_rep in range(1):
   ....:     (x, y, d) = data[i_rep]
   ....:     obj_dml_data = DoubleMLData.from_arrays(x, y, d)
   ....:     obj_dml_plr_orth_nosplit = DoubleMLPLR(obj_dml_data,
   ....:                                         ml_l, ml_m, ml_g,
   ....:                                         n_folds=1,
   ....:                                         score='IV-type',
   ....:                                         apply_cross_fitting=False)
   ....:     obj_dml_plr_orth_nosplit.fit()
   ....:     this_theta = obj_dml_plr_orth_nosplit.coef[0]
   ....:     this_se = obj_dml_plr_orth_nosplit.se[0]
   ....:     print(np.abs(theta_orth_nosplit[i_rep] - this_theta))
   ....:     print(np.abs(se_orth_nosplit[i_rep] - this_se))
   ....:     theta_orth_nosplit[i_rep] = this_theta
   ....:     se_orth_nosplit[i_rep] = this_se
   ....: 
0.019904426114232265
0.0009613229108579729

In [42]: plt.figure(constrained_layout=True);

In [43]: ax = sns.histplot((theta_orth_nosplit - alpha)/se_orth_nosplit,
   ....:                 color=face_colors[1], edgecolor = edge_colors[1],
   ....:                 stat='density', bins=30, label='Double ML (no sample splitting)');
   ....: 

In [44]: ax.axvline(0., color='k');

In [45]: xx = np.arange(-5, +5, 0.001)

In [46]: yy = stats.norm.pdf(xx)

In [47]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [48]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [49]: ax.set_xlim([-6., 6.]);

In [50]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/orth_nosplit.png
library(data.table)
lgr::get_logger("mlr3")$set_threshold("warn")
set.seed(2222)

# to speed up the illustration we hard-code the simulation results
theta_orth_nosplit = c(0.497919857, 0.493917534, 0.416514503, 0.476232175, 0.412929436, 0.448641257, 0.564799593, 0.454269839, 0.420637156, 0.544918810, 0.517223713, 0.435538685, 0.444877006, 0.401903040, 0.461285589, 0.409819054, 0.454794314, 0.528790715, 0.499351284, 0.481874391, 0.430690729, 0.468141883, 0.473995519, 0.463688361, 0.486383887, 0.434219030, 0.488078921, 0.562504934, 0.493648169, 0.462918129, 0.502065895, 0.470101714, 0.579575510, 0.506011813, 0.462908503, 0.452329421, 0.507392534, 0.509547597, 0.460559260, 0.509577147, 0.482517277, 0.534971643, 0.355355696, 0.533763683, 0.569134235, 0.539763423, 0.535231022, 0.462566215, 0.481408931, 0.448715263, 0.491620360, 0.539071425, 0.548421990, 0.424896296, 0.492694630, 0.598550280, 0.488188605, 0.406294717, 0.463690315, 0.437664829, 0.466196729, 0.429505517, 0.495047976, 0.460093925, 0.511632538, 0.449426928, 0.438359907, 0.462342174, 0.553995422, 0.444503574, 0.526797886, 0.524949776, 0.432833900, 0.442813460, 0.480755144, 0.486566148, 0.493205249, 0.493628693, 0.452248443, 0.468385518, 0.442034753, 0.469355823, 0.489001043, 0.465142246, 0.486235968, 0.503548996, 0.465061905, 0.493052173, 0.456772879, 0.582864496, 0.539590475, 0.459290682, 0.434292315, 0.461609052, 0.402391034, 0.540729856, 0.471067738, 0.479175940, 0.529790415, 0.472256945, 0.446532830, 0.423005718, 0.458991254, 0.472673412, 0.464360526, 0.410565221, 0.493283688, 0.476627731, 0.481205501, 0.484919280, 0.462872501, 0.500217244, 0.432746440, 0.513275023, 0.405544128, 0.468472273, 0.508256506, 0.479762021, 0.483677880, 0.459198605, 0.525016367, 0.521710553, 0.512508317, 0.453933743, 0.481405329, 0.487911822, 0.430889503, 0.496192756, 0.484952386, 0.486819106, 0.506353419, 0.465582071, 0.415050715, 0.564972286, 0.461292032, 0.495115703, 0.553161337, 0.446704656, 0.472220429, 0.478994803, 0.463584015, 0.425939267, 0.533053318, 0.448593061, 0.501115032, 0.453835534, 0.452416742, 0.533753794, 0.528535596, 0.492446280, 0.566103956, 0.497161427, 0.570305831, 0.429709123, 0.608087018, 0.479085101, 0.408917109, 0.431701271, 0.517403775, 0.446731746, 0.574939312, 0.493070008, 0.502484831, 0.466572517, 0.562413467, 0.488633751, 0.560111815, 0.483960839, 0.518017051, 0.570124237, 0.490545797, 0.497894062, 0.459843449, 0.454269914, 0.504642066, 0.482850322, 0.444971692, 0.502197372, 0.438373473, 0.437651566, 0.449240020, 0.431742188, 0.520381100, 0.512522492, 0.429333319, 0.425580694, 0.477770341, 0.503151151, 0.419390810, 0.477861521, 0.486361358, 0.535398562, 0.474534557, 0.556408474, 0.492789379, 0.523017560, 0.459284415, 0.478682601, 0.420632794, 0.412326311, 0.449064497, 0.504571054, 0.396834013, 0.551599643, 0.538262919, 0.397096030, 0.446499532, 0.544902623, 0.506097343, 0.508293937, 0.450355311, 0.515324340, 0.500617844, 0.439873355, 0.495198247, 0.525396961, 0.552202345, 0.488730062, 0.402460890, 0.416635327, 0.497267997, 0.520875427, 0.455588919, 0.402049605, 0.476783076, 0.537876118, 0.470556885, 0.457867359, 0.456765160, 0.504479051, 0.489995323, 0.455569306, 0.469483513, 0.390079702, 0.471024748, 0.482894810, 0.513571476, 0.415534294, 0.452503027, 0.434399958, 0.422852488, 0.511785340, 0.506290191, 0.482292080, 0.469634682, 0.444112925, 0.451343094, 0.563579449, 0.471451713, 0.504841289,
                    0.406902606, 0.531770369, 0.487491033, 0.507892615, 0.448710661, 0.486197505, 0.394209765, 0.437785839, 0.454763800, 0.371616500, 0.520606855, 0.480428767, 0.442876913, 0.459196417, 0.507085852, 0.474554017, 0.462776120, 0.410038223, 0.515197604, 0.451497096, 0.478149025, 0.502887512, 0.547606719, 0.488839629, 0.494233732, 0.506036670, 0.467519109, 0.464524742, 0.508500974, 0.475975637, 0.461159476, 0.457126837, 0.523177636, 0.463959211, 0.487123543, 0.525315944, 0.491118552, 0.431768234, 0.569325492, 0.506794008, 0.527366522, 0.498723377, 0.476015949, 0.547964981, 0.450281890, 0.454583215, 0.425495858, 0.492947219, 0.461566235, 0.466014009, 0.431693899, 0.463059411, 0.487301203, 0.490328960, 0.544269556, 0.464415072, 0.566969528, 0.445252051, 0.462514001, 0.478097843, 0.565904142, 0.487664489, 0.442908689, 0.446474670, 0.483292597, 0.465313413, 0.503799898, 0.438849661, 0.481389333, 0.474853887, 0.522913447, 0.374109506, 0.454236279, 0.486927489, 0.502901127, 0.509538213, 0.433342962, 0.532164120, 0.472878759, 0.524534580, 0.500116551, 0.488895397, 0.489134366, 0.506899394, 0.441709786, 0.451354616, 0.492003313, 0.523118242, 0.509114607, 0.482828539, 0.358140577, 0.489292694, 0.477061463, 0.495402486, 0.535556587, 0.500220764, 0.448570380, 0.450850394, 0.477938931, 0.525512810, 0.493065395, 0.391602699, 0.533114415, 0.536416015, 0.446714275, 0.437596139, 0.467890326, 0.488901105, 0.483402132, 0.490373081, 0.506180100, 0.504457745, 0.539816949, 0.487440588, 0.436065814, 0.491635827, 0.466587478, 0.496002901, 0.502890698, 0.403564886, 0.447846202, 0.451144085, 0.537151792, 0.453237238, 0.492467500, 0.489060635, 0.483867166, 0.478079107, 0.504410439, 0.458613011, 0.518290080, 0.536046545, 0.502619007, 0.464894707, 0.502700404, 0.495946217, 0.414731709, 0.471975282, 0.487328511, 0.413396165, 0.542984304, 0.521382504, 0.492463477, 0.426331611, 0.434812060, 0.458787566, 0.508306876, 0.518786668, 0.474315857, 0.486822128, 0.520971953, 0.574398576, 0.549453493, 0.506843957, 0.426187920, 0.498536554, 0.477876796, 0.482435691, 0.484321573, 0.426083985, 0.470625505, 0.493741241, 0.500207599, 0.536492958, 0.452246607, 0.377825451, 0.473493136, 0.435814098, 0.424855958, 0.501319454, 0.483646558, 0.469367424, 0.486704759, 0.495795203, 0.517041019, 0.478155002, 0.496000721, 0.464572537, 0.459796986, 0.470899664, 0.511479534, 0.485689684, 0.529648017, 0.449999118, 0.420596592, 0.500594356, 0.434085603, 0.490270135, 0.477414613, 0.526618665, 0.536497112, 0.467812620, 0.519881940, 0.449234834, 0.508020928, 0.535812313, 0.442558061, 0.484649535, 0.512863915, 0.541242690, 0.550442852, 0.565686029, 0.504660914, 0.396277618, 0.484955116, 0.515723327, 0.477598622, 0.416861345, 0.502547968, 0.537359503, 0.489845172, 0.469928615, 0.446495108, 0.381923366, 0.431854062, 0.488958967, 0.484907945, 0.433950046, 0.501524827, 0.435876120, 0.442164637, 0.433197212, 0.483391341, 0.483728319, 0.546662847, 0.504339642, 0.423932310, 0.496990723, 0.428061227, 0.419677195, 0.546069140, 0.452573252, 0.496171145, 0.504014929, 0.491759941, 0.497083929, 0.449750318, 0.514053104, 0.526085161, 0.434903119, 0.459551015, 0.489590939, 0.563278794, 0.472936465, 0.498477471, 0.475405241, 0.476529760, 0.508896391, 0.543750617, 0.460913380,
                    0.431687488, 0.383495477, 0.434627056, 0.488995114, 0.527154098, 0.490159276, 0.550225931, 0.468891897, 0.580101771, 0.516873799, 0.525226380, 0.509673522, 0.527530156, 0.484039748, 0.389759962, 0.557329601, 0.534055641, 0.470421996, 0.513326534, 0.506179662, 0.466411715, 0.427173217, 0.441512652, 0.487748190, 0.469667544, 0.551689030, 0.416847005, 0.483970006, 0.406643898, 0.510567708, 0.468731842, 0.438849360, 0.471268111, 0.489649755, 0.475076521, 0.535650143, 0.436620485, 0.430850300, 0.462973276, 0.496233915, 0.464436052, 0.482813618, 0.424198267, 0.440998957, 0.421224739, 0.553106564, 0.431543119, 0.514836309, 0.362607660, 0.511919674, 0.470734442, 0.436490286, 0.473845405, 0.538398221, 0.434689200, 0.453848478, 0.452607824, 0.490511387, 0.545845137, 0.481027562, 0.534631343, 0.481061454, 0.421952035, 0.501293447, 0.503267908, 0.524129919, 0.468005273, 0.420095523, 0.482321408, 0.435568140, 0.505468457, 0.445403584, 0.394345362, 0.481000182, 0.497226180, 0.511953478, 0.519256134, 0.547721311, 0.545972972, 0.490388860, 0.559827807, 0.424905265, 0.396301574, 0.520752281, 0.437183024, 0.463689867, 0.464779675, 0.426796849, 0.545466021, 0.462249159, 0.451134135, 0.450480408, 0.467373532, 0.520838877, 0.492399606, 0.467859700, 0.504814931, 0.542760844, 0.529152117, 0.464995017, 0.449365195, 0.379441350, 0.513754653, 0.501034146, 0.439605643, 0.484473863, 0.522262813, 0.492058343, 0.473674131, 0.420512721, 0.498284020, 0.467669993, 0.477529434, 0.528584514, 0.572190697, 0.506540793, 0.447599793, 0.433805725, 0.503107069, 0.516442451, 0.485110381, 0.424682777, 0.398027102, 0.482317104, 0.433980477, 0.461538676, 0.498237221, 0.522989967, 0.510300106, 0.435528357, 0.527344115, 0.500848274, 0.479741224, 0.529417686, 0.509268466, 0.486988107, 0.476190014, 0.526693447, 0.490499951, 0.518619236, 0.439907971, 0.405807477, 0.452138227, 0.387661145, 0.482211942, 0.478250228, 0.539888152, 0.567478785, 0.422010076, 0.633773150, 0.523156768, 0.506399586, 0.465029074, 0.483846798, 0.449405185, 0.491074076, 0.502972176, 0.440784191, 0.522960685, 0.498880328, 0.438603839, 0.454750522, 0.445834027, 0.449463661, 0.506585882, 0.494284249, 0.456720783, 0.412222464, 0.416898819, 0.438749372, 0.497099949, 0.528262461, 0.454684460, 0.495619336, 0.476348749, 0.472585690, 0.478588038, 0.539029150, 0.476124122, 0.488084420, 0.468494323, 0.473745218, 0.479520879, 0.435325020, 0.500484853, 0.516165636, 0.531860743, 0.452802681, 0.454032355, 0.500077045, 0.448727192, 0.527624874, 0.387018205, 0.455842884, 0.446188323, 0.491140491, 0.406183665, 0.478779564, 0.439811868, 0.500198597, 0.483131044, 0.474464810, 0.403223509, 0.360137418, 0.480683506, 0.512824257, 0.427721937, 0.514294840, 0.437335093, 0.476997897, 0.430668800, 0.483014635, 0.540177148, 0.483564038, 0.476608503, 0.574151432, 0.514086285, 0.406449496, 0.445330206, 0.466581023, 0.450281046, 0.506629446, 0.533208780, 0.456159214, 0.530903448, 0.447681063, 0.528580441, 0.486323292, 0.430875137, 0.460236801, 0.461124368, 0.464023642, 0.497824208, 0.547315556, 0.475132506, 0.474351242, 0.475417534, 0.468169578, 0.467709981, 0.522400146, 0.459957848, 0.476054806, 0.499018913, 0.443057685, 0.507859707, 0.467337669, 0.511088398, 0.475492235, 0.559957889, 0.392966003,
                    0.437582776, 0.488870608, 0.504682437, 0.481458344, 0.463886671, 0.544692229, 0.444973521, 0.458163319, 0.496613965, 0.447092139, 0.559698601, 0.448910753, 0.464233475, 0.446752838, 0.506994189, 0.437084268, 0.508235221, 0.510687882, 0.492108348, 0.483867449, 0.509621877, 0.464298702, 0.383227605, 0.531522980, 0.493945852, 0.544596720, 0.516481546, 0.427392454, 0.547600686, 0.476038520, 0.457152549, 0.475628514, 0.463455359, 0.493895299, 0.494257331, 0.402184735, 0.523407084, 0.482738434, 0.528094660, 0.442753847, 0.470158656, 0.528099587, 0.522995738, 0.536049557, 0.468727950, 0.426443099, 0.577860218, 0.449334835, 0.535210544, 0.457928359, 0.488717815, 0.463366187, 0.434782169, 0.482365010, 0.419272021, 0.476663003, 0.484050988, 0.530193801, 0.400530994, 0.528516545, 0.480400951, 0.412261902, 0.447723736, 0.431595929, 0.477774047, 0.496965051, 0.514886223, 0.481970969, 0.533231482, 0.520593999, 0.527400870, 0.473956442, 0.503813567, 0.475057158, 0.365714266, 0.456621426, 0.505654981, 0.449702872, 0.463849338, 0.501395034, 0.488040758, 0.511687766, 0.446462081, 0.530227938, 0.512639575, 0.568302832, 0.486468879, 0.478180501, 0.528639074, 0.505271757, 0.416626066, 0.441627338, 0.445530329, 0.398814867, 0.460657830, 0.539945224, 0.531506161, 0.441873002, 0.474964925, 0.523338395, 0.444374358, 0.501827806, 0.492979781, 0.462656815, 0.484503882, 0.447677988, 0.510457265, 0.449300942, 0.503920646, 0.487079653, 0.480318847, 0.471914031, 0.490198105, 0.500074103, 0.482298891, 0.434724021, 0.513164025, 0.505832639, 0.386535437, 0.436334646, 0.499193197, 0.529868043, 0.441765697, 0.498210710, 0.495532505, 0.405010092, 0.486182160, 0.445503948, 0.440922032, 0.421635887, 0.481897807, 0.440487422, 0.480065084, 0.489150585, 0.531277696, 0.519740256, 0.494447331, 0.489307880, 0.491201360, 0.573117701, 0.506330793, 0.564565611, 0.496265655, 0.505822893, 0.401513863, 0.412639206, 0.522171206, 0.488410297, 0.458498142, 0.558719188, 0.558437543, 0.536569968, 0.443789456, 0.500621109, 0.475052117, 0.429723059, 0.555333689, 0.501533054, 0.383230580, 0.515683818, 0.523511203, 0.442013196, 0.561273430, 0.430105089, 0.506817930, 0.547548435, 0.514616112, 0.460726629, 0.469794405, 0.496923502, 0.467042619, 0.493594450, 0.411298369, 0.440571309, 0.431002730, 0.502676551, 0.417416215, 0.513590941, 0.564697160, 0.469856431, 0.473954756, 0.555199003, 0.516448780, 0.523839290, 0.379553757, 0.468202220, 0.515611181, 0.511841423, 0.510301188, 0.449573024, 0.472320167, 0.495526555, 0.448585315, 0.382244378, 0.478399441, 0.480704674, 0.532706935, 0.487930802, 0.507435761, 0.516170692, 0.442699560, 0.421042231, 0.526773898, 0.520541246, 0.489166652, 0.526574686, 0.500307267, 0.491709586, 0.455747912, 0.531639173, 0.527049979, 0.411682061, 0.423745075, 0.438643649, 0.477633185, 0.448793670, 0.477032846, 0.513398960, 0.488323599, 0.483460427, 0.478246132, 0.485472070, 0.469997191, 0.479596811, 0.465766931, 0.516689292, 0.459517968, 0.539667522, 0.507254357, 0.490934597, 0.496862265, 0.495062143, 0.493874819, 0.424999460, 0.371145367, 0.471599298, 0.437495249, 0.480209734, 0.509153575, 0.441003067, 0.531033347, 0.467096286, 0.522305089, 0.449518335, 0.466920063, 0.576018776, 0.517314814, 0.493501645, 0.395402059, 0.536592951)
se_orth_nosplit = c(0.0346303525, 0.0345186695, 0.0324054836, 0.0315913224, 0.0320982393, 0.0328292864, 0.0356994291, 0.0343032388, 0.0331411217, 0.0305183221, 0.0353208144, 0.0299280661, 0.0315422764, 0.0337302803, 0.0314802450, 0.0316912427, 0.0396537845, 0.0402949951, 0.0353169839, 0.0311644387, 0.0355320543, 0.0361554683, 0.0338439286, 0.0346927486, 0.0301085789, 0.0352784218, 0.0338974935, 0.0348253645, 0.0339281726, 0.0379045744, 0.0360186695, 0.0350992025, 0.0373538879, 0.0362703686, 0.0345240534, 0.0322348171, 0.0309015894, 0.0354513826, 0.0334694952, 0.0389673170, 0.0311000043, 0.0337174020, 0.0362021297, 0.0395214331, 0.0305395565, 0.0361004230, 0.0324450794, 0.0380780074, 0.0344571911, 0.0303129742, 0.0373512808, 0.0334584609, 0.0334547230, 0.0353865100, 0.0352390233, 0.0331133601, 0.0392275466, 0.0364469319, 0.0344314601, 0.0332729712, 0.0358759180, 0.0344242778, 0.0304058808, 0.0360297071, 0.0339669352, 0.0337922567, 0.0318169995, 0.0362293277, 0.0343186277, 0.0343823799, 0.0348466099, 0.0342637609, 0.0342168893, 0.0320795331, 0.0325809091, 0.0328985792, 0.0347311770, 0.0321404075, 0.0344739070, 0.0318137709, 0.0316052845, 0.0338281257, 0.0321817674, 0.0363744347, 0.0331454887, 0.0318688264, 0.0321536015, 0.0358149120, 0.0370362852, 0.0331707892, 0.0318954105, 0.0329878538, 0.0296531163, 0.0373907873, 0.0362126394, 0.0342919559, 0.0350699038, 0.0337703047, 0.0325924870, 0.0333960577, 0.0320443726, 0.0339642596, 0.0302790341, 0.0346340810, 0.0344070786, 0.0331529557, 0.0295188409, 0.0344982917, 0.0340503444, 0.0326257713, 0.0361580167, 0.0321259476, 0.0327708808, 0.0339509995, 0.0326487791, 0.0364927353, 0.0380448308, 0.0355253484, 0.0312146000, 0.0331322147, 0.0321922246, 0.0333917312, 0.0394408285, 0.0350678586, 0.0316880081, 0.0309265463, 0.0343540426, 0.0369323021, 0.0339410141, 0.0331134986, 0.0321600676, 0.0323424325, 0.0365633933, 0.0323377799, 0.0337075893, 0.0371320637, 0.0352851133, 0.0345081644, 0.0343081360, 0.0343843873, 0.0322395532, 0.0336599025, 0.0372701432, 0.0327237778, 0.0330885488, 0.0341332881, 0.0342574843, 0.0347684232, 0.0340171002, 0.0294029961, 0.0353561972, 0.0346303050, 0.0330659311, 0.0373703421, 0.0365832062, 0.0335523539, 0.0337258084, 0.0332723263, 0.0346228748, 0.0342243297, 0.0363512253, 0.0363657924, 0.0331923490, 0.0327257110, 0.0359920284, 0.0319909798, 0.0334852850, 0.0366051866, 0.0352345872, 0.0358754296, 0.0328472885, 0.0333915701, 0.0308769045, 0.0329099140, 0.0365275563, 0.0368098133, 0.0339216667, 0.0346919781, 0.0342473437, 0.0371297663, 0.0358502444, 0.0333085513, 0.0359800969, 0.0379277218, 0.0306404832, 0.0338071977, 0.0345616307, 0.0338983399, 0.0360714427, 0.0327305034, 0.0340865449, 0.0333826404, 0.0318169554, 0.0347065655, 0.0343073272, 0.0368820302, 0.0347677302, 0.0342599702, 0.0319077937, 0.0374233366, 0.0331420158, 0.0327949070, 0.0358096319, 0.0336694535, 0.0329976501, 0.0354888910, 0.0334983516, 0.0325868733, 0.0325708545, 0.0351118570, 0.0375027754, 0.0402231508, 0.0353896396, 0.0334495202, 0.0368241430, 0.0350060018, 0.0343979019, 0.0360849577, 0.0347260359, 0.0330473435, 0.0351009264, 0.0354864600, 0.0336524823, 0.0334545504, 0.0337131260, 0.0361391392, 0.0354320117, 0.0312266113, 0.0314296311, 0.0332282234, 0.0342670367, 0.0313179985, 0.0367233682, 0.0327536427, 0.0317194783, 0.0319682940, 0.0323440360, 0.0333039168, 0.0329524456, 0.0328229387, 0.0350863498, 0.0327498121, 0.0334311158, 0.0379412906, 0.0287123766, 0.0346464080, 0.0332107385, 0.0317565614, 0.0349715783, 0.0371739054,
                    0.0321561001, 0.0325518083, 0.0324582919, 0.0352366576, 0.0327967406, 0.0332041419, 0.0343403711, 0.0324075898, 0.0340949014, 0.0340244516, 0.0337563964, 0.0300524893, 0.0364110378, 0.0345073651, 0.0322028956, 0.0358264741, 0.0336262467, 0.0332480653, 0.0370409233, 0.0354181796, 0.0330915593, 0.0363585086, 0.0327897815, 0.0325500837, 0.0342626019, 0.0313303196, 0.0350319536, 0.0360054927, 0.0351581472, 0.0305234765, 0.0321372815, 0.0326539790, 0.0340682343, 0.0372181010, 0.0355661597, 0.0333686047, 0.0341105543, 0.0331939185, 0.0344681807, 0.0337463076, 0.0346261591, 0.0308955369, 0.0400585193, 0.0331617913, 0.0355128450, 0.0341054130, 0.0343670716, 0.0336927804, 0.0340387969, 0.0367075274, 0.0319223957, 0.0351918214, 0.0332431009, 0.0352271561, 0.0325863900, 0.0355968793, 0.0362069728, 0.0313614304, 0.0326890506, 0.0313262468, 0.0334300688, 0.0321954063, 0.0322260367, 0.0354909274, 0.0360415048, 0.0355125512, 0.0380667896, 0.0298174277, 0.0341158142, 0.0325290938, 0.0331343602, 0.0352523635, 0.0333817702, 0.0335117829, 0.0337214195, 0.0330384426, 0.0323202388, 0.0347395295, 0.0354309718, 0.0351139237, 0.0349633520, 0.0351851800, 0.0367303058, 0.0352338103, 0.0339963345, 0.0328206661, 0.0359241500, 0.0343602565, 0.0316508200, 0.0347033146, 0.0333266554, 0.0320789265, 0.0311053396, 0.0320807531, 0.0357205849, 0.0355515396, 0.0363257125, 0.0353752309, 0.0329907701, 0.0319153504, 0.0347076233, 0.0368914788, 0.0353233866, 0.0340231862, 0.0326737167, 0.0332534013, 0.0384619083, 0.0369212584, 0.0333324169, 0.0369055476, 0.0289118334, 0.0329851526, 0.0395778845, 0.0340705313, 0.0368329974, 0.0353401853, 0.0336485111, 0.0329219524, 0.0353702030, 0.0350458188, 0.0343616734, 0.0327860817, 0.0315764937, 0.0314408060, 0.0349141714, 0.0346152924, 0.0355051871, 0.0332759279, 0.0361248092, 0.0329426961, 0.0366532551, 0.0328655734, 0.0290683619, 0.0314280802, 0.0348454320, 0.0326428137, 0.0372566026, 0.0351550843, 0.0318379542, 0.0318888453, 0.0332551152, 0.0352506488, 0.0310237631, 0.0346726507, 0.0340533042, 0.0341346322, 0.0323559175, 0.0323822997, 0.0316222348, 0.0384273891, 0.0370195929, 0.0335794831, 0.0322775815, 0.0317649474, 0.0332005886, 0.0390349282, 0.0358370073, 0.0314956599, 0.0328314065, 0.0350734846, 0.0300930718, 0.0349935441, 0.0335204195, 0.0315345989, 0.0315054612, 0.0373469979, 0.0356766223, 0.0306881258, 0.0311731736, 0.0316914958, 0.0358984621, 0.0345085877, 0.0328523686, 0.0307589907, 0.0325619140, 0.0330624637, 0.0348241782, 0.0344037950, 0.0360556733, 0.0315634221, 0.0350675734, 0.0362833220, 0.0303844924, 0.0343621467, 0.0338776093, 0.0349915006, 0.0324568309, 0.0330284578, 0.0387016639, 0.0323473919, 0.0366005230, 0.0337302735, 0.0334747501, 0.0335929346, 0.0299151435, 0.0321356981, 0.0330234866, 0.0312758562, 0.0326397289, 0.0344537397, 0.0357353527, 0.0364532062, 0.0359915000, 0.0320750153, 0.0321116729, 0.0299891793, 0.0335857619, 0.0408259644, 0.0336553511, 0.0351198700, 0.0333868928, 0.0397005432, 0.0350437126, 0.0340003083, 0.0318940274, 0.0356353574, 0.0364079413, 0.0367568829, 0.0319923095, 0.0336247263, 0.0337187203, 0.0348990852, 0.0344602527, 0.0325299709, 0.0357059921, 0.0425362501, 0.0316230098, 0.0335300385, 0.0334322512, 0.0333374828, 0.0333261098, 0.0363099619, 0.0337644888, 0.0330951399, 0.0314957616, 0.0364708477, 0.0349616747, 0.0329624557, 0.0330713081, 0.0316561498, 0.0346202915, 0.0348109897, 0.0345878492, 0.0306440898, 0.0367077013, 0.0319875495, 0.0311239107, 0.0312598049, 0.0317668814, 0.0317471745,
                    0.0345602430, 0.0333591414, 0.0350439640, 0.0353177608, 0.0319211084, 0.0298723056, 0.0344245505, 0.0344569052, 0.0363984021, 0.0385203055, 0.0328475219, 0.0379768153, 0.0330138460, 0.0339428409, 0.0329523104, 0.0358972952, 0.0323075219, 0.0313541947, 0.0363300988, 0.0353025757, 0.0358772380, 0.0334689172, 0.0426339175, 0.0302142806, 0.0301954931, 0.0338966454, 0.0361350450, 0.0398406931, 0.0322986553, 0.0355128930, 0.0299109706, 0.0326988648, 0.0360378958, 0.0377298095, 0.0295950951, 0.0356926529, 0.0351742638, 0.0303107313, 0.0360209559, 0.0340648389, 0.0321606838, 0.0331554730, 0.0308242163, 0.0337119671, 0.0374948581, 0.0342504105, 0.0338300751, 0.0328525577, 0.0326061438, 0.0314356178, 0.0319744169, 0.0316470437, 0.0343687698, 0.0349441269, 0.0358791519, 0.0317138241, 0.0333076142, 0.0343362006, 0.0388538772, 0.0327316011, 0.0312863492, 0.0380478831, 0.0323221138, 0.0364509508, 0.0358057484, 0.0349232801, 0.0390291366, 0.0360625259, 0.0349984621, 0.0348074988, 0.0317678898, 0.0351830784, 0.0334661208, 0.0335646744, 0.0337586280, 0.0347793271, 0.0368533683, 0.0354851090, 0.0331495410, 0.0323745700, 0.0342420118, 0.0369403345, 0.0358409327, 0.0327320390, 0.0412247638, 0.0326217227, 0.0339269664, 0.0355533469, 0.0342082060, 0.0342945355, 0.0347869500, 0.0380828984, 0.0361433366, 0.0364639866, 0.0347377337, 0.0326604795, 0.0332591454, 0.0369563140, 0.0329387751, 0.0313650065, 0.0351122378, 0.0317310851, 0.0314914847, 0.0331265829, 0.0348040639, 0.0343961788, 0.0358909347, 0.0377670017, 0.0305946042, 0.0370231559, 0.0334705314, 0.0352219859, 0.0347510718, 0.0334910913, 0.0334033324, 0.0316911197, 0.0341270030, 0.0385217381, 0.0343437294, 0.0326188079, 0.0358924845, 0.0342906622, 0.0361774028, 0.0363128253, 0.0318025029, 0.0332700434, 0.0327067800, 0.0334515980, 0.0343818187, 0.0331607903, 0.0367837199, 0.0312902889, 0.0352869535, 0.0339717419, 0.0351043390, 0.0349642942, 0.0359755711, 0.0318263935, 0.0371666307, 0.0373679581, 0.0315581604, 0.0357593801, 0.0385093925, 0.0331352715, 0.0337386303, 0.0352891393, 0.0331482829, 0.0313087226, 0.0378945332, 0.0321543653, 0.0355125400, 0.0336158666, 0.0339658925, 0.0323649723, 0.0350011742, 0.0347484454, 0.0311552009, 0.0330995383, 0.0332641552, 0.0297853104, 0.0364979163, 0.0345580395, 0.0337469216, 0.0340756007, 0.0354882739, 0.0311330448, 0.0327217526, 0.0322130205, 0.0332809958, 0.0334503080, 0.0383962907, 0.0365999629, 0.0330064559, 0.0330501123, 0.0317342212, 0.0333600425, 0.0328894426, 0.0358668178, 0.0304149712, 0.0353914491, 0.0309126755, 0.0332917931, 0.0356741657, 0.0386533999, 0.0326661369, 0.0328555960, 0.0333144392, 0.0323987033, 0.0345375561, 0.0298294309, 0.0335302868, 0.0336672130, 0.0368138609, 0.0329777781, 0.0356996023, 0.0325896776, 0.0347997509, 0.0297617154, 0.0324814137, 0.0348209731, 0.0361088946, 0.0314085719, 0.0389199369, 0.0335385371, 0.0343301359, 0.0358933989, 0.0299579996, 0.0339303043, 0.0322240916, 0.0352296303, 0.0342577613, 0.0339352050, 0.0337831485, 0.0331002454, 0.0329010463, 0.0313188562, 0.0293864125, 0.0307635565, 0.0366658174, 0.0366190409, 0.0362131220, 0.0341349779, 0.0316942375, 0.0357645933, 0.0358380697, 0.0330497765, 0.0311162822, 0.0323616034, 0.0354733385, 0.0340511484, 0.0361978209, 0.0326394720, 0.0315290633, 0.0344155484, 0.0351217699, 0.0361619959, 0.0329640457, 0.0383631108, 0.0368262396, 0.0334921793, 0.0358960753, 0.0301869838, 0.0349510688, 0.0342826255, 0.0326108953, 0.0381538655, 0.0340351076, 0.0365177578, 0.0332623954, 0.0363191737,
                    0.0293536837, 0.0329005176, 0.0366893418, 0.0357758770, 0.0328128036, 0.0343593678, 0.0359188066, 0.0318050461, 0.0319690181, 0.0336035260, 0.0363641634, 0.0339181522, 0.0354639025, 0.0343183705, 0.0364227189, 0.0375800020, 0.0331837355, 0.0357411446, 0.0370755983, 0.0322462288, 0.0337333611, 0.0318521747, 0.0310140612, 0.0353801691, 0.0327899844, 0.0353605325, 0.0308106809, 0.0354502080, 0.0347924354, 0.0309973556, 0.0349328907, 0.0309599647, 0.0333413712, 0.0308870409, 0.0347242241, 0.0335511580, 0.0311909248, 0.0361224734, 0.0334670599, 0.0352639827, 0.0350084338, 0.0366740867, 0.0357627195, 0.0360080716, 0.0322798570, 0.0343342018, 0.0348747935, 0.0355591818, 0.0357289193, 0.0339752948, 0.0322675738, 0.0338711514, 0.0341802572, 0.0358668691, 0.0307883430, 0.0327307602, 0.0319775457, 0.0335137044, 0.0354710589, 0.0334260988, 0.0368328429, 0.0315917591, 0.0362184804, 0.0343315336, 0.0355617278, 0.0424116315, 0.0343906900, 0.0321901498, 0.0338709399, 0.0342251292, 0.0354997745, 0.0337811564, 0.0321156626, 0.0343381373, 0.0342849777, 0.0338654098, 0.0337600203, 0.0325762443, 0.0350842348, 0.0365607126, 0.0321243576, 0.0370539298, 0.0348342900, 0.0346771486, 0.0326912210, 0.0367127247, 0.0338907644, 0.0382766794, 0.0319261804, 0.0322996570, 0.0338374157, 0.0333998118, 0.0341025305, 0.0335011546, 0.0359043809, 0.0376686127, 0.0310563468, 0.0372578228, 0.0359407594, 0.0353309039, 0.0323055511, 0.0330772805, 0.0346590306, 0.0361176241, 0.0318440137, 0.0306115947, 0.0334875860, 0.0324508127, 0.0304743628, 0.0364731227, 0.0334856491, 0.0352910508, 0.0348219463, 0.0356823891, 0.0303181897, 0.0380025811, 0.0351955175, 0.0346656919, 0.0363200489, 0.0342555942, 0.0323526927, 0.0346686974, 0.0329113753, 0.0340177900, 0.0359002417, 0.0344283273, 0.0331970399, 0.0326463043, 0.0360714424, 0.0331550981, 0.0322087683, 0.0348300942, 0.0351960666, 0.0329612730, 0.0337515078, 0.0334076520, 0.0315707958, 0.0372634115, 0.0355476786, 0.0349949689, 0.0378809943, 0.0346042378, 0.0362216647, 0.0327920694, 0.0351346447, 0.0369917136, 0.0363323032, 0.0349968491, 0.0319283782, 0.0308960118, 0.0296760907, 0.0351826281, 0.0372285708, 0.0361600401, 0.0351824195, 0.0367480774, 0.0377885216, 0.0347934045, 0.0343594004, 0.0360172437, 0.0332004741, 0.0328187484, 0.0319095283, 0.0341301662, 0.0368152226, 0.0325636887, 0.0278098444, 0.0338527584, 0.0357619561, 0.0344976289, 0.0308734936, 0.0335201837, 0.0345951360, 0.0338154139, 0.0384176165, 0.0339703122, 0.0321008854, 0.0304343495, 0.0383744231, 0.0326511530, 0.0357007692, 0.0364832862, 0.0336478745, 0.0354983104, 0.0349903528, 0.0323750578, 0.0362311983, 0.0317867627, 0.0348228931, 0.0347552913, 0.0354843736, 0.0366361339, 0.0326680627, 0.0325121978, 0.0373359480, 0.0332577694, 0.0359011959, 0.0326710008, 0.0374441123, 0.0294243636, 0.0337145872, 0.0380173731, 0.0366694190, 0.0328193935, 0.0379898684, 0.0322195023, 0.0337454946, 0.0345276309, 0.0364909653, 0.0334296165, 0.0358988742, 0.0331649512, 0.0331349341, 0.0355790826, 0.0355390276, 0.0340805740, 0.0325635992, 0.0345979215, 0.0348568556, 0.0353007498, 0.0358776752, 0.0365003484, 0.0361202812, 0.0321241206, 0.0391502926, 0.0309165817, 0.0379365085, 0.0340129424, 0.0325177785, 0.0332456390, 0.0333622897, 0.0346441767, 0.0351135120, 0.0344107385, 0.0363620369, 0.0319351166, 0.0312223492, 0.0360603563, 0.0381125251, 0.0332026160, 0.0352838661, 0.0346451541, 0.0303747736, 0.0335054672, 0.0314421632, 0.0329926348, 0.0368155443, 0.0340350988, 0.0346156710, 0.0359462684)
# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for (i_rep in seq_len(n_rep)){
for (i_rep in seq_len(1)) {
    df = data[[i_rep]]
    obj_dml_data = double_ml_data_from_data_frame(df, y_col = "y", d_cols = "d")
    obj_dml_plr_orth_nosplit = DoubleMLPLR$new(obj_dml_data,
                                        ml_l, ml_m, ml_g,
                                        n_folds=1,
                                        score='IV-type',
                                        apply_cross_fitting=FALSE)
    obj_dml_plr_orth_nosplit$fit()
    this_theta = obj_dml_plr_orth_nosplit$coef
    this_se = obj_dml_plr_orth_nosplit$se
    print(abs(theta_orth_nosplit[i_rep] - this_theta))
    print(abs(se_orth_nosplit[i_rep] - this_se))
    theta_orth_nosplit[i_rep] = this_theta
    se_orth_nosplit[i_rep] = this_se
}

g_nosplit = ggplot(data.frame(theta_rescaled=(theta_orth_nosplit - alpha)/se_orth_nosplit), aes(x = theta_rescaled)) +
                geom_histogram(aes(y=after_stat(density), x=theta_rescaled, colour = "Double ML (no sample splitting)", fill="Double ML (no sample splitting)"),
                            bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Double ML (no sample splitting)", "N(0, 1)"),
                    values=c("Double ML (no sample splitting)"="dark orange", "N(0, 1)"='black')) +
                scale_fill_manual(name='',
                    breaks=c("Double ML (no sample splitting)", "N(0, 1)"),
                    values=c("Double ML (no sample splitting)"="dark orange", "N(0, 1)"=NA)) +
                xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_nosplit
           d 
2.223562e-10 
          d 
4.12991e-11 
../_images/basics_3_1.png

If the nuisance models \(\hat{g}_0()\) and \(\hat{m}()\) are estimated on the whole dataset, which is also used for obtaining the final estimate \(\check{\theta}_0\), another bias is observed.

1.4. Sample splitting to remove bias induced by overfitting#

Using sample splitting, i.e., estimate the nuisance models \(\hat{g}_0()\) and \(\hat{m}()\) on one part of the data (training data) and estimate \(\check{\theta}_0\) on the other part of the data (test data), overcomes the bias induced by overfitting. We can exploit the benefits of cross-fitting by switching the role of the training and test sample. Cross-fitting performs well empirically because the entire sample can be used for estimation.

In [51]: import numpy as np

In [52]: np.random.seed(3333)

# to speed up the illustration we hard-code the simulation results
In [53]: theta_dml = np.array([0.53136293, 0.52272831, 0.49954636, 0.48334576, 0.52869052, 0.50960096, 0.53103551, 0.45362412, 0.51957113, 0.61069451, 0.51955025, 0.52937277, 0.57872562, 0.38798612, 0.46269652, 0.50968841, 0.54554518, 0.47220716, 0.52347167, 0.4977856 , 0.4810843 , 0.4878693 , 0.46698642, 0.48443493, 0.46534302, 0.45298452, 0.52018123, 0.48756693, 0.48174886, 0.50335839, 0.52151406, 0.58889816, 0.39964656, 0.39930344, 0.49470468, 0.45137001, 0.46303227, 0.55073348, 0.48722535, 0.53190714, 0.4400922 , 0.4616436 , 0.48494513, 0.40860847, 0.53792101, 0.51689913, 0.52059786, 0.52139367, 0.5408944 , 0.52875149, 0.47727554, 0.46864492, 0.53029963, 0.54005011, 0.54397691, 0.43625533, 0.55041521, 0.53843621, 0.45583064, 0.48333893, 0.49964207, 0.53990306, 0.56825612, 0.51368379, 0.55904805, 0.44723682, 0.45519343, 0.51047696, 0.59761023, 0.55036315, 0.4866524 , 0.48804607, 0.49237478, 0.4962529 , 0.5077831 , 0.57796123, 0.52018872, 0.50510419, 0.50104404, 0.52428141, 0.50728626, 0.48344444, 0.5141088 , 0.50738986, 0.43945456, 0.51760056, 0.55749679, 0.50915542, 0.46754079, 0.53593284, 0.41350172, 0.45835974, 0.56138434, 0.51870932, 0.52875457, 0.4874456 , 0.50557897, 0.51744226, 0.56002103, 0.53739233, 0.48502689, 0.54489851, 0.44516489, 0.53242594, 0.44808442, 0.61292999, 0.50723535, 0.50036306, 0.42097857, 0.50636392, 0.4316992 , 0.51075124, 0.45559127, 0.43386408, 0.47768967, 0.4443101 , 0.50053364, 0.48279399, 0.47966487, 0.49183904, 0.45375581, 0.58152412, 0.52056005, 0.4944706 , 0.41394685, 0.55891371, 0.45624999, 0.48770709, 0.49510956, 0.45966771, 0.53445906, 0.48592879, 0.47174132, 0.49600819, 0.45099157, 0.5213728 , 0.52984893, 0.54123979, 0.42396682, 0.43733171, 0.49048566, 0.45995511, 0.56677635, 0.51760897, 0.58186166, 0.43185859, 0.41208982, 0.56619156, 0.436994  , 0.52275822, 0.53982074, 0.51239518, 0.48191852, 0.47681983, 0.53004811, 0.63301374, 0.45414726, 0.50639682, 0.44919845, 0.59455466, 0.50610284, 0.45209639, 0.54129382, 0.53827613, 0.5463622 , 0.46923036, 0.56824179, 0.50299939, 0.55194225, 0.5202513 , 0.49927143, 0.49647582, 0.49307445, 0.44855007, 0.48564176, 0.53120614, 0.52780768, 0.59618638, 0.50788421, 0.48484397, 0.4735896 , 0.55641477, 0.49123131, 0.45702819, 0.40759442, 0.50326529, 0.38615708, 0.48304318, 0.5572498 , 0.52226062, 0.48415644, 0.49909294, 0.46534393, 0.41914833, 0.5041645 , 0.53792139, 0.46867822, 0.57588454, 0.45926144, 0.46670446, 0.5029714 , 0.58832425, 0.49860647, 0.51478656, 0.48416584, 0.46848499, 0.51144127, 0.48090559, 0.55818848, 0.54492593, 0.45488626, 0.61029026, 0.44918048, 0.43848122, 0.43151488, 0.54406625, 0.48015404, 0.56150037, 0.54449333, 0.5056398 , 0.54556854, 0.48725672, 0.51484744, 0.5355666 , 0.5220055 , 0.53646095, 0.48808221, 0.53077698, 0.59040192, 0.49943543, 0.5410012 , 0.56538167, 0.65180024, 0.48622944, 0.53176816, 0.61092756, 0.52541687, 0.47786008, 0.58806778, 0.54430649, 0.48797871, 0.58191711, 0.50011255, 0.55384654, 0.47269601, 0.46901973, 0.52839749, 0.49577639, 0.43846973, 0.45726162, 0.44095152, 0.52613674, 0.517144  , 0.55747665, 0.52412769, 0.42320198, 0.49221666, 0.51332249, 0.6102125 , 0.47287016, 0.48641625, 0.44462589, 0.54614317, 0.46774837, 0.47569551, 0.53311202, 0.49764894, 0.53625808, 0.54379954, 0.4710383 , 0.42705854, 0.4602913 , 0.42062529, 0.56448918, 0.57327728, 0.55341806, 0.5221236 , 0.48277209, 0.53950506, 0.51243729, 0.52756561, 0.48170962, 0.59553086, 0.47744399, 0.53232556, 0.55442321, 0.57620493, 0.5055298 , 0.574668  , 0.43901612, 0.50379399, 0.53949653, 0.52254757, 0.47339489, 0.49258173, 0.5183886 , 0.64137403, 0.4537604 , 0.54647638, 0.41302615, 0.54680774, 0.56025252, 0.52192699, 0.52571136, 0.47495594, 0.53848808, 0.5438765 , 0.44636054, 0.57098026, 0.53867527, 0.49614499, 0.44195915, 0.50894715, 0.57024528, 0.45768364, 0.48115412, 0.32967638, 0.52638924, 0.51212732, 0.54093912, 0.61031993, 0.44329509, 0.54984334, 0.56934913, 0.53850485, 0.48548764, 0.48619359, 0.4879198 , 0.48089325, 0.48093318, 0.49012512, 0.58464257, 0.51770681, 0.45842364, 0.50154922, 0.4633238 , 0.60477447, 0.3840878 , 0.55262339, 0.46379557, 0.50155153, 0.43089435, 0.50358359, 0.45836877, 0.45155272, 0.55496056, 0.5145327 , 0.55495792, 0.48836971, 0.43117485, 0.52500554, 0.48005583, 0.55926532, 0.48117512, 0.58564901, 0.57534914, 0.5566144 , 0.45938352, 0.45330172, 0.45472652, 0.51522657, 0.48634136, 0.55942669, 0.51910296, 0.56037535, 0.5562515 , 0.53264942, 0.54919816, 0.53420782, 0.49410759, 0.44943343, 0.49828523, 0.48610302, 0.48141947, 0.45363185, 0.49028851, 0.54073859, 0.47251981, 0.46071425, 0.42744937, 0.54373207, 0.49520946, 0.5513407 , 0.48579394, 0.52918428, 0.52081621, 0.50674517, 0.52533792, 0.4287179 , 0.47300219, 0.51597441, 0.52424363, 0.56801114, 0.51765264, 0.43426476, 0.38982034, 0.49132784, 0.48535703, 0.50389229, 0.50923137, 0.49587617, 0.46628965, 0.47645684, 0.5568767 , 0.46326808, 0.48160501, 0.47352731, 0.50182387, 0.53394634, 0.47127585, 0.4531616 , 0.42814489, 0.42563885, 0.41669073, 0.46000945, 0.49680789, 0.55531998, 0.47099631, 0.42235261, 0.50826971, 0.48266141, 0.48068487, 0.47415839, 0.50339469, 0.56426391, 0.50714938, 0.54175227, 0.46615236, 0.49714452, 0.58707064, 0.5836838 , 0.46398478, 0.53507902, 0.47070714, 0.46065883, 0.49412765, 0.52365932, 0.54021214, 0.53362809, 0.45948609, 0.58916472, 0.53973573, 0.53793666, 0.5215106 , 0.50351403, 0.44731051, 0.51264616, 0.54907843, 0.46733528, 0.52374948, 0.48320222, 0.44755671, 0.52588939, 0.49270753, 0.46645489, 0.52431866, 0.54457481, 0.46103621, 0.43384568, 0.51977889, 0.52428337, 0.45370544, 0.49159615, 0.39145847, 0.47093342, 0.46258887, 0.5302714 , 0.53538872, 0.43440156, 0.53291484, 0.4806193 , 0.46224348, 0.55178615, 0.44827114, 0.50469842, 0.52082239, 0.47379301, 0.47879537, 0.47875975, 0.50922767, 0.54470212, 0.47602979, 0.55249429, 0.49562578, 0.48704513, 0.42116293, 0.52129429, 0.55841889, 0.54157331, 0.56488022, 0.51442595, 0.46919796, 0.43750352, 0.50256996, 0.45722328, 0.57957189, 0.58044095, 0.47605385, 0.39757726, 0.5204202 , 0.48244   , 0.53463332, 0.50912164, 0.47047587, 0.53972193, 0.45047608, 0.40202742, 0.55285721, 0.57729907, 0.55842033, 0.4962056 , 0.45028994, 0.51468329, 0.57998638, 0.57139213, 0.5131156 , 0.47646389, 0.54095014, 0.46397522, 0.4485555 , 0.48532192, 0.44235448, 0.51347433, 0.45575175, 0.46130362, 0.54816065, 0.5522224 , 0.55504234, 0.51953446, 0.45645616, 0.59391189, 0.50501443, 0.53681853, 0.49650863, 0.49616803, 0.46026864, 0.60486169, 0.56991945, 0.48858188, 0.47884647, 0.53930786, 0.48704381, 0.50201714, 0.47889923, 0.49059772, 0.45167014, 0.51259908, 0.50756958, 0.50177218, 0.52255236, 0.50581654, 0.51760235, 0.59012884, 0.59985609, 0.48404319, 0.54707528, 0.53690096, 0.5129813 , 0.49097044, 0.44393174, 0.41610736, 0.56533807, 0.46507743, 0.5170366 , 0.47671569, 0.52740176, 0.54509643, 0.49359077, 0.57002499, 0.55915348, 0.42686252, 0.49451919, 0.44249956, 0.49482616, 0.5534894 , 0.53262351, 0.49415316, 0.46428469, 0.45910802, 0.60898016, 0.46789951, 0.60217096, 0.55632073, 0.49215808, 0.51967744, 0.42659154, 0.40320059, 0.45542357, 0.50566995, 0.43413893, 0.47236048, 0.4730468 , 0.46542312, 0.58036831, 0.47178704, 0.48796475, 0.55344806, 0.48679801, 0.52385712, 0.52714831, 0.50505238, 0.55820019, 0.53234846, 0.48099387, 0.50714475, 0.55254672, 0.49714287, 0.50279854, 0.49271632, 0.51905668, 0.50704024, 0.51989623, 0.49840608, 0.44489991, 0.49132964, 0.46017365, 0.52238502, 0.58116519, 0.48581235, 0.56232817, 0.56636795, 0.53952668, 0.50779277, 0.54246253, 0.43242725, 0.51135409, 0.42284434, 0.51788145, 0.51975574, 0.54239929, 0.50968128, 0.65253281, 0.50373615, 0.48614475, 0.49863181, 0.61503884, 0.44949508, 0.55972135, 0.49525966, 0.49261208, 0.44111368, 0.63441355, 0.48637754, 0.55398729, 0.56778945, 0.45902377, 0.57463649, 0.46121876, 0.54155362, 0.44478171, 0.52435051, 0.57087088, 0.39245217, 0.46396707, 0.50510056, 0.5069028 , 0.48665451, 0.57847942, 0.42323615, 0.54759841, 0.51696255, 0.55060358, 0.54442527, 0.47507197, 0.48206163, 0.56839492, 0.52930626, 0.48166739, 0.43443332, 0.47844387, 0.54589331, 0.48463549, 0.55026587, 0.46140555, 0.53735227, 0.45285953, 0.47713501, 0.45401454, 0.35975943, 0.51008005, 0.55417445, 0.49993366, 0.48587355, 0.55409922, 0.51759863, 0.6103252 , 0.47978687, 0.54027196, 0.53353782, 0.48636421, 0.49506053, 0.52526545, 0.58294162, 0.45855799, 0.52657642, 0.51304469, 0.52025121, 0.53871685, 0.45504542, 0.46904091, 0.49470649, 0.55199598, 0.46424461, 0.50388651, 0.46500381, 0.48168773, 0.52653742, 0.48911706, 0.48392117, 0.49352537, 0.45431985, 0.56327712, 0.52790318, 0.48400641, 0.49237972, 0.53373982, 0.39831133, 0.5649761 , 0.54902235, 0.44074566, 0.42049476, 0.51954156, 0.52258857, 0.54230792, 0.50280809, 0.4339837 , 0.4644633 , 0.50787032, 0.52874887, 0.59047196, 0.51215975, 0.52840121, 0.51081136, 0.56514492, 0.54241922, 0.53519724, 0.52820358, 0.55715823, 0.58547163, 0.49777178, 0.52623281, 0.5017119 , 0.64372458, 0.52223454, 0.51593815, 0.44428961, 0.56491759, 0.50354986, 0.46730887, 0.47892029, 0.47908061, 0.57468579, 0.50815634, 0.50228529, 0.52348798, 0.61573092, 0.39695719, 0.55025551, 0.54751588, 0.46280727, 0.47667546, 0.53997524, 0.52529117, 0.53178652, 0.51157481, 0.51605013, 0.47286783, 0.52629508, 0.5846704 , 0.49872661, 0.45332425, 0.52898154, 0.4699794 , 0.46390095, 0.47759878, 0.37733012, 0.5115532 , 0.50444157, 0.51921322, 0.53001455, 0.50901359, 0.48552478, 0.43383384, 0.44819809, 0.55747646, 0.47719987, 0.52906354, 0.53946325, 0.49667595, 0.53863836, 0.60556717, 0.50571002, 0.4651874 , 0.56184654, 0.48148176, 0.60553531, 0.44449289, 0.50566925, 0.55150338, 0.5001125 , 0.44491697, 0.45301713, 0.49467688, 0.48813413, 0.49126065, 0.49358158, 0.51385847, 0.47953825, 0.5431249 , 0.45075482, 0.59074403, 0.56949778, 0.49203902, 0.52315143, 0.57593538, 0.48795262, 0.48162209, 0.52078148, 0.4909698 , 0.45673381, 0.53827103, 0.48172874, 0.58061229, 0.47593299, 0.54073734, 0.54522708, 0.46184543, 0.4959692 , 0.4294827 , 0.44999313, 0.44973668, 0.51974583, 0.51672712, 0.53010395, 0.5228019 , 0.59312345, 0.48991575, 0.50370248, 0.48362954, 0.40305167, 0.46827572, 0.53782401, 0.54927567, 0.55919428, 0.58823779, 0.49755018, 0.52863269, 0.5288442 , 0.48776318, 0.46883583, 0.36395434, 0.59900297, 0.47637107, 0.51653852, 0.460052  , 0.59300112, 0.43400939, 0.56324665, 0.4900747 , 0.5231264 , 0.55965705, 0.53133956, 0.54956469, 0.41375333, 0.48080361, 0.60415333, 0.48909132, 0.50683815, 0.52202015, 0.53511728, 0.48063877, 0.53188573, 0.51275626, 0.49709038, 0.45734633, 0.48069221, 0.45463481, 0.55533079, 0.50718593, 0.57828931, 0.53999175, 0.54793958, 0.52846782, 0.49284515, 0.57232448, 0.42503111, 0.57343691, 0.51694705, 0.46771321, 0.43041661, 0.59017731, 0.49683349, 0.51239223, 0.50168615, 0.4435032 , 0.56883681, 0.50566309, 0.4768778 , 0.52026538, 0.56956521, 0.41806343, 0.49501286, 0.47926238, 0.46166467, 0.49539291, 0.43903866, 0.54666996, 0.36408008, 0.51138189, 0.56013817, 0.47949159, 0.51620916, 0.46406434, 0.4321351 , 0.59831181, 0.50361498, 0.53678082, 0.47096002, 0.43574422, 0.56583098, 0.59492964, 0.50920948, 0.51323477, 0.44414516, 0.57889363, 0.49414783, 0.48518923, 0.54112235, 0.44818199, 0.55585544, 0.50517962, 0.42871447, 0.52354361, 0.55310075, 0.5062023 , 0.54722905, 0.52960227, 0.50620311, 0.47954884, 0.49630517, 0.47788121, 0.58900933, 0.53264215, 0.47771333, 0.51253034, 0.45793071, 0.49573853, 0.44799847, 0.53553779, 0.51327999, 0.61805459, 0.51404724, 0.48044965, 0.5548255 , 0.42701429, 0.46496555, 0.52774306, 0.48027187, 0.49042958, 0.47982127, 0.55689975, 0.46786333, 0.49741252, 0.4305642 , 0.53657994, 0.55687243, 0.50280181, 0.50661455, 0.54592754, 0.46576354, 0.54996808, 0.48235281, 0.43544111, 0.4979282 , 0.40185842, 0.47833626, 0.52129907, 0.46030088, 0.44938231, 0.50064939, 0.46586232, 0.55550797, 0.49609405, 0.49965942, 0.47790909, 0.45629575, 0.60067607, 0.55270055, 0.52972619, 0.52151004, 0.47740249, 0.51620499, 0.40906359, 0.58986775, 0.55217603, 0.49252861, 0.53500691, 0.52813659, 0.48438568, 0.51182359])

In [54]: se_dml = np.array([0.04451577, 0.04490176, 0.04013621, 0.04605524, 0.04977187, 0.04212784, 0.05068112, 0.05198796, 0.05196444, 0.04506378, 0.04616982, 0.04480436, 0.03900256, 0.0408141 , 0.04463835, 0.04262014, 0.05274251, 0.04588425, 0.0406925 , 0.04619202, 0.0443178 , 0.05331612, 0.04373689, 0.04470977, 0.04717082, 0.03746608, 0.04401159, 0.04484962, 0.04559701, 0.04350091, 0.03976468, 0.0404016 , 0.04144786, 0.04561865, 0.0477659 , 0.04166419, 0.04830947, 0.04266617, 0.04119545, 0.04471898, 0.04575399, 0.04373017, 0.04500419, 0.0438294 , 0.04052023, 0.04356239, 0.04462905, 0.04127356, 0.04148683, 0.04766906, 0.04087846, 0.03775995, 0.04123315, 0.04630391, 0.04460172, 0.05037454, 0.04571886, 0.04152775, 0.0427847 , 0.04150442, 0.04431639, 0.04820055, 0.04518448, 0.04374162, 0.0444376 , 0.04319458, 0.04870047, 0.03979945, 0.04596467, 0.04931064, 0.03986882, 0.03962937, 0.04125952, 0.04870504, 0.04270478, 0.04403063, 0.04529282, 0.04620437, 0.04520664, 0.04757334, 0.04328208, 0.04642612, 0.04225026, 0.04083541, 0.0420464 , 0.04743644, 0.04094565, 0.04811671, 0.04929223, 0.04734472, 0.04486223, 0.04522005, 0.03971825, 0.0494492 , 0.04246032, 0.04445648, 0.04564281, 0.04151786, 0.04590433, 0.0429455 , 0.0458209 , 0.04451129, 0.04592348, 0.04650847, 0.04314546, 0.04175605, 0.04911152, 0.0449944 , 0.04460767, 0.04476069, 0.04956918, 0.04341115, 0.04423823, 0.0454818 , 0.05354475, 0.04697678, 0.04636224, 0.04538301, 0.04269111, 0.04881574, 0.04682834, 0.05010542, 0.04094056, 0.04192807, 0.04817982, 0.04648762, 0.04513767, 0.04538384, 0.0431342 , 0.04366012, 0.04717716, 0.05104802, 0.05037837, 0.03937307, 0.04616315, 0.04925793, 0.04352705, 0.04513465, 0.04400273, 0.04393063, 0.04720379, 0.04673644, 0.04176819, 0.04758137, 0.04702437, 0.04555107, 0.04090498, 0.04103245, 0.04237081, 0.04192252, 0.04409652, 0.04748513, 0.04606071, 0.0466778 , 0.04083337, 0.04075193, 0.04389173, 0.04114668, 0.04487498, 0.04585767, 0.04381332, 0.04707023, 0.04608198, 0.04299302, 0.04885294, 0.04625258, 0.04341669, 0.04364555, 0.04496738, 0.04771595, 0.04221626, 0.04669934, 0.04655068, 0.04293044, 0.04142471, 0.0430474 , 0.04142686, 0.04910276, 0.05069312, 0.04412301, 0.03741907, 0.04366074, 0.04271793, 0.04822319, 0.04955733, 0.04480288, 0.03854231, 0.05258446, 0.04632841, 0.04218598, 0.04873542, 0.04684362, 0.04173435, 0.04979273, 0.04954611, 0.04809578, 0.04894047, 0.04714015, 0.04727152, 0.0405341 , 0.04869596, 0.04211921, 0.0472672 , 0.03973715, 0.04285718, 0.0441104 , 0.04695732, 0.04738585, 0.04666111, 0.05082641, 0.04619593, 0.04727027, 0.05069427, 0.0456792 , 0.04395541, 0.04032792, 0.04956266, 0.04489709, 0.04551175, 0.04170445, 0.039224  , 0.04439168, 0.05087589, 0.04068655, 0.04844672, 0.04605304, 0.04629987, 0.04351723, 0.04140273, 0.04298938, 0.04106323, 0.04317099, 0.04732946, 0.03829337, 0.04569024, 0.04079556, 0.04742151, 0.04236698, 0.04340556, 0.04842246, 0.04903173, 0.04463866, 0.04369826, 0.04606098, 0.04681235, 0.04796005, 0.04444611, 0.05009542, 0.04329401, 0.0476929 , 0.04254179, 0.04640316, 0.04698205, 0.04594029, 0.04440063, 0.04371973, 0.04043747, 0.04419555, 0.04642175, 0.04144921, 0.04500867, 0.04081082, 0.04333657, 0.04190279, 0.04592907, 0.04117577, 0.04978934, 0.04488768, 0.04813121, 0.04600955, 0.04739863, 0.0458207 , 0.04700503, 0.04251042, 0.04407827, 0.04381095, 0.04798204, 0.04381264, 0.0468246 , 0.04432791, 0.04262607, 0.04803382, 0.04367965, 0.04473193, 0.05151782, 0.0431806 , 0.04946927, 0.04764608, 0.04325926, 0.0458524 , 0.03946785, 0.04038225, 0.04750486, 0.03900081, 0.04092891, 0.0480587 , 0.04586711, 0.04201325, 0.04718183, 0.04768575, 0.04396952, 0.04126091, 0.04288731, 0.04131418, 0.04292477, 0.04131691, 0.04881642, 0.04769117, 0.04634296, 0.04856059, 0.05022532, 0.04751964, 0.04985441, 0.04781258, 0.04623542, 0.04786554, 0.04871963, 0.04515905, 0.0444008 , 0.05050105, 0.04165176, 0.04565505, 0.04683316, 0.04405835, 0.04556649, 0.04277391, 0.04445551, 0.04347322, 0.04471067, 0.04621331, 0.04364481, 0.04606537, 0.04067207, 0.04011425, 0.04845894, 0.04581275, 0.04729834, 0.04866388, 0.0434395 , 0.03920529, 0.041447  , 0.0425844 , 0.0455108 , 0.04510086, 0.04611818, 0.04471245, 0.04859071, 0.04859655, 0.03961201, 0.04108481, 0.04350163, 0.04066479, 0.04299716, 0.0409928 , 0.04570243, 0.04068177, 0.0424811 , 0.04828524, 0.04412345, 0.03944542, 0.04338805, 0.04922771, 0.04946275, 0.0447216 , 0.04872858, 0.04079523, 0.04283997, 0.04124148, 0.04565558, 0.04281041, 0.04773227, 0.04550097, 0.04508202, 0.04749466, 0.03991025, 0.04691873, 0.04008758, 0.03827076, 0.04817591, 0.04113973, 0.04271469, 0.04142675, 0.04383673, 0.04241571, 0.0444138 , 0.0448699 , 0.0445637 , 0.04551745, 0.04266308, 0.04128645, 0.05029066, 0.04258456, 0.04092529, 0.04228388, 0.04809675, 0.04779026, 0.04547699, 0.04681882, 0.04515109, 0.04455849, 0.04062707, 0.04394847, 0.0540176 , 0.04906232, 0.04280255, 0.04570146, 0.0404382 , 0.04646957, 0.0494561 , 0.04502105, 0.04290089, 0.04731206, 0.04166547, 0.04091599, 0.04691376, 0.05123364, 0.04381634, 0.0444253 , 0.04774744, 0.04107327, 0.04970158, 0.04363839, 0.04146108, 0.0400315 , 0.04564745, 0.04812489, 0.04502683, 0.04618436, 0.04718696, 0.04238817, 0.04991695, 0.04687108, 0.04568382, 0.05013433, 0.05055857, 0.04523953, 0.04260869, 0.04038252, 0.03702686, 0.04697013, 0.04766749, 0.04014567, 0.04355803, 0.04262662, 0.04035628, 0.04161503, 0.04735591, 0.0419495 , 0.04501374, 0.04442854, 0.04369903, 0.04695287, 0.04540954, 0.04597675, 0.04189571, 0.04684482, 0.04469593, 0.04726894, 0.04466175, 0.04596659, 0.04904686, 0.04339822, 0.04567987, 0.04510266, 0.04440095, 0.04442157, 0.04872819, 0.04540775, 0.04153831, 0.04634731, 0.04988497, 0.05146532, 0.04338413, 0.04044059, 0.04872481, 0.0423472 , 0.04788741, 0.04758564, 0.04553868, 0.0495484 , 0.04609652, 0.04553537, 0.04613947, 0.04627545, 0.04510762, 0.04362909, 0.05090735, 0.04690261, 0.04309459, 0.04375869, 0.04321443, 0.04611827, 0.04708216, 0.05039695, 0.04783286, 0.04478104, 0.04727804, 0.04231607, 0.04161096, 0.04446286, 0.04402919, 0.04460511, 0.0413567 , 0.04510582, 0.04006267, 0.04453602, 0.04417668, 0.04033842, 0.04450278, 0.04465175, 0.04769427, 0.0443506 , 0.04098464, 0.04510074, 0.04695567, 0.04279144, 0.04598814, 0.04353124, 0.04606945, 0.04433485, 0.04485745, 0.04296954, 0.04964465, 0.04690607, 0.04838417, 0.04720311, 0.0464799 , 0.04139271, 0.04371307, 0.04277626, 0.05042578, 0.0463995 , 0.04486922, 0.04572229, 0.04506653, 0.03891538, 0.04640719, 0.04188499, 0.0512673 , 0.04436281, 0.04058269, 0.04509973, 0.04520745, 0.04511468, 0.04361522, 0.04003884, 0.04579448, 0.04956273, 0.04314602, 0.04821385, 0.04319144, 0.04799197, 0.04788702, 0.04104649, 0.0374441 , 0.04357559, 0.04716883, 0.04013432, 0.0482949 , 0.04696951, 0.04355121, 0.04541856, 0.04508064, 0.04584068, 0.04093339, 0.0443579 , 0.04337625, 0.04700408, 0.04378976, 0.03908194, 0.04061357, 0.03785945, 0.05134845, 0.04326495, 0.04580763, 0.0432741 , 0.03901876, 0.04663364, 0.04619656, 0.04407017, 0.05297828, 0.04412658, 0.04390205, 0.04169626, 0.05047105, 0.0428717 , 0.04460648, 0.04339771, 0.04348521, 0.04056755, 0.04543886, 0.04911588, 0.05009616, 0.04541441, 0.04439132, 0.04260284, 0.0491047 , 0.04982572, 0.04974341, 0.04517618, 0.04280691, 0.04813894, 0.04497489, 0.04452172, 0.04441396, 0.04326458, 0.03926745, 0.04521706, 0.04309774, 0.04295556, 0.04249547, 0.03923885, 0.04729502, 0.04430447, 0.04759113, 0.05264991, 0.04923853, 0.04658972, 0.04564823, 0.0463732 , 0.04504823, 0.04608112, 0.04510274, 0.04070388, 0.04523186, 0.04283385, 0.04240228, 0.04183081, 0.04182954, 0.0461404 , 0.04899793, 0.04262142, 0.04358443, 0.04386389, 0.04425116, 0.04815725, 0.04524432, 0.04668408, 0.04142753, 0.04405384, 0.04488571, 0.04732727, 0.0427516 , 0.04166611, 0.04098165, 0.04059517, 0.04621188, 0.04878163, 0.03982029, 0.04702698, 0.04009018, 0.04044453, 0.04817704, 0.045409  , 0.04112917, 0.03883971, 0.04327644, 0.04579022, 0.04034365, 0.04854353, 0.04070647, 0.04286558, 0.05156507, 0.0463016 , 0.04050037, 0.04267794, 0.04203434, 0.04334474, 0.049374  , 0.0476435 , 0.04481233, 0.0399334 , 0.04068469, 0.04258163, 0.03980833, 0.04205589, 0.04616518, 0.04174171, 0.05102498, 0.04772019, 0.04038319, 0.04834888, 0.04541133, 0.04542193, 0.0444672 , 0.04600997, 0.0472814 , 0.04552797, 0.04271417, 0.04199389, 0.04742649, 0.04821626, 0.04620429, 0.03949069, 0.04417927, 0.04300667, 0.04681882, 0.04731583, 0.04465423, 0.04521578, 0.04240016, 0.03912794, 0.04470876, 0.0445801 , 0.04300908, 0.05041768, 0.0394401 , 0.03940126, 0.04568624, 0.04859571, 0.05189341, 0.04170926, 0.04438121, 0.04457078, 0.04517643, 0.04370614, 0.04958972, 0.03840254, 0.04512002, 0.04392756, 0.04209291, 0.0404631 , 0.04973605, 0.04544987, 0.04430782, 0.04150844, 0.04293343, 0.03735777, 0.04090707, 0.04377457, 0.04167597, 0.04646467, 0.04530597, 0.04724711, 0.04549568, 0.04503617, 0.04175847, 0.04705591, 0.04651767, 0.04638402, 0.04362851, 0.04381222, 0.04696647, 0.04563065, 0.04006881, 0.04642041, 0.04673795, 0.04505947, 0.04894623, 0.04850348, 0.04274634, 0.04661226, 0.04584635, 0.04418679, 0.0488062 , 0.04684457, 0.04166846, 0.04580169, 0.04385596, 0.04443812, 0.042286  , 0.04960309, 0.04097018, 0.04379288, 0.04165084, 0.04515601, 0.04370915, 0.04254403, 0.03945375, 0.04632602, 0.04639047, 0.04663681, 0.04179178, 0.04725791, 0.04757171, 0.04843659, 0.04273204, 0.04256972, 0.05294427, 0.05185989, 0.04727349, 0.05511793, 0.04127009, 0.05043235, 0.04191125, 0.04420794, 0.04700199, 0.04715707, 0.03940633, 0.04295491, 0.04048252, 0.04686483, 0.04432732, 0.05075038, 0.04767598, 0.04395612, 0.04282439, 0.04487319, 0.04284997, 0.04689691, 0.04344958, 0.04622157, 0.04383957, 0.04808749, 0.04143248, 0.04020974, 0.041259  , 0.04111953, 0.04542849, 0.04617783, 0.04547408, 0.05126034, 0.0449876 , 0.04431241, 0.04331047, 0.04359685, 0.04466332, 0.04352393, 0.05053184, 0.0420588 , 0.04557359, 0.04991296, 0.04589503, 0.04366415, 0.04336119, 0.05020386, 0.04424407, 0.04738682, 0.0428142 , 0.04654414, 0.04670968, 0.04839783, 0.04567707, 0.04619739, 0.04063572, 0.04939731, 0.03943886, 0.04608255, 0.04359433, 0.04050661, 0.04111041, 0.05775102, 0.04982569, 0.04418107, 0.04213239, 0.04606388, 0.04622949, 0.04454934, 0.04437447, 0.04153468, 0.04723632, 0.04337555, 0.04531656, 0.04531844, 0.04965025, 0.03908481, 0.04886395, 0.04144512, 0.05106899, 0.0435134 , 0.04010173, 0.04324871, 0.04741957, 0.04429757, 0.04478984, 0.04471098, 0.05048376, 0.0455334 , 0.04490975, 0.0461487 , 0.04498832, 0.05002286, 0.04224944, 0.03989775, 0.04229135, 0.05001072, 0.0444921 , 0.04369312, 0.049683  , 0.04144563, 0.04192496, 0.04427042, 0.04268237, 0.04406869, 0.04276288, 0.04455397, 0.0400342 , 0.04535496, 0.04483139, 0.04496589, 0.04388483, 0.04325281, 0.04742232, 0.04147194, 0.03935482, 0.0449111 , 0.04847137, 0.04637344, 0.0476185 , 0.04605648, 0.04594097, 0.04594877, 0.04271411, 0.04803218, 0.04732811, 0.04761602, 0.0447552 , 0.04163056, 0.04239556, 0.04513909, 0.04752108, 0.04820901, 0.04538986, 0.04130778, 0.04395333, 0.04485472, 0.04424779, 0.04422037, 0.04472496, 0.04255319, 0.04775233, 0.04389739, 0.03939557, 0.04467024, 0.03869845, 0.04545562, 0.04902888, 0.04442053, 0.04398383, 0.04517772, 0.0440139 , 0.04175955, 0.04460751, 0.04662963, 0.05069564, 0.04281444, 0.04561765, 0.0429581 , 0.04310135, 0.03930565, 0.04523182, 0.0416166 , 0.03961216, 0.04025454, 0.04639793, 0.04287705, 0.04865216, 0.04496899, 0.04240827, 0.04512669, 0.04363657, 0.04442822, 0.04522617, 0.04841711, 0.049549  , 0.04556039, 0.04758399, 0.04074275, 0.04459929, 0.04159275, 0.04585022, 0.04388692, 0.04480129, 0.04471656, 0.04502996, 0.04695812, 0.04245843, 0.04893408, 0.04471161, 0.04508629, 0.04459937, 0.04035969, 0.04275175, 0.04880425, 0.04554817, 0.04345368, 0.04076855, 0.04290657, 0.04557181, 0.04811059, 0.04359669, 0.04545599, 0.04268864, 0.04507617, 0.04556212, 0.04969935, 0.0472998 , 0.04697147, 0.04470329, 0.04410011, 0.0448672 , 0.04116184, 0.0454671 , 0.04731715, 0.04707245, 0.04644871, 0.04360283, 0.04479812, 0.04705519, 0.0437019])

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for i_rep in range(n_rep):
In [55]: for i_rep in range(1):
   ....:     (x, y, d) = data[i_rep]
   ....:     obj_dml_data = DoubleMLData.from_arrays(x, y, d)
   ....:     obj_dml_plr = DoubleMLPLR(obj_dml_data,
   ....:                             ml_l, ml_m, ml_g,
   ....:                             n_folds=2,
   ....:                             score='IV-type')
   ....:     obj_dml_plr.fit()
   ....:     this_theta = obj_dml_plr.coef[0]
   ....:     this_se = obj_dml_plr.se[0]
   ....:     print(np.abs(theta_dml[i_rep] - this_theta))
   ....:     print(np.abs(se_dml[i_rep] - this_se))
   ....:     theta_dml[i_rep] = this_theta
   ....:     se_dml[i_rep] = this_se
   ....: 
0.022227396181988324
0.0003648449675882695

In [56]: plt.figure(constrained_layout=True);

In [57]: ax = sns.histplot((theta_dml - alpha)/se_dml,
   ....:                 color=face_colors[2], edgecolor = edge_colors[2],
   ....:                 stat='density', bins=30, label='Double ML with cross-fitting');
   ....: 

In [58]: ax.axvline(0., color='k');

In [59]: xx = np.arange(-5, +5, 0.001)

In [60]: yy = stats.norm.pdf(xx)

In [61]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [62]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [63]: ax.set_xlim([-6., 6.]);

In [64]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/orth.png
set.seed(3333)

# to speed up the illustration we hard-code the simulation results
theta_dml = c(0.526496861, 0.516423626, 0.425721911, 0.485296273, 0.461591628, 0.449992993, 0.559168622, 0.472629416, 0.451626352, 0.583773380, 0.540160800, 0.482345390, 0.467005290, 0.451166527, 0.481830043, 0.408407292, 0.462678212, 0.548922849, 0.520159040, 0.497193803, 0.440822840, 0.487791056, 0.503975646, 0.491378910, 0.524024331, 0.479086742, 0.494545415, 0.565138341, 0.503716816, 0.457255120, 0.527315906, 0.523266212, 0.594335656, 0.529733774, 0.473181690, 0.536626049, 0.515769211, 0.551253541, 0.475809536, 0.540341285, 0.533543029, 0.565422865, 0.400152176, 0.549123154, 0.600493796, 0.595089836, 0.551132521, 0.520290454, 0.500975768, 0.478196306, 0.543913201, 0.585342980, 0.596924666, 0.448544973, 0.515724987, 0.640526277, 0.494115129, 0.443993343, 0.480925887, 0.475648583, 0.529057561, 0.461694662, 0.526163020, 0.471925816, 0.522638728, 0.485680892, 0.446199496, 0.476997020, 0.595499939, 0.479949953, 0.561294909, 0.549522249, 0.465846409, 0.476958622, 0.532324561, 0.525280727, 0.537130558, 0.508431195, 0.454000570, 0.478485684, 0.465719740, 0.488619250, 0.535829149, 0.491406242, 0.496324215, 0.513651824, 0.486021785, 0.548085775, 0.450218617, 0.589061272, 0.570028944, 0.493790633, 0.457712969, 0.490754288, 0.450186566, 0.564573252, 0.514390205, 0.536154853, 0.564205629, 0.446216003, 0.474929702, 0.424738279, 0.480728948, 0.509737486, 0.470349035, 0.395730146, 0.514206304, 0.483136001, 0.505550017, 0.455673847, 0.497664192, 0.504363088, 0.472553498, 0.548180298, 0.441851680, 0.509809776, 0.514380902, 0.515111492, 0.524438567, 0.475238211, 0.518538727, 0.537238300, 0.536895285, 0.457091071, 0.479487524, 0.527342928, 0.466519739, 0.500898678, 0.492437507, 0.524065769, 0.522812378, 0.487676679, 0.482675721, 0.606135565, 0.500221561, 0.506274601, 0.571517841, 0.443503212, 0.483164272, 0.490383478, 0.534053445, 0.426995347, 0.555014827, 0.456736852, 0.506900157, 0.462229813, 0.476749648, 0.551276460, 0.541959084, 0.541989827, 0.571251150, 0.509000317, 0.586522553, 0.481518655, 0.624988641, 0.525507021, 0.416529800, 0.469122189, 0.535983548, 0.492231164, 0.590738180, 0.497245521, 0.520602377, 0.475623045, 0.612294504, 0.504006944, 0.568137487, 0.534675673, 0.525995577, 0.600662288, 0.474244759, 0.471054751, 0.478299115, 0.489695552, 0.562705161, 0.491275830, 0.463764360, 0.511402277, 0.449216851, 0.457577952, 0.461359224, 0.441720852, 0.515833161, 0.552845018, 0.445352371, 0.433054211, 0.521784596, 0.517861769, 0.428610970, 0.490151889, 0.490057116, 0.530749907, 0.493865394, 0.575550501, 0.521199371, 0.522942683, 0.476600718, 0.483198750, 0.450953100, 0.417531459, 0.504314885, 0.542740796, 0.403608989, 0.584574209, 0.602746578, 0.428342195, 0.480118563, 0.611147593, 0.540325466, 0.536663887, 0.482854898, 0.548586883, 0.507039120, 0.462672092, 0.530467193, 0.553647450, 0.587152661, 0.528806814, 0.425184460, 0.437779291, 0.517846466, 0.527048897, 0.503559461, 0.438427889, 0.507159897, 0.542511572, 0.470296932, 0.487715405, 0.507438629, 0.525845998, 0.490429927, 0.499009890, 0.481786490, 0.448895843, 0.466312236, 0.495927151, 0.550072442, 0.407513971, 0.484162554, 0.457867808, 0.491339385, 0.558883223, 0.554413612, 0.515865134, 0.491476007, 0.432321031, 0.500748821, 0.602614445, 0.495326189, 0.537322895,
            0.435082303, 0.536855850, 0.521886639, 0.556088247, 0.498664916, 0.496657563, 0.438670614, 0.479836991, 0.465567611, 0.443088724, 0.549493447, 0.520863419, 0.485880843, 0.491620501, 0.497278091, 0.499753413, 0.489089688, 0.432632333, 0.542871569, 0.488010869, 0.461325007, 0.516428267, 0.569533362, 0.505236978, 0.517686862, 0.498655296, 0.519844603, 0.473304577, 0.527883827, 0.523656344, 0.504169493, 0.455283706, 0.598325421, 0.472983499, 0.517807850, 0.547712071, 0.509369960, 0.437746837, 0.569849366, 0.522265545, 0.539601063, 0.535131141, 0.490061199, 0.562085236, 0.451379302, 0.444425409, 0.457712136, 0.529186270, 0.490129726, 0.502728521, 0.458249625, 0.464209433, 0.540701533, 0.489974256, 0.577625392, 0.490314196, 0.651041738, 0.468518457, 0.512386542, 0.468917674, 0.597005437, 0.524877138, 0.442121863, 0.485403152, 0.506072072, 0.509517194, 0.541591749, 0.467503127, 0.528268571, 0.494485255, 0.561024583, 0.399094723, 0.503840347, 0.513874090, 0.524081940, 0.519125688, 0.449089827, 0.589765730, 0.486302378, 0.563737460, 0.511757073, 0.488476937, 0.533714979, 0.537573720, 0.427938777, 0.459323285, 0.535557089, 0.582036132, 0.535193543, 0.478417149, 0.383330110, 0.529422548, 0.503942314, 0.532207930, 0.586057084, 0.511947418, 0.470331103, 0.474770615, 0.507580591, 0.546605103, 0.522188853, 0.429355286, 0.572140316, 0.561258610, 0.460131188, 0.452902720, 0.496388422, 0.506668434, 0.490149450, 0.509338802, 0.501638561, 0.499779288, 0.546238717, 0.502623875, 0.432260842, 0.497627070, 0.511316043, 0.545365089, 0.538137328, 0.457859455, 0.453587162, 0.475622619, 0.572387257, 0.485639006, 0.518053657, 0.503427803, 0.503048899, 0.540383919, 0.493457345, 0.450395090, 0.534949215, 0.557382894, 0.534380782, 0.508725941, 0.551246161, 0.525896629, 0.400648336, 0.488763074, 0.527672695, 0.424693743, 0.575318311, 0.551457444, 0.537292914, 0.447912640, 0.463898168, 0.445057758, 0.535534587, 0.556765806, 0.515784047, 0.480877073, 0.572669277, 0.586097559, 0.538941708, 0.531877884, 0.438362663, 0.529896235, 0.498074681, 0.512755317, 0.501546660, 0.460365491, 0.518271383, 0.521026833, 0.524296674, 0.578400838, 0.471163716, 0.407778367, 0.531479083, 0.457065729, 0.452797248, 0.547754631, 0.535333251, 0.486621673, 0.533333502, 0.512585748, 0.573120633, 0.493075179, 0.536298318, 0.490408943, 0.492613851, 0.515634887, 0.520953978, 0.513414401, 0.565388881, 0.448519619, 0.467559204, 0.509864262, 0.442904006, 0.490109976, 0.534351365, 0.534179970, 0.557771444, 0.514516075, 0.519784049, 0.485297624, 0.536380072, 0.550809275, 0.448427472, 0.493015574, 0.532626063, 0.554964252, 0.534263750, 0.596174770, 0.568671474, 0.422851018, 0.538661804, 0.537325385, 0.503527249, 0.439025905, 0.551841010, 0.572171145, 0.518936835, 0.482281929, 0.461553681, 0.410208067, 0.448480865, 0.480915422, 0.486679326, 0.481556363, 0.537210814, 0.459726483, 0.469751432, 0.452110055, 0.508456501, 0.543183393, 0.583745800, 0.527349244, 0.464877344, 0.535844275, 0.442712049, 0.432099315, 0.557778388, 0.499356396, 0.525486405, 0.514135561, 0.536915139, 0.523707582, 0.462669642, 0.574375201, 0.538129597, 0.460811022, 0.469898047, 0.476470499, 0.597182716, 0.499428235, 0.520102652, 0.512266150, 0.507346379, 0.530595860, 0.596174529, 0.493450429,
            0.467753442, 0.418983851, 0.443016650, 0.489288188, 0.519135540, 0.529404070, 0.590913702, 0.514905818, 0.595071633, 0.564989643, 0.550394820, 0.529932447, 0.555261839, 0.482325619, 0.428649183, 0.586819452, 0.577900128, 0.454670496, 0.516212671, 0.525556836, 0.495380852, 0.433787371, 0.456882873, 0.505626647, 0.480399964, 0.567110779, 0.463698835, 0.509625083, 0.419048593, 0.543423737, 0.485946550, 0.461914165, 0.504166865, 0.509459252, 0.496259111, 0.556228140, 0.448400693, 0.457535908, 0.465489789, 0.509267170, 0.477808918, 0.529695325, 0.434139856, 0.454591158, 0.429105207, 0.575914908, 0.447020348, 0.529844733, 0.373347431, 0.537159093, 0.499685444, 0.418661666, 0.456443352, 0.584872676, 0.451602520, 0.450348484, 0.453250391, 0.521788836, 0.526172956, 0.488037086, 0.533567162, 0.560744168, 0.440398033, 0.532711540, 0.530134994, 0.504209397, 0.447400211, 0.425008271, 0.516812732, 0.455672264, 0.540950117, 0.472910067, 0.414727073, 0.502684799, 0.506963329, 0.554433733, 0.554821413, 0.573707647, 0.547555131, 0.507832092, 0.593165686, 0.433090128, 0.411529072, 0.536899849, 0.468702340, 0.490093574, 0.504769803, 0.472109330, 0.549933986, 0.482994009, 0.490996350, 0.477038252, 0.469576210, 0.549356725, 0.500941790, 0.481368822, 0.548622848, 0.547555863, 0.567670275, 0.478386094, 0.447765379, 0.441149465, 0.509846825, 0.550376789, 0.468940821, 0.539059513, 0.525857246, 0.513721013, 0.489882421, 0.452975517, 0.553226219, 0.502540710, 0.488158955, 0.542927835, 0.621186936, 0.535315345, 0.479982269, 0.445903284, 0.550138165, 0.535177013, 0.529421950, 0.443045350, 0.451976715, 0.505082709, 0.452919746, 0.469870510, 0.531751243, 0.537707204, 0.527677575, 0.445564817, 0.563943631, 0.547361399, 0.484122612, 0.558962249, 0.510648089, 0.509582346, 0.504780801, 0.561277203, 0.508949258, 0.524267386, 0.442101579, 0.439593077, 0.465579898, 0.449070866, 0.493639443, 0.528873344, 0.573281801, 0.573981200, 0.453894862, 0.671048305, 0.559325727, 0.524238917, 0.480040240, 0.506184772, 0.472709532, 0.503019068, 0.528312156, 0.457797678, 0.579639824, 0.527183702, 0.492649005, 0.488461666, 0.462559863, 0.488460190, 0.498344108, 0.500522942, 0.485034370, 0.426707641, 0.418255274, 0.455822485, 0.501971487, 0.552856777, 0.464114429, 0.504789479, 0.522911187, 0.486247849, 0.494864775, 0.584647154, 0.463437017, 0.491042601, 0.489098208, 0.485216405, 0.493737063, 0.464072169, 0.529556484, 0.552803154, 0.527666056, 0.506144058, 0.487192429, 0.549385636, 0.486568486, 0.521919182, 0.445463372, 0.471090513, 0.492484255, 0.520809889, 0.416783284, 0.514696109, 0.474594277, 0.478141640, 0.528087473, 0.502851883, 0.434506318, 0.345439342, 0.503857382, 0.541490283, 0.452425178, 0.552336632, 0.499726440, 0.486331554, 0.465456844, 0.536046765, 0.557922771, 0.531833250, 0.468322143, 0.607299241, 0.524984583, 0.401490789, 0.459539340, 0.509631698, 0.516039897, 0.499634395, 0.540545514, 0.474438205, 0.534083978, 0.462877421, 0.564507870, 0.496374027, 0.449156130, 0.492138665, 0.477158718, 0.496583686, 0.541931996, 0.611491369, 0.447694369, 0.527832536, 0.495899280, 0.512490385, 0.512115692, 0.537270951, 0.512055966, 0.475501540, 0.532834960, 0.468651723, 0.492526802, 0.487603388, 0.562583651, 0.522808398, 0.588727940, 0.469481727,
            0.476338523, 0.491492243, 0.547023400, 0.488819245, 0.513475593, 0.551406361, 0.482524929, 0.488237202, 0.541827499, 0.440964329, 0.597819361, 0.459415432, 0.521870553, 0.506377348, 0.526383199, 0.500716460, 0.527163335, 0.537013067, 0.533191111, 0.538923317, 0.514834296, 0.500703010, 0.410222358, 0.566701369, 0.492936524, 0.574343233, 0.547803027, 0.460683313, 0.578993390, 0.485218099, 0.482649606, 0.490506250, 0.460607633, 0.538219154, 0.510574017, 0.412753842, 0.530022133, 0.496629899, 0.551721755, 0.488979683, 0.477666640, 0.584765504, 0.558994289, 0.576869112, 0.481600458, 0.419980168, 0.589541238, 0.495017547, 0.559769645, 0.481570942, 0.513677992, 0.486732398, 0.470466567, 0.498390145, 0.440683750, 0.504212650, 0.484340159, 0.547354252, 0.436351249, 0.575151102, 0.519435183, 0.442065328, 0.474954844, 0.487734434, 0.518493617, 0.501238125, 0.522472876, 0.494242744, 0.557874318, 0.570759857, 0.545206104, 0.476331555, 0.505642659, 0.463123976, 0.389784479, 0.490964602, 0.544499658, 0.503343106, 0.469545223, 0.518358092, 0.524470435, 0.564577289, 0.507410959, 0.536679441, 0.560672146, 0.568249655, 0.511382617, 0.508237974, 0.545819583, 0.506918200, 0.456888247, 0.485467697, 0.503245587, 0.414701975, 0.501094135, 0.558824985, 0.566221109, 0.481771193, 0.503501521, 0.523207003, 0.466002136, 0.524448710, 0.525027135, 0.491718526, 0.505096445, 0.470404439, 0.524150053, 0.450207374, 0.544405665, 0.519299724, 0.504728313, 0.492213933, 0.529085791, 0.503375571, 0.495846105, 0.437172874, 0.539401410, 0.506089589, 0.431224626, 0.483530628, 0.543122255, 0.570319876, 0.476956820, 0.512402467, 0.508731622, 0.414489980, 0.490960439, 0.484874692, 0.491633363, 0.457767496, 0.494598247, 0.461205441, 0.513560810, 0.523383081, 0.533182717, 0.541803610, 0.542719828, 0.528873929, 0.527440157, 0.599518371, 0.544493122, 0.566819276, 0.527787376, 0.541638211, 0.418428540, 0.429952163, 0.518814515, 0.491632118, 0.494269810, 0.574714485, 0.590469517, 0.535498072, 0.473329934, 0.526000632, 0.530424888, 0.442788363, 0.582018897, 0.555182445, 0.401056185, 0.511486328, 0.564567275, 0.469935679, 0.570279981, 0.404521404, 0.512463207, 0.540748561, 0.564057043, 0.502089398, 0.489045252, 0.527059960, 0.486244041, 0.519106832, 0.423082151, 0.465851224, 0.461443352, 0.548314098, 0.457065014, 0.559127045, 0.575568903, 0.471134846, 0.493302706, 0.575362420, 0.536046980, 0.528900674, 0.415325148, 0.503520321, 0.542434939, 0.536627002, 0.538721496, 0.485037398, 0.519167961, 0.483395958, 0.475782570, 0.420312314, 0.502585927, 0.487045097, 0.568882355, 0.486363429, 0.518771287, 0.528704723, 0.465141994, 0.434499341, 0.540650252, 0.547986414, 0.485954670, 0.552500106, 0.552781515, 0.468090853, 0.495576849, 0.571792515, 0.567468852, 0.412088625, 0.474065400, 0.445789609, 0.507640086, 0.462192756, 0.485610917, 0.517984254, 0.531908967, 0.498897240, 0.498344967, 0.486508236, 0.488946633, 0.495260075, 0.486465657, 0.543663830, 0.483577617, 0.567011513, 0.548034817, 0.479783299, 0.512339483, 0.496316821, 0.543433184, 0.477249429, 0.384742888, 0.486166728, 0.471801654, 0.513562722, 0.545886714, 0.468391892, 0.551923479, 0.518712240, 0.574853864, 0.441880394, 0.482785165, 0.624194556, 0.535141387, 0.521832675, 0.416633931, 0.521563762)
se_dml = c(0.0459486570, 0.0427164347, 0.0421129286, 0.0426511338, 0.0435054521, 0.0445955603, 0.0447804118, 0.0491623322, 0.0427274029, 0.0391098010, 0.0430905799, 0.0402490415, 0.0437686667, 0.0452208507, 0.0403921614, 0.0403273047, 0.0474629308, 0.0541207268, 0.0495409280, 0.0407166801, 0.0474830398, 0.0491076836, 0.0472301709, 0.0470574759, 0.0375038341, 0.0450470270, 0.0442185701, 0.0438963378, 0.0469834110, 0.0528586340, 0.0443037998, 0.0444308116, 0.0464334131, 0.0456276458, 0.0523982611, 0.0451506399, 0.0394511084, 0.0436577101, 0.0447160580, 0.0485423722, 0.0392618715, 0.0477369092, 0.0458259776, 0.0501888707, 0.0433958344, 0.0475662703, 0.0437856579, 0.0513090428, 0.0459377155, 0.0399055055, 0.0496063179, 0.0439646027, 0.0453017598, 0.0448261788, 0.0457971566, 0.0408774765, 0.0495501401, 0.0511912037, 0.0430238911, 0.0423318223, 0.0467567273, 0.0451718192, 0.0398980313, 0.0464729680, 0.0479479017, 0.0427360589, 0.0413409894, 0.0446780370, 0.0436500724, 0.0421590535, 0.0428913945, 0.0451454341, 0.0460799035, 0.0419040712, 0.0434802341, 0.0450984753, 0.0456554873, 0.0422882860, 0.0428161642, 0.0410891398, 0.0416383607, 0.0411182801, 0.0436694519, 0.0463204355, 0.0429146700, 0.0406762889, 0.0403156249, 0.0450427097, 0.0499986817, 0.0425009064, 0.0423851213, 0.0420207198, 0.0382721681, 0.0480687536, 0.0493360598, 0.0420604155, 0.0483816926, 0.0446986818, 0.0430198138, 0.0444754635, 0.0414275714, 0.0467395243, 0.0413662637, 0.0451064995, 0.0459162125, 0.0446667029, 0.0384506948, 0.0436396598, 0.0451688359, 0.0435311307, 0.0460350028, 0.0432994998, 0.0454653628, 0.0429259328, 0.0451174802, 0.0492213093, 0.0483757672, 0.0476997522, 0.0409404632, 0.0428023977, 0.0400608012, 0.0417010074, 0.0512842029, 0.0439027054, 0.0398776901, 0.0414818928, 0.0445569613, 0.0473592097, 0.0425068015, 0.0410613056, 0.0399781505, 0.0419512151, 0.0465740305, 0.0432724066, 0.0456513953, 0.0497255423, 0.0473861540, 0.0455023734, 0.0431838225, 0.0436962266, 0.0405253742, 0.0474065347, 0.0481648103, 0.0429806576, 0.0432331384, 0.0425746022, 0.0441635910, 0.0438158911, 0.0413962544, 0.0361634128, 0.0463446301, 0.0473595368, 0.0428375847, 0.0509637127, 0.0499946463, 0.0450493984, 0.0450857911, 0.0455173857, 0.0465024348, 0.0466233605, 0.0477536954, 0.0484616344, 0.0423479893, 0.0437104948, 0.0462098604, 0.0413123913, 0.0435643722, 0.0445354878, 0.0484836627, 0.0465716093, 0.0411395786, 0.0468053510, 0.0407303381, 0.0423606864, 0.0473289424, 0.0468656683, 0.0446194090, 0.0436460935, 0.0458001910, 0.0483715867, 0.0456211425, 0.0437913013, 0.0478861747, 0.0479155896, 0.0447400940, 0.0428180984, 0.0446561011, 0.0438705665, 0.0476477944, 0.0427156391, 0.0445455841, 0.0451325894, 0.0421587754, 0.0444581848, 0.0437405431, 0.0497176519, 0.0468306029, 0.0447048861, 0.0413249220, 0.0520801097, 0.0428372668, 0.0421879925, 0.0445812532, 0.0441809219, 0.0442840059, 0.0477483549, 0.0454864402, 0.0427667284, 0.0449910206, 0.0445109011, 0.0464603374, 0.0504553017, 0.0468781210, 0.0449492753, 0.0497589629, 0.0458589525, 0.0462343860, 0.0473093490, 0.0461843641, 0.0439234166, 0.0447329945, 0.0437550159, 0.0435533290, 0.0450084391, 0.0440417089, 0.0471659895, 0.0456444977, 0.0404775543, 0.0416808372, 0.0451739034, 0.0455834295, 0.0434527193, 0.0458574752, 0.0468341642, 0.0414578168, 0.0422614777, 0.0400518909, 0.0450992298, 0.0431689994, 0.0406515428, 0.0437678938, 0.0411988174, 0.0424418484, 0.0478578790, 0.0386177052, 0.0444807961, 0.0413502267, 0.0405502421, 0.0443049592, 0.0492122218,
        0.0415023030, 0.0406705566, 0.0408198686, 0.0457456178, 0.0416810788, 0.0429542667, 0.0471460861, 0.0440530588, 0.0439950736, 0.0441586380, 0.0427035500, 0.0383669585, 0.0485645030, 0.0444517010, 0.0421927214, 0.0478535243, 0.0453883240, 0.0444123182, 0.0491793741, 0.0456530975, 0.0443722190, 0.0487743910, 0.0413677165, 0.0415438745, 0.0423889310, 0.0446884081, 0.0477893230, 0.0488963534, 0.0448559463, 0.0383212001, 0.0432652080, 0.0447385473, 0.0446487641, 0.0517938992, 0.0465202127, 0.0432993652, 0.0437825833, 0.0433960405, 0.0442868149, 0.0442263739, 0.0468955832, 0.0404869329, 0.0568290047, 0.0429494028, 0.0449968635, 0.0483581875, 0.0442350392, 0.0446020077, 0.0440855167, 0.0472119089, 0.0417431750, 0.0445306463, 0.0439853842, 0.0442217633, 0.0436724987, 0.0459136986, 0.0470342098, 0.0419853234, 0.0424214546, 0.0429135037, 0.0439950418, 0.0438369690, 0.0460588787, 0.0457362680, 0.0463082825, 0.0469805936, 0.0486961722, 0.0383118855, 0.0458579237, 0.0431902222, 0.0429493904, 0.0473916352, 0.0439362802, 0.0427028399, 0.0437357114, 0.0411564542, 0.0408628440, 0.0431157777, 0.0455318817, 0.0444617988, 0.0427746643, 0.0449289560, 0.0464962667, 0.0473235300, 0.0442455742, 0.0443392750, 0.0462599843, 0.0460606282, 0.0414533830, 0.0447796945, 0.0435026062, 0.0446323556, 0.0406237477, 0.0409108276, 0.0443292861, 0.0447124238, 0.0457235779, 0.0464698359, 0.0411350395, 0.0402359459, 0.0461321620, 0.0481023422, 0.0451502616, 0.0435777011, 0.0408641870, 0.0462350692, 0.0518780519, 0.0512115864, 0.0439761646, 0.0474554162, 0.0382615269, 0.0470998767, 0.0475240737, 0.0436634844, 0.0469561279, 0.0450682076, 0.0457623311, 0.0433321327, 0.0485009586, 0.0438042100, 0.0436128603, 0.0418350894, 0.0403915008, 0.0422523804, 0.0464884117, 0.0459027093, 0.0463916528, 0.0413689953, 0.0464401644, 0.0426021949, 0.0498590605, 0.0437853905, 0.0382619275, 0.0408580736, 0.0481102918, 0.0440044610, 0.0485725756, 0.0479091816, 0.0418599146, 0.0433232062, 0.0437688258, 0.0440449956, 0.0403664443, 0.0447550672, 0.0474148565, 0.0428229000, 0.0435350351, 0.0449911650, 0.0414966640, 0.0491750640, 0.0498749595, 0.0429196305, 0.0426677387, 0.0415629202, 0.0462883275, 0.0481573542, 0.0467125742, 0.0420880244, 0.0429284056, 0.0441345758, 0.0404150391, 0.0474525876, 0.0443092955, 0.0417593836, 0.0422202758, 0.0467853919, 0.0470457469, 0.0405760563, 0.0422148487, 0.0432156330, 0.0465999405, 0.0448843270, 0.0448184505, 0.0400301029, 0.0435553117, 0.0433940780, 0.0410873462, 0.0433235063, 0.0463503703, 0.0442648445, 0.0466138084, 0.0467931767, 0.0402387083, 0.0456172780, 0.0428245221, 0.0472417672, 0.0437131123, 0.0438055181, 0.0508492921, 0.0427088761, 0.0456952776, 0.0463181495, 0.0440933150, 0.0451865059, 0.0395495168, 0.0448969883, 0.0428658049, 0.0427025612, 0.0413126381, 0.0454942076, 0.0443736837, 0.0450609810, 0.0476441516, 0.0413185787, 0.0410480512, 0.0395182161, 0.0454214481, 0.0553785506, 0.0424342005, 0.0440304949, 0.0436434890, 0.0519229687, 0.0465609539, 0.0435109159, 0.0427501159, 0.0471582178, 0.0447385240, 0.0476317385, 0.0434190068, 0.0451516642, 0.0441780706, 0.0452948974, 0.0429244756, 0.0428850559, 0.0470191975, 0.0570160317, 0.0409190135, 0.0431539541, 0.0437967596, 0.0435078040, 0.0425420034, 0.0484456576, 0.0454732112, 0.0425891601, 0.0417193649, 0.0492266093, 0.0445264977, 0.0461257120, 0.0415995350, 0.0403636208, 0.0471628772, 0.0463507274, 0.0488585717, 0.0416637643, 0.0470971190, 0.0424058623, 0.0408225405, 0.0417604444, 0.0412125302, 0.0425828113,
        0.0482499519, 0.0446316339, 0.0456034930, 0.0460902596, 0.0444504770, 0.0379709512, 0.0448907516, 0.0507556669, 0.0459480772, 0.0499707081, 0.0426258110, 0.0488695566, 0.0415298811, 0.0414485563, 0.0429323843, 0.0468609363, 0.0419407553, 0.0438273134, 0.0472767043, 0.0475352544, 0.0470211840, 0.0447641077, 0.0580175276, 0.0371047782, 0.0404746548, 0.0427253652, 0.0477529842, 0.0528949160, 0.0434883326, 0.0482010726, 0.0355215657, 0.0406214976, 0.0435834004, 0.0470045493, 0.0385664352, 0.0472325023, 0.0444419170, 0.0400665491, 0.0498178897, 0.0442400491, 0.0416440262, 0.0418480689, 0.0398616655, 0.0430931637, 0.0479540357, 0.0450493115, 0.0467705075, 0.0450768679, 0.0403235576, 0.0405796384, 0.0428518613, 0.0422108033, 0.0456190872, 0.0439781648, 0.0487045609, 0.0397670898, 0.0439254764, 0.0461722983, 0.0515924998, 0.0416588820, 0.0414975201, 0.0502438732, 0.0410323452, 0.0459847647, 0.0456258864, 0.0467261313, 0.0501880832, 0.0467273956, 0.0462085729, 0.0472110286, 0.0393934556, 0.0454877806, 0.0451223124, 0.0439503863, 0.0429342459, 0.0461093298, 0.0489114071, 0.0466530381, 0.0434444633, 0.0432470956, 0.0459068608, 0.0475079041, 0.0479623946, 0.0423448524, 0.0534109608, 0.0446951776, 0.0425815377, 0.0472747606, 0.0451700479, 0.0428634603, 0.0462891944, 0.0494328493, 0.0474882087, 0.0499571479, 0.0419461574, 0.0447534997, 0.0440009996, 0.0473322149, 0.0421812393, 0.0435714409, 0.0465693343, 0.0412020819, 0.0425745278, 0.0419824251, 0.0451248086, 0.0424342863, 0.0471111147, 0.0496996569, 0.0386218618, 0.0483678280, 0.0427052642, 0.0467335197, 0.0456933317, 0.0407545054, 0.0428280180, 0.0408489372, 0.0454104982, 0.0481908207, 0.0438358393, 0.0385052171, 0.0443490148, 0.0470035729, 0.0469784277, 0.0450578868, 0.0426215533, 0.0422878879, 0.0427978847, 0.0438805277, 0.0432833188, 0.0445551672, 0.0456565362, 0.0400851990, 0.0464596644, 0.0433879616, 0.0440521340, 0.0472391843, 0.0468134606, 0.0432352171, 0.0514054190, 0.0477084712, 0.0396379406, 0.0456425763, 0.0457500615, 0.0478434809, 0.0455024170, 0.0455004090, 0.0438530489, 0.0413289386, 0.0448764883, 0.0404208907, 0.0488761174, 0.0442638442, 0.0460552694, 0.0417968666, 0.0468234801, 0.0442716688, 0.0413565796, 0.0444732417, 0.0440898540, 0.0386603884, 0.0512978341, 0.0456067828, 0.0427035699, 0.0420464797, 0.0484629199, 0.0418745123, 0.0433378063, 0.0411936959, 0.0409332114, 0.0420151344, 0.0470519135, 0.0476174448, 0.0444958502, 0.0429532166, 0.0407580479, 0.0435016758, 0.0443576213, 0.0475781317, 0.0393657397, 0.0462344019, 0.0406485076, 0.0459636989, 0.0482741197, 0.0500332121, 0.0413240955, 0.0401818389, 0.0442769702, 0.0458078363, 0.0474676202, 0.0425250866, 0.0432738449, 0.0434355898, 0.0474600315, 0.0438535041, 0.0459913453, 0.0416143374, 0.0460806005, 0.0368005508, 0.0395121384, 0.0472623878, 0.0464689185, 0.0425102962, 0.0512446643, 0.0462737897, 0.0443148232, 0.0471696359, 0.0380973646, 0.0436201858, 0.0430784754, 0.0439574016, 0.0432222307, 0.0452884733, 0.0450533858, 0.0437313707, 0.0457048425, 0.0422273840, 0.0364609671, 0.0400449949, 0.0497254131, 0.0469534072, 0.0459863250, 0.0422778454, 0.0426151771, 0.0475423906, 0.0477401610, 0.0459846678, 0.0390511482, 0.0442722637, 0.0458054106, 0.0428708746, 0.0461712771, 0.0432618223, 0.0419045248, 0.0444196238, 0.0456363745, 0.0468995035, 0.0408984423, 0.0508127809, 0.0459799341, 0.0430328514, 0.0465827798, 0.0416158731, 0.0458712027, 0.0478040590, 0.0422139494, 0.0479701237, 0.0448880992, 0.0479679927, 0.0417961757, 0.0464013377,
        0.0385243136, 0.0423007766, 0.0467074991, 0.0447892059, 0.0409665179, 0.0445811045, 0.0470848135, 0.0443024787, 0.0397446724, 0.0433068881, 0.0517339835, 0.0462017336, 0.0455606041, 0.0472051930, 0.0508521692, 0.0493632363, 0.0445423642, 0.0488209453, 0.0477119073, 0.0409958372, 0.0453962934, 0.0442043931, 0.0412188450, 0.0443873150, 0.0429597760, 0.0478171680, 0.0397152617, 0.0451271643, 0.0444629501, 0.0400444160, 0.0447988813, 0.0404119483, 0.0419218662, 0.0411116509, 0.0438202941, 0.0435572580, 0.0422580429, 0.0474320926, 0.0437850686, 0.0472176449, 0.0465718403, 0.0484860490, 0.0516804395, 0.0495733776, 0.0417042067, 0.0464740464, 0.0463601506, 0.0446442820, 0.0453487897, 0.0457041726, 0.0424084565, 0.0429766089, 0.0416657030, 0.0457907740, 0.0409503790, 0.0437512246, 0.0448202871, 0.0433855864, 0.0463362318, 0.0444422820, 0.0499028754, 0.0414335753, 0.0467306879, 0.0420646602, 0.0459093535, 0.0534056069, 0.0432605373, 0.0397915621, 0.0398695106, 0.0463127755, 0.0458955003, 0.0472525774, 0.0427114775, 0.0482497202, 0.0435529090, 0.0441176161, 0.0447136807, 0.0434899835, 0.0454968213, 0.0499376173, 0.0408098808, 0.0470413739, 0.0454530476, 0.0453446117, 0.0425645974, 0.0454178057, 0.0461366768, 0.0490291725, 0.0428624026, 0.0422983280, 0.0431454228, 0.0430222888, 0.0443439588, 0.0451224205, 0.0461949702, 0.0468945414, 0.0418024676, 0.0479534095, 0.0476875032, 0.0465623495, 0.0452691189, 0.0417160895, 0.0465506861, 0.0453280185, 0.0405296532, 0.0424733480, 0.0426569651, 0.0429293153, 0.0402043958, 0.0502562486, 0.0432207448, 0.0436047325, 0.0446937885, 0.0449971351, 0.0407042709, 0.0482809961, 0.0464824510, 0.0449933215, 0.0481167521, 0.0450947835, 0.0401256981, 0.0435383833, 0.0413568700, 0.0408951595, 0.0470189691, 0.0498184492, 0.0445232494, 0.0401293688, 0.0483243288, 0.0441458902, 0.0447345011, 0.0467586848, 0.0450101942, 0.0431761710, 0.0421874512, 0.0430332011, 0.0410765638, 0.0495292068, 0.0450962730, 0.0443434607, 0.0495437566, 0.0431240543, 0.0433584381, 0.0442090481, 0.0458189728, 0.0481548257, 0.0448615757, 0.0449263129, 0.0388349603, 0.0396614381, 0.0377649745, 0.0452379051, 0.0501995611, 0.0467505056, 0.0443627512, 0.0468372899, 0.0466199417, 0.0468921794, 0.0463387382, 0.0486956992, 0.0430408619, 0.0428758018, 0.0407966022, 0.0473178670, 0.0460632480, 0.0432186199, 0.0372435615, 0.0413304721, 0.0460981280, 0.0459454594, 0.0428500814, 0.0431672319, 0.0415400332, 0.0440274999, 0.0491958105, 0.0432928628, 0.0422572617, 0.0409147734, 0.0485845001, 0.0425080878, 0.0496401158, 0.0478275391, 0.0419048581, 0.0454532196, 0.0451911305, 0.0418947861, 0.0458610689, 0.0398327450, 0.0437131145, 0.0442147894, 0.0448991118, 0.0456487824, 0.0439557482, 0.0436311183, 0.0474513218, 0.0477400735, 0.0454708454, 0.0437252664, 0.0485216345, 0.0388007530, 0.0426837589, 0.0490116647, 0.0489168180, 0.0427928835, 0.0487548890, 0.0406265118, 0.0426556870, 0.0452826058, 0.0460122246, 0.0456357238, 0.0478611570, 0.0432341025, 0.0455112499, 0.0481232371, 0.0488332482, 0.0438626637, 0.0431496595, 0.0448964730, 0.0446672567, 0.0477499667, 0.0456940156, 0.0472585455, 0.0466457367, 0.0420420651, 0.0516605473, 0.0400514425, 0.0468697383, 0.0425252678, 0.0414423871, 0.0418201062, 0.0433899816, 0.0466428306, 0.0456264474, 0.0442617512, 0.0432283716, 0.0413839098, 0.0413602884, 0.0459591157, 0.0482617049, 0.0444450002, 0.0468406450, 0.0438595597, 0.0403181647, 0.0434331567, 0.0420806305, 0.0423684465, 0.0456064497, 0.0410769126, 0.0434588066, 0.0489372916)

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for (i_rep in seq_len(n_rep)) {
for (i_rep in seq_len(1)) {
    df = data[[i_rep]]
    obj_dml_data = double_ml_data_from_data_frame(df, y_col = "y", d_cols = "d")
    obj_dml_plr = DoubleMLPLR$new(obj_dml_data,
                                ml_l, ml_m, ml_g,
                                n_folds=2,
                                score='IV-type')
    obj_dml_plr$fit()
    this_theta = obj_dml_plr$coef
    this_se = obj_dml_plr$se
    print(abs(theta_dml[i_rep] - this_theta))
    print(abs(se_dml[i_rep] - this_se))
    theta_dml[i_rep] = this_theta
    se_dml[i_rep] = this_se
}

g_dml = ggplot(data.frame(theta_rescaled=(theta_dml - alpha)/se_dml), aes(x = theta_rescaled)) +
                geom_histogram(aes(y=after_stat(density), x=theta_rescaled, colour = "Double ML with cross-fitting", fill="Double ML with cross-fitting"),
                            bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Double ML with cross-fitting"="dark green", "N(0, 1)"='black')) +
                scale_fill_manual(name='',
                    breaks=c("Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Double ML with cross-fitting"="dark green", "N(0, 1)"=NA)) +
                xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_dml
           d 
2.315448e-11 
           d 
2.115916e-11 
../_images/basics_4_1.png

1.5. Double/debiased machine learning#

To illustrate the benefits of the auxiliary prediction step in the DML framework we write the error as

\[\sqrt{n}(\check{\theta}_0 - \theta_0) = a^* + b^* + c^*\]

Chernozhukov et al. (2018) argues that:

The first term

\[a^* := (EV^2)^{-1} \frac{1}{\sqrt{n}} \sum_{i\in I} V_i \zeta_i\]

will be asymptotically normally distributed.

The second term

\[b^* := (EV^2)^{-1} \frac{1}{\sqrt{n}} \sum_{i\in I} (\hat{m}(X_i) - m(X_i)) (\hat{g}_0(X_i) - g_0(X_i))\]

vanishes asymptotically for many data generating processes.

The third term \(c^*\) vanishes in probability if sample splitting is applied.

In [65]: plt.figure(constrained_layout=True);

In [66]: ax = sns.histplot((theta_nonorth - alpha)/se_nonorth,
   ....:                 color=face_colors[0], edgecolor = edge_colors[0],
   ....:                 stat='density', bins=30, label='Non-orthogonal ML');
   ....: 

In [67]: sns.histplot((theta_orth_nosplit - alpha)/se_orth_nosplit,
   ....:             color=face_colors[1], edgecolor = edge_colors[1],
   ....:             stat='density', bins=30, label='Double ML (no sample splitting)');
   ....: 

In [68]: sns.histplot((theta_dml - alpha)/se_dml,
   ....:             color=face_colors[2], edgecolor = edge_colors[2],
   ....:             stat='density', bins=30, label='Double ML with cross-fitting');
   ....: 

In [69]: ax.axvline(0., color='k');

In [70]: xx = np.arange(-5, +5, 0.001)

In [71]: yy = stats.norm.pdf(xx)

In [72]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [73]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [74]: ax.set_xlim([-6., 6.]);

In [75]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/comparison.png
g_all = ggplot(data.frame(t_nonorth=(theta_nonorth - alpha)/se_nonorth,
                        t_orth_nosplit=(theta_orth_nosplit - alpha)/se_orth_nosplit,
                        t_dml=(theta_dml - alpha)/se_dml)) +
                geom_histogram(aes(x = t_nonorth, y=after_stat(density), colour = "Non-orthogonal ML", fill="Non-orthogonal ML"),
                                bins = 30, alpha = 0.3) +
                geom_histogram(aes(x = t_orth_nosplit, y=after_stat(density), colour = "Double ML (no sample splitting)", fill="Double ML (no sample splitting)"),
                                bins = 30, alpha = 0.3) +
                geom_histogram(aes(x = t_dml, y=after_stat(density), colour = "Double ML with cross-fitting", fill="Double ML with cross-fitting"),
                                bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Non-orthogonal ML", "Double ML (no sample splitting)", "Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Non-orthogonal ML"="dark blue",
                            "Double ML (no sample splitting)"="dark orange",
                            "Double ML with cross-fitting"="dark green",
                            "N(0, 1)"='black')) +
                scale_fill_manual(name='',
                    breaks=c("Non-orthogonal ML", "Double ML (no sample splitting)", "Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Non-orthogonal ML"="dark blue",
                            "Double ML (no sample splitting)"="dark orange",
                            "Double ML with cross-fitting"="dark green",
                            "N(0, 1)"=NA)) +
            xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_all
../_images/basics_5_1.png

1.6. Partialling out score#

Another debiased estimator, based on the partialling-out approach of Robinson(1988), is

\[\check{\theta}_0 = \left(\frac{1}{n} \sum_{i\in I} \hat{V}_i \hat{V}_i \right)^{-1} \frac{1}{n} \sum_{i\in I} \hat{V}_i (Y_i - \hat{\ell}_0(X_i)),\]

with \(\ell_0(X_i) = E(Y|X)\). All nuisance parameters for the estimator with score='partialling out' are conditional mean functions, which can be directly estimated using ML methods. This is a minor advantage over the estimator with score='IV-type'. In the following, we repeat the above analysis with score='partialling out'. In a first part of the analysis, we estimate \(\theta_0\) without sample splitting. Again we observe a bias from overfitting.

In [76]: import numpy as np

In [77]: np.random.seed(4444)

# to speed up the illustration we hard-code the simulation results
In [78]: theta_orth_po_nosplit = np.array([0.44689745, 0.41560548, 0.39147078, 0.40061244, 0.41388613, 0.40812013, 0.44497593, 0.38585885, 0.44117726, 0.49159354, 0.42731988, 0.43751013, 0.45444596, 0.33483986, 0.39266598, 0.38949641, 0.41844929, 0.37425161, 0.44119905, 0.40405533, 0.38900643, 0.36211315, 0.37546086, 0.41105622, 0.39496921, 0.37376606, 0.42015518, 0.39926076, 0.38283516, 0.42610636, 0.41467175, 0.47398591, 0.33381323, 0.35597262, 0.40394593, 0.37240773, 0.38373405, 0.45020658, 0.43253392, 0.42079326, 0.37306779, 0.37176962, 0.41359098, 0.32905667, 0.43924895, 0.40621988, 0.4248174 , 0.4188524 , 0.42545551, 0.48109574, 0.39236691, 0.41109807, 0.43830774, 0.43131476, 0.46297181, 0.36525   , 0.42785268, 0.45948104, 0.37387788, 0.39193983, 0.41964355, 0.45105777, 0.45068412, 0.41531941, 0.45774125, 0.37707203, 0.37312002, 0.41251921, 0.46760764, 0.45245259, 0.38508787, 0.399372  , 0.39485543, 0.42089349, 0.42689592, 0.43747816, 0.43590912, 0.43153398, 0.40612324, 0.4246974 , 0.407134  , 0.40267842, 0.39337628, 0.39783404, 0.36343842, 0.416114  , 0.43468455, 0.42479065, 0.44861003, 0.4284088 , 0.33906023, 0.36972258, 0.46021926, 0.40991793, 0.43182578, 0.4058362 , 0.41099645, 0.40465821, 0.5049942 , 0.44719956, 0.37759362, 0.46968968, 0.39354983, 0.43817316, 0.37478456, 0.47752947, 0.4158715 , 0.42853136, 0.34761861, 0.40501635, 0.35281687, 0.40102032, 0.36820323, 0.37565568, 0.38721431, 0.38768897, 0.40365893, 0.40833054, 0.38796741, 0.38696343, 0.38890053, 0.47678995, 0.40821229, 0.39226213, 0.32782232, 0.46068932, 0.37661274, 0.39197202, 0.38255031, 0.34728656, 0.43755796, 0.36722004, 0.40465598, 0.39280923, 0.38506902, 0.45724146, 0.45084514, 0.44738245, 0.37119941, 0.40383196, 0.38649858, 0.37208117, 0.47703402, 0.41352775, 0.47243667, 0.34997923, 0.34107974, 0.4503945 , 0.37347764, 0.43770291, 0.45765222, 0.41591249, 0.37818029, 0.40079684, 0.40742744, 0.51493047, 0.38143551, 0.38922804, 0.36482121, 0.48946817, 0.40386025, 0.3789189 , 0.43472849, 0.4482401 , 0.41958351, 0.3874319 , 0.46551354, 0.40688943, 0.42076722, 0.42261826, 0.42613403, 0.3982167 , 0.40560043, 0.38510455, 0.41363841, 0.4153734 , 0.42633414, 0.48195624, 0.4064136 , 0.39629634, 0.37622216, 0.44147214, 0.42028914, 0.35511551, 0.32997176, 0.37204305, 0.34571186, 0.38392038, 0.454553  , 0.42857666, 0.37738172, 0.38752155, 0.39888209, 0.33003166, 0.39749669, 0.40623056, 0.38995359, 0.43574707, 0.39400018, 0.38395351, 0.42308851, 0.45226606, 0.39925256, 0.41512287, 0.38956918, 0.36903949, 0.39506798, 0.38304656, 0.45834436, 0.44365015, 0.3559809 , 0.49703991, 0.36755582, 0.32405813, 0.35703684, 0.45291725, 0.3862536 , 0.45430432, 0.43151156, 0.42199184, 0.45506641, 0.41894509, 0.40927734, 0.44103929, 0.41244317, 0.45798097, 0.41423993, 0.41234892, 0.49257489, 0.39316852, 0.45133683, 0.48647005, 0.52262288, 0.39411164, 0.4361213 , 0.47251784, 0.41942088, 0.38252744, 0.48580277, 0.41970908, 0.41279836, 0.4496232 , 0.39192501, 0.44793215, 0.39777389, 0.36491141, 0.42293433, 0.38311846, 0.34729731, 0.3467867 , 0.38890129, 0.41369155, 0.43718281, 0.42255496, 0.42606418, 0.34113915, 0.40785283, 0.4266964 , 0.48600678, 0.38993538, 0.37674472, 0.36469012, 0.41382762, 0.3910651 , 0.36058839, 0.4385373 , 0.3853683 , 0.45285794, 0.43859701, 0.35940378, 0.35532133, 0.36747323, 0.31895662, 0.4765736 , 0.44085975, 0.43925062, 0.43305578, 0.38225082, 0.40558291, 0.42308383, 0.44251497, 0.38819576, 0.48809178, 0.39663077, 0.43415774, 0.44212896, 0.46864931, 0.41112727, 0.46702856, 0.35242806, 0.43235724, 0.43946028, 0.41192496, 0.3837241 , 0.38252215, 0.40869806, 0.51874593, 0.3617031 , 0.45676473, 0.34502171, 0.42263263, 0.46617327, 0.44260223, 0.38736024, 0.38962609, 0.41169203, 0.42714373, 0.35953918, 0.44465238, 0.41616539, 0.40898319, 0.35428957, 0.39896774, 0.46760866, 0.35534866, 0.39458018, 0.3010404 , 0.4275348 , 0.4130533 , 0.42218207, 0.50383664, 0.35943386, 0.46271252, 0.43461421, 0.44607091, 0.38827735, 0.4151206 , 0.39796933, 0.38299143, 0.37773728, 0.39394795, 0.46817041, 0.37619518, 0.37979198, 0.39579081, 0.38947461, 0.49225938, 0.32224241, 0.45937019, 0.40716829, 0.41395486, 0.35955957, 0.41686161, 0.37045689, 0.35787435, 0.46819524, 0.42714861, 0.4317218 , 0.41438206, 0.37601954, 0.4035717 , 0.38687642, 0.46099666, 0.39478873, 0.47577063, 0.46146113, 0.43162587, 0.37506128, 0.367823  , 0.3814589 , 0.43190693, 0.37833206, 0.44924794, 0.43123303, 0.43457722, 0.45822097, 0.42546258, 0.44599857, 0.43560714, 0.4018572 , 0.35588031, 0.39884516, 0.38828861, 0.3938863 , 0.36650029, 0.38365921, 0.45357156, 0.40473875, 0.38083154, 0.34806574, 0.45759315, 0.392613  , 0.44443932, 0.3859657 , 0.42588092, 0.37958914, 0.43936553, 0.40565913, 0.37050438, 0.38075554, 0.41480746, 0.41046031, 0.44809874, 0.40125569, 0.37153855, 0.34580786, 0.39599036, 0.40912106, 0.40286777, 0.4204081 , 0.40193548, 0.38921222, 0.36955462, 0.43778725, 0.38803946, 0.40488867, 0.39969558, 0.41182898, 0.41815582, 0.39436057, 0.40924522, 0.34340729, 0.36349859, 0.32419746, 0.38380303, 0.40018357, 0.45952972, 0.38707899, 0.35145758, 0.38427105, 0.39348254, 0.41127523, 0.4128339 , 0.40017793, 0.44410231, 0.40519121, 0.43557319, 0.39673401, 0.42723438, 0.46481697, 0.46732216, 0.35065925, 0.44945291, 0.38482921, 0.38124517, 0.40981892, 0.43832261, 0.43373603, 0.41552012, 0.38114908, 0.46441949, 0.43537922, 0.44091101, 0.41058189, 0.38814734, 0.37535326, 0.43135988, 0.4162225 , 0.41918978, 0.42145809, 0.39896498, 0.37387455, 0.43116882, 0.3833774 , 0.38335557, 0.40718161, 0.45818585, 0.39677352, 0.35869148, 0.43742879, 0.4388087 , 0.39325689, 0.40411463, 0.34076527, 0.4002913 , 0.38073684, 0.42822759, 0.41065555, 0.36612017, 0.43793757, 0.38045494, 0.40073521, 0.43634931, 0.37228829, 0.38076058, 0.44028763, 0.40618622, 0.39886155, 0.39606878, 0.40121651, 0.42329785, 0.38391397, 0.48701045, 0.40852587, 0.38811837, 0.33700027, 0.43337934, 0.47638898, 0.45862387, 0.43101757, 0.39399701, 0.37816887, 0.34243431, 0.40166362, 0.3677345 , 0.48000176, 0.46025401, 0.42700476, 0.34592185, 0.41396936, 0.3651648 , 0.44434418, 0.42944586, 0.37357513, 0.45325424, 0.35135126, 0.34060331, 0.44891731, 0.45647405, 0.40584386, 0.40792945, 0.37417043, 0.40859987, 0.48744066, 0.45568601, 0.40720023, 0.38534174, 0.44418675, 0.40091154, 0.36556   , 0.40113015, 0.37258915, 0.44318192, 0.38091808, 0.40725597, 0.44666564, 0.42190333, 0.44481681, 0.41919932, 0.37032402, 0.48364551, 0.38748608, 0.44018272, 0.42203535, 0.37242747, 0.38219231, 0.46776887, 0.43337044, 0.42124322, 0.37882104, 0.44778111, 0.41846436, 0.37811701, 0.37155185, 0.39007756, 0.36378231, 0.42661165, 0.43822261, 0.40546708, 0.41911667, 0.4260626 , 0.42256451, 0.44192597, 0.47842638, 0.39611512, 0.44491116, 0.40365296, 0.39359214, 0.40003074, 0.34958918, 0.34758949, 0.45646971, 0.38078347, 0.42067093, 0.39756817, 0.41426262, 0.45689868, 0.42263988, 0.48026677, 0.44894483, 0.35304089, 0.40763657, 0.35102165, 0.40311662, 0.44168856, 0.42674332, 0.40034222, 0.37597472, 0.37988866, 0.49597058, 0.36669922, 0.50231546, 0.47759904, 0.41977028, 0.3902988 , 0.35337019, 0.29725319, 0.37085959, 0.40683181, 0.33962811, 0.3775262 , 0.40378711, 0.37522767, 0.43806618, 0.37608875, 0.38363954, 0.4213465 , 0.37685846, 0.43864085, 0.42072523, 0.41303825, 0.44085664, 0.44935243, 0.3955478 , 0.41700251, 0.42745432, 0.40076353, 0.44415625, 0.40592704, 0.42403648, 0.43164961, 0.43741185, 0.4556666 , 0.35447542, 0.36179497, 0.37609757, 0.41936549, 0.45255993, 0.39765959, 0.41473308, 0.45325442, 0.43660725, 0.41725395, 0.42584886, 0.35245624, 0.40770218, 0.34849235, 0.41924673, 0.42967222, 0.4688549 , 0.41986642, 0.5394729 , 0.41234063, 0.38889672, 0.4133863 , 0.48377739, 0.3985232 , 0.44467283, 0.40187751, 0.41207328, 0.38259148, 0.49482289, 0.40994346, 0.43842771, 0.46299092, 0.35792853, 0.43628973, 0.38300048, 0.4402988 , 0.37719632, 0.447099  , 0.46458036, 0.34070484, 0.38668328, 0.41877418, 0.39920467, 0.41402592, 0.46197827, 0.34998859, 0.44292424, 0.39554279, 0.45806025, 0.44549445, 0.41144303, 0.39757833, 0.44460934, 0.39282869, 0.40982084, 0.3594684 , 0.38035559, 0.46361533, 0.39866406, 0.45390917, 0.37363494, 0.42751835, 0.36809349, 0.3981875 , 0.38283569, 0.33765472, 0.445369  , 0.46432175, 0.3828271 , 0.40032819, 0.43784922, 0.40907506, 0.50620526, 0.39825537, 0.40494115, 0.42097051, 0.39813231, 0.42767821, 0.43632554, 0.48342796, 0.37171266, 0.4231365 , 0.39791793, 0.4475876 , 0.43187838, 0.36713241, 0.39348117, 0.37435029, 0.44677536, 0.3560875 , 0.41850455, 0.38217649, 0.37817251, 0.44770328, 0.43056134, 0.38866372, 0.42418107, 0.35271324, 0.44943607, 0.41989644, 0.4117774 , 0.40604735, 0.40890907, 0.33590615, 0.46407173, 0.43129958, 0.36415985, 0.38422561, 0.43792973, 0.41323115, 0.4359505 , 0.43611463, 0.36418954, 0.39182405, 0.39411455, 0.41871595, 0.46333644, 0.402323  , 0.44001463, 0.40980919, 0.46406623, 0.43420349, 0.40457103, 0.38281922, 0.4200635 , 0.45682402, 0.42409818, 0.43678774, 0.39269752, 0.51152078, 0.41304056, 0.44903095, 0.3799896 , 0.44601481, 0.42465758, 0.3995831 , 0.38351877, 0.39567814, 0.49077009, 0.4166894 , 0.42924459, 0.43517778, 0.49714309, 0.34822792, 0.45457007, 0.45281455, 0.37328413, 0.39353403, 0.43454553, 0.44074761, 0.4115068 , 0.41406096, 0.42452023, 0.3787139 , 0.43965875, 0.49540995, 0.41198105, 0.35261123, 0.41107871, 0.38119491, 0.37193428, 0.38633685, 0.32842662, 0.40204225, 0.42665654, 0.40166691, 0.40939109, 0.41806659, 0.3609013 , 0.37036398, 0.36511387, 0.45810674, 0.38218874, 0.40843999, 0.39675316, 0.41089759, 0.45017994, 0.48048135, 0.40035762, 0.38592168, 0.43293865, 0.38960311, 0.49343706, 0.36434481, 0.4042647 , 0.4543836 , 0.37766804, 0.37252239, 0.38376966, 0.4007445 , 0.40013226, 0.40464522, 0.39352434, 0.40585953, 0.38774478, 0.43955992, 0.38933552, 0.47584388, 0.4760254 , 0.38309879, 0.4010732 , 0.46586454, 0.37250797, 0.41343097, 0.41691298, 0.42565652, 0.39245694, 0.43781405, 0.39532442, 0.46479819, 0.37892093, 0.4500263 , 0.42672327, 0.36790712, 0.41575054, 0.36628736, 0.35657307, 0.37455605, 0.42584967, 0.44626351, 0.42206467, 0.40746804, 0.49480752, 0.40585813, 0.39371666, 0.38483937, 0.32532322, 0.37839034, 0.44029757, 0.43886105, 0.44089243, 0.48483716, 0.38290252, 0.44274085, 0.4272902 , 0.40004465, 0.37967661, 0.29926117, 0.46973071, 0.39067255, 0.40449049, 0.36781328, 0.46677963, 0.37546023, 0.455158  , 0.3808844 , 0.41382398, 0.45051137, 0.4279048 , 0.47032358, 0.34036995, 0.43181476, 0.44090817, 0.41262752, 0.42174053, 0.43467423, 0.43022294, 0.37072532, 0.43068552, 0.42300783, 0.38696066, 0.36009265, 0.34119649, 0.39879691, 0.4365699 , 0.4120221 , 0.47382627, 0.42169809, 0.40599731, 0.44671891, 0.40248377, 0.44969546, 0.35117912, 0.44837504, 0.4161964 , 0.37582456, 0.35299654, 0.447547  , 0.39787134, 0.3803233 , 0.45412813, 0.36251435, 0.45113205, 0.42711722, 0.35638102, 0.42258747, 0.45780058, 0.35630224, 0.39713166, 0.37472678, 0.37831073, 0.43158708, 0.36181206, 0.45090422, 0.32068871, 0.43781083, 0.44439732, 0.4035753 , 0.40448936, 0.37632135, 0.35958719, 0.46351404, 0.40932618, 0.4341114 , 0.38818929, 0.38353028, 0.45386913, 0.50000539, 0.42122936, 0.40654102, 0.36816651, 0.44763332, 0.41004633, 0.39898167, 0.44444691, 0.36822278, 0.4553816 , 0.3905132 , 0.36842322, 0.48547593, 0.44972635, 0.41782122, 0.45257978, 0.45659295, 0.42285171, 0.39763381, 0.41796586, 0.39381587, 0.46934179, 0.42922762, 0.38053444, 0.40544273, 0.36006186, 0.39863556, 0.3719792 , 0.39821203, 0.41790859, 0.49867499, 0.42365679, 0.395948  , 0.43571833, 0.34534889, 0.41997742, 0.41201298, 0.37578671, 0.41356327, 0.39392439, 0.44224059, 0.38535319, 0.41808058, 0.33271179, 0.46387916, 0.44893328, 0.40814264, 0.39180342, 0.43969064, 0.35560315, 0.4266996 , 0.38941229, 0.35687593, 0.40373073, 0.34140252, 0.40307342, 0.42094028, 0.39607329, 0.37907175, 0.41389525, 0.39529958, 0.45090839, 0.40201934, 0.42203752, 0.39398395, 0.39915548, 0.49363392, 0.4614152 , 0.47190431, 0.42186278, 0.40138577, 0.40398946, 0.31354679, 0.4615471 , 0.44052724, 0.40421449, 0.43339062, 0.42131888, 0.39299912, 0.43951129])

In [79]: se_orth_po_nosplit = np.array([0.03474502, 0.0373666 , 0.03254624, 0.035711  , 0.03857083, 0.03393274, 0.0382176 , 0.0390209 , 0.03947079, 0.03632686, 0.0365749 , 0.03596462, 0.03283355, 0.03305384, 0.03462809, 0.03429812, 0.04047603, 0.03751935, 0.03350184, 0.03692805, 0.03675086, 0.04425244, 0.03688826, 0.03667372, 0.04111085, 0.03012514, 0.03567342, 0.03630253, 0.03869279, 0.03591116, 0.03291957, 0.03330094, 0.03466816, 0.03615811, 0.03925414, 0.03463743, 0.0403616 , 0.03672733, 0.03673892, 0.03729507, 0.03656263, 0.0361764 , 0.03740284, 0.03674824, 0.03385807, 0.03696247, 0.03624528, 0.03540566, 0.03432279, 0.03781447, 0.03544402, 0.03242579, 0.03509169, 0.03933641, 0.03515456, 0.04092438, 0.03431629, 0.03421128, 0.03484018, 0.03407852, 0.03809609, 0.03848484, 0.0382654 , 0.03495158, 0.03619387, 0.03773587, 0.03797528, 0.03389219, 0.03663497, 0.03785326, 0.03551873, 0.03299111, 0.03513855, 0.03886106, 0.03445817, 0.03464812, 0.0355295 , 0.03802371, 0.0352706 , 0.03641776, 0.03786271, 0.03845134, 0.03586474, 0.03619399, 0.03436212, 0.03985137, 0.03525877, 0.0385634 , 0.04007947, 0.03799021, 0.03552911, 0.03579554, 0.03336541, 0.04141928, 0.03515444, 0.03668795, 0.03444747, 0.03644692, 0.03806484, 0.03519977, 0.03743296, 0.03828006, 0.03827395, 0.03657322, 0.03633241, 0.03422569, 0.03600341, 0.03973577, 0.03454769, 0.03568129, 0.0396222 , 0.03521892, 0.03596001, 0.03624428, 0.03815015, 0.03995477, 0.03826805, 0.03525698, 0.03742405, 0.03782724, 0.03844241, 0.03742421, 0.03438375, 0.03364354, 0.03845537, 0.03885686, 0.03643648, 0.03452413, 0.03600843, 0.0369478 , 0.03951252, 0.04147925, 0.03912529, 0.03211512, 0.03828445, 0.04122697, 0.03767405, 0.03814904, 0.03677246, 0.0348576 , 0.03664641, 0.03738636, 0.03694522, 0.03921987, 0.03652723, 0.03714045, 0.03334889, 0.03591158, 0.03467354, 0.03291863, 0.03650219, 0.03963865, 0.03836493, 0.03835041, 0.03321675, 0.03321789, 0.03548968, 0.03402733, 0.03633222, 0.0378797 , 0.03689956, 0.03718884, 0.03861813, 0.03437033, 0.0396973 , 0.03825877, 0.03611252, 0.03611327, 0.03678618, 0.03914326, 0.03612262, 0.03907715, 0.03660782, 0.03543502, 0.034366  , 0.03436277, 0.03323214, 0.03867857, 0.03855516, 0.03736977, 0.03163678, 0.0357661 , 0.03607132, 0.03876504, 0.04041912, 0.03634519, 0.03088368, 0.04378558, 0.03802604, 0.03509891, 0.03971062, 0.03689964, 0.03480082, 0.03983675, 0.03928926, 0.03992703, 0.04197775, 0.03720813, 0.04007649, 0.03307689, 0.03943535, 0.03518234, 0.03879254, 0.03356806, 0.03555913, 0.03467602, 0.03840389, 0.03858417, 0.03910251, 0.03937124, 0.03695466, 0.03822676, 0.04013834, 0.03398154, 0.03628905, 0.03605391, 0.03737559, 0.03754431, 0.03731786, 0.03372294, 0.03382883, 0.03872675, 0.0408826 , 0.03332793, 0.04086265, 0.03681539, 0.03775453, 0.03515851, 0.03418413, 0.03516572, 0.03302308, 0.03497077, 0.0376036 , 0.03127416, 0.03481038, 0.032526  , 0.03874042, 0.03619953, 0.03620319, 0.04098181, 0.04187841, 0.03502884, 0.03437674, 0.03790772, 0.03717506, 0.03745607, 0.03696607, 0.03843035, 0.03415598, 0.03953016, 0.03580827, 0.03824459, 0.03737082, 0.03784694, 0.03611907, 0.03467281, 0.03198953, 0.03810093, 0.03684028, 0.03511122, 0.03606661, 0.03401353, 0.03538895, 0.0342976 , 0.03729535, 0.03238319, 0.03912026, 0.03972276, 0.03902827, 0.03950146, 0.03682319, 0.03569845, 0.039429  , 0.03579186, 0.03471518, 0.03556643, 0.03674656, 0.03592277, 0.0395152 , 0.03486726, 0.03607796, 0.03755308, 0.03898473, 0.03776401, 0.04209196, 0.03472871, 0.03780762, 0.03604197, 0.03741701, 0.03777826, 0.03220387, 0.03437665, 0.03660562, 0.03364242, 0.03439096, 0.03905695, 0.0408217 , 0.03625206, 0.03527866, 0.03767158, 0.03844056, 0.03399458, 0.03530452, 0.03274726, 0.03356248, 0.03429015, 0.03689297, 0.03870866, 0.0376923 , 0.03621653, 0.04218239, 0.04052051, 0.03984298, 0.03756918, 0.03609664, 0.03872729, 0.04016341, 0.03726113, 0.03766057, 0.03861554, 0.03569534, 0.03717902, 0.03770473, 0.04025156, 0.03445772, 0.03484697, 0.0370166 , 0.0351166 , 0.0365101 , 0.0374368 , 0.0346713 , 0.03894735, 0.03490064, 0.03174345, 0.0385112 , 0.03815683, 0.03793529, 0.04031503, 0.0362836 , 0.03127785, 0.03453122, 0.03460265, 0.03765777, 0.03644693, 0.03743668, 0.03402657, 0.04032537, 0.03817767, 0.03306188, 0.031091  , 0.03503291, 0.03468745, 0.03430702, 0.03550759, 0.03727183, 0.02990325, 0.03680624, 0.03968029, 0.03608235, 0.03198201, 0.0366191 , 0.03998343, 0.04061129, 0.03567003, 0.04076703, 0.03249735, 0.03515599, 0.03485176, 0.035669  , 0.03549834, 0.03879247, 0.03661692, 0.03747362, 0.03750218, 0.03330484, 0.03813348, 0.033797  , 0.03391037, 0.04017033, 0.03433249, 0.03476942, 0.03520731, 0.03512518, 0.03375186, 0.03708254, 0.03703487, 0.03503332, 0.03616182, 0.03645462, 0.03523783, 0.03852401, 0.03614316, 0.03284501, 0.03464836, 0.03971259, 0.03955255, 0.03700798, 0.0381579 , 0.03613027, 0.03634116, 0.03535069, 0.03326997, 0.04079629, 0.04215011, 0.03784852, 0.03668303, 0.03487979, 0.03712058, 0.03848018, 0.03734685, 0.0349481 , 0.03699958, 0.03484379, 0.03480017, 0.0383092 , 0.041678  , 0.03849958, 0.03624649, 0.03924312, 0.03463224, 0.03685374, 0.03455844, 0.03348522, 0.03394397, 0.03537769, 0.03887363, 0.03827461, 0.03933226, 0.03423046, 0.03376462, 0.04089655, 0.03499454, 0.03622702, 0.04035379, 0.04054636, 0.03801992, 0.03507852, 0.03490228, 0.03317885, 0.03776315, 0.04063868, 0.03417157, 0.03586549, 0.03411777, 0.03295217, 0.03585279, 0.03938355, 0.03560154, 0.03433591, 0.03679912, 0.03626668, 0.03776974, 0.03864417, 0.03691031, 0.03631245, 0.03780573, 0.03659203, 0.03787791, 0.03729458, 0.03915565, 0.03684003, 0.03453042, 0.03888395, 0.03733987, 0.03710271, 0.03438019, 0.03809916, 0.03762763, 0.03580245, 0.03694712, 0.03945784, 0.03911459, 0.03689581, 0.03241027, 0.03787878, 0.03603995, 0.04165727, 0.04056771, 0.03741212, 0.04157788, 0.0383887 , 0.03631563, 0.03781401, 0.03979479, 0.03416006, 0.0341921 , 0.03618848, 0.03964278, 0.03551569, 0.03615303, 0.03525878, 0.03574053, 0.03594098, 0.04178191, 0.03929774, 0.03581196, 0.04015341, 0.03319067, 0.03153384, 0.03607218, 0.03691251, 0.03548286, 0.0346934 , 0.03886053, 0.03477746, 0.03550772, 0.03587398, 0.03568007, 0.03744178, 0.0349228 , 0.03687551, 0.03503053, 0.03286544, 0.03669241, 0.03896562, 0.0343098 , 0.03777013, 0.03480939, 0.0387271 , 0.0351315 , 0.03754386, 0.03496421, 0.03995719, 0.03707774, 0.0382146 , 0.03683755, 0.03623896, 0.03273244, 0.03571262, 0.03445738, 0.03952536, 0.03657445, 0.03454587, 0.03726281, 0.0382534 , 0.03129206, 0.03768886, 0.03430767, 0.04070874, 0.03799011, 0.03384805, 0.0375251 , 0.03590798, 0.03801495, 0.03763615, 0.03625218, 0.04115623, 0.03998008, 0.03596863, 0.03880255, 0.03579289, 0.03743173, 0.03760444, 0.03482858, 0.03092043, 0.03764129, 0.03918522, 0.03405991, 0.03793179, 0.03773335, 0.03510268, 0.0355164 , 0.03812738, 0.03702729, 0.03428584, 0.0385688 , 0.0361883 , 0.0374408 , 0.03668985, 0.03242703, 0.03392123, 0.0317929 , 0.04031644, 0.03506659, 0.04009986, 0.03490808, 0.03239399, 0.03968875, 0.03832643, 0.03697817, 0.04172446, 0.03641767, 0.03802434, 0.03432554, 0.0393749 , 0.03819441, 0.03672693, 0.03547376, 0.03470635, 0.03660539, 0.03643943, 0.03919675, 0.0361405 , 0.0357092 , 0.0378333 , 0.03754306, 0.0394014 , 0.03973461, 0.04056114, 0.03716176, 0.03680801, 0.03956678, 0.03753543, 0.03598327, 0.03675005, 0.03547101, 0.03492406, 0.03793042, 0.03602637, 0.03615463, 0.03547103, 0.03236276, 0.03696476, 0.03716882, 0.03786123, 0.04152208, 0.0399251 , 0.03797253, 0.03609592, 0.03853076, 0.03632484, 0.03520405, 0.0367671 , 0.03447667, 0.03734966, 0.03661531, 0.03458445, 0.03463842, 0.0371716 , 0.03547479, 0.04045816, 0.03632047, 0.03529348, 0.03648633, 0.03464473, 0.04066408, 0.03632672, 0.03852298, 0.03489493, 0.03893466, 0.03510144, 0.03716704, 0.03528462, 0.03274645, 0.0337673 , 0.03198426, 0.0395838 , 0.04101707, 0.03277293, 0.04074065, 0.03251893, 0.03694768, 0.03948034, 0.03528972, 0.03545367, 0.03282461, 0.03354317, 0.0345222 , 0.03136711, 0.04038137, 0.03186262, 0.03507791, 0.0414906 , 0.03570211, 0.03408069, 0.03395696, 0.03572162, 0.03459173, 0.04038807, 0.03742919, 0.03650051, 0.03371639, 0.03380714, 0.03407761, 0.0336904 , 0.03439459, 0.03640594, 0.03345293, 0.04019585, 0.04134589, 0.03516821, 0.0378304 , 0.03598071, 0.03453574, 0.03846343, 0.03718089, 0.03722151, 0.0362938 , 0.03440824, 0.0354824 , 0.03956783, 0.03707031, 0.03814283, 0.03349067, 0.04074838, 0.03481607, 0.03672595, 0.03990626, 0.03476584, 0.03966015, 0.03477156, 0.034339  , 0.03762172, 0.0370995 , 0.03470849, 0.04224772, 0.03291124, 0.03226651, 0.03696301, 0.03999309, 0.04208041, 0.03438727, 0.03539256, 0.03644022, 0.03480234, 0.03583202, 0.03857345, 0.03350579, 0.03714886, 0.03717429, 0.03530833, 0.03353564, 0.04307491, 0.03645676, 0.03686309, 0.0367092 , 0.03505246, 0.03179146, 0.03502657, 0.03505816, 0.03535941, 0.03823574, 0.03782026, 0.03577473, 0.03670732, 0.03679464, 0.03476963, 0.03889374, 0.03949057, 0.03865546, 0.03631931, 0.03409329, 0.03739669, 0.03325993, 0.03221564, 0.03833878, 0.03957746, 0.03584435, 0.03997407, 0.03960826, 0.03756598, 0.03733641, 0.0386708 , 0.03431129, 0.03770288, 0.03696621, 0.03523463, 0.0371088 , 0.03490614, 0.035653  , 0.03504013, 0.04009002, 0.03475992, 0.03571412, 0.03399289, 0.03837119, 0.03626078, 0.03563635, 0.03259052, 0.03989942, 0.03941204, 0.03900715, 0.03197333, 0.0384862 , 0.03788241, 0.04003726, 0.03603506, 0.03401377, 0.04334113, 0.04094369, 0.04066732, 0.04200563, 0.03444455, 0.04031428, 0.03129243, 0.03565401, 0.03737025, 0.03639366, 0.03277422, 0.03440789, 0.03223552, 0.03970053, 0.0346974 , 0.04086497, 0.03948381, 0.0368716 , 0.03481614, 0.03764524, 0.03437654, 0.03768604, 0.03475278, 0.0377687 , 0.0356684 , 0.04110741, 0.03516462, 0.03384485, 0.03392398, 0.03614618, 0.03474271, 0.03807704, 0.03889803, 0.04126355, 0.03592061, 0.03792865, 0.03459002, 0.03689696, 0.03525553, 0.03818139, 0.03975973, 0.03604507, 0.03658735, 0.04199084, 0.0359869 , 0.03620933, 0.03487707, 0.04071032, 0.03694701, 0.03910624, 0.03560849, 0.03885618, 0.03690596, 0.04243034, 0.03618007, 0.0397088 , 0.03370807, 0.03754302, 0.03168435, 0.03774717, 0.03630268, 0.03329076, 0.03146299, 0.04447259, 0.0410724 , 0.03736169, 0.0336196 , 0.03825899, 0.03744144, 0.04050642, 0.03529018, 0.03470333, 0.03860355, 0.03561639, 0.03627923, 0.03813162, 0.04057664, 0.03332849, 0.03969077, 0.03634978, 0.03917337, 0.03650846, 0.03467217, 0.03198052, 0.0386248 , 0.03941164, 0.0363901 , 0.03570452, 0.03906684, 0.03918833, 0.03749422, 0.03694331, 0.03682521, 0.04132099, 0.03731989, 0.03337376, 0.03387718, 0.04181991, 0.03646947, 0.03333412, 0.03860092, 0.03489202, 0.03532625, 0.03593162, 0.03604625, 0.03726524, 0.03723409, 0.03618784, 0.03247795, 0.03773535, 0.0381503 , 0.035616  , 0.03683644, 0.03373601, 0.04030972, 0.0342309 , 0.03353867, 0.03739194, 0.03584757, 0.03754637, 0.03965457, 0.03587568, 0.03843132, 0.03723711, 0.03364555, 0.03801765, 0.03954501, 0.03919557, 0.03598286, 0.0331916 , 0.03302435, 0.03921672, 0.03782883, 0.03787895, 0.03720195, 0.03426919, 0.03843508, 0.03765756, 0.03658322, 0.03653467, 0.03603962, 0.03587782, 0.03827373, 0.03529358, 0.03287978, 0.03425231, 0.0324074 , 0.03792556, 0.04154412, 0.03515388, 0.03634466, 0.0400113 , 0.034952  , 0.03427303, 0.03561047, 0.03870101, 0.04051633, 0.03391229, 0.03566566, 0.03549207, 0.03462774, 0.0346016 , 0.03661904, 0.03340004, 0.03263238, 0.03592759, 0.03652783, 0.03363493, 0.04014916, 0.0373243 , 0.03569296, 0.03765387, 0.03373767, 0.03786649, 0.03665141, 0.040085  , 0.03916567, 0.03762358, 0.03805482, 0.03526314, 0.03691169, 0.03471357, 0.03976527, 0.03574635, 0.03773984, 0.03642111, 0.03648961, 0.03905214, 0.03505632, 0.03830454, 0.03571615, 0.0380485 , 0.03712205, 0.03357085, 0.03427145, 0.03841388, 0.03599436, 0.03768774, 0.03368026, 0.03557021, 0.04037147, 0.03826648, 0.03545627, 0.0361974 , 0.03457355, 0.03951696, 0.03935793, 0.04005394, 0.03675155, 0.03694277, 0.03466973, 0.03672045, 0.03379401, 0.03248116, 0.03836208, 0.03720803, 0.03818912, 0.03828179, 0.03432679, 0.03796187, 0.03594795, 0.03584864])

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for i_rep in range(n_rep):
In [80]: for i_rep in range(1):
   ....:     (x, y, d) = data[i_rep]
   ....:     obj_dml_data = DoubleMLData.from_arrays(x, y, d)
   ....:     obj_dml_plr_orth_nosplit = DoubleMLPLR(obj_dml_data,
   ....:                                         ml_l, ml_m,
   ....:                                         n_folds=1,
   ....:                                         score='partialling out',
   ....:                                         apply_cross_fitting=False)
   ....:     obj_dml_plr_orth_nosplit.fit()
   ....:     this_theta = obj_dml_plr_orth_nosplit.coef[0]
   ....:     this_se = obj_dml_plr_orth_nosplit.se[0]
   ....:     print(np.abs(theta_orth_po_nosplit[i_rep] - this_theta))
   ....:     print(np.abs(se_orth_po_nosplit[i_rep] - this_se))
   ....:     theta_orth_po_nosplit[i_rep] = this_theta
   ....:     se_orth_po_nosplit[i_rep] = this_se
   ....: 
0.010195010813936811
0.001850874209900183

In [81]: plt.figure(constrained_layout=True);

In [82]: ax = sns.histplot((theta_orth_po_nosplit - alpha)/se_orth_po_nosplit,
   ....:                 color=face_colors[1], edgecolor = edge_colors[1],
   ....:                 stat='density', bins=30, label='Double ML (no sample splitting)');
   ....: 

In [83]: ax.axvline(0., color='k');

In [84]: xx = np.arange(-5, +5, 0.001)

In [85]: yy = stats.norm.pdf(xx)

In [86]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [87]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [88]: ax.set_xlim([-6., 6.]);

In [89]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/orth_po_nosplit.png
library(data.table)
lgr::get_logger("mlr3")$set_threshold("warn")
set.seed(4444)

# to speed up the illustration we hard-code the simulation results
theta_orth_po_nosplit = c(0.424894688, 0.415979258, 0.358214049, 0.401787264, 0.352802605, 0.374900867, 0.485234930, 0.401148984, 0.369991876, 0.475517512, 0.445076802, 0.373960370, 0.387824181, 0.342148215, 0.402114616, 0.351833721, 0.381125616, 0.461414960, 0.427616126, 0.418759210, 0.358268211, 0.401264980, 0.407889106, 0.393857741, 0.426785803, 0.368804415, 0.416975212, 0.484760806, 0.425441264, 0.390564373, 0.429884259, 0.403958684, 0.507137102, 0.439465474, 0.388448386, 0.383863300, 0.430680807, 0.442740900, 0.395929332, 0.438879887, 0.416105186, 0.463420783, 0.304417989, 0.467550408, 0.484586052, 0.470996524, 0.460477341, 0.401223146, 0.411119154, 0.383637282, 0.425053123, 0.466271156, 0.469006334, 0.363616413, 0.417576737, 0.513733653, 0.418133692, 0.348599183, 0.394726181, 0.384581212, 0.392746793, 0.365197270, 0.428143024, 0.404918669, 0.440169667, 0.394103063, 0.378160715, 0.395855561, 0.480792301, 0.382743709, 0.451031703, 0.455251318, 0.381408527, 0.381300737, 0.410594718, 0.417900354, 0.431650650, 0.427987923, 0.388522594, 0.404514383, 0.383377328, 0.407637457, 0.422540318, 0.396505143, 0.417604299, 0.433979261, 0.398505303, 0.438577405, 0.386354014, 0.496864697, 0.470265900, 0.398362215, 0.378489890, 0.397782706, 0.352943887, 0.458299569, 0.405409413, 0.411557225, 0.452976954, 0.399677608, 0.383131470, 0.359409202, 0.386673278, 0.403451635, 0.402101397, 0.345926992, 0.425853359, 0.414767703, 0.413546600, 0.425961817, 0.393060787, 0.423209103, 0.382419733, 0.439528814, 0.346969958, 0.406054155, 0.434916933, 0.413842955, 0.420869241, 0.396018540, 0.440530908, 0.463801605, 0.441943536, 0.392670005, 0.412549373, 0.418128097, 0.370135392, 0.433372541, 0.413511986, 0.417984837, 0.433422575, 0.395192998, 0.355008154, 0.481853182, 0.395635319, 0.415828051, 0.465411478, 0.377717947, 0.393839458, 0.416500090, 0.397860190, 0.365627420, 0.454536636, 0.375311328, 0.430895740, 0.381281709, 0.383331630, 0.459377553, 0.452957283, 0.435474077, 0.475775653, 0.418168929, 0.491069389, 0.367996790, 0.512591597, 0.413127082, 0.347189024, 0.371585245, 0.452311983, 0.387491017, 0.502240559, 0.420601769, 0.427401406, 0.392831214, 0.468965141, 0.415459641, 0.470943789, 0.433053303, 0.434626699, 0.492090441, 0.419246226, 0.418893912, 0.393065697, 0.388770405, 0.441625509, 0.412995748, 0.371077872, 0.429367874, 0.377048620, 0.372883541, 0.373757424, 0.370734880, 0.440019202, 0.446060065, 0.368311775, 0.358840911, 0.410658460, 0.434416070, 0.357136936, 0.405721983, 0.426689088, 0.461247188, 0.404427560, 0.486848662, 0.421560795, 0.448725346, 0.395054774, 0.416209154, 0.348607332, 0.366021039, 0.394709281, 0.430889800, 0.344462363, 0.477618944, 0.459546440, 0.339655440, 0.379558250, 0.474168015, 0.442126248, 0.434445686, 0.384672615, 0.434607996, 0.428411546, 0.379106440, 0.429089990, 0.441497373, 0.472405799, 0.420758530, 0.343717385, 0.366743818, 0.428770078, 0.455448048, 0.393978437, 0.346644741, 0.413489758, 0.465933477, 0.410372147, 0.380400118, 0.389768437, 0.433616164, 0.415860347, 0.397688077, 0.403562635, 0.333999464, 0.400165296, 0.418106933, 0.438916985, 0.348258431, 0.393831547, 0.376630297, 0.361524823, 0.446085218, 0.437275242, 0.418582123, 0.402979134, 0.379250484, 0.385105923, 0.490360011, 0.408958240, 0.432456309,
                        0.351920445, 0.447363475, 0.422481090, 0.430591197, 0.392504110, 0.418217743, 0.335004556, 0.372325037, 0.394052607, 0.323269074, 0.450976993, 0.414753060, 0.377835580, 0.393009569, 0.430968945, 0.408493740, 0.400109532, 0.343548576, 0.432738866, 0.385312627, 0.417914016, 0.445751407, 0.456904998, 0.427402045, 0.428451693, 0.432616192, 0.397268553, 0.384487737, 0.454374367, 0.410259806, 0.394052351, 0.386824902, 0.449221702, 0.387562801, 0.419401117, 0.452489229, 0.411449728, 0.370941031, 0.485727233, 0.432207428, 0.446356136, 0.428725027, 0.408534909, 0.463849885, 0.383363434, 0.397317715, 0.370839991, 0.422689252, 0.398367964, 0.399402307, 0.370772153, 0.388901162, 0.419421703, 0.421480883, 0.462461035, 0.402952908, 0.481567653, 0.380262787, 0.400084769, 0.410680051, 0.480213431, 0.422283869, 0.376365158, 0.385215532, 0.426120281, 0.410418090, 0.433670541, 0.377211515, 0.419357991, 0.415964247, 0.455015478, 0.317675157, 0.387075050, 0.408334191, 0.426357587, 0.439444693, 0.377670795, 0.464149481, 0.406615740, 0.454187707, 0.432317322, 0.421451013, 0.418353714, 0.444449725, 0.381350545, 0.387726995, 0.424795832, 0.440197280, 0.452127352, 0.416719835, 0.311493371, 0.422479433, 0.409537979, 0.414986548, 0.467710387, 0.420232182, 0.381676188, 0.388174915, 0.401078159, 0.447170278, 0.435258241, 0.338825490, 0.455670717, 0.461917584, 0.371304778, 0.376446660, 0.407706339, 0.422186563, 0.418115968, 0.416378061, 0.425279277, 0.428291259, 0.462693090, 0.418222657, 0.369201029, 0.420151461, 0.392211425, 0.431599930, 0.424963409, 0.342202797, 0.384637525, 0.380550985, 0.457112811, 0.393566169, 0.425138820, 0.415367175, 0.407742930, 0.401935672, 0.430092673, 0.397948321, 0.443193402, 0.459284304, 0.430411609, 0.405542103, 0.433985448, 0.427231711, 0.362992584, 0.401492971, 0.419008384, 0.348550839, 0.471964735, 0.446598128, 0.436886151, 0.368575038, 0.367530471, 0.401633597, 0.424980640, 0.454243346, 0.414387404, 0.416863374, 0.449528153, 0.503963861, 0.469473707, 0.441125251, 0.365749826, 0.434098011, 0.415426355, 0.417771687, 0.419604405, 0.367309353, 0.411200519, 0.430404379, 0.428630305, 0.455207160, 0.397395094, 0.317963341, 0.413866802, 0.373058861, 0.363022778, 0.433642126, 0.408401413, 0.402172901, 0.415956625, 0.426929765, 0.447624636, 0.407888648, 0.424093072, 0.403808267, 0.401864776, 0.404786678, 0.434549093, 0.421308095, 0.463228885, 0.381578411, 0.360937371, 0.430389043, 0.380815478, 0.425050042, 0.409222214, 0.449231897, 0.468960783, 0.403600201, 0.449153584, 0.393266075, 0.432475963, 0.470040732, 0.370270174, 0.411428716, 0.445065055, 0.465809180, 0.478426094, 0.482827469, 0.440886189, 0.342951435, 0.420371681, 0.431011999, 0.409995431, 0.364304974, 0.430555977, 0.469468645, 0.420829269, 0.401066443, 0.377822921, 0.324573196, 0.376868840, 0.417123950, 0.419508274, 0.364629906, 0.424054805, 0.383711305, 0.382673810, 0.375404460, 0.411889877, 0.417394647, 0.474884703, 0.420248148, 0.359983139, 0.430039395, 0.362279964, 0.352218095, 0.467685621, 0.391297314, 0.422716169, 0.432300645, 0.423483352, 0.413034621, 0.381545204, 0.443612460, 0.449914879, 0.370031098, 0.394246127, 0.418733550, 0.469678298, 0.407178606, 0.432198930, 0.414867318, 0.408681708, 0.434265691, 0.467060193, 0.391013760,
                        0.370400490, 0.332203204, 0.363481637, 0.429850822, 0.450047054, 0.431698023, 0.466034941, 0.400121872, 0.503031211, 0.446934294, 0.460041072, 0.431456780, 0.457649668, 0.422576622, 0.332316868, 0.472845396, 0.455770826, 0.397403289, 0.441297765, 0.433151706, 0.395843096, 0.371432785, 0.382138596, 0.423748251, 0.402355421, 0.472308119, 0.352218499, 0.416618010, 0.356814570, 0.431636611, 0.394538337, 0.373993666, 0.409556738, 0.428374106, 0.410665007, 0.453274019, 0.380463333, 0.365077040, 0.404261814, 0.436856490, 0.405327743, 0.417387191, 0.366897402, 0.383415388, 0.364644324, 0.474808617, 0.369956377, 0.443745943, 0.314597833, 0.435137100, 0.397470863, 0.366913406, 0.414212215, 0.458358528, 0.365783871, 0.389472053, 0.390800205, 0.426404960, 0.467304794, 0.422227455, 0.464829857, 0.408686483, 0.368035908, 0.423865983, 0.433479830, 0.451516349, 0.382986187, 0.360148917, 0.414429349, 0.372056454, 0.448279799, 0.396465210, 0.336651635, 0.415939450, 0.423274516, 0.441782734, 0.445279158, 0.457713399, 0.464028502, 0.417341788, 0.479052167, 0.364470659, 0.341975244, 0.450537833, 0.366797702, 0.401167599, 0.392824068, 0.371416939, 0.465633574, 0.394107951, 0.395270182, 0.384203394, 0.406193169, 0.458989859, 0.425523943, 0.403831818, 0.441603388, 0.463630643, 0.458745937, 0.383506306, 0.380828043, 0.324446665, 0.438192365, 0.432349193, 0.378082464, 0.423641862, 0.440539350, 0.421866949, 0.398939487, 0.360102156, 0.430645835, 0.406681322, 0.405615359, 0.457507748, 0.499485391, 0.445504548, 0.379768456, 0.366212804, 0.426411010, 0.442667618, 0.413089925, 0.356627005, 0.346204403, 0.414539759, 0.369000893, 0.410983419, 0.418884758, 0.436838293, 0.442840502, 0.372796312, 0.456826712, 0.439872488, 0.420979564, 0.458726471, 0.427222566, 0.414561165, 0.404129340, 0.437164782, 0.420125851, 0.444937697, 0.378823585, 0.344974252, 0.378473181, 0.326708387, 0.422673827, 0.411802218, 0.463528600, 0.480643262, 0.369553567, 0.539561102, 0.446754556, 0.443372240, 0.391506790, 0.420883675, 0.384909902, 0.428005736, 0.435572680, 0.380064121, 0.441688800, 0.427728771, 0.376879408, 0.386230389, 0.379297661, 0.391151078, 0.448742043, 0.426269009, 0.391016905, 0.361911038, 0.361260555, 0.375962888, 0.429031608, 0.453435995, 0.382849951, 0.418972156, 0.411782379, 0.409748513, 0.417185266, 0.474186128, 0.408962890, 0.423095877, 0.403080294, 0.407192386, 0.411146072, 0.371414033, 0.434524192, 0.458307494, 0.459465643, 0.383470468, 0.393895199, 0.441245225, 0.385601119, 0.457798268, 0.333568766, 0.392325004, 0.389500615, 0.419601265, 0.342127805, 0.410058017, 0.386873477, 0.419857392, 0.416583760, 0.413571437, 0.348420129, 0.306958517, 0.415446113, 0.433828085, 0.362749830, 0.439709459, 0.373498153, 0.408862604, 0.367324240, 0.410599367, 0.462074177, 0.417798870, 0.403447345, 0.486268512, 0.436681939, 0.353226945, 0.375727800, 0.400238336, 0.387701863, 0.434732159, 0.470295878, 0.388492069, 0.450566244, 0.375847217, 0.452672717, 0.410252985, 0.370101076, 0.401929643, 0.396687160, 0.409564069, 0.422040540, 0.470611612, 0.405628552, 0.412845597, 0.410790548, 0.406955232, 0.406718944, 0.448502718, 0.394616540, 0.397300376, 0.434718696, 0.378026061, 0.429331337, 0.394758391, 0.446681929, 0.416128251, 0.486614601, 0.338719225,
                        0.379557811, 0.416149459, 0.438549694, 0.408487185, 0.394909023, 0.471054009, 0.385801377, 0.398903948, 0.426567805, 0.388798764, 0.473609202, 0.381982662, 0.398691822, 0.387011715, 0.441720158, 0.384760231, 0.429064300, 0.446734393, 0.418929618, 0.425831265, 0.431901906, 0.398304481, 0.325154177, 0.449176834, 0.426711411, 0.462732600, 0.450886972, 0.369002936, 0.473904836, 0.409876993, 0.391839838, 0.414163386, 0.390136760, 0.419732527, 0.418566659, 0.354634774, 0.450677909, 0.414044049, 0.455101914, 0.377457834, 0.407166551, 0.463989578, 0.443941774, 0.464190729, 0.399992176, 0.365743954, 0.494537290, 0.389166628, 0.461950897, 0.384885929, 0.425542300, 0.392324863, 0.369717572, 0.411383107, 0.360734874, 0.412082713, 0.413211097, 0.460642582, 0.340431259, 0.447807429, 0.413854492, 0.363850727, 0.377037754, 0.373448238, 0.411695258, 0.434247387, 0.437846402, 0.420436823, 0.451136645, 0.459976008, 0.457703156, 0.410214227, 0.439866327, 0.408595226, 0.311587984, 0.389788276, 0.434837426, 0.393205506, 0.397440704, 0.429051957, 0.409268771, 0.441501688, 0.376344016, 0.456800297, 0.443762504, 0.485934342, 0.411445200, 0.415473004, 0.457860135, 0.428509101, 0.348680514, 0.382412030, 0.384236468, 0.336588701, 0.395033981, 0.470638735, 0.456460635, 0.374916181, 0.409757001, 0.446347336, 0.386195523, 0.437997392, 0.416817515, 0.401767758, 0.417448024, 0.383419763, 0.437394936, 0.390106036, 0.438424137, 0.415366444, 0.416113141, 0.397503991, 0.407284043, 0.419731523, 0.415320508, 0.374656927, 0.448380205, 0.434587373, 0.334040203, 0.381187524, 0.430973164, 0.462871380, 0.374971316, 0.434664582, 0.423872408, 0.353548703, 0.408951814, 0.386961873, 0.374368242, 0.365238833, 0.410072260, 0.374385573, 0.413393750, 0.430356486, 0.457390487, 0.437869531, 0.417503051, 0.417142259, 0.419814555, 0.494517700, 0.435496761, 0.494769645, 0.432470989, 0.430374049, 0.353567354, 0.354965171, 0.438851283, 0.420323761, 0.393051108, 0.479738224, 0.478709592, 0.457409926, 0.382295768, 0.432279881, 0.406922783, 0.370337217, 0.486575672, 0.433604426, 0.328854098, 0.442303787, 0.455974644, 0.379021371, 0.483716293, 0.361257180, 0.441799533, 0.461619525, 0.436204304, 0.400482903, 0.416440613, 0.422738340, 0.398063077, 0.420496873, 0.353993836, 0.382452566, 0.371148390, 0.428635151, 0.360623312, 0.435017107, 0.486246068, 0.403706028, 0.409318512, 0.475617780, 0.449477163, 0.443347279, 0.334113010, 0.404588645, 0.444905156, 0.443339740, 0.436970173, 0.383174883, 0.401506449, 0.422593340, 0.395204934, 0.327544686, 0.411575102, 0.407071333, 0.453808542, 0.426140167, 0.437071898, 0.447402657, 0.387552043, 0.356983603, 0.447273435, 0.444320809, 0.424265298, 0.450762016, 0.422511090, 0.425658227, 0.396261512, 0.454702873, 0.447998973, 0.357790158, 0.372444927, 0.375074800, 0.412820238, 0.386209275, 0.417595949, 0.447094826, 0.431459703, 0.422612480, 0.403658719, 0.412560423, 0.408525948, 0.419478656, 0.406359697, 0.445193045, 0.403698609, 0.468360722, 0.436780315, 0.424582248, 0.435778912, 0.421655511, 0.419587375, 0.363362782, 0.314487440, 0.413161689, 0.375812452, 0.409232797, 0.431542093, 0.381663699, 0.459229785, 0.405715553, 0.450246648, 0.385156654, 0.399908611, 0.495611859, 0.438489055, 0.434156073, 0.336363317, 0.462242061)
se_orth_po_nosplit = c(0.0369249937, 0.0366232166, 0.0352132615, 0.0357962562, 0.0345049556, 0.0361262917, 0.0385463535, 0.0368034228, 0.0354351281, 0.0333831231, 0.0402495762, 0.0335314336, 0.0343515619, 0.0365670189, 0.0337228740, 0.0333227216, 0.0426300264, 0.0440211182, 0.0382558092, 0.0336980296, 0.0382198398, 0.0392737882, 0.0358866245, 0.0371949430, 0.0334161164, 0.0386112083, 0.0367611265, 0.0367412759, 0.0379716336, 0.0411895083, 0.0381076337, 0.0386184276, 0.0398358082, 0.0387196574, 0.0388327060, 0.0364272833, 0.0339169542, 0.0380975564, 0.0362605086, 0.0404485292, 0.0339254053, 0.0358481896, 0.0398973515, 0.0418559718, 0.0322929223, 0.0391445722, 0.0352535863, 0.0407457193, 0.0381563624, 0.0324255617, 0.0405592833, 0.0369996847, 0.0345523241, 0.0387905589, 0.0386349948, 0.0365253978, 0.0433434719, 0.0398188984, 0.0362117055, 0.0342701997, 0.0400886743, 0.0379609911, 0.0333977515, 0.0393487648, 0.0369779531, 0.0375621374, 0.0325041742, 0.0387477077, 0.0380749138, 0.0373413643, 0.0379796819, 0.0373226004, 0.0376677267, 0.0349157821, 0.0346622644, 0.0355238235, 0.0381691113, 0.0349897123, 0.0378986526, 0.0350406392, 0.0333717668, 0.0365995511, 0.0358975624, 0.0394310793, 0.0360894113, 0.0348494460, 0.0350188627, 0.0379314350, 0.0395471213, 0.0348427081, 0.0352419296, 0.0356833101, 0.0317318338, 0.0388212687, 0.0389492142, 0.0363170519, 0.0379470806, 0.0368118802, 0.0343779606, 0.0367881789, 0.0342973037, 0.0377790637, 0.0326271478, 0.0359853488, 0.0373458914, 0.0358605895, 0.0327402839, 0.0380161151, 0.0379797917, 0.0340346274, 0.0393887944, 0.0353565289, 0.0366771994, 0.0357489017, 0.0357177390, 0.0392098998, 0.0415141917, 0.0386790734, 0.0340422201, 0.0352620909, 0.0352257514, 0.0365514568, 0.0422526465, 0.0378846512, 0.0349287423, 0.0342852895, 0.0377285062, 0.0395522624, 0.0366243053, 0.0356420055, 0.0337987406, 0.0351550723, 0.0403973846, 0.0343271190, 0.0371690023, 0.0402125590, 0.0379987646, 0.0371561830, 0.0377747611, 0.0387412979, 0.0342890640, 0.0362439912, 0.0399781737, 0.0354668345, 0.0355798503, 0.0378158282, 0.0373887839, 0.0367890081, 0.0364132958, 0.0316696876, 0.0366735911, 0.0375554456, 0.0351768749, 0.0402093755, 0.0388770688, 0.0350375306, 0.0362373368, 0.0368829639, 0.0374174714, 0.0376122238, 0.0396791162, 0.0377645583, 0.0344713625, 0.0344121739, 0.0384872790, 0.0349841773, 0.0367329137, 0.0415318771, 0.0380704513, 0.0366988115, 0.0354045825, 0.0362387461, 0.0338391083, 0.0348513246, 0.0391287468, 0.0398345559, 0.0370238403, 0.0376002404, 0.0373263167, 0.0403515262, 0.0382045983, 0.0358038382, 0.0379768912, 0.0404881572, 0.0329837069, 0.0366323084, 0.0373143173, 0.0367056216, 0.0394424637, 0.0338721006, 0.0363571591, 0.0358660136, 0.0354478615, 0.0371378037, 0.0371951176, 0.0397721191, 0.0377044514, 0.0365577228, 0.0348615115, 0.0396726795, 0.0365713485, 0.0359730608, 0.0395486556, 0.0340883207, 0.0365270000, 0.0375245803, 0.0362486326, 0.0351907161, 0.0352683426, 0.0371649834, 0.0408355838, 0.0433708840, 0.0384014082, 0.0364107251, 0.0396378805, 0.0375877073, 0.0369852690, 0.0391400903, 0.0377302961, 0.0355080999, 0.0387590883, 0.0390154314, 0.0376327689, 0.0371729544, 0.0362131718, 0.0394311839, 0.0397455758, 0.0338254334, 0.0339592893, 0.0350270473, 0.0365871407, 0.0348248381, 0.0397966778, 0.0352881053, 0.0343784640, 0.0349831541, 0.0348252297, 0.0355288461, 0.0347750894, 0.0359251796, 0.0377969821, 0.0344496764, 0.0364498354, 0.0407896156, 0.0302891372, 0.0367511518, 0.0362461083, 0.0338413879, 0.0376009260, 0.0416784692,
                    0.0355676088, 0.0354810273, 0.0347563980, 0.0390815703, 0.0365781628, 0.0356438064, 0.0370253095, 0.0346080207, 0.0366758485, 0.0365856649, 0.0357777501, 0.0333222235, 0.0384474677, 0.0372652799, 0.0340667506, 0.0392409054, 0.0358411180, 0.0354550356, 0.0392816686, 0.0378646966, 0.0364721933, 0.0403215102, 0.0348425990, 0.0351672287, 0.0362464031, 0.0358741667, 0.0380285793, 0.0392726268, 0.0385350072, 0.0319476245, 0.0338427123, 0.0348540533, 0.0369521168, 0.0398366717, 0.0389639752, 0.0370317966, 0.0371140538, 0.0355371713, 0.0363329517, 0.0374690989, 0.0390756382, 0.0326706498, 0.0439476087, 0.0359901097, 0.0382919101, 0.0376204892, 0.0376587002, 0.0365372987, 0.0381686041, 0.0390329021, 0.0333172334, 0.0374771801, 0.0370162654, 0.0365934335, 0.0345133055, 0.0377695837, 0.0383205767, 0.0342981905, 0.0360441143, 0.0350886870, 0.0364055532, 0.0350689849, 0.0351638326, 0.0389041461, 0.0393064094, 0.0383452294, 0.0405354213, 0.0324294873, 0.0372726981, 0.0347757225, 0.0354444328, 0.0385655046, 0.0361342930, 0.0368683660, 0.0364370618, 0.0362055159, 0.0356479739, 0.0370198029, 0.0389147441, 0.0381533923, 0.0378841099, 0.0375338872, 0.0397564525, 0.0383997468, 0.0372784222, 0.0355349409, 0.0382286022, 0.0370193756, 0.0335471387, 0.0361635481, 0.0364180793, 0.0347234531, 0.0344764278, 0.0338724454, 0.0382032583, 0.0371174726, 0.0403042829, 0.0389863381, 0.0357583539, 0.0346608756, 0.0371734722, 0.0410630651, 0.0383511631, 0.0353802392, 0.0357127875, 0.0362375087, 0.0430681387, 0.0401093829, 0.0358399973, 0.0382847912, 0.0307255113, 0.0342237485, 0.0428171846, 0.0372517454, 0.0386076704, 0.0378034563, 0.0360672409, 0.0357859946, 0.0385656925, 0.0373509222, 0.0368877062, 0.0359272464, 0.0336546963, 0.0335879692, 0.0368621306, 0.0383153424, 0.0386184533, 0.0363456546, 0.0399388852, 0.0365243547, 0.0411256024, 0.0364633097, 0.0316391551, 0.0344368511, 0.0377815592, 0.0369273729, 0.0402271924, 0.0383658713, 0.0343101963, 0.0355220437, 0.0351253139, 0.0374152945, 0.0349770422, 0.0364736648, 0.0374523052, 0.0373063848, 0.0362776648, 0.0359394270, 0.0354230225, 0.0402450722, 0.0403374147, 0.0362700810, 0.0341783098, 0.0352790805, 0.0362478930, 0.0422737100, 0.0397633564, 0.0342151953, 0.0349775972, 0.0383469899, 0.0326468495, 0.0376559285, 0.0360585156, 0.0358415977, 0.0339164796, 0.0391971651, 0.0379741386, 0.0328984950, 0.0333478044, 0.0339087152, 0.0392270743, 0.0369140592, 0.0356481616, 0.0335338925, 0.0358359237, 0.0359519495, 0.0383729767, 0.0380200474, 0.0392320072, 0.0349795492, 0.0385933769, 0.0385337152, 0.0339949367, 0.0368081394, 0.0364832561, 0.0369027300, 0.0348527406, 0.0353266428, 0.0409249736, 0.0349847219, 0.0373107503, 0.0362845900, 0.0357049963, 0.0374549170, 0.0328355998, 0.0352186631, 0.0360181482, 0.0339079916, 0.0356234022, 0.0368818532, 0.0377727168, 0.0404549723, 0.0378194702, 0.0339986616, 0.0347353022, 0.0341101278, 0.0363994038, 0.0454005713, 0.0364765251, 0.0381052499, 0.0354623023, 0.0416077888, 0.0385198360, 0.0371301870, 0.0340609225, 0.0381526038, 0.0398425724, 0.0395502167, 0.0347530350, 0.0360908058, 0.0362714648, 0.0377928170, 0.0367091680, 0.0347300577, 0.0383511940, 0.0455298064, 0.0345029973, 0.0358853526, 0.0366139751, 0.0371735171, 0.0369081979, 0.0388371790, 0.0363142955, 0.0361592014, 0.0336743480, 0.0398775837, 0.0371858894, 0.0369441537, 0.0342515133, 0.0330603885, 0.0366774175, 0.0372780305, 0.0384357725, 0.0327281233, 0.0398455960, 0.0349781592, 0.0332261588, 0.0335007409, 0.0343487372, 0.0344446637,
                    0.0373896634, 0.0360469614, 0.0384601466, 0.0379069720, 0.0344681226, 0.0321005301, 0.0372949422, 0.0376218266, 0.0384834302, 0.0415069849, 0.0361675933, 0.0411957439, 0.0352347018, 0.0370950773, 0.0363468156, 0.0391674776, 0.0359043016, 0.0343064231, 0.0381767329, 0.0381724977, 0.0376863880, 0.0362853697, 0.0473642657, 0.0321476669, 0.0337037424, 0.0361915748, 0.0399475564, 0.0438185360, 0.0343215024, 0.0394374795, 0.0328045276, 0.0363354500, 0.0390130052, 0.0402113042, 0.0331546111, 0.0399187023, 0.0385610432, 0.0335671335, 0.0388047857, 0.0382630539, 0.0352719847, 0.0356151542, 0.0334228344, 0.0368779390, 0.0399147580, 0.0372539437, 0.0376295519, 0.0342599493, 0.0355239098, 0.0348426572, 0.0340256326, 0.0343128218, 0.0372396122, 0.0369769539, 0.0394337923, 0.0339594669, 0.0356773800, 0.0365046239, 0.0410308833, 0.0338451879, 0.0337491141, 0.0399865890, 0.0338668098, 0.0388658337, 0.0374178512, 0.0370322112, 0.0434228447, 0.0392062958, 0.0379827098, 0.0379192708, 0.0334753337, 0.0387883328, 0.0368278599, 0.0354812858, 0.0353263303, 0.0387281325, 0.0392107061, 0.0366563188, 0.0348989677, 0.0349570814, 0.0365983319, 0.0390011130, 0.0389533555, 0.0352820147, 0.0451128067, 0.0358390871, 0.0382993401, 0.0381725299, 0.0374396881, 0.0361240319, 0.0375975481, 0.0429443388, 0.0377616709, 0.0394815698, 0.0379874691, 0.0348771133, 0.0353325382, 0.0399458594, 0.0357562535, 0.0354703396, 0.0371421311, 0.0349452848, 0.0335497368, 0.0360487611, 0.0381963919, 0.0368377269, 0.0387121263, 0.0399682368, 0.0326218785, 0.0397446149, 0.0361055492, 0.0377749879, 0.0371968263, 0.0353627786, 0.0353910346, 0.0343485802, 0.0367565148, 0.0413084443, 0.0367265558, 0.0354179943, 0.0382604067, 0.0365711243, 0.0405838474, 0.0382653708, 0.0339588753, 0.0347804883, 0.0350120577, 0.0359922676, 0.0369672072, 0.0351613400, 0.0403676382, 0.0342321575, 0.0383123398, 0.0373524826, 0.0367792678, 0.0381369283, 0.0392099553, 0.0352038618, 0.0411622304, 0.0389699820, 0.0343076621, 0.0405775834, 0.0411801748, 0.0356677802, 0.0366416736, 0.0405571097, 0.0364058481, 0.0346285443, 0.0414215902, 0.0339456792, 0.0389323963, 0.0368766661, 0.0364887226, 0.0355923593, 0.0385476311, 0.0361379482, 0.0347195865, 0.0364422042, 0.0364172493, 0.0330822207, 0.0397386702, 0.0370599053, 0.0361456332, 0.0353346394, 0.0382634901, 0.0328174827, 0.0364344161, 0.0352058716, 0.0359885506, 0.0360347605, 0.0407330211, 0.0397713058, 0.0363578603, 0.0360970823, 0.0336726056, 0.0360769004, 0.0361774017, 0.0375372853, 0.0342849274, 0.0377435977, 0.0331884339, 0.0357310450, 0.0384191739, 0.0419794197, 0.0352883571, 0.0353893693, 0.0349984920, 0.0350303481, 0.0373690518, 0.0323551856, 0.0370063562, 0.0354295781, 0.0407199139, 0.0358561220, 0.0385965794, 0.0350956698, 0.0385640688, 0.0320200370, 0.0355708851, 0.0367567424, 0.0398889105, 0.0337766114, 0.0420417317, 0.0366275042, 0.0375734840, 0.0373726871, 0.0326122782, 0.0365790073, 0.0344297953, 0.0387711616, 0.0374603423, 0.0372834867, 0.0366211848, 0.0347407690, 0.0363108899, 0.0350238267, 0.0317626286, 0.0331506020, 0.0408579454, 0.0389398819, 0.0399149633, 0.0376256461, 0.0350371339, 0.0386344787, 0.0382209044, 0.0358302799, 0.0346141886, 0.0350192453, 0.0391874375, 0.0381368396, 0.0394854722, 0.0362065382, 0.0342822668, 0.0362374841, 0.0378217639, 0.0398215542, 0.0365463994, 0.0413244552, 0.0397431888, 0.0355421117, 0.0394554041, 0.0327252997, 0.0368132145, 0.0367869076, 0.0368758911, 0.0411303623, 0.0362732663, 0.0390759891, 0.0340982866, 0.0403384514,
                    0.0318183239, 0.0361099221, 0.0402409129, 0.0384354063, 0.0343115790, 0.0368494662, 0.0402420624, 0.0353061786, 0.0338574691, 0.0371088912, 0.0391739661, 0.0370644997, 0.0391891831, 0.0380362254, 0.0404687271, 0.0404906474, 0.0352339228, 0.0383117640, 0.0396372971, 0.0339371955, 0.0356753996, 0.0339298625, 0.0330988736, 0.0376727491, 0.0367847135, 0.0381433694, 0.0326747712, 0.0391429991, 0.0376406387, 0.0352639365, 0.0370389503, 0.0338770548, 0.0358137198, 0.0338629149, 0.0363082160, 0.0354460648, 0.0343265756, 0.0381136419, 0.0356454636, 0.0371229587, 0.0389978427, 0.0402244046, 0.0382496773, 0.0394424714, 0.0353786233, 0.0380071075, 0.0382076460, 0.0395020689, 0.0385407280, 0.0369531474, 0.0357005596, 0.0374634732, 0.0379451792, 0.0401219270, 0.0347805074, 0.0361252182, 0.0352261792, 0.0352649148, 0.0384631887, 0.0370160547, 0.0385053752, 0.0350962715, 0.0387306736, 0.0369875480, 0.0404257489, 0.0461123938, 0.0366037343, 0.0351987497, 0.0361276201, 0.0365775610, 0.0388976575, 0.0380851196, 0.0345951130, 0.0370417913, 0.0364155305, 0.0366196088, 0.0368103509, 0.0361618694, 0.0380338390, 0.0396245699, 0.0346361865, 0.0405216381, 0.0372940104, 0.0363723035, 0.0356640541, 0.0385326683, 0.0362931946, 0.0421462758, 0.0338109984, 0.0357543058, 0.0374628359, 0.0362797844, 0.0368728312, 0.0364604038, 0.0385642164, 0.0399893332, 0.0336799753, 0.0395206713, 0.0388872471, 0.0382730401, 0.0353623359, 0.0352444078, 0.0382368267, 0.0381393840, 0.0343350981, 0.0337197178, 0.0369189299, 0.0349719620, 0.0333890391, 0.0396441517, 0.0361873774, 0.0378307358, 0.0365695005, 0.0396327142, 0.0331171659, 0.0432410971, 0.0380011748, 0.0369813756, 0.0396292617, 0.0367488363, 0.0348375991, 0.0363480151, 0.0347260403, 0.0371735622, 0.0399512827, 0.0382587505, 0.0362809042, 0.0344871085, 0.0394235255, 0.0353605375, 0.0344596148, 0.0382193516, 0.0372817520, 0.0362770657, 0.0362057784, 0.0368400217, 0.0361431971, 0.0397821566, 0.0391969913, 0.0380037971, 0.0399016978, 0.0373176775, 0.0389868924, 0.0354224897, 0.0377122574, 0.0395566809, 0.0386080910, 0.0371366835, 0.0343289156, 0.0332663013, 0.0330794474, 0.0388330658, 0.0397220703, 0.0388879765, 0.0384766482, 0.0409410321, 0.0414657279, 0.0375928777, 0.0386564545, 0.0377466918, 0.0354752347, 0.0345848544, 0.0346798247, 0.0387448445, 0.0394138765, 0.0353539490, 0.0299221885, 0.0366166852, 0.0372525184, 0.0372967391, 0.0339701181, 0.0366998335, 0.0384988327, 0.0378874575, 0.0420594119, 0.0363607648, 0.0360699822, 0.0317958512, 0.0404294042, 0.0352864907, 0.0405165125, 0.0399594364, 0.0361487076, 0.0374133456, 0.0374805363, 0.0355464495, 0.0392695227, 0.0337534926, 0.0384322112, 0.0391902532, 0.0375980277, 0.0375924745, 0.0352334383, 0.0370078136, 0.0399579600, 0.0360427313, 0.0382787029, 0.0350579378, 0.0401883559, 0.0319766776, 0.0370449943, 0.0404588657, 0.0407541195, 0.0344746390, 0.0412191332, 0.0358989477, 0.0366126875, 0.0370809996, 0.0399497678, 0.0355534343, 0.0393131128, 0.0370407940, 0.0363187432, 0.0389475031, 0.0378005386, 0.0377157383, 0.0353959562, 0.0385682187, 0.0377720111, 0.0388690038, 0.0391966137, 0.0405436846, 0.0384275227, 0.0342578823, 0.0422762326, 0.0332816830, 0.0386548470, 0.0369299494, 0.0351850600, 0.0363734045, 0.0362109816, 0.0364759838, 0.0368868785, 0.0367005653, 0.0383874488, 0.0342395609, 0.0347803973, 0.0392387853, 0.0402901017, 0.0349486732, 0.0388709549, 0.0385755033, 0.0325223829, 0.0366812686, 0.0342228295, 0.0356556147, 0.0380793542, 0.0375113139, 0.0381656074, 0.0383364452)

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for (i_rep in seq_len(n_rep)){
for (i_rep in seq_len(1)) {
    df = data[[i_rep]]
    obj_dml_data = double_ml_data_from_data_frame(df, y_col = "y", d_cols = "d")
    obj_dml_plr_orth_nosplit = DoubleMLPLR$new(obj_dml_data,
                                            ml_l, ml_m,
                                            n_folds=1,
                                            score='partialling out',
                                            apply_cross_fitting=FALSE)
    obj_dml_plr_orth_nosplit$fit()
    this_theta = obj_dml_plr_orth_nosplit$coef
    this_se = obj_dml_plr_orth_nosplit$se
    print(abs(theta_orth_po_nosplit[i_rep] - this_theta))
    print(abs(se_orth_po_nosplit[i_rep] - this_se))
    theta_orth_po_nosplit[i_rep] = this_theta
    se_orth_po_nosplit[i_rep] = this_se
}

g_nosplit = ggplot(data.frame(theta_rescaled=(theta_orth_po_nosplit - alpha)/se_orth_po_nosplit), aes(x = theta_rescaled)) +
                geom_histogram(aes(y=after_stat(density), x=theta_rescaled, colour = "Double ML (no sample splitting)", fill="Double ML (no sample splitting)"),
                            bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Double ML (no sample splitting)", "N(0, 1)"),
                    values=c("Double ML (no sample splitting)"="dark orange", "N(0, 1)"='black')) +
                scale_fill_manual(name='',,
                    breaks=c("Double ML (no sample splitting)", "N(0, 1)"),
                    values=c("Double ML (no sample splitting)"="dark orange", "N(0, 1)"=NA)) +
                xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_nosplit
           d 
1.580585e-10 
           d 
2.869787e-11 
../_images/basics_6_1.png

Using sample splitting, overcomes the bias induced by overfitting.

In [90]: import numpy as np

In [91]: np.random.seed(5555)

# to speed up the illustration we hard-code the simulation results
In [92]: theta_dml_po = np.array([0.52876386, 0.49642496, 0.43558359, 0.48385395, 0.48263744, 0.52065436, 0.51196604, 0.45457013, 0.50236773, 0.60226776, 0.49525345, 0.54929426, 0.55862886, 0.38668434, 0.46651516, 0.48596014, 0.51073451, 0.47555414, 0.56154942, 0.47712008, 0.45908535, 0.47905771, 0.48119272, 0.5039857 , 0.48549178, 0.44828651, 0.51054201, 0.46965257, 0.44771795, 0.54639828, 0.47136481, 0.58571177, 0.40240481, 0.43868009, 0.46543858, 0.44238912, 0.45729493, 0.55316233, 0.49995909, 0.53027911, 0.48020647, 0.5191674 , 0.49229801, 0.37730406, 0.57612697, 0.50399902, 0.49049858, 0.51522608, 0.51054361, 0.4939221 , 0.48388515, 0.49238434, 0.47703209, 0.51727205, 0.61579399, 0.38693497, 0.55208572, 0.48290605, 0.49366392, 0.47067728, 0.48912104, 0.54112017, 0.54915469, 0.48089163, 0.56427844, 0.46009275, 0.4533473 , 0.49321491, 0.56400308, 0.56071557, 0.4453699 , 0.48957027, 0.50948593, 0.47617631, 0.49869524, 0.52732989, 0.49713173, 0.51638675, 0.5039623 , 0.53514343, 0.52809171, 0.48055678, 0.47932269, 0.44400388, 0.43742165, 0.5035799 , 0.55940179, 0.52720895, 0.48898253, 0.55113636, 0.38530608, 0.48212808, 0.56255715, 0.4681873 , 0.50922832, 0.49665169, 0.49973596, 0.50728249, 0.61919775, 0.52980464, 0.4470384 , 0.54970346, 0.4603203 , 0.50395574, 0.44948521, 0.59271845, 0.54610525, 0.48435625, 0.40402406, 0.49332716, 0.42959719, 0.48235224, 0.44457234, 0.43675964, 0.48845666, 0.450786  , 0.47855978, 0.4693617 , 0.48993912, 0.41517384, 0.45892182, 0.60196253, 0.50991046, 0.47869586, 0.39594481, 0.58051677, 0.45685749, 0.45722061, 0.48340673, 0.46928463, 0.50811054, 0.48351326, 0.49455325, 0.47532855, 0.45697168, 0.52864274, 0.51573529, 0.55979803, 0.46307792, 0.49551285, 0.4476106 , 0.47584211, 0.57505639, 0.47849081, 0.5754398 , 0.42882078, 0.43890495, 0.5712939 , 0.45392337, 0.54160894, 0.56094447, 0.47404527, 0.47344072, 0.46475148, 0.5162425 , 0.61577599, 0.48598403, 0.4706845 , 0.43193503, 0.60009588, 0.49000676, 0.46722224, 0.53955457, 0.53058301, 0.49350086, 0.46416138, 0.56295573, 0.50641166, 0.50500217, 0.53639407, 0.53181473, 0.49211802, 0.5137631 , 0.47101913, 0.50834946, 0.49639409, 0.49041039, 0.58718694, 0.5053225 , 0.47442319, 0.45029834, 0.53214004, 0.48029363, 0.43771314, 0.41368455, 0.43934673, 0.42540836, 0.45567131, 0.56527456, 0.50845985, 0.44297089, 0.48081024, 0.49390183, 0.41014255, 0.50802301, 0.4715952 , 0.44784824, 0.52827121, 0.461319  , 0.4661665 , 0.52817668, 0.5774521 , 0.4795185 , 0.51946092, 0.45543458, 0.45574257, 0.48488458, 0.48652943, 0.54044881, 0.55479025, 0.44064243, 0.62755167, 0.42012331, 0.40775333, 0.43366019, 0.52687122, 0.4517471 , 0.53678077, 0.50584558, 0.53164932, 0.53117984, 0.50457742, 0.46806336, 0.52904057, 0.5307677 , 0.54662925, 0.45878668, 0.49324139, 0.574838  , 0.49137141, 0.58268286, 0.5924264 , 0.62310897, 0.47510252, 0.53649311, 0.57229299, 0.51940046, 0.45731134, 0.54884152, 0.48680994, 0.51510473, 0.50922301, 0.51677578, 0.57780639, 0.46816876, 0.44897551, 0.51321758, 0.49450203, 0.42872782, 0.4365137 , 0.4628704 , 0.51399804, 0.55653439, 0.52488332, 0.50600489, 0.48140922, 0.50350718, 0.52654721, 0.59815318, 0.42071962, 0.47969415, 0.4456638 , 0.50211309, 0.49697633, 0.44140602, 0.53930818, 0.47884922, 0.56818849, 0.51630494, 0.48671292, 0.46039979, 0.41114395, 0.39818181, 0.56145449, 0.542998  , 0.50010098, 0.49820963, 0.49003785, 0.50305572, 0.51292791, 0.48933725, 0.45660895, 0.49518821, 0.4849069 , 0.52267743, 0.50392296, 0.58937665, 0.47274635, 0.56755771, 0.38741005, 0.52876889, 0.49566081, 0.50850134, 0.44876604, 0.43954376, 0.49462121, 0.59135693, 0.46764294, 0.58774516, 0.42427519, 0.55204104, 0.59373285, 0.5284568 , 0.47892363, 0.46903582, 0.473618  , 0.53177486, 0.42273053, 0.52900964, 0.48550055, 0.50106813, 0.45814701, 0.4722137 , 0.57443057, 0.39776497, 0.49355381, 0.36617604, 0.50976518, 0.52859814, 0.52722868, 0.61453654, 0.45841707, 0.55796556, 0.55644629, 0.5506848 , 0.4702159 , 0.50083763, 0.53856514, 0.46602807, 0.45204245, 0.48080515, 0.56483207, 0.45621144, 0.42794771, 0.4860271 , 0.46479965, 0.56875931, 0.41161689, 0.55302315, 0.47271993, 0.50344196, 0.42053369, 0.52565845, 0.43104463, 0.43922226, 0.57412536, 0.49435242, 0.5598449 , 0.50651293, 0.4243393 , 0.47901695, 0.42058707, 0.5476903 , 0.50184981, 0.57823467, 0.55067893, 0.51966014, 0.41881399, 0.44953744, 0.46319358, 0.53574066, 0.45995912, 0.47871539, 0.56629616, 0.57595297, 0.53876127, 0.53609786, 0.52978709, 0.53875115, 0.50847709, 0.4149362 , 0.45260669, 0.4536379 , 0.50394067, 0.42305305, 0.41424964, 0.52197237, 0.48594172, 0.45009749, 0.4307894 , 0.56654082, 0.52400503, 0.50464779, 0.4883888 , 0.50770741, 0.44965224, 0.48960481, 0.55406137, 0.47093463, 0.46452095, 0.47775312, 0.49929834, 0.54082214, 0.48656641, 0.44160879, 0.40050997, 0.43967865, 0.52972772, 0.48894344, 0.48959524, 0.45225519, 0.46477098, 0.45606621, 0.5488213 , 0.42547011, 0.49625743, 0.4865749 , 0.49467224, 0.55015222, 0.50699681, 0.47427151, 0.43403248, 0.42448919, 0.39432154, 0.48474832, 0.47421844, 0.53084624, 0.46260523, 0.45064904, 0.48230808, 0.43730637, 0.51041301, 0.47497435, 0.49359209, 0.5595982 , 0.48490794, 0.51250825, 0.46914558, 0.53257313, 0.54640514, 0.55242549, 0.43611181, 0.52036922, 0.47315045, 0.46437181, 0.47094681, 0.52144713, 0.52288962, 0.52173716, 0.48752518, 0.52550315, 0.50604638, 0.52228596, 0.49880518, 0.50851985, 0.4465949 , 0.52202277, 0.50249377, 0.46322091, 0.54615601, 0.50894802, 0.43345177, 0.50954733, 0.46339897, 0.46015515, 0.50448629, 0.51675392, 0.50012197, 0.44156462, 0.53740657, 0.53755287, 0.51308269, 0.49421434, 0.39274913, 0.47712458, 0.47812675, 0.49915688, 0.53254843, 0.42084555, 0.46325418, 0.49086648, 0.45019164, 0.5420365 , 0.47279955, 0.48982796, 0.54589376, 0.51462906, 0.43819174, 0.50983744, 0.50781399, 0.49550464, 0.46471352, 0.58631511, 0.47949176, 0.51639418, 0.39523312, 0.51664646, 0.5448198 , 0.56068757, 0.50757457, 0.47905316, 0.45066173, 0.41872143, 0.50006031, 0.42814963, 0.57007205, 0.58021248, 0.53159123, 0.42537663, 0.51625064, 0.47240764, 0.55303755, 0.48823736, 0.42029816, 0.53373549, 0.44653573, 0.43038701, 0.57681681, 0.54862281, 0.5205924 , 0.50207264, 0.46024779, 0.49115148, 0.58285578, 0.56729901, 0.50065596, 0.43313588, 0.53193915, 0.46971056, 0.46810937, 0.54975298, 0.44592224, 0.5273588 , 0.45066263, 0.49022521, 0.54036456, 0.52373846, 0.51341698, 0.49523554, 0.46354297, 0.59599975, 0.46715844, 0.51362765, 0.49410913, 0.44571835, 0.41595069, 0.57077163, 0.52015364, 0.48560591, 0.48571281, 0.51829923, 0.47543306, 0.46038   , 0.44356321, 0.46757523, 0.46887054, 0.55768647, 0.54349256, 0.47197434, 0.51751084, 0.51076787, 0.49690516, 0.60331217, 0.57465717, 0.51494865, 0.56925775, 0.47763364, 0.46602821, 0.5187162 , 0.45728743, 0.37034602, 0.54977269, 0.4680515 , 0.5262913 , 0.48117704, 0.49573812, 0.54406615, 0.51055961, 0.56104265, 0.5592123 , 0.41827194, 0.527187  , 0.46604307, 0.49439706, 0.53662182, 0.51926518, 0.47345959, 0.47946106, 0.47932428, 0.59299744, 0.42411538, 0.60750248, 0.56642017, 0.51119554, 0.49077337, 0.40567808, 0.37298201, 0.48068202, 0.4868408 , 0.41970932, 0.45143647, 0.48364514, 0.4945257 , 0.49703403, 0.49551628, 0.44295951, 0.53390061, 0.43523352, 0.49790843, 0.53749617, 0.46802951, 0.55940488, 0.52359195, 0.50736714, 0.52502905, 0.48463152, 0.45303868, 0.57144172, 0.48372973, 0.53818662, 0.50312434, 0.50637077, 0.54574298, 0.41583979, 0.48042361, 0.50222613, 0.47359926, 0.56900104, 0.46190257, 0.55831883, 0.56685946, 0.52938241, 0.49552427, 0.50929147, 0.47357133, 0.49662637, 0.4343192 , 0.53597924, 0.53930657, 0.53026288, 0.4861995 , 0.61926515, 0.52733928, 0.45598938, 0.53494507, 0.52942118, 0.47078208, 0.53457652, 0.48507914, 0.50306637, 0.4412238 , 0.59952472, 0.52392443, 0.54847361, 0.56994672, 0.41829809, 0.5814434 , 0.45197069, 0.55710022, 0.45528081, 0.5401222 , 0.54592327, 0.44220664, 0.47673524, 0.52873844, 0.4829449 , 0.48515887, 0.54134607, 0.450466  , 0.54837702, 0.47590747, 0.57199309, 0.58851981, 0.47132444, 0.44442932, 0.56183549, 0.48979552, 0.51374854, 0.41011541, 0.46538776, 0.58606274, 0.51545543, 0.54614756, 0.4506355 , 0.49779654, 0.443503  , 0.47268849, 0.4504294 , 0.39291152, 0.54669478, 0.54779101, 0.47582864, 0.50894455, 0.51927094, 0.49861091, 0.59310058, 0.45429373, 0.48678437, 0.50288586, 0.48069622, 0.52760912, 0.5118683 , 0.60196906, 0.4282119 , 0.51393524, 0.5106446 , 0.53389979, 0.53176284, 0.47265592, 0.45720696, 0.42943445, 0.54018803, 0.43633861, 0.51280376, 0.42495233, 0.48423667, 0.53328973, 0.51377185, 0.45810269, 0.49723702, 0.403323  , 0.56444141, 0.51351277, 0.47767768, 0.51641341, 0.4966969 , 0.42828877, 0.55426548, 0.53245294, 0.48623397, 0.42692114, 0.50321609, 0.53440262, 0.54244648, 0.51299351, 0.43263567, 0.47331176, 0.48165027, 0.51232191, 0.55445258, 0.54323231, 0.50930401, 0.50153814, 0.54471426, 0.53923209, 0.47315923, 0.43551507, 0.55701856, 0.55112787, 0.50850312, 0.49295049, 0.47247679, 0.58057907, 0.52169959, 0.51034787, 0.42896117, 0.55294684, 0.52292619, 0.42976747, 0.4706387 , 0.46060276, 0.60014024, 0.51666398, 0.51434187, 0.49136887, 0.61065831, 0.38513663, 0.56736394, 0.54790665, 0.44434231, 0.48441654, 0.57945827, 0.53637528, 0.47735573, 0.52615155, 0.51504026, 0.4641185 , 0.50871316, 0.56002337, 0.4707652 , 0.42641551, 0.48532868, 0.48351299, 0.47063727, 0.46747184, 0.42279864, 0.46458271, 0.51786366, 0.51228997, 0.5033719 , 0.48058348, 0.40904451, 0.43758533, 0.44100579, 0.57999117, 0.4925471 , 0.47551867, 0.5286477 , 0.46000318, 0.5637859 , 0.59928435, 0.48360782, 0.4771193 , 0.53749157, 0.45664404, 0.58401153, 0.46197167, 0.50154002, 0.54169984, 0.47225318, 0.50535922, 0.46600936, 0.48476778, 0.45769416, 0.49335976, 0.47891549, 0.47997919, 0.45763229, 0.53670601, 0.45686323, 0.56551689, 0.59629776, 0.47251306, 0.48778836, 0.56468832, 0.48890077, 0.52307882, 0.53440244, 0.50813894, 0.4428279 , 0.52356287, 0.47703679, 0.60258583, 0.4108778 , 0.54088935, 0.53795036, 0.44628152, 0.48215627, 0.44107261, 0.45252552, 0.46111263, 0.50135487, 0.55187685, 0.51325235, 0.51514277, 0.5680781 , 0.48667023, 0.48555444, 0.45070021, 0.39405688, 0.48145638, 0.54777308, 0.57570516, 0.55441856, 0.58127967, 0.47059829, 0.55769376, 0.52569789, 0.47112601, 0.5010574 , 0.35419379, 0.57555654, 0.47210866, 0.50287819, 0.4258165 , 0.56729575, 0.45470128, 0.55061083, 0.46312785, 0.51492596, 0.51134206, 0.48960366, 0.57966146, 0.37426146, 0.51913096, 0.51783745, 0.51242465, 0.45738121, 0.51659558, 0.48073267, 0.45818103, 0.52604388, 0.53847543, 0.46773059, 0.44172535, 0.43433353, 0.43758119, 0.52672775, 0.50251892, 0.57854698, 0.5175629 , 0.4611426 , 0.52172734, 0.45272314, 0.51589939, 0.43278818, 0.53944443, 0.53054068, 0.49185357, 0.42120363, 0.577586  , 0.52179469, 0.51180071, 0.55495018, 0.42470079, 0.54284353, 0.50912782, 0.43475174, 0.52285215, 0.53892128, 0.46787949, 0.53336718, 0.46930669, 0.45339336, 0.49623817, 0.4311819 , 0.55982476, 0.38516919, 0.49657255, 0.55963216, 0.47214567, 0.5240232 , 0.43767568, 0.46480375, 0.57115072, 0.49141717, 0.49789593, 0.46457368, 0.46656324, 0.55545586, 0.63923336, 0.46879923, 0.45622937, 0.42976341, 0.51129408, 0.49839078, 0.5164966 , 0.57959171, 0.45868351, 0.54262484, 0.49203866, 0.42105985, 0.60347606, 0.55442278, 0.51974864, 0.55806284, 0.56181645, 0.54627102, 0.50413101, 0.48039105, 0.46379635, 0.58390471, 0.5377935 , 0.41095458, 0.42925395, 0.42520725, 0.4893355 , 0.48419668, 0.51066485, 0.46864138, 0.59308306, 0.54484266, 0.4790423 , 0.48557658, 0.43889655, 0.50258992, 0.50661835, 0.45562128, 0.47451614, 0.50141995, 0.52912567, 0.48534654, 0.50892843, 0.43341213, 0.54916986, 0.52695849, 0.47247929, 0.46517683, 0.55822228, 0.43617081, 0.54370429, 0.45345871, 0.4418124 , 0.45103698, 0.3915015 , 0.51655919, 0.51625817, 0.4902453 , 0.47138125, 0.50868646, 0.53437357, 0.5563727 , 0.4870521 , 0.47828182, 0.44788723, 0.48242661, 0.58646635, 0.52495117, 0.53766765, 0.51010016, 0.47590069, 0.49285749, 0.33303451, 0.58635962, 0.47230682, 0.46693197, 0.53479744, 0.49730085, 0.4686777 , 0.52578667])

In [93]: se_dml_po = np.array([0.04366143, 0.04632413, 0.03934783, 0.04376407, 0.04776953, 0.04294894, 0.0493605 , 0.05057076, 0.04993363, 0.04528385, 0.04716893, 0.04316392, 0.03844692, 0.04002265, 0.04364729, 0.04180496, 0.04915626, 0.04444379, 0.04258075, 0.04642707, 0.0453024 , 0.05041915, 0.04495728, 0.04627783, 0.04774967, 0.03613853, 0.04456387, 0.0428944 , 0.04773842, 0.04278792, 0.03998002, 0.04199909, 0.04050232, 0.04279711, 0.04826966, 0.04232603, 0.04629067, 0.04520752, 0.04292975, 0.04775048, 0.04387756, 0.04303141, 0.04699689, 0.04426411, 0.04174037, 0.0450418 , 0.04357423, 0.04296971, 0.04115976, 0.04803088, 0.0440271 , 0.03910127, 0.04188743, 0.0461947 , 0.04445704, 0.04758127, 0.04105246, 0.04229529, 0.04348393, 0.03940532, 0.04691201, 0.04712129, 0.04532333, 0.04198115, 0.04467275, 0.0456634 , 0.04796472, 0.04080751, 0.04541844, 0.04754002, 0.04303026, 0.03978123, 0.04099255, 0.04866286, 0.04067465, 0.04196374, 0.04548078, 0.04779556, 0.04321585, 0.04544103, 0.04639701, 0.04444337, 0.04158797, 0.04212771, 0.04294366, 0.04862461, 0.03713917, 0.04505446, 0.04856092, 0.04640594, 0.04342124, 0.04298389, 0.04025997, 0.04828067, 0.04270125, 0.04275123, 0.04282572, 0.04353543, 0.04703092, 0.04467834, 0.04520262, 0.04597939, 0.04693617, 0.04535161, 0.04437884, 0.04265513, 0.04768799, 0.04478721, 0.04296025, 0.04637604, 0.0487638 , 0.04499217, 0.04168946, 0.0439831 , 0.04748039, 0.05013583, 0.05015454, 0.04192372, 0.04506462, 0.04632873, 0.04833074, 0.04748367, 0.04152701, 0.04165487, 0.04654159, 0.04765364, 0.04452404, 0.04139589, 0.0442406 , 0.0457696 , 0.04844991, 0.04943656, 0.04777142, 0.03825993, 0.04597716, 0.04874836, 0.04776631, 0.04595611, 0.0458343 , 0.0428256 , 0.04534578, 0.0448361 , 0.042015  , 0.04811913, 0.0448321 , 0.04292421, 0.03894937, 0.04272008, 0.04455543, 0.03876354, 0.04314453, 0.04628697, 0.04603369, 0.04497386, 0.04267185, 0.04019239, 0.0422623 , 0.04053257, 0.04286978, 0.04745838, 0.04552007, 0.04932073, 0.04500954, 0.04000683, 0.0472705 , 0.04828826, 0.04341315, 0.0464942 , 0.04558246, 0.04395118, 0.04105528, 0.04638659, 0.04586976, 0.04029563, 0.04217629, 0.04204087, 0.04093607, 0.04969833, 0.04664773, 0.04504618, 0.03758201, 0.0452988 , 0.04503191, 0.04843537, 0.04914253, 0.04435506, 0.0368011 , 0.05420537, 0.04624779, 0.04433298, 0.05062355, 0.0447908 , 0.04379796, 0.04982575, 0.04793812, 0.0467464 , 0.0506507 , 0.04515699, 0.04629882, 0.04103533, 0.04999819, 0.04301357, 0.04669165, 0.04087331, 0.04158373, 0.0439232 , 0.04715809, 0.04692125, 0.04897129, 0.04748409, 0.04625044, 0.04551256, 0.04820112, 0.04693338, 0.04282482, 0.04321722, 0.04492408, 0.04680481, 0.04651601, 0.04297949, 0.04045679, 0.04618816, 0.0493394 , 0.03985102, 0.05072911, 0.04725812, 0.0481278 , 0.04495275, 0.04530795, 0.04074308, 0.04334787, 0.04071895, 0.04912917, 0.03774198, 0.04314333, 0.04086531, 0.04824108, 0.04406156, 0.04409377, 0.04891328, 0.0500406 , 0.04516683, 0.0414013 , 0.04620527, 0.04709315, 0.04822646, 0.04682268, 0.05036133, 0.04125324, 0.0461525 , 0.04235533, 0.04557972, 0.04499424, 0.04816397, 0.042596  , 0.04261622, 0.04148597, 0.046121  , 0.04583109, 0.04317212, 0.04462103, 0.04028714, 0.04365713, 0.04248785, 0.0467333 , 0.04079037, 0.04934807, 0.04507899, 0.04644339, 0.04587939, 0.04737139, 0.04552572, 0.04947069, 0.04414528, 0.04099972, 0.04527949, 0.04627014, 0.04386254, 0.04570415, 0.04411444, 0.04289963, 0.04525811, 0.0474116 , 0.04547358, 0.05100277, 0.04175249, 0.0485154 , 0.04771437, 0.04406015, 0.04622295, 0.039592  , 0.04335127, 0.04427896, 0.0393652 , 0.04025816, 0.04790163, 0.04682166, 0.04510704, 0.04299321, 0.0476545 , 0.0473511 , 0.04064169, 0.04439331, 0.04040281, 0.04181763, 0.04290026, 0.04493665, 0.04679808, 0.04864147, 0.04560976, 0.05244334, 0.05009814, 0.04916519, 0.04749958, 0.04397354, 0.04772573, 0.04904464, 0.04965606, 0.04217941, 0.04897094, 0.04123459, 0.0432386 , 0.04709203, 0.04826865, 0.04435245, 0.04306565, 0.04210565, 0.04290201, 0.04805011, 0.04584127, 0.04447501, 0.04654913, 0.04310199, 0.03854194, 0.04580982, 0.04767768, 0.04875136, 0.05074004, 0.04464792, 0.03933025, 0.04077989, 0.04167724, 0.04390614, 0.04570174, 0.04538323, 0.04332988, 0.04665934, 0.04842956, 0.03863581, 0.04017111, 0.04204172, 0.04213322, 0.04268302, 0.04363571, 0.04629439, 0.04024711, 0.04315797, 0.04541346, 0.04428588, 0.03936651, 0.04484814, 0.049777  , 0.04682585, 0.04265238, 0.05493733, 0.04141143, 0.04255895, 0.04297288, 0.04319185, 0.04368864, 0.04448444, 0.04807221, 0.04451277, 0.04842245, 0.03945935, 0.04650975, 0.04165787, 0.04001618, 0.04819221, 0.04239392, 0.04135269, 0.04276419, 0.04041064, 0.04346972, 0.04214591, 0.04530573, 0.04295206, 0.04447011, 0.0476322 , 0.04297454, 0.04802991, 0.04303747, 0.03914079, 0.04454937, 0.04833492, 0.04789917, 0.04606072, 0.04715249, 0.04573149, 0.04279117, 0.04254376, 0.0403669 , 0.05619312, 0.04938559, 0.04313127, 0.04490884, 0.04155294, 0.04682644, 0.04952157, 0.04256427, 0.04280082, 0.04634973, 0.04157787, 0.04059484, 0.04625132, 0.04861964, 0.0456383 , 0.0428753 , 0.0455957 , 0.04186756, 0.0464355 , 0.04185124, 0.04173826, 0.0410638 , 0.04593701, 0.04863952, 0.04531707, 0.04692063, 0.04615908, 0.04105317, 0.049331  , 0.04502511, 0.04493834, 0.04664758, 0.04615444, 0.04554463, 0.04199733, 0.04431206, 0.04118765, 0.04591012, 0.05045064, 0.04158319, 0.04429355, 0.04223113, 0.03969192, 0.0436478 , 0.05076127, 0.04303168, 0.0415556 , 0.04470683, 0.04511164, 0.04486504, 0.04502342, 0.04492337, 0.04252807, 0.0495405 , 0.04566507, 0.04596565, 0.0449505 , 0.04786531, 0.04569081, 0.04213937, 0.05005629, 0.0434723 , 0.04626321, 0.04364834, 0.04566388, 0.04713147, 0.04182015, 0.04457914, 0.04805054, 0.05225486, 0.0474002 , 0.0409488 , 0.04760028, 0.04486234, 0.05135251, 0.04853203, 0.04888681, 0.04967928, 0.04514113, 0.04408134, 0.04518277, 0.04647372, 0.04210594, 0.04183561, 0.04759757, 0.04638927, 0.04695067, 0.04202962, 0.04183168, 0.04637013, 0.04551546, 0.05082791, 0.04615458, 0.04567446, 0.04877952, 0.03922464, 0.03864079, 0.04345652, 0.04472654, 0.04329195, 0.04336706, 0.04380224, 0.0436433 , 0.04703133, 0.04542158, 0.04070404, 0.043123  , 0.04304618, 0.04756028, 0.04466588, 0.04008962, 0.04416704, 0.047083  , 0.04343354, 0.04328825, 0.04128289, 0.04797098, 0.04484212, 0.04503446, 0.04188074, 0.04671925, 0.04465078, 0.04874003, 0.04494375, 0.04625267, 0.04066548, 0.04330019, 0.03913068, 0.05079306, 0.04596748, 0.04518592, 0.04711726, 0.04508213, 0.03804182, 0.04560625, 0.042082  , 0.05198356, 0.04671626, 0.04238704, 0.04577586, 0.04322268, 0.04775087, 0.04692211, 0.04132109, 0.04906609, 0.04861446, 0.04307522, 0.04761847, 0.0442623 , 0.04528084, 0.04601433, 0.04184879, 0.04013743, 0.04537962, 0.04560355, 0.04082902, 0.04771007, 0.04810656, 0.04181141, 0.04363583, 0.04545695, 0.04517319, 0.04270835, 0.04530133, 0.04461901, 0.04362228, 0.04520353, 0.04039833, 0.04185737, 0.03957646, 0.04536973, 0.04023931, 0.04685081, 0.04439482, 0.03921729, 0.04959055, 0.04746106, 0.04675399, 0.05214294, 0.0464757 , 0.04585351, 0.04133049, 0.05058726, 0.04815479, 0.04493285, 0.04227591, 0.04229086, 0.04359974, 0.04692625, 0.04852676, 0.04481415, 0.04475359, 0.04732867, 0.04378654, 0.04859246, 0.04766565, 0.05149647, 0.04758104, 0.04476619, 0.0447561 , 0.04652143, 0.04465528, 0.04485388, 0.04102461, 0.04152636, 0.04844676, 0.04338375, 0.04316988, 0.04247638, 0.03906722, 0.04504118, 0.04430981, 0.04747676, 0.0533095 , 0.04781572, 0.04675546, 0.04594965, 0.04523947, 0.04254596, 0.04441746, 0.04408057, 0.04147999, 0.04516373, 0.04318777, 0.04395332, 0.04136753, 0.04404612, 0.04481491, 0.04865378, 0.04253294, 0.04267905, 0.04477323, 0.04448586, 0.04958079, 0.04415501, 0.04776651, 0.04070179, 0.04699118, 0.04397997, 0.04592556, 0.04276607, 0.03956084, 0.04080207, 0.04035732, 0.0468081 , 0.04875999, 0.03868134, 0.04715079, 0.04108798, 0.0443913 , 0.04569703, 0.04387604, 0.04179464, 0.04015547, 0.0433569 , 0.04528929, 0.03860953, 0.04976271, 0.04108088, 0.04336586, 0.05090655, 0.04489043, 0.03832453, 0.0438332 , 0.04216618, 0.04244166, 0.04889756, 0.04376899, 0.04459088, 0.04060368, 0.04171002, 0.04291755, 0.04042948, 0.04301972, 0.04504935, 0.04075044, 0.04658386, 0.04667455, 0.04239227, 0.0454948 , 0.04395952, 0.04566263, 0.04644776, 0.0472576 , 0.04320539, 0.04367673, 0.04372062, 0.04109036, 0.04963561, 0.04485157, 0.04830976, 0.03934099, 0.04930203, 0.04521219, 0.04431363, 0.04630182, 0.04414541, 0.04679306, 0.04193693, 0.04414566, 0.04577935, 0.04780609, 0.04347577, 0.05090181, 0.04015752, 0.03947669, 0.04295765, 0.04977118, 0.05137322, 0.04235594, 0.04365023, 0.04671102, 0.04115597, 0.04226988, 0.04707771, 0.03925437, 0.04513961, 0.0465118 , 0.04131011, 0.04014652, 0.0512401 , 0.04836521, 0.0448319 , 0.04389894, 0.04354019, 0.04021803, 0.04309532, 0.04263222, 0.04396544, 0.04923313, 0.0477914 , 0.04328708, 0.04245669, 0.04302829, 0.04192883, 0.04812229, 0.04801755, 0.04761739, 0.04598512, 0.04248567, 0.04684313, 0.04273867, 0.03934617, 0.04554571, 0.04926563, 0.04315612, 0.05041068, 0.04821278, 0.04494212, 0.04427627, 0.04560213, 0.03987408, 0.04400685, 0.04709236, 0.04158083, 0.0447051 , 0.04390364, 0.04233113, 0.04103328, 0.0488311 , 0.04185222, 0.04171723, 0.04182328, 0.0444572 , 0.04489263, 0.04402228, 0.03943944, 0.04881562, 0.04686757, 0.04589471, 0.03900169, 0.04893455, 0.04732217, 0.04823214, 0.04237029, 0.04492963, 0.04876891, 0.04788519, 0.04728083, 0.05084502, 0.04555633, 0.05153353, 0.04245686, 0.0445393 , 0.04529056, 0.04805109, 0.03909855, 0.0441579 , 0.04009273, 0.04833389, 0.04335762, 0.0487235 , 0.04793003, 0.04744083, 0.04497436, 0.04439482, 0.04417169, 0.04487584, 0.04149336, 0.04581779, 0.04302379, 0.04730023, 0.04074397, 0.0426177 , 0.04144998, 0.04554913, 0.04398114, 0.04368888, 0.04684536, 0.04893886, 0.04441862, 0.04646384, 0.04373368, 0.04583414, 0.04424393, 0.04435307, 0.05151157, 0.04523948, 0.04624434, 0.04763616, 0.04429373, 0.04435428, 0.04066626, 0.04850437, 0.0440769 , 0.04807946, 0.04242926, 0.04600121, 0.04535562, 0.05036463, 0.04495395, 0.04966027, 0.04020707, 0.04710001, 0.03835692, 0.04706426, 0.04517028, 0.04060998, 0.04117483, 0.05759099, 0.05168384, 0.04488953, 0.04298455, 0.05004272, 0.0454869 , 0.0449041 , 0.04490075, 0.04452586, 0.04675966, 0.04110656, 0.04448455, 0.04590486, 0.04961628, 0.04045468, 0.05065138, 0.04290253, 0.04904711, 0.04510714, 0.04169845, 0.04017691, 0.04575501, 0.04605821, 0.04405548, 0.04664584, 0.0478982 , 0.04628937, 0.04424418, 0.04613777, 0.04578426, 0.04725448, 0.04645413, 0.04135783, 0.04062497, 0.04972194, 0.04393031, 0.04443315, 0.04687277, 0.04239731, 0.0421795 , 0.04737418, 0.04182724, 0.04215289, 0.04455361, 0.04328229, 0.03965512, 0.04787494, 0.04640227, 0.04050011, 0.04418661, 0.04282853, 0.05295413, 0.04282882, 0.04227624, 0.04621299, 0.04420618, 0.0464249 , 0.04677917, 0.0447752 , 0.04577487, 0.04751948, 0.04174396, 0.04717273, 0.04712549, 0.04967362, 0.04212043, 0.04126582, 0.0400929 , 0.04729312, 0.04916058, 0.04743923, 0.04674456, 0.0426739 , 0.04807577, 0.0471212 , 0.04660028, 0.04404454, 0.04386943, 0.04671481, 0.04770813, 0.04276558, 0.04236685, 0.04024044, 0.04031839, 0.04509778, 0.05081884, 0.0452145 , 0.04434399, 0.04777426, 0.04267024, 0.03933003, 0.04722241, 0.04739409, 0.05255036, 0.04003435, 0.04533648, 0.04412494, 0.04411879, 0.04261987, 0.04469745, 0.04263345, 0.04239181, 0.04201696, 0.04423246, 0.04341077, 0.04819775, 0.04691498, 0.04237232, 0.04410359, 0.04044761, 0.044337  , 0.04929771, 0.04925044, 0.04694016, 0.0438847 , 0.04710392, 0.0415846 , 0.0441434 , 0.04246665, 0.04861628, 0.04398318, 0.04258132, 0.04593046, 0.04446947, 0.04809013, 0.04357285, 0.04728308, 0.04466791, 0.04391723, 0.04725787, 0.04057481, 0.04136977, 0.05221815, 0.04425619, 0.04415679, 0.0404598 , 0.04464952, 0.04641681, 0.04791448, 0.04399596, 0.04606058, 0.04165912, 0.04747206, 0.04528619, 0.05164746, 0.04341658, 0.04389238, 0.04312489, 0.04597068, 0.04712426, 0.04022928, 0.04500399, 0.04459979, 0.04872266, 0.04756165, 0.04166714, 0.04580468, 0.04350212, 0.0425324])

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for i_rep in range(n_rep):
In [94]: for i_rep in range(1):
   ....:     (x, y, d) = data[i_rep]
   ....:     obj_dml_data = DoubleMLData.from_arrays(x, y, d)
   ....:     obj_dml_plr = DoubleMLPLR(obj_dml_data,
   ....:                             ml_l, ml_m,
   ....:                             n_folds=2,
   ....:                             score='partialling out')
   ....:     obj_dml_plr.fit()
   ....:     this_theta = obj_dml_plr.coef[0]
   ....:     this_se = obj_dml_plr.se[0]
   ....:     print(np.abs(theta_dml_po[i_rep] - this_theta))
   ....:     print(np.abs(se_dml_po[i_rep] - this_se))
   ....:     theta_dml_po[i_rep] = this_theta
   ....:     se_dml_po[i_rep] = this_se
   ....: 
0.02291424608829118
0.0017844159455330522

In [95]: plt.figure(constrained_layout=True);

In [96]: ax = sns.histplot((theta_dml_po - alpha)/se_dml_po,
   ....:                 color=face_colors[2], edgecolor = edge_colors[2],
   ....:                 stat='density', bins=30, label='Double ML with cross-fitting');
   ....: 

In [97]: ax.axvline(0., color='k');

In [98]: xx = np.arange(-5, +5, 0.001)

In [99]: yy = stats.norm.pdf(xx)

In [100]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [101]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [102]: ax.set_xlim([-6., 6.]);

In [103]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/orth_po.png
set.seed(5555)

# to speed up the illustration we hard-code the simulation results
theta_dml_po = c(0.528929305, 0.524166106, 0.451625400, 0.481825448, 0.437547797, 0.478983941, 0.595735437, 0.504146789, 0.477701836, 0.555757361, 0.509946294, 0.482621495, 0.484000068, 0.435829918, 0.472128822, 0.437704381, 0.492793231, 0.549994506, 0.501524331, 0.500380684, 0.404144531, 0.464623937, 0.507083497, 0.452636998, 0.511753393, 0.454828747, 0.470530138, 0.573594266, 0.500503122, 0.486072954, 0.490245595, 0.435874202, 0.655562845, 0.564458817, 0.456068556, 0.481776445, 0.521628576, 0.528145239, 0.435524326, 0.541558276, 0.520581239, 0.548347798, 0.410600001, 0.548111626, 0.561417232, 0.565057590, 0.569559383, 0.534560415, 0.489788915, 0.462890711, 0.487090830, 0.530282207, 0.603032550, 0.470690285, 0.497606122, 0.622735251, 0.501934927, 0.448152643, 0.476624907, 0.445380734, 0.481506092, 0.448385435, 0.545291003, 0.502574048, 0.504246410, 0.464174968, 0.468343480, 0.461442733, 0.545334139, 0.474707557, 0.542118443, 0.524144042, 0.423730692, 0.436341238, 0.513615913, 0.500882990, 0.521748352, 0.538908355, 0.447217526, 0.493472118, 0.424747680, 0.497873343, 0.508668557, 0.508476976, 0.508078831, 0.489466840, 0.485841133, 0.467494506, 0.492297379, 0.591710996, 0.589443587, 0.474464990, 0.456152648, 0.530132841, 0.402934007, 0.559060278, 0.452289153, 0.531651817, 0.557275666, 0.493257933, 0.450157556, 0.418314553, 0.494901444, 0.510357009, 0.483434818, 0.421694596, 0.516056398, 0.506513906, 0.494035742, 0.502110446, 0.486391123, 0.502495550, 0.467286445, 0.488338097, 0.438663036, 0.497291466, 0.493119600, 0.501582001, 0.510332906, 0.495763180, 0.538677334, 0.546065989, 0.515238558, 0.498520612, 0.470267041, 0.502284214, 0.480202263, 0.507158599, 0.497926448, 0.527142789, 0.528020269, 0.483060947, 0.446734351, 0.580134490, 0.524634633, 0.478397358, 0.583881918, 0.482283220, 0.473529221, 0.523149540, 0.503318183, 0.434520261, 0.565038698, 0.494658140, 0.482419660, 0.474924711, 0.445798775, 0.539232232, 0.526370036, 0.520267696, 0.582505676, 0.501827939, 0.578082546, 0.460174208, 0.628940531, 0.497760092, 0.416803557, 0.451989307, 0.541747005, 0.477475822, 0.599009515, 0.490841213, 0.498024328, 0.466645921, 0.596155475, 0.514117685, 0.616173672, 0.478501201, 0.508374826, 0.577131397, 0.467610894, 0.488153770, 0.514340586, 0.480234482, 0.544403625, 0.490047059, 0.492203817, 0.503426265, 0.475708594, 0.467758104, 0.445317360, 0.426501477, 0.559152043, 0.518667020, 0.460217643, 0.424770041, 0.532601186, 0.518290351, 0.415608392, 0.496448300, 0.491461821, 0.574624682, 0.497096595, 0.572225217, 0.563645297, 0.565865550, 0.459524026, 0.467229524, 0.408708517, 0.460688550, 0.492079054, 0.520314870, 0.454612210, 0.566993376, 0.564688339, 0.405875504, 0.444422298, 0.567882347, 0.523173348, 0.532446921, 0.447302094, 0.547230142, 0.523344293, 0.425544984, 0.536317105, 0.553970107, 0.596946705, 0.512206456, 0.420470208, 0.443051243, 0.528253209, 0.530685357, 0.466369447, 0.406971502, 0.510648658, 0.573694992, 0.465244936, 0.454228624, 0.476045386, 0.552822940, 0.514711997, 0.480833510, 0.495754520, 0.444803423, 0.483793405, 0.468678545, 0.519521156, 0.439401937, 0.460177593, 0.466097332, 0.443843088, 0.529619820, 0.518480317, 0.526510426, 0.500424064, 0.453144914, 0.460236105, 0.562048290, 0.516089696, 0.528869392,
                0.418437552, 0.535357378, 0.512321914, 0.506201866, 0.454603631, 0.499333855, 0.408035186, 0.430295475, 0.457574546, 0.415501972, 0.537784196, 0.506507161, 0.455958374, 0.482664686, 0.558281390, 0.502988823, 0.472407229, 0.411700675, 0.524268092, 0.495372505, 0.514738408, 0.507391273, 0.545098256, 0.510787741, 0.524056562, 0.527604408, 0.513238451, 0.490536319, 0.501284277, 0.515363859, 0.464154660, 0.450451836, 0.570862346, 0.450713013, 0.487943518, 0.536914644, 0.508686757, 0.440262065, 0.568978485, 0.527752092, 0.535192893, 0.483637201, 0.464594624, 0.564906577, 0.457075076, 0.484845400, 0.438608719, 0.506351695, 0.505222865, 0.461529985, 0.452937460, 0.508888146, 0.517469669, 0.507455485, 0.556022584, 0.458070609, 0.567509738, 0.476227231, 0.494220742, 0.507646043, 0.606399836, 0.512885919, 0.457287016, 0.517578558, 0.482191072, 0.478660253, 0.494519169, 0.455926332, 0.483201417, 0.520567478, 0.553893483, 0.406281301, 0.475029231, 0.502872047, 0.512367384, 0.531066521, 0.493544326, 0.566572815, 0.456218183, 0.533881334, 0.517587797, 0.491538264, 0.452080383, 0.549326160, 0.451892980, 0.470967517, 0.485753423, 0.555439924, 0.564934584, 0.504503725, 0.365120359, 0.536268511, 0.505501217, 0.547301769, 0.521837539, 0.494415220, 0.480677107, 0.464160744, 0.484564227, 0.506030300, 0.544895280, 0.420921023, 0.554332303, 0.571402548, 0.469410674, 0.432813715, 0.497178890, 0.508195316, 0.486224241, 0.504062393, 0.528757658, 0.544182477, 0.572767929, 0.493720099, 0.434814509, 0.537327702, 0.490471332, 0.525268381, 0.500631408, 0.425750435, 0.454183309, 0.460271501, 0.552740571, 0.488877753, 0.503887023, 0.493697484, 0.496833562, 0.468960171, 0.483951803, 0.477611961, 0.542478840, 0.530739222, 0.508113262, 0.474719439, 0.518617794, 0.492387350, 0.377194163, 0.506034774, 0.528514850, 0.405646062, 0.574553812, 0.547711082, 0.528261529, 0.458456690, 0.428018314, 0.479989366, 0.533742084, 0.533160176, 0.500305198, 0.520568712, 0.517599360, 0.577852125, 0.544738741, 0.512469742, 0.432961531, 0.513438167, 0.512180912, 0.439384489, 0.464477951, 0.454436213, 0.503965204, 0.558667400, 0.541939875, 0.565303117, 0.464630046, 0.380983931, 0.485112517, 0.448974635, 0.421620451, 0.493160149, 0.521991278, 0.513966346, 0.508762669, 0.513260701, 0.541730726, 0.509173393, 0.529478794, 0.458218020, 0.476249455, 0.515037563, 0.526951572, 0.497130545, 0.526400104, 0.514678756, 0.468804650, 0.516883882, 0.449256945, 0.484194763, 0.498747909, 0.543203598, 0.544696641, 0.492034217, 0.534088707, 0.489315917, 0.501940483, 0.536539996, 0.471765757, 0.498238686, 0.552811905, 0.551689267, 0.546496425, 0.537478422, 0.505512759, 0.391897221, 0.461451904, 0.528794878, 0.480367495, 0.417003519, 0.537443049, 0.532941478, 0.537021748, 0.476978136, 0.447385292, 0.401122385, 0.437789407, 0.503712921, 0.479222512, 0.444176717, 0.494162728, 0.463978465, 0.447420587, 0.453548182, 0.538136577, 0.488698559, 0.539731223, 0.561827143, 0.425556372, 0.539425872, 0.421379433, 0.410573090, 0.548288926, 0.492213770, 0.516577250, 0.496622223, 0.531138281, 0.485743737, 0.448609846, 0.572971670, 0.571438541, 0.444549066, 0.451317073, 0.507861445, 0.598311645, 0.508099212, 0.523695419, 0.539862417, 0.465409989, 0.561214516, 0.564621151, 0.465419592,
                0.455939621, 0.403848844, 0.435280621, 0.465540249, 0.545743051, 0.504983437, 0.580164476, 0.494241622, 0.585880925, 0.534909533, 0.572404567, 0.516370584, 0.521469069, 0.501596610, 0.406415221, 0.593218158, 0.545166460, 0.494873537, 0.531479024, 0.533431139, 0.478524003, 0.417494355, 0.495220613, 0.465151337, 0.490336254, 0.574956485, 0.443825985, 0.498799585, 0.406600953, 0.568582680, 0.465388530, 0.483330202, 0.511320398, 0.504536921, 0.466345025, 0.544028013, 0.415498708, 0.459631120, 0.510267551, 0.546867942, 0.508822005, 0.497838777, 0.452140218, 0.470697845, 0.417154413, 0.577092790, 0.434763604, 0.516837107, 0.380979385, 0.529535198, 0.476851052, 0.448921689, 0.496390884, 0.574518645, 0.463937364, 0.438976157, 0.488609802, 0.497765937, 0.545086164, 0.504355476, 0.502997232, 0.508712805, 0.404144513, 0.516200801, 0.524881095, 0.558208561, 0.487446747, 0.427403542, 0.484338504, 0.426593367, 0.509215104, 0.450850809, 0.442370837, 0.481226278, 0.515255009, 0.528548896, 0.513263839, 0.521514461, 0.567346143, 0.455509858, 0.568724669, 0.439245664, 0.436353272, 0.514302705, 0.495105085, 0.465458954, 0.515925392, 0.452107595, 0.558880453, 0.527058894, 0.476759303, 0.517560886, 0.476597742, 0.549837559, 0.543764932, 0.502258369, 0.532912989, 0.534555371, 0.568238944, 0.483064595, 0.483481744, 0.404644749, 0.531771908, 0.508334834, 0.439653788, 0.500064559, 0.528640373, 0.537956379, 0.506765854, 0.454736266, 0.539377259, 0.478914934, 0.486476661, 0.525669718, 0.586420464, 0.541457390, 0.458113804, 0.429515552, 0.526501629, 0.505727664, 0.496538987, 0.429521939, 0.400408186, 0.485172824, 0.482264230, 0.474051602, 0.562544665, 0.553739537, 0.537816620, 0.455008673, 0.554563567, 0.511488473, 0.487183325, 0.574268906, 0.564911221, 0.506017820, 0.507124508, 0.522633173, 0.515863162, 0.501386527, 0.432263205, 0.387493025, 0.448437904, 0.426409789, 0.480796794, 0.567443932, 0.532509768, 0.599172214, 0.449388683, 0.634234708, 0.520986895, 0.508651246, 0.479610754, 0.473403781, 0.458828900, 0.506731868, 0.536052013, 0.465428520, 0.551930519, 0.497322512, 0.470429398, 0.445696484, 0.477245066, 0.436917882, 0.524591515, 0.458308052, 0.485223737, 0.416827228, 0.441832926, 0.456295792, 0.532004238, 0.559007160, 0.471194374, 0.501534265, 0.458219060, 0.487549915, 0.477752947, 0.564057270, 0.505565864, 0.497217633, 0.487834546, 0.495366218, 0.499796246, 0.467260542, 0.538641992, 0.533807631, 0.542275689, 0.464704577, 0.497097152, 0.529170367, 0.426403827, 0.533977327, 0.420575152, 0.509743590, 0.446744046, 0.482897243, 0.425139318, 0.480555522, 0.470976897, 0.498329378, 0.534134219, 0.509050733, 0.450644947, 0.365292264, 0.509720234, 0.538041637, 0.425904081, 0.550900039, 0.472855738, 0.470215245, 0.445077645, 0.508636762, 0.535701105, 0.533032467, 0.479446481, 0.595612040, 0.514476241, 0.406871216, 0.489761646, 0.478245691, 0.496722778, 0.500625716, 0.568127960, 0.473315875, 0.552671656, 0.467567138, 0.587156656, 0.450638599, 0.438651604, 0.465896459, 0.491022085, 0.466253967, 0.503212924, 0.615191650, 0.490351498, 0.534819707, 0.511891628, 0.483192380, 0.498922525, 0.542704320, 0.509884810, 0.497219140, 0.556189513, 0.467267138, 0.521387563, 0.466023855, 0.524534075, 0.484491717, 0.577928273, 0.392238766,
                0.447760594, 0.515876611, 0.521457709, 0.535130199, 0.449875495, 0.569663935, 0.489929639, 0.502838804, 0.482240555, 0.404236270, 0.622196761, 0.437934512, 0.539712253, 0.466186985, 0.526261755, 0.441862687, 0.556668161, 0.507139530, 0.542354257, 0.523498216, 0.517362249, 0.508913948, 0.360408364, 0.553102019, 0.516707472, 0.586485176, 0.544416128, 0.442992140, 0.588645180, 0.450134448, 0.465455377, 0.522119316, 0.431973515, 0.532048952, 0.489536096, 0.423843057, 0.583538003, 0.520633738, 0.549802107, 0.474114508, 0.460593713, 0.534870192, 0.509058585, 0.534005415, 0.494864065, 0.438132303, 0.574057621, 0.457239509, 0.572997314, 0.451684179, 0.512620158, 0.480317135, 0.464953113, 0.484426014, 0.389955989, 0.489917453, 0.480510603, 0.555692617, 0.390583739, 0.583645148, 0.472470716, 0.432870458, 0.470675549, 0.459518292, 0.473306963, 0.532231412, 0.541247157, 0.477481994, 0.574164057, 0.544111833, 0.550865276, 0.488049715, 0.525875430, 0.524719681, 0.368912909, 0.479004953, 0.508917726, 0.506315587, 0.490350589, 0.531897691, 0.501459857, 0.516702796, 0.466695809, 0.557933288, 0.500560049, 0.564251106, 0.484549438, 0.469584003, 0.559953533, 0.505203148, 0.468927366, 0.422932316, 0.472981376, 0.397713686, 0.517644221, 0.552023074, 0.559983289, 0.431046169, 0.502767665, 0.533157597, 0.430680084, 0.532961326, 0.496362776, 0.460114821, 0.537888346, 0.460190182, 0.534114793, 0.463453521, 0.529167975, 0.467139855, 0.467910335, 0.493771269, 0.523022691, 0.488449544, 0.489227985, 0.453106871, 0.517816272, 0.518105243, 0.424183904, 0.469225056, 0.560032874, 0.539904458, 0.491118132, 0.534246626, 0.481190063, 0.444659882, 0.511358131, 0.451980036, 0.449700371, 0.443902852, 0.470174192, 0.477342614, 0.477623402, 0.529911544, 0.522015113, 0.530149883, 0.500039447, 0.514468281, 0.495545188, 0.594648734, 0.527704224, 0.585460912, 0.487121505, 0.560804832, 0.423674171, 0.438511119, 0.516919838, 0.506782894, 0.487018065, 0.594321865, 0.581561105, 0.554268212, 0.456258768, 0.513765089, 0.435707789, 0.451094845, 0.535435227, 0.536789205, 0.393461792, 0.510646553, 0.538077749, 0.447653667, 0.571659506, 0.429907613, 0.517797520, 0.566446391, 0.523661725, 0.492847472, 0.482555825, 0.503280026, 0.458652571, 0.517001714, 0.405166603, 0.485645385, 0.436924651, 0.544409558, 0.435555372, 0.545304122, 0.590598741, 0.484680937, 0.521124571, 0.614254920, 0.499266081, 0.555696194, 0.394091745, 0.498249879, 0.517679647, 0.495328847, 0.532118898, 0.454934071, 0.508498181, 0.529632228, 0.500706673, 0.412100845, 0.478146278, 0.474480335, 0.557436153, 0.479228012, 0.534619489, 0.557454300, 0.482464669, 0.440860839, 0.538459425, 0.513226869, 0.482503590, 0.545393707, 0.526546108, 0.512945438, 0.485965220, 0.574223433, 0.548750002, 0.450586928, 0.472396545, 0.424789369, 0.531055828, 0.516712013, 0.470623965, 0.553653603, 0.510583001, 0.519733930, 0.487737727, 0.479564120, 0.479129236, 0.528968158, 0.500992879, 0.567073632, 0.508843441, 0.545296924, 0.523066881, 0.546063299, 0.492532284, 0.516297567, 0.520810095, 0.428744294, 0.392715751, 0.474486933, 0.448466029, 0.526251752, 0.483369713, 0.469783888, 0.551264104, 0.478410929, 0.550488733, 0.425831624, 0.469105405, 0.568043007, 0.566561822, 0.476783584, 0.378936224, 0.539095122)
se_dml_po = c(0.0434856354, 0.0449909751, 0.0412343665, 0.0434867351, 0.0426816854, 0.0432660004, 0.0442063422, 0.0453752608, 0.0414156667, 0.0414029206, 0.0445706914, 0.0425871629, 0.0414589846, 0.0463883773, 0.0411063437, 0.0418296094, 0.0511347959, 0.0527985875, 0.0492336263, 0.0419605951, 0.0482329884, 0.0498052989, 0.0443665271, 0.0470984864, 0.0394081305, 0.0469836291, 0.0420282554, 0.0399614915, 0.0486114165, 0.0509329919, 0.0459762972, 0.0448620748, 0.0486023058, 0.0458205509, 0.0448047044, 0.0462191872, 0.0444371989, 0.0444743463, 0.0421171024, 0.0487895452, 0.0406127084, 0.0457636971, 0.0475267157, 0.0487640046, 0.0422062330, 0.0463523571, 0.0451753137, 0.0482065676, 0.0458499831, 0.0408702810, 0.0453744969, 0.0434234081, 0.0430949278, 0.0453029415, 0.0442131297, 0.0432394035, 0.0489691509, 0.0478083232, 0.0441431520, 0.0427929451, 0.0460930288, 0.0465807446, 0.0403349042, 0.0495064451, 0.0452042571, 0.0427579659, 0.0409161182, 0.0440448573, 0.0462905949, 0.0444684437, 0.0453318423, 0.0470717385, 0.0453307020, 0.0422713105, 0.0420776466, 0.0434892083, 0.0468101265, 0.0431585181, 0.0449988018, 0.0413798561, 0.0416447852, 0.0448559043, 0.0432338473, 0.0460127919, 0.0434116159, 0.0415203445, 0.0448199866, 0.0443858745, 0.0487485566, 0.0424788253, 0.0455731127, 0.0407264273, 0.0384912302, 0.0481227030, 0.0458342231, 0.0439534882, 0.0468952813, 0.0487479684, 0.0407494005, 0.0421097667, 0.0418870801, 0.0475423237, 0.0433519860, 0.0409932986, 0.0447418249, 0.0424617557, 0.0394069040, 0.0455396441, 0.0487496125, 0.0403867470, 0.0471382272, 0.0441135633, 0.0441852350, 0.0470091490, 0.0454836636, 0.0501399372, 0.0508939225, 0.0478002474, 0.0451234033, 0.0422841304, 0.0431107971, 0.0412681351, 0.0514054697, 0.0438387351, 0.0413831691, 0.0411385136, 0.0456976291, 0.0455376742, 0.0432429042, 0.0411361405, 0.0416303015, 0.0426052946, 0.0482175520, 0.0436083145, 0.0444696641, 0.0476747004, 0.0463405465, 0.0454637469, 0.0438200622, 0.0456285769, 0.0434145510, 0.0460813786, 0.0467100729, 0.0439354602, 0.0429374752, 0.0441789444, 0.0445144290, 0.0445980516, 0.0411907280, 0.0368473727, 0.0450787722, 0.0459287480, 0.0439170947, 0.0476198818, 0.0461595801, 0.0429203701, 0.0422266981, 0.0456721624, 0.0465838054, 0.0447450270, 0.0461102696, 0.0462217515, 0.0420180132, 0.0437184292, 0.0479108225, 0.0422362293, 0.0448791372, 0.0491953066, 0.0454951483, 0.0446842495, 0.0428118511, 0.0454396102, 0.0414008334, 0.0399468156, 0.0482145172, 0.0500287650, 0.0456585799, 0.0449833963, 0.0439395726, 0.0473129220, 0.0455416759, 0.0442336820, 0.0476535156, 0.0474671550, 0.0405145506, 0.0415519146, 0.0459774231, 0.0434665188, 0.0458938227, 0.0422547492, 0.0414850642, 0.0427270875, 0.0419108763, 0.0448099944, 0.0442260892, 0.0501602753, 0.0457549328, 0.0437501768, 0.0394372550, 0.0472106346, 0.0440147704, 0.0446122733, 0.0465866484, 0.0443398786, 0.0434179595, 0.0483923585, 0.0429863119, 0.0412377004, 0.0418009834, 0.0441275774, 0.0480055115, 0.0498825501, 0.0478575157, 0.0438961855, 0.0499995224, 0.0472267518, 0.0447670701, 0.0496148872, 0.0452068083, 0.0448423575, 0.0459172174, 0.0428776568, 0.0452131546, 0.0461268658, 0.0426258772, 0.0475063278, 0.0472408578, 0.0446091081, 0.0424050961, 0.0429348126, 0.0421265704, 0.0434943698, 0.0484314165, 0.0448263246, 0.0426683986, 0.0416609484, 0.0414283404, 0.0446416272, 0.0409941394, 0.0427813831, 0.0465865821, 0.0408309112, 0.0422481350, 0.0496832768, 0.0388508163, 0.0453873677, 0.0434704930, 0.0411681517, 0.0445678422, 0.0499742376,
            0.0413415408, 0.0405909254, 0.0412803065, 0.0472132630, 0.0429350947, 0.0412087195, 0.0445017781, 0.0404800784, 0.0428572301, 0.0440868320, 0.0461360286, 0.0399657350, 0.0478429909, 0.0435296750, 0.0422636758, 0.0472143690, 0.0430650222, 0.0435322482, 0.0494857201, 0.0448441559, 0.0435095479, 0.0485147238, 0.0433087563, 0.0418758639, 0.0432160545, 0.0426093750, 0.0468055316, 0.0498377108, 0.0447029357, 0.0387071772, 0.0415046424, 0.0419011681, 0.0433309910, 0.0489771778, 0.0471238235, 0.0448933562, 0.0455730112, 0.0448702380, 0.0446465477, 0.0484902345, 0.0438211722, 0.0430308925, 0.0528781979, 0.0425646564, 0.0469459098, 0.0463228838, 0.0450300856, 0.0445571775, 0.0470255902, 0.0477636233, 0.0409415842, 0.0455307911, 0.0448079103, 0.0458699373, 0.0422040790, 0.0443877184, 0.0468109275, 0.0437736342, 0.0423354317, 0.0416731283, 0.0447892588, 0.0404955840, 0.0436334738, 0.0460776884, 0.0482039603, 0.0477919804, 0.0481124622, 0.0402018874, 0.0455233868, 0.0443288648, 0.0426751552, 0.0496390455, 0.0473517180, 0.0447418236, 0.0436056848, 0.0420502829, 0.0463491445, 0.0446638988, 0.0456855124, 0.0444307768, 0.0449416962, 0.0444476963, 0.0480857999, 0.0478148051, 0.0465282276, 0.0452618401, 0.0440711934, 0.0466980643, 0.0435951511, 0.0433518012, 0.0425449486, 0.0432481811, 0.0397565890, 0.0407649939, 0.0436010886, 0.0455738060, 0.0485152262, 0.0472629741, 0.0418851590, 0.0406459007, 0.0474509995, 0.0473777758, 0.0460273071, 0.0442506799, 0.0438041830, 0.0467000229, 0.0514415720, 0.0483754742, 0.0437886700, 0.0483187198, 0.0373052682, 0.0445698720, 0.0510452850, 0.0436470731, 0.0479001296, 0.0449772839, 0.0460893323, 0.0438292383, 0.0453725071, 0.0456856788, 0.0458729545, 0.0442397847, 0.0433640501, 0.0418388918, 0.0456722641, 0.0460787284, 0.0491722426, 0.0424693267, 0.0471803551, 0.0424370461, 0.0511632678, 0.0443784440, 0.0388264415, 0.0409514299, 0.0465273995, 0.0440615791, 0.0472738255, 0.0479875406, 0.0433404245, 0.0416906202, 0.0429407121, 0.0440608042, 0.0411089879, 0.0467010836, 0.0438139132, 0.0420951654, 0.0425055626, 0.0449358517, 0.0424911705, 0.0479855071, 0.0483781602, 0.0418310159, 0.0408075505, 0.0414244205, 0.0424704839, 0.0523071082, 0.0469389464, 0.0432266704, 0.0416691932, 0.0460887041, 0.0399158320, 0.0500687829, 0.0447838513, 0.0428981624, 0.0421836673, 0.0499681949, 0.0461031638, 0.0401099439, 0.0432303420, 0.0430873634, 0.0468523422, 0.0456288766, 0.0452276482, 0.0413568677, 0.0427962657, 0.0434803923, 0.0433409998, 0.0451000046, 0.0469981892, 0.0441132982, 0.0457114078, 0.0447626731, 0.0430758420, 0.0462470219, 0.0438529372, 0.0457539172, 0.0424561156, 0.0427199333, 0.0477891889, 0.0415413890, 0.0461968884, 0.0470033829, 0.0434885994, 0.0446480400, 0.0401481201, 0.0422093507, 0.0412620941, 0.0421577207, 0.0422612862, 0.0485575153, 0.0445747930, 0.0488146456, 0.0476213798, 0.0421610382, 0.0420411033, 0.0444973529, 0.0465486256, 0.0551011182, 0.0432018882, 0.0423701302, 0.0470822009, 0.0538534845, 0.0473246156, 0.0435301544, 0.0392188189, 0.0483681613, 0.0468222575, 0.0466567013, 0.0442856212, 0.0458239374, 0.0445162744, 0.0449768586, 0.0441025538, 0.0435248418, 0.0475843151, 0.0548989934, 0.0415717507, 0.0421512496, 0.0450870675, 0.0460190655, 0.0432971267, 0.0473867559, 0.0442738990, 0.0424060562, 0.0431562852, 0.0479244266, 0.0447410510, 0.0415609464, 0.0402884865, 0.0394052713, 0.0452884362, 0.0440613073, 0.0453510394, 0.0423025688, 0.0457004378, 0.0436675315, 0.0407028459, 0.0417417396, 0.0403773389, 0.0431874617,
            0.0456131066, 0.0449160242, 0.0466727460, 0.0441052012, 0.0420092037, 0.0389294848, 0.0426533625, 0.0479740747, 0.0458802110, 0.0508785816, 0.0431055432, 0.0502861141, 0.0438003415, 0.0437357036, 0.0473404420, 0.0476560369, 0.0426601106, 0.0443346001, 0.0459871144, 0.0496979493, 0.0489142964, 0.0440756378, 0.0590243203, 0.0380476802, 0.0395445052, 0.0427711073, 0.0481489119, 0.0511804931, 0.0449385961, 0.0464974820, 0.0383614511, 0.0438017164, 0.0470291704, 0.0477054150, 0.0385464611, 0.0461889924, 0.0454904923, 0.0412832514, 0.0491546027, 0.0465012530, 0.0427468271, 0.0434424038, 0.0396650845, 0.0437837748, 0.0473686149, 0.0464770564, 0.0474161702, 0.0433348596, 0.0435340452, 0.0416355464, 0.0399296987, 0.0405482877, 0.0452315309, 0.0434306036, 0.0445313641, 0.0414634672, 0.0447603587, 0.0441881555, 0.0496823968, 0.0401616682, 0.0390309901, 0.0487170179, 0.0418218193, 0.0464374054, 0.0456174395, 0.0471081895, 0.0489421622, 0.0480249361, 0.0438261829, 0.0442537786, 0.0394098306, 0.0451999522, 0.0428574881, 0.0436186021, 0.0448292932, 0.0462847856, 0.0489734895, 0.0456698389, 0.0446195569, 0.0415688193, 0.0454536576, 0.0501086800, 0.0447656474, 0.0419716160, 0.0554928675, 0.0462486905, 0.0453146372, 0.0452515684, 0.0455292255, 0.0461085770, 0.0438255464, 0.0507731074, 0.0488969105, 0.0508566134, 0.0449762119, 0.0433199250, 0.0417114424, 0.0482790902, 0.0438539325, 0.0427013836, 0.0458171466, 0.0439974266, 0.0421534218, 0.0438755379, 0.0439615265, 0.0452697372, 0.0478322513, 0.0527052731, 0.0409655189, 0.0491207031, 0.0437395260, 0.0471055197, 0.0441370488, 0.0414063317, 0.0445095807, 0.0442424165, 0.0462612074, 0.0497244282, 0.0448463235, 0.0413426318, 0.0467569035, 0.0465486758, 0.0479196628, 0.0477680536, 0.0432553890, 0.0414034806, 0.0436614700, 0.0432208347, 0.0438852072, 0.0444143939, 0.0453850708, 0.0406107833, 0.0476053726, 0.0447981502, 0.0463369894, 0.0442927940, 0.0483712665, 0.0455567859, 0.0488471465, 0.0489840142, 0.0428974992, 0.0471797318, 0.0514890344, 0.0449970800, 0.0447408778, 0.0474807626, 0.0459181822, 0.0411115811, 0.0486283654, 0.0405510448, 0.0483306745, 0.0423022486, 0.0444765989, 0.0435894459, 0.0469704783, 0.0444066140, 0.0411926382, 0.0443122777, 0.0462195869, 0.0421971580, 0.0475577799, 0.0463075866, 0.0435392089, 0.0476292551, 0.0471666476, 0.0411768578, 0.0421767940, 0.0407479023, 0.0443738396, 0.0461646643, 0.0475327247, 0.0476775046, 0.0448512608, 0.0404672780, 0.0411392417, 0.0443537643, 0.0438445404, 0.0483220279, 0.0396712543, 0.0443395816, 0.0401185680, 0.0430710800, 0.0466624588, 0.0482823805, 0.0407783396, 0.0402079878, 0.0423194499, 0.0461672777, 0.0446457130, 0.0426731335, 0.0434590339, 0.0433561131, 0.0477376361, 0.0453379253, 0.0455635863, 0.0409024758, 0.0477686572, 0.0397436740, 0.0404306185, 0.0464088622, 0.0488128917, 0.0410203120, 0.0526721782, 0.0435263843, 0.0457518457, 0.0472539328, 0.0395472276, 0.0436933033, 0.0424613758, 0.0455806546, 0.0473136472, 0.0441805080, 0.0430473467, 0.0447567613, 0.0435356113, 0.0430805359, 0.0410747035, 0.0404922172, 0.0471826461, 0.0484327807, 0.0467886106, 0.0462083899, 0.0435329614, 0.0449860417, 0.0453074373, 0.0436403212, 0.0397468676, 0.0422695719, 0.0441124288, 0.0434291342, 0.0471951724, 0.0423960648, 0.0421673625, 0.0479337097, 0.0451183839, 0.0463349513, 0.0454243832, 0.0514400435, 0.0450966633, 0.0441135794, 0.0461859977, 0.0422128996, 0.0454937511, 0.0443757964, 0.0457996127, 0.0504139196, 0.0441336342, 0.0472618260, 0.0421523232, 0.0460213665,
            0.0386543627, 0.0422584317, 0.0488002239, 0.0471390755, 0.0410038451, 0.0472294441, 0.0505038797, 0.0424905412, 0.0409927496, 0.0438960690, 0.0485043916, 0.0417997851, 0.0487973102, 0.0459688575, 0.0510106004, 0.0504856979, 0.0447476893, 0.0436398134, 0.0495304954, 0.0425404563, 0.0475108158, 0.0416349129, 0.0413908256, 0.0469019918, 0.0411031105, 0.0450789301, 0.0377854724, 0.0460794384, 0.0449444228, 0.0430275639, 0.0447318265, 0.0419953334, 0.0430857842, 0.0419443045, 0.0433365396, 0.0431572086, 0.0417635679, 0.0470305565, 0.0435849574, 0.0481614807, 0.0452261553, 0.0483204329, 0.0485888835, 0.0455875083, 0.0433588049, 0.0438005658, 0.0438969435, 0.0482734521, 0.0463492788, 0.0460435499, 0.0450705988, 0.0454923769, 0.0436803165, 0.0503292800, 0.0433317977, 0.0437258496, 0.0436086760, 0.0426916864, 0.0451659917, 0.0441053995, 0.0517127171, 0.0408578739, 0.0454984346, 0.0430943450, 0.0473775473, 0.0515394538, 0.0424925868, 0.0416918462, 0.0418660785, 0.0441519549, 0.0471086420, 0.0430676066, 0.0427848501, 0.0453772610, 0.0465046820, 0.0439579923, 0.0461329240, 0.0430823972, 0.0469213391, 0.0469912486, 0.0429561100, 0.0494401770, 0.0454358831, 0.0468482347, 0.0437230006, 0.0483446000, 0.0439940125, 0.0499725374, 0.0430154120, 0.0426438029, 0.0460993897, 0.0437583859, 0.0442988951, 0.0457552342, 0.0446209589, 0.0471586672, 0.0392868449, 0.0502770985, 0.0452377461, 0.0471729341, 0.0405972353, 0.0409740741, 0.0458060199, 0.0478659993, 0.0412226983, 0.0388599723, 0.0446957081, 0.0453372567, 0.0400001508, 0.0502988012, 0.0425248390, 0.0454564635, 0.0435454323, 0.0475926090, 0.0406074050, 0.0481848105, 0.0437181777, 0.0432005213, 0.0480309900, 0.0463864127, 0.0422477331, 0.0446760512, 0.0439146553, 0.0441187997, 0.0478947711, 0.0468220080, 0.0454049423, 0.0431294048, 0.0484464709, 0.0436190538, 0.0425426021, 0.0465571932, 0.0450467035, 0.0455853658, 0.0447383176, 0.0450462899, 0.0419250380, 0.0478865756, 0.0466518813, 0.0426608461, 0.0491645809, 0.0460344679, 0.0455470251, 0.0431141321, 0.0468126628, 0.0513564846, 0.0473470901, 0.0462808302, 0.0403843821, 0.0398550053, 0.0388632134, 0.0468402390, 0.0513384981, 0.0492639840, 0.0443255962, 0.0474207998, 0.0490144741, 0.0463047285, 0.0480784879, 0.0449957310, 0.0419181286, 0.0416882269, 0.0435890412, 0.0488815392, 0.0475753668, 0.0445161408, 0.0394133790, 0.0437393726, 0.0460113217, 0.0444514485, 0.0403999343, 0.0445497813, 0.0464931812, 0.0498635036, 0.0499944664, 0.0457159647, 0.0435424658, 0.0394828243, 0.0453096252, 0.0424811131, 0.0511458419, 0.0466107591, 0.0423855219, 0.0447590622, 0.0463544572, 0.0417609318, 0.0477494435, 0.0404891174, 0.0447435978, 0.0437581953, 0.0473154519, 0.0449950388, 0.0423434069, 0.0452420125, 0.0452047757, 0.0449526138, 0.0466613490, 0.0409872320, 0.0484519214, 0.0352437017, 0.0430470758, 0.0475445400, 0.0454740377, 0.0423447527, 0.0496876593, 0.0439748868, 0.0427690644, 0.0468111097, 0.0494035213, 0.0425496477, 0.0465137448, 0.0447275277, 0.0484827693, 0.0458997490, 0.0464914386, 0.0433278287, 0.0445023944, 0.0466340547, 0.0441450072, 0.0474577431, 0.0480442403, 0.0471825641, 0.0468976085, 0.0421529837, 0.0496266909, 0.0392661148, 0.0482181540, 0.0436511829, 0.0413371341, 0.0429495849, 0.0420580993, 0.0449661668, 0.0472251303, 0.0461371903, 0.0474402788, 0.0438124402, 0.0414037459, 0.0491058290, 0.0500372334, 0.0450386547, 0.0463601996, 0.0461323055, 0.0416831353, 0.0445322971, 0.0426195463, 0.0432235284, 0.0460557804, 0.0431648518, 0.0468505390, 0.0467809093)

# to run the full simulation uncomment the following line to fit the model for every dataset and not just for the first dataset
#for (i_rep in seq_len(n_rep)) {
for (i_rep in seq_len(1)) {
    df = data[[i_rep]]
    obj_dml_data = double_ml_data_from_data_frame(df, y_col = "y", d_cols = "d")
    obj_dml_plr = DoubleMLPLR$new(obj_dml_data,
                                ml_l, ml_m,
                                n_folds=2,
                                score='partialling out')
    obj_dml_plr$fit()
    this_theta = obj_dml_plr$coef
    this_se = obj_dml_plr$se
    print(abs(theta_dml_po[i_rep] - this_theta))
    print(abs(se_dml_po[i_rep] - this_se))
    theta_dml_po[i_rep] = this_theta
    se_dml_po[i_rep] = this_se
}

g_dml = ggplot(data.frame(theta_rescaled=(theta_dml_po - alpha)/se_dml_po), aes(x = theta_rescaled)) +
                geom_histogram(aes(y=after_stat(density), x=theta_rescaled, colour = "Double ML with cross-fitting", fill="Double ML with cross-fitting"),
                            bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Double ML with cross-fitting"="dark green", "N(0, 1)"='black')) +
                scale_fill_manual(name='',,
                    breaks=c("Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Double ML with cross-fitting"="dark green", "N(0, 1)"=NA)) +
                xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_dml
           d 
4.934876e-10 
           d 
4.339459e-11 
../_images/basics_7_1.png
In [104]: plt.figure(constrained_layout=True);

In [105]: ax = sns.histplot((theta_nonorth - alpha)/se_nonorth,
   .....:                 color=face_colors[0], edgecolor = edge_colors[0],
   .....:                 stat='density', bins=30, label='Non-orthogonal ML');
   .....: 

In [106]: sns.histplot((theta_orth_po_nosplit - alpha)/se_orth_po_nosplit,
   .....:             color=face_colors[1], edgecolor = edge_colors[1],
   .....:             stat='density', bins=30, label='Double ML (no sample splitting)');
   .....: 

In [107]: sns.histplot((theta_dml_po - alpha)/se_dml_po,
   .....:             color=face_colors[2], edgecolor = edge_colors[2],
   .....:             stat='density', bins=30, label='Double ML with cross-fitting');
   .....: 

In [108]: ax.axvline(0., color='k');

In [109]: xx = np.arange(-5, +5, 0.001)

In [110]: yy = stats.norm.pdf(xx)

In [111]: ax.plot(xx, yy, color='k', label='$\\mathcal{N}(0, 1)$');

In [112]: ax.legend(loc='upper right', bbox_to_anchor=(1.2, 1.0));

In [113]: ax.set_xlim([-6., 6.]);

In [114]: ax.set_xlabel('$(\hat{\\theta}_0 - \\theta_0)/\hat{\sigma}$');
../_images/comparison_po.png
g_all = ggplot(data.frame(t_nonorth=(theta_nonorth - alpha)/se_nonorth,
                        t_orth_nosplit=(theta_orth_po_nosplit - alpha)/se_orth_po_nosplit,
                        t_dml=(theta_dml_po - alpha)/se_dml_po)) +
                geom_histogram(aes(x = t_nonorth, y=after_stat(density), colour = "Non-orthogonal ML", fill="Non-orthogonal ML"),
                                bins = 30, alpha = 0.3) +
                geom_histogram(aes(x = t_orth_nosplit, y=after_stat(density), colour = "Double ML (no sample splitting)", fill="Double ML (no sample splitting)"),
                                bins = 30, alpha = 0.3) +
                geom_histogram(aes(x = t_dml, y=after_stat(density), colour = "Double ML with cross-fitting", fill="Double ML with cross-fitting"),
                                bins = 30, alpha = 0.3) +
                geom_vline(aes(xintercept = 0), col = "black") +
                suppressWarnings(geom_function(fun = dnorm, aes(colour = "N(0, 1)", fill="N(0, 1)"))) +
                scale_color_manual(name='',
                    breaks=c("Non-orthogonal ML", "Double ML (no sample splitting)", "Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Non-orthogonal ML"="dark blue",
                            "Double ML (no sample splitting)"="dark orange",
                            "Double ML with cross-fitting"="dark green",
                            "N(0, 1)"='black')) +
                scale_fill_manual(name='',
                    breaks=c("Non-orthogonal ML", "Double ML (no sample splitting)", "Double ML with cross-fitting", "N(0, 1)"),
                    values=c("Non-orthogonal ML"="dark blue",
                            "Double ML (no sample splitting)"="dark orange",
                            "Double ML with cross-fitting"="dark green",
                            "N(0, 1)"=NA)) +
            xlim(c(-6.0, 6.0)) + xlab("") + ylab("") + theme_minimal()
g_all
../_images/basics_8_1.png

1.7. References#

Chernozhukov, V., Chetverikov, D., Demirer, M., Duflo, E., Hansen, C., Newey, W. and Robins, J. (2018), Double/debiased machine learning for treatment and structural parameters. The Econometrics Journal, 21: C1-C68. doi:10.1111/ectj.12097.

Robinson, P. M. (1988). Root-N-consistent semi-parametric regression. Econometrica 56, 931-54. doi:10.2307/1912705.