{
  "chapter": "METR-21",
  "status": "Author actual standalone fixed archive; independent whole/runtime/UI and native gates separate",
  "programProcesses": 30,
  "successful": 28,
  "expectedInvalid": 2,
  "storedSVG": 28,
  "authorTargetLaunchesIncludingHistorical": 52,
  "history": "Initial 30 target executions: 28 normal SVG outputs, including six explicit undefined-status SVGs without numeric points, and two genuine same-group-across-folds rejections. Two layout-only R follow-ups reran 11 axis-bearing programs each: first separated y-axis titles from ticks, then separated the x-axis title, legend and footer. All 33 numeric output files in each follow-up were byte-identical. Current 30 programs are distinct from 52 historical target launches. One separate draw-only prototype read stored plot CSV and performed no fitting/scoring.",
  "sourceScope": "Real-data fixed examples retain all 440 US counties, 722 full-experimental NSW people, and 384 complete-FTE-pair NJPA records, with declared folds, training-arm frames and grid propensity policy. They read the three factual CSVs only. Other fixed examples are explicitly constructed teaching data with unit weights and a bounded supported ridge domain; they are not full ports of every general six-API diagnostic.",
  "publicProjection": "Exact executed code and short summaries embedded; original SVG, full JSON/flat CSV and plot CSV linked externally. Public rejection diagnostics omit local executable paths. Original commands, cwd, code-before-launch, raw stdout/stderr, original failures and every prior output remain private.",
  "dependencies": {
    "Python": "Python 3 standard-library Fraction and SVG writer, no third-party package required",
    "R": "Base R with grDevices SVG capability; explicitly approximate arithmetic",
    "sourcePrograms": "Three retained factual CSVs; constructed fixed examples need no data files"
  },
  "historicalWholeCandidateBindings": {
    "body": "9a21fb5574b817493c40b2b088fd203500e490a9c1347d1f954169265b0ad8b3",
    "cases": "1030361688e54cfdd975afdef7354aa5ce7e8b1a2a53833f7718a050c2c8b06b",
    "engine": "d47d0741c6066bb7ec4e2ae6e0790f9134d43df06658f365bb3f460ec0916af4",
    "source": "ac9ef479454bf89487bd8ecf8548ac22e0dee6348e8480ec9fc6e59541f408ee"
  },
  "runs": [
    {
      "api": "nuisance",
      "variant": "ridge-two",
      "profile": "ridge-two",
      "language": "Python",
      "file": "metr21-programs/nuisance-ridge-two-Python.py",
      "codeSHA256": "22ec82ee470624cff76cbb91a59f431dd9ae7c8729b68985175392b41081e7e9",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "두 행 ridge와 비벌점 절편",
        "en": "Two-row ridge: unpenalized intercept"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"nuisance\", \"key\": \"ridge-two\", \"title\": \"Two-row ridge: unpenalized intercept\", \"input\": {\"rows\": [{\"x\": [0], \"y\": 1}, {\"x\": [1], \"y\": 3}], \"queries\": [[0], [2]], \"lambdaValue\": 1, \"scale\": \"none\"}, \"xLabel\": \"Feature / query X\", \"yLabel\": \"Outcome / prediction units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "1",
        "nTrain": "2",
        "intercept": "1.8",
        "slope": "0.4",
        "MSE": "0.64",
        "objective": "0.8"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1",
          "series": "Training observed"
        },
        {
          "x": "1",
          "y": "3",
          "series": "Training observed"
        },
        {
          "x": "0",
          "y": "9/5",
          "series": "Query prediction"
        },
        {
          "x": "2",
          "y": "13/5",
          "series": "Query prediction"
        }
      ],
      "summaryFile": "metr21-programs/nuisance-ridge-two-Python-summary.csv",
      "summarySHA256": "58e2a9e758d2fd9ec5a7b605a6937ea984cda9e56e5c678e16f4c8b611e644ff",
      "pointsFile": "metr21-programs/nuisance-ridge-two-Python-points.csv",
      "pointsSHA256": "1ca0dc37f5180cf3693189d3d654c5f974bd1c05a4e059986ffa6fdd9f63cf2b",
      "fullResultFile": "metr21-programs/nuisance-ridge-two-Python-full.json",
      "fullResultSHA256": "b6debc51e4f3ddfd5e675bf91b4d35071163dc3f2b07d2878ffa58703542eada",
      "plotFile": "metr21-programs/nuisance-ridge-two-Python.svg",
      "plotSHA256": "d3c9d464cc56e680e17b7f23a41d47458b1c8580a672605f5835aefbe95421d6"
    },
    {
      "api": "nuisance",
      "variant": "empty-training",
      "profile": "empty-training",
      "language": "Python",
      "file": "metr21-programs/nuisance-empty-training-Python.py",
      "codeSHA256": "c210146fe90f251261755c06472ab6fdee9efde5c1750cc56d74f7772f80fd22",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "훈련정보가 없으면 예측 미정의",
        "en": "Empty training: undefined, not a zero prediction"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"nuisance\", \"key\": \"empty-training\", \"title\": \"Empty training: undefined, not a zero prediction\", \"input\": {\"rows\": [], \"queries\": [[1]], \"lambdaValue\": 0, \"scale\": \"range\"}, \"xLabel\": \"Feature / query X\", \"yLabel\": \"Outcome / prediction units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "0",
        "nTrain": "0",
        "intercept": "undefined",
        "slope": "undefined",
        "MSE": "undefined",
        "objective": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [],
      "summaryFile": "metr21-programs/nuisance-empty-training-Python-summary.csv",
      "summarySHA256": "59d8e2fd4f2f4d0daf0c93e0f20731b4e06f2ec8dcff7a165afc27fc6e6b3f1a",
      "pointsFile": "metr21-programs/nuisance-empty-training-Python-points.csv",
      "pointsSHA256": "25985483525a6b3c1c73189424f2105073009975762a4d5913b5d8798d2c5f7d",
      "fullResultFile": "metr21-programs/nuisance-empty-training-Python-full.json",
      "fullResultSHA256": "abde90b9211ecd9aa590c1ac3f0d60a9542a51b36f37381903f7c4c4e894a12b",
      "plotFile": "metr21-programs/nuisance-empty-training-Python.svg",
      "plotSHA256": "f6bcb1c72abe407fe127c7121f0790f9582de2b324d126e684e2dd965837046c"
    },
    {
      "api": "nuisance",
      "variant": "ridge-two",
      "profile": "ridge-two",
      "language": "R",
      "file": "metr21-programs/nuisance-ridge-two-R.R",
      "codeSHA256": "bbb5e2f7578ac3c3cf46408c9e3808b52975e686a49d0d8db8168247051178c5",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "두 행 ridge와 비벌점 절편",
        "en": "Two-row ridge: unpenalized intercept"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"nuisance\",\"key\"=\"ridge-two\",\"title\"=\"Two-row ridge: unpenalized intercept\",\"input\"=list(\"rows\"=list(list(\"x\"=list(0),\"y\"=1),list(\"x\"=list(1),\"y\"=3)),\"queries\"=list(list(0),list(2)),\"lambdaValue\"=1,\"scale\"=\"none\"),\"xLabel\"=\"Feature / query X\",\"yLabel\"=\"Outcome / prediction units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "1",
        "nTrain": "2",
        "intercept": "1.8",
        "slope": "0.4",
        "MSE": "0.64",
        "objective": "0.8"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1",
          "series": "Training observed"
        },
        {
          "x": "1",
          "y": "3",
          "series": "Training observed"
        },
        {
          "x": "0",
          "y": "1.8",
          "series": "Query prediction"
        },
        {
          "x": "2",
          "y": "2.6",
          "series": "Query prediction"
        }
      ],
      "summaryFile": "metr21-programs/nuisance-ridge-two-R-summary.csv",
      "summarySHA256": "6bd0891df561958bad6370b2b5cc3e3ffb916605e262318e4d88d96264458e8a",
      "pointsFile": "metr21-programs/nuisance-ridge-two-R-points.csv",
      "pointsSHA256": "967b0539397b458d935167159d54e9fc0070722dea1a1ae38f872cdb24e0d0e0",
      "fullResultFile": "metr21-programs/nuisance-ridge-two-R-full.csv",
      "fullResultSHA256": "5eb85b09188e6f968ed1b2e15fd4b0678a038a31091f311b96b0e040d3db0bde",
      "plotFile": "metr21-programs/nuisance-ridge-two-R.svg",
      "plotSHA256": "98b4a8d575cfb386866a0805c54934028c7eac0943365594898b7d6ddfd4f7ff"
    },
    {
      "api": "crossfit",
      "variant": "intercept-folds",
      "profile": "intercept-folds",
      "language": "Python",
      "file": "metr21-programs/crossfit-intercept-folds-Python.py",
      "codeSHA256": "3a65cae9defc4b25ce90db9d405ba2755d743d99c1d40bae86d06fe068ac7594",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "빈 X와 두 fold 밖 예측",
        "en": "Two held-out folds with no covariates"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"crossfit\", \"key\": \"intercept-folds\", \"title\": \"Two held-out folds with no covariates\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"a\", \"fold\": 0, \"x\": [], \"d\": 0, \"y\": 1}, {\"id\": \"b\", \"group\": \"b\", \"fold\": 0, \"x\": [], \"d\": 1, \"y\": 4}, {\"id\": \"c\", \"group\": \"c\", \"fold\": 1, \"x\": [], \"d\": 0, \"y\": 2}, {\"id\": \"d\", \"group\": \"d\", \"fold\": 1, \"x\": [], \"d\": 1, \"y\": 5}], \"K\": 2, \"lambdaValue\": \"1/100\"}, \"xLabel\": \"Constructed row order\", \"yLabel\": \"Outcome units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "rows": "4",
        "missingArmPredictions": "0",
        "meanEll": "3",
        "meanM": "0.5"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "7/2",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "4",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "7/2",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "2",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "5/2",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "5",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "5/2",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/crossfit-intercept-folds-Python-summary.csv",
      "summarySHA256": "dcbb07c5d4bc4cb60b5392b99bd9d97e1b34ae2a59bab2c41eedf8ed370b1b6c",
      "pointsFile": "metr21-programs/crossfit-intercept-folds-Python-points.csv",
      "pointsSHA256": "cd54cc78a07eafdfc1f76bd090c3fd86fc9d8d0182e84ef3aee41ef9eeb1536e",
      "fullResultFile": "metr21-programs/crossfit-intercept-folds-Python-full.json",
      "fullResultSHA256": "fc0d4a63ff300b8f2994504ee0f97397fc8fb1ea534826e1bfe9f90a9e6a3b49",
      "plotFile": "metr21-programs/crossfit-intercept-folds-Python.svg",
      "plotSHA256": "dbc798a14113001a128a674430cc0681fa55111972b81cac17e541972f582187"
    },
    {
      "api": "nuisance",
      "variant": "empty-training",
      "profile": "empty-training",
      "language": "R",
      "file": "metr21-programs/nuisance-empty-training-R.R",
      "codeSHA256": "8f75d55eaf9824a26a330e7573789d85983dae85dd42a515a07db5d4a1d64ba6",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "훈련정보가 없으면 예측 미정의",
        "en": "Empty training: undefined, not a zero prediction"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"nuisance\",\"key\"=\"empty-training\",\"title\"=\"Empty training: undefined, not a zero prediction\",\"input\"=list(\"rows\"=list(),\"queries\"=list(list(1)),\"lambdaValue\"=0,\"scale\"=\"range\"),\"xLabel\"=\"Feature / query X\",\"yLabel\"=\"Outcome / prediction units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab=spec$yLabel,axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend('bottomleft',inset=c(0,-.25),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xpd=TRUE,cex=.8);mtext('Finite calculation;inspect code and full values. No automatic causal guarantee.',side=1,line=4.8,cex=.65)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "0",
        "nTrain": "0",
        "intercept": "undefined",
        "slope": "undefined",
        "MSE": "undefined",
        "objective": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [],
      "summaryFile": "metr21-programs/nuisance-empty-training-R-summary.csv",
      "summarySHA256": "6d1c82b3b2d187596ac3a09250ecd0210c98e0b0d8addafe2c286b70f580506c",
      "pointsFile": "metr21-programs/nuisance-empty-training-R-points.csv",
      "pointsSHA256": "293edd9d790fd02722c629d7efcfa3ef4061d455e3a385f5cc6db5f3f2f406a6",
      "fullResultFile": "metr21-programs/nuisance-empty-training-R-full.csv",
      "fullResultSHA256": "0d82635c1e127e09aec30b0986b313aa42b77a3fd78f84eae3e1d197d9d69721",
      "plotFile": "metr21-programs/nuisance-empty-training-R.svg",
      "plotSHA256": "431c5d74910be5e47fe615e68767cdf45cb411662f7725f17fdd3bf39e74f63f"
    },
    {
      "api": "crossfit",
      "variant": "missing-arm",
      "profile": "missing-arm",
      "language": "Python",
      "file": "metr21-programs/crossfit-missing-arm-Python.py",
      "codeSHA256": "4761cfcc17e0f64fabeaf75c8e1c5e8ba371a565c7882002f21eb7e4c3e8d8cb",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "빈 훈련 팔의 예측 유지",
        "en": "Missing training arm: retain undefined predictions"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"crossfit\", \"key\": \"missing-arm\", \"title\": \"Missing training arm: retain undefined predictions\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"a\", \"fold\": 0, \"x\": [], \"d\": 0, \"y\": 1}, {\"id\": \"b\", \"group\": \"b\", \"fold\": 0, \"x\": [], \"d\": 0, \"y\": 4}, {\"id\": \"c\", \"group\": \"c\", \"fold\": 1, \"x\": [], \"d\": 1, \"y\": 2}, {\"id\": \"d\", \"group\": \"d\", \"fold\": 1, \"x\": [], \"d\": 1, \"y\": 5}], \"K\": 2, \"lambdaValue\": \"1/100\"}, \"xLabel\": \"Constructed row order\", \"yLabel\": \"Outcome units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "rows": "4",
        "missingArmPredictions": "4",
        "meanEll": "3",
        "meanM": "0.5"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "7/2",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "4",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "7/2",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "2",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "5/2",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "5",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "5/2",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/crossfit-missing-arm-Python-summary.csv",
      "summarySHA256": "3871ec59fd80dd49059db56ecb68d702cd44654a647239eaced9b0e4aec4415f",
      "pointsFile": "metr21-programs/crossfit-missing-arm-Python-points.csv",
      "pointsSHA256": "cd54cc78a07eafdfc1f76bd090c3fd86fc9d8d0182e84ef3aee41ef9eeb1536e",
      "fullResultFile": "metr21-programs/crossfit-missing-arm-Python-full.json",
      "fullResultSHA256": "b90fe54503d28229afced68ffe9e21ff9bf61ce5da2ba11b3b1fef037824a136",
      "plotFile": "metr21-programs/crossfit-missing-arm-Python.svg",
      "plotSHA256": "6669d5ca9ac71db9a3e4d2f749a4b48e211c2f0ef8f687e59455ce23229d9f54"
    },
    {
      "api": "crossfit",
      "variant": "intercept-folds",
      "profile": "intercept-folds",
      "language": "R",
      "file": "metr21-programs/crossfit-intercept-folds-R.R",
      "codeSHA256": "05816bc4f79d92ae37c891bc4f0d39416974c92a8eeef26ee17aba09ef33cce7",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "빈 X와 두 fold 밖 예측",
        "en": "Two held-out folds with no covariates"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"crossfit\",\"key\"=\"intercept-folds\",\"title\"=\"Two held-out folds with no covariates\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"a\",\"fold\"=0,\"x\"=list(),\"d\"=0,\"y\"=1),list(\"id\"=\"b\",\"group\"=\"b\",\"fold\"=0,\"x\"=list(),\"d\"=1,\"y\"=4),list(\"id\"=\"c\",\"group\"=\"c\",\"fold\"=1,\"x\"=list(),\"d\"=0,\"y\"=2),list(\"id\"=\"d\",\"group\"=\"d\",\"fold\"=1,\"x\"=list(),\"d\"=1,\"y\"=5)),\"K\"=2,\"lambdaValue\"=\"1/100\"),\"xLabel\"=\"Constructed row order\",\"yLabel\"=\"Outcome units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "rows": "4",
        "missingArmPredictions": "0",
        "meanEll": "3",
        "meanM": "0.5"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "3.5",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "4",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "3.5",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "2",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "2.5",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "5",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "2.5",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/crossfit-intercept-folds-R-summary.csv",
      "summarySHA256": "18236141e39212f0bb4b4d7af413c0f6181cb48ab8a3cbe0fb338e2eb71121da",
      "pointsFile": "metr21-programs/crossfit-intercept-folds-R-points.csv",
      "pointsSHA256": "a59ee85f3415e32c3318893f1bf8e114ee8d541236b3a166fb07a422ff8a124a",
      "fullResultFile": "metr21-programs/crossfit-intercept-folds-R-full.csv",
      "fullResultSHA256": "15d30c72146770190090efadb8226e2333c7637234b22e45e65c99250a94375b",
      "plotFile": "metr21-programs/crossfit-intercept-folds-R.svg",
      "plotSHA256": "6c8d873cd4a9409a35b18c0cd6983e2976e8db6fc823e9ac393b04b3d1122148"
    },
    {
      "api": "orthogonal",
      "variant": "four-supplied",
      "profile": "four-supplied",
      "language": "Python",
      "file": "metr21-programs/orthogonal-four-supplied-Python.py",
      "codeSHA256": "55d1a3769db9df94fc83e3f644b81ec6c1ed1fd5cb47ad9500a78fad2ee54f9b",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "네 행 PLR과 묶음 점수",
        "en": "Four-row residual score and grouped contributions"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"orthogonal\", \"key\": \"four-supplied\", \"title\": \"Four-row residual score and grouped contributions\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"pair0\", \"y\": 1, \"d\": 0, \"ell\": 0, \"m\": \"1/2\"}, {\"id\": \"b\", \"group\": \"pair0\", \"y\": 2, \"d\": 1, \"ell\": 0, \"m\": \"1/2\"}, {\"id\": \"c\", \"group\": \"pair1\", \"y\": 3, \"d\": 0, \"ell\": 0, \"m\": \"1/2\"}, {\"id\": \"d\", \"group\": \"pair1\", \"y\": 4, \"d\": 1, \"ell\": 0, \"m\": \"1/2\"}]}, \"xLabel\": \"Treatment residual V\", \"yLabel\": \"Outcome residual U\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "1",
        "theta": "1",
        "numerator": "1",
        "denominator": "1",
        "rowHC0": "7.25",
        "groupHC0": "0",
        "meanScore": "0"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "-1/2",
          "y": "1",
          "series": "U against V"
        },
        {
          "x": "1/2",
          "y": "2",
          "series": "U against V"
        },
        {
          "x": "-1/2",
          "y": "3",
          "series": "U against V"
        },
        {
          "x": "1/2",
          "y": "4",
          "series": "U against V"
        }
      ],
      "summaryFile": "metr21-programs/orthogonal-four-supplied-Python-summary.csv",
      "summarySHA256": "476af64eeaf5b325b8a5fd31a7121c828aa058b258393f38de9f0bf1c3b5207c",
      "pointsFile": "metr21-programs/orthogonal-four-supplied-Python-points.csv",
      "pointsSHA256": "8fdcd9dbd6c4e88d3ce64ad681f60288d08f72d497b01d8564a801558ac78441",
      "fullResultFile": "metr21-programs/orthogonal-four-supplied-Python-full.json",
      "fullResultSHA256": "bd3a8905d9086cdbb53d331503de02fbf170e3b037611aca09530e7d21f0cdb9",
      "plotFile": "metr21-programs/orthogonal-four-supplied-Python.svg",
      "plotSHA256": "b7cbeccc330be8d6e41ee7a201ebb3206a20d30ba3b2f6c4b4519e837ab41b0b"
    },
    {
      "api": "crossfit",
      "variant": "missing-arm",
      "profile": "missing-arm",
      "language": "R",
      "file": "metr21-programs/crossfit-missing-arm-R.R",
      "codeSHA256": "bc1395a1ee9acba83bd6b52ad1c6dddb4fd8dd1d09dba59c841124adb31d191d",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "빈 훈련 팔의 예측 유지",
        "en": "Missing training arm: retain undefined predictions"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"crossfit\",\"key\"=\"missing-arm\",\"title\"=\"Missing training arm: retain undefined predictions\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"a\",\"fold\"=0,\"x\"=list(),\"d\"=0,\"y\"=1),list(\"id\"=\"b\",\"group\"=\"b\",\"fold\"=0,\"x\"=list(),\"d\"=0,\"y\"=4),list(\"id\"=\"c\",\"group\"=\"c\",\"fold\"=1,\"x\"=list(),\"d\"=1,\"y\"=2),list(\"id\"=\"d\",\"group\"=\"d\",\"fold\"=1,\"x\"=list(),\"d\"=1,\"y\"=5)),\"K\"=2,\"lambdaValue\"=\"1/100\"),\"xLabel\"=\"Constructed row order\",\"yLabel\"=\"Outcome units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "rows": "4",
        "missingArmPredictions": "4",
        "meanEll": "3",
        "meanM": "0.5"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "3.5",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "4",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "3.5",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "2",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "2.5",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "5",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "2.5",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/crossfit-missing-arm-R-summary.csv",
      "summarySHA256": "f5f97d10579620599b55d9640bd0fecb8fd21d642030aa7a9ebf7b64d0592d18",
      "pointsFile": "metr21-programs/crossfit-missing-arm-R-points.csv",
      "pointsSHA256": "a59ee85f3415e32c3318893f1bf8e114ee8d541236b3a166fb07a422ff8a124a",
      "fullResultFile": "metr21-programs/crossfit-missing-arm-R-full.csv",
      "fullResultSHA256": "5660adc8d3dce46b2b463e6e43b844fd20f0e4c56ab5648db87d251048e5fe87",
      "plotFile": "metr21-programs/crossfit-missing-arm-R.svg",
      "plotSHA256": "38fc57a1e0b4331759d7f9b585ec7dcd28188a8bd2f94a54f67ce7e1624b2257"
    },
    {
      "api": "orthogonal",
      "variant": "zero-residual",
      "profile": "zero-residual",
      "language": "Python",
      "file": "metr21-programs/orthogonal-zero-residual-Python.py",
      "codeSHA256": "941accdff7192d604e085b67ccc69de07edaf54704bab0bd95c42b8d97c042a6",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "처치 잔차 0과 미식별",
        "en": "No residual treatment variation: unidentified slope"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"orthogonal\", \"key\": \"zero-residual\", \"title\": \"No residual treatment variation: unidentified slope\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"pair0\", \"y\": 1, \"d\": \"1/2\", \"ell\": 0, \"m\": \"1/2\"}, {\"id\": \"b\", \"group\": \"pair0\", \"y\": 2, \"d\": \"1/2\", \"ell\": 0, \"m\": \"1/2\"}, {\"id\": \"c\", \"group\": \"pair1\", \"y\": 3, \"d\": \"1/2\", \"ell\": 0, \"m\": \"1/2\"}, {\"id\": \"d\", \"group\": \"pair1\", \"y\": 4, \"d\": \"1/2\", \"ell\": 0, \"m\": \"1/2\"}]}, \"xLabel\": \"Treatment residual V\", \"yLabel\": \"Outcome residual U\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "0",
        "theta": "undefined",
        "numerator": "0",
        "denominator": "0",
        "rowHC0": "undefined",
        "groupHC0": "undefined",
        "meanScore": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [],
      "summaryFile": "metr21-programs/orthogonal-zero-residual-Python-summary.csv",
      "summarySHA256": "6bbaffda6ba7cb1f69b5e938ecc01f0f16cd576b29f47af32cd3eb8fe5098716",
      "pointsFile": "metr21-programs/orthogonal-zero-residual-Python-points.csv",
      "pointsSHA256": "25985483525a6b3c1c73189424f2105073009975762a4d5913b5d8798d2c5f7d",
      "fullResultFile": "metr21-programs/orthogonal-zero-residual-Python-full.json",
      "fullResultSHA256": "884b56e5968f5753603d8518d5b5e75a2b526c6eaa0a8cad09f2216a19a89672",
      "plotFile": "metr21-programs/orthogonal-zero-residual-Python.svg",
      "plotSHA256": "165be15a050289517710f0b2458cb6e0294c962764c4e67edb8fba75847a1438"
    },
    {
      "api": "orthogonal",
      "variant": "four-supplied",
      "profile": "four-supplied",
      "language": "R",
      "file": "metr21-programs/orthogonal-four-supplied-R.R",
      "codeSHA256": "c6bc89a93519e07e6c439e7be1de6e7d63066df6872828ee973288161286ead5",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "네 행 PLR과 묶음 점수",
        "en": "Four-row residual score and grouped contributions"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"orthogonal\",\"key\"=\"four-supplied\",\"title\"=\"Four-row residual score and grouped contributions\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"pair0\",\"y\"=1,\"d\"=0,\"ell\"=0,\"m\"=\"1/2\"),list(\"id\"=\"b\",\"group\"=\"pair0\",\"y\"=2,\"d\"=1,\"ell\"=0,\"m\"=\"1/2\"),list(\"id\"=\"c\",\"group\"=\"pair1\",\"y\"=3,\"d\"=0,\"ell\"=0,\"m\"=\"1/2\"),list(\"id\"=\"d\",\"group\"=\"pair1\",\"y\"=4,\"d\"=1,\"ell\"=0,\"m\"=\"1/2\"))),\"xLabel\"=\"Treatment residual V\",\"yLabel\"=\"Outcome residual U\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "1",
        "theta": "1",
        "numerator": "1",
        "denominator": "1",
        "rowHC0": "7.25",
        "groupHC0": "0",
        "meanScore": "0"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "-0.5",
          "y": "1",
          "series": "U against V"
        },
        {
          "x": "0.5",
          "y": "2",
          "series": "U against V"
        },
        {
          "x": "-0.5",
          "y": "3",
          "series": "U against V"
        },
        {
          "x": "0.5",
          "y": "4",
          "series": "U against V"
        }
      ],
      "summaryFile": "metr21-programs/orthogonal-four-supplied-R-summary.csv",
      "summarySHA256": "7ce73d87d221fd9943fd51e8fe6b1bcbc18cfa240d94f6f836a0b93bd8c9f589",
      "pointsFile": "metr21-programs/orthogonal-four-supplied-R-points.csv",
      "pointsSHA256": "4069e7eb6339f4c1b54193cf54b5e9f996b4cb5beab588ef99d594edcc1a95c2",
      "fullResultFile": "metr21-programs/orthogonal-four-supplied-R-full.csv",
      "fullResultSHA256": "efb7470604ed039c408f36c2c2191dd3f715660fba85fe536852cffb55f9ebd5",
      "plotFile": "metr21-programs/orthogonal-four-supplied-R.svg",
      "plotSHA256": "780c28c791624efb9ee83f85e732d7e026a53bc47ce933e7160235f716713b47"
    },
    {
      "api": "aipw",
      "variant": "supplied-four",
      "profile": "supplied-four",
      "language": "Python",
      "file": "metr21-programs/aipw-supplied-four-Python.py",
      "codeSHA256": "a0ee6d103496d4807f38aaf8d0dc6a2cb6da468cad7b2181a2a96d9c02f16c11",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "네 AIPW 의사결과",
        "en": "Four AIPW pseudo-outcomes"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"aipw\", \"key\": \"supplied-four\", \"title\": \"Four AIPW pseudo-outcomes\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"pair0\", \"y\": 1, \"d\": 0, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"b\", \"group\": \"pair0\", \"y\": 2, \"d\": 1, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"c\", \"group\": \"pair1\", \"y\": 3, \"d\": 0, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"d\", \"group\": \"pair1\", \"y\": 4, \"d\": 1, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}]}, \"xLabel\": \"Constructed row order\", \"yLabel\": \"Pseudo-outcome units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "1",
        "theta": "1",
        "rowHC0": "1.25",
        "groupHC0": "0",
        "clippedRows": "0",
        "invalidRows": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "2",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "1",
          "y": "0",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "2",
          "y": "-2",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "3",
          "y": "4",
          "series": "AIPW pseudo-outcome"
        }
      ],
      "summaryFile": "metr21-programs/aipw-supplied-four-Python-summary.csv",
      "summarySHA256": "a1cb7808968011c54286c076241970bc71b8e48223800c505d216bb6d98815b1",
      "pointsFile": "metr21-programs/aipw-supplied-four-Python-points.csv",
      "pointsSHA256": "8fb8bc222f25cc8bf6e5d0f9c87d8899633f77104fbc253b4184d93637d9d03d",
      "fullResultFile": "metr21-programs/aipw-supplied-four-Python-full.json",
      "fullResultSHA256": "494b5093ad62907e4f6443056061171f067d5eca0262979e7da2a8c550bf9343",
      "plotFile": "metr21-programs/aipw-supplied-four-Python.svg",
      "plotSHA256": "c094f3aa1bd61fb0707b883b7178d996a76d3b942f3a8d45fbe962b7dcd49253"
    },
    {
      "api": "orthogonal",
      "variant": "zero-residual",
      "profile": "zero-residual",
      "language": "R",
      "file": "metr21-programs/orthogonal-zero-residual-R.R",
      "codeSHA256": "c381e25db0ac7511a5af368c63427ff74f56770cfc445dd96f8941cfe73dd6db",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "처치 잔차 0과 미식별",
        "en": "No residual treatment variation: unidentified slope"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"orthogonal\",\"key\"=\"zero-residual\",\"title\"=\"No residual treatment variation: unidentified slope\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"pair0\",\"y\"=1,\"d\"=\"1/2\",\"ell\"=0,\"m\"=\"1/2\"),list(\"id\"=\"b\",\"group\"=\"pair0\",\"y\"=2,\"d\"=\"1/2\",\"ell\"=0,\"m\"=\"1/2\"),list(\"id\"=\"c\",\"group\"=\"pair1\",\"y\"=3,\"d\"=\"1/2\",\"ell\"=0,\"m\"=\"1/2\"),list(\"id\"=\"d\",\"group\"=\"pair1\",\"y\"=4,\"d\"=\"1/2\",\"ell\"=0,\"m\"=\"1/2\"))),\"xLabel\"=\"Treatment residual V\",\"yLabel\"=\"Outcome residual U\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab=spec$yLabel,axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend('bottomleft',inset=c(0,-.25),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xpd=TRUE,cex=.8);mtext('Finite calculation;inspect code and full values. No automatic causal guarantee.',side=1,line=4.8,cex=.65)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "0",
        "theta": "undefined",
        "numerator": "0",
        "denominator": "0",
        "rowHC0": "undefined",
        "groupHC0": "undefined",
        "meanScore": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [],
      "summaryFile": "metr21-programs/orthogonal-zero-residual-R-summary.csv",
      "summarySHA256": "b5c5a019136d51cd7277aa752cd1dadcff67160b3d05232736a1f777b0a4af00",
      "pointsFile": "metr21-programs/orthogonal-zero-residual-R-points.csv",
      "pointsSHA256": "293edd9d790fd02722c629d7efcfa3ef4061d455e3a385f5cc6db5f3f2f406a6",
      "fullResultFile": "metr21-programs/orthogonal-zero-residual-R-full.csv",
      "fullResultSHA256": "6145235dce4bb0e7b67455b3f10f349c7ede8bfde0e150b7f4f2994a35721108",
      "plotFile": "metr21-programs/orthogonal-zero-residual-R.svg",
      "plotSHA256": "648beab05e284d8e2ced77af2804f0ba9af342d31b1428c02accff5c88d88f3b"
    },
    {
      "api": "aipw",
      "variant": "explicit-clip",
      "profile": "explicit-clip",
      "language": "Python",
      "file": "metr21-programs/aipw-explicit-clip-Python.py",
      "codeSHA256": "f26ae3a6f89e72d1d9d75406097ef17249b5c5cbdd8a07790d51af0a3c918579",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "명시적 클리핑의 점수",
        "en": "Explicit clipping preserves raw propensity values"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"aipw\", \"key\": \"explicit-clip\", \"title\": \"Explicit clipping preserves raw propensity values\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"pair0\", \"y\": 1, \"d\": 0, \"e\": 0, \"mu0\": 1, \"mu1\": 3}, {\"id\": \"b\", \"group\": \"pair0\", \"y\": 2, \"d\": 1, \"e\": \"3/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"c\", \"group\": \"pair1\", \"y\": 3, \"d\": 0, \"e\": \"3/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"d\", \"group\": \"pair1\", \"y\": 4, \"d\": 1, \"e\": \"3/2\", \"mu0\": 1, \"mu1\": 3}], \"clip\": \"1/20\"}, \"xLabel\": \"Constructed row order\", \"yLabel\": \"Pseudo-outcome units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "1",
        "theta": "-8",
        "rowHC0": "75.1385042",
        "groupHC0": "44.8753463",
        "clippedRows": "4",
        "invalidRows": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "2",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "1",
          "y": "18/19",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "2",
          "y": "-38",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "3",
          "y": "58/19",
          "series": "AIPW pseudo-outcome"
        }
      ],
      "summaryFile": "metr21-programs/aipw-explicit-clip-Python-summary.csv",
      "summarySHA256": "28bad8de70bec6db24c3e39165e6dcb0c106b76ae6556753d3f6944ce3a38999",
      "pointsFile": "metr21-programs/aipw-explicit-clip-Python-points.csv",
      "pointsSHA256": "ca407fb3749074c577f71dd4c95ada50f469d6c02cdc2f78cb834a0d58df9b9f",
      "fullResultFile": "metr21-programs/aipw-explicit-clip-Python-full.json",
      "fullResultSHA256": "d37a6ded123b2e49ddcfea340d9f8156049b7a577463158caf83f6dc1edcb41a",
      "plotFile": "metr21-programs/aipw-explicit-clip-Python.svg",
      "plotSHA256": "0040fc1c9389d50b00846c0da6b7aded59c7a62c059d5a35294286e564da5d32"
    },
    {
      "api": "aipw",
      "variant": "supplied-four",
      "profile": "supplied-four",
      "language": "R",
      "file": "metr21-programs/aipw-supplied-four-R.R",
      "codeSHA256": "8b86fa1feb65363410b028311540b1837047b8c797e0d2411c5e28db9b90dba6",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "네 AIPW 의사결과",
        "en": "Four AIPW pseudo-outcomes"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"aipw\",\"key\"=\"supplied-four\",\"title\"=\"Four AIPW pseudo-outcomes\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"pair0\",\"y\"=1,\"d\"=0,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"b\",\"group\"=\"pair0\",\"y\"=2,\"d\"=1,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"c\",\"group\"=\"pair1\",\"y\"=3,\"d\"=0,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"d\",\"group\"=\"pair1\",\"y\"=4,\"d\"=1,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3))),\"xLabel\"=\"Constructed row order\",\"yLabel\"=\"Pseudo-outcome units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "1",
        "theta": "1",
        "rowHC0": "1.25",
        "groupHC0": "0",
        "clippedRows": "0",
        "invalidRows": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "2",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "1",
          "y": "0",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "2",
          "y": "-2",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "3",
          "y": "4",
          "series": "AIPW pseudo-outcome"
        }
      ],
      "summaryFile": "metr21-programs/aipw-supplied-four-R-summary.csv",
      "summarySHA256": "782ddb501dc6a2b578fede0ce3dffb4e80ff15fef8da8c533c1c950aab571c07",
      "pointsFile": "metr21-programs/aipw-supplied-four-R-points.csv",
      "pointsSHA256": "4fab8a86b687117d94b48b4e71b8ce1ed1dd6da2a1502be1f88e2ed5e0828c73",
      "fullResultFile": "metr21-programs/aipw-supplied-four-R-full.csv",
      "fullResultSHA256": "13b6f157e15ca1bd92c81a87870a404480c57dab0bdd7f46f1d0fec0e3498f6c",
      "plotFile": "metr21-programs/aipw-supplied-four-R.svg",
      "plotSHA256": "86465b3cfc4c48cef375131e9d60337f9257bb6f737d1d30d7613190a2ac260c"
    },
    {
      "api": "perturb",
      "variant": "balanced-quadratic",
      "profile": "balanced-quadratic",
      "language": "Python",
      "file": "metr21-programs/perturb-balanced-quadratic-Python.py",
      "codeSHA256": "2224eb3cf2a064c4742ad942ff1e51ea056e7dd0ba7ed2dcf30813fec3d71574",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "균형 가상표의 이차 변화",
        "en": "Balanced constructed score: quadratic nuisance response"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"perturb\", \"key\": \"balanced-quadratic\", \"title\": \"Balanced constructed score: quadratic nuisance response\", \"input\": {\"rows\": [{\"y\": 2, \"d\": 0, \"ell\": 4, \"m\": \"1/2\", \"a\": 7, \"b\": 2}, {\"y\": 4, \"d\": 0, \"ell\": 4, \"m\": \"1/2\", \"a\": 7, \"b\": 2}, {\"y\": 4, \"d\": 1, \"ell\": 4, \"m\": \"1/2\", \"a\": 7, \"b\": 2}, {\"y\": 6, \"d\": 1, \"ell\": 4, \"m\": \"1/2\", \"a\": 7, \"b\": 2}], \"theta\": 2, \"t\": \"1/10\"}, \"xLabel\": \"Nuisance perturbation t\", \"yLabel\": \"Mean score units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "M0": "0",
        "M1": "0",
        "M2": "6",
        "t": "0.1",
        "direct": "0.06"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "-1",
          "y": "6",
          "series": "Mean perturbed score"
        },
        {
          "x": "-9/10",
          "y": "243/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "-4/5",
          "y": "96/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "-7/10",
          "y": "147/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "-3/5",
          "y": "54/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "-1/2",
          "y": "3/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "-2/5",
          "y": "24/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "-3/10",
          "y": "27/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "-1/5",
          "y": "6/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "-1/10",
          "y": "3/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "0",
          "y": "0",
          "series": "Mean perturbed score"
        },
        {
          "x": "1/10",
          "y": "3/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "1/5",
          "y": "6/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "3/10",
          "y": "27/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "2/5",
          "y": "24/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "1/2",
          "y": "3/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "3/5",
          "y": "54/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "7/10",
          "y": "147/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "4/5",
          "y": "96/25",
          "series": "Mean perturbed score"
        },
        {
          "x": "9/10",
          "y": "243/50",
          "series": "Mean perturbed score"
        },
        {
          "x": "1",
          "y": "6",
          "series": "Mean perturbed score"
        }
      ],
      "summaryFile": "metr21-programs/perturb-balanced-quadratic-Python-summary.csv",
      "summarySHA256": "fd00e3315e28c02a2ef66b1f4c258932d5e50311b8307153a1fb6ff911dd9c68",
      "pointsFile": "metr21-programs/perturb-balanced-quadratic-Python-points.csv",
      "pointsSHA256": "6d064533c9f6d35c5919a50e3d4b9d9873732308168ce7f2788f33551352785f",
      "fullResultFile": "metr21-programs/perturb-balanced-quadratic-Python-full.json",
      "fullResultSHA256": "f23b2b7d919dc0938e4b3a3dd868829b0b512f3739e7e1f52b24748d009f419c",
      "plotFile": "metr21-programs/perturb-balanced-quadratic-Python.svg",
      "plotSHA256": "3ac229cee6e1e44861e7cd06278256e8eaba334e86fbf9e0445fd218515f7cde"
    },
    {
      "api": "aipw",
      "variant": "explicit-clip",
      "profile": "explicit-clip",
      "language": "R",
      "file": "metr21-programs/aipw-explicit-clip-R.R",
      "codeSHA256": "b9b6ae4b418b2a0cf788cf9f03103b6f80589920c114a5b2e8512f4ccbb5652a",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "명시적 클리핑의 점수",
        "en": "Explicit clipping preserves raw propensity values"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"aipw\",\"key\"=\"explicit-clip\",\"title\"=\"Explicit clipping preserves raw propensity values\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"pair0\",\"y\"=1,\"d\"=0,\"e\"=0,\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"b\",\"group\"=\"pair0\",\"y\"=2,\"d\"=1,\"e\"=\"3/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"c\",\"group\"=\"pair1\",\"y\"=3,\"d\"=0,\"e\"=\"3/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"d\",\"group\"=\"pair1\",\"y\"=4,\"d\"=1,\"e\"=\"3/2\",\"mu0\"=1,\"mu1\"=3)),\"clip\"=\"1/20\"),\"xLabel\"=\"Constructed row order\",\"yLabel\"=\"Pseudo-outcome units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "1",
        "theta": "-8",
        "rowHC0": "75.1385042",
        "groupHC0": "44.8753463",
        "clippedRows": "4",
        "invalidRows": "undefined"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "2",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "1",
          "y": "0.947368421052632",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "2",
          "y": "-38",
          "series": "AIPW pseudo-outcome"
        },
        {
          "x": "3",
          "y": "3.05263157894737",
          "series": "AIPW pseudo-outcome"
        }
      ],
      "summaryFile": "metr21-programs/aipw-explicit-clip-R-summary.csv",
      "summarySHA256": "4871f6fb71ded9b00329ab0e77f642a68fee0e55f5b4bdb51a4579342ebec7b3",
      "pointsFile": "metr21-programs/aipw-explicit-clip-R-points.csv",
      "pointsSHA256": "7cb086781fb858d2e3cc7647d5d89bba449fe483edb4e8605e106d26c9dd911d",
      "fullResultFile": "metr21-programs/aipw-explicit-clip-R-full.csv",
      "fullResultSHA256": "2c2f764d1fa6e67caffa3c5cd64c7e394ea424111755ede1ef660320f16b1f03",
      "plotFile": "metr21-programs/aipw-explicit-clip-R.svg",
      "plotSHA256": "d268e50f409b3bdcf50ec8b9c8e3942721487c08a2c12004a292a43eef617c8e"
    },
    {
      "api": "perturb",
      "variant": "finite-linear",
      "profile": "finite-linear",
      "language": "Python",
      "file": "metr21-programs/perturb-finite-linear-Python.py",
      "codeSHA256": "5fabac4bdc006c7c7648d986b3567e0eff26488b64ee920fe5ca3980896792da",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "유한 표본의 비영 미분",
        "en": "A finite score derivative need not vanish"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"perturb\", \"key\": \"finite-linear\", \"title\": \"A finite score derivative need not vanish\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"pair0\", \"y\": 1, \"d\": 0, \"ell\": 0, \"m\": \"1/2\", \"a\": 1, \"b\": 1}, {\"id\": \"b\", \"group\": \"pair0\", \"y\": 2, \"d\": 1, \"ell\": 0, \"m\": \"1/2\", \"a\": 1, \"b\": 1}, {\"id\": \"c\", \"group\": \"pair1\", \"y\": 3, \"d\": 0, \"ell\": 0, \"m\": \"1/2\", \"a\": 1, \"b\": 1}, {\"id\": \"d\", \"group\": \"pair1\", \"y\": 4, \"d\": 1, \"ell\": 0, \"m\": \"1/2\", \"a\": 1, \"b\": 1}], \"theta\": 1, \"t\": \"1/10\"}, \"xLabel\": \"Nuisance perturbation t\", \"yLabel\": \"Mean score units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "M0": "0",
        "M1": "-2.5",
        "M2": "0",
        "t": "0.1",
        "direct": "-0.25"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "-1",
          "y": "5/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "-9/10",
          "y": "9/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "-4/5",
          "y": "2",
          "series": "Mean perturbed score"
        },
        {
          "x": "-7/10",
          "y": "7/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "-3/5",
          "y": "3/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "-1/2",
          "y": "5/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "-2/5",
          "y": "1",
          "series": "Mean perturbed score"
        },
        {
          "x": "-3/10",
          "y": "3/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "-1/5",
          "y": "1/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "-1/10",
          "y": "1/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "0",
          "y": "0",
          "series": "Mean perturbed score"
        },
        {
          "x": "1/10",
          "y": "-1/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "1/5",
          "y": "-1/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "3/10",
          "y": "-3/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "2/5",
          "y": "-1",
          "series": "Mean perturbed score"
        },
        {
          "x": "1/2",
          "y": "-5/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "3/5",
          "y": "-3/2",
          "series": "Mean perturbed score"
        },
        {
          "x": "7/10",
          "y": "-7/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "4/5",
          "y": "-2",
          "series": "Mean perturbed score"
        },
        {
          "x": "9/10",
          "y": "-9/4",
          "series": "Mean perturbed score"
        },
        {
          "x": "1",
          "y": "-5/2",
          "series": "Mean perturbed score"
        }
      ],
      "summaryFile": "metr21-programs/perturb-finite-linear-Python-summary.csv",
      "summarySHA256": "a90b6f0d1841d69b5706a19769f17a26ab06c0cd6a6ab1b7037d96edde128570",
      "pointsFile": "metr21-programs/perturb-finite-linear-Python-points.csv",
      "pointsSHA256": "d5cfc92ff1a77b0eb47697e1e4d54d588019285ee35817be45df4d687252d6b5",
      "fullResultFile": "metr21-programs/perturb-finite-linear-Python-full.json",
      "fullResultSHA256": "7621be5c759d6591297cb95e3fee6d49861ce53584f0701f6a6a7adfbeb02086",
      "plotFile": "metr21-programs/perturb-finite-linear-Python.svg",
      "plotSHA256": "2b20e648057d3cc2f02564481c6f8d0589ee3074fc0b04aa2940e66fb6456831"
    },
    {
      "api": "perturb",
      "variant": "balanced-quadratic",
      "profile": "balanced-quadratic",
      "language": "R",
      "file": "metr21-programs/perturb-balanced-quadratic-R.R",
      "codeSHA256": "c7da381fb5b139e98f8e8e83642a1e77e7460a1d1b6f886ad0f825bb481d1265",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "균형 가상표의 이차 변화",
        "en": "Balanced constructed score: quadratic nuisance response"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"perturb\",\"key\"=\"balanced-quadratic\",\"title\"=\"Balanced constructed score: quadratic nuisance response\",\"input\"=list(\"rows\"=list(list(\"y\"=2,\"d\"=0,\"ell\"=4,\"m\"=\"1/2\",\"a\"=7,\"b\"=2),list(\"y\"=4,\"d\"=0,\"ell\"=4,\"m\"=\"1/2\",\"a\"=7,\"b\"=2),list(\"y\"=4,\"d\"=1,\"ell\"=4,\"m\"=\"1/2\",\"a\"=7,\"b\"=2),list(\"y\"=6,\"d\"=1,\"ell\"=4,\"m\"=\"1/2\",\"a\"=7,\"b\"=2)),\"theta\"=2,\"t\"=\"1/10\"),\"xLabel\"=\"Nuisance perturbation t\",\"yLabel\"=\"Mean score units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "M0": "0",
        "M1": "0",
        "M2": "6",
        "t": "0.1",
        "direct": "0.06"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "-1",
          "y": "6",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.9",
          "y": "4.86",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.8",
          "y": "3.84",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.7",
          "y": "2.94",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.6",
          "y": "2.16",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.5",
          "y": "1.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.4",
          "y": "0.96",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.3",
          "y": "0.54",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.2",
          "y": "0.24",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.1",
          "y": "0.06",
          "series": "Mean perturbed score"
        },
        {
          "x": "0",
          "y": "0",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.1",
          "y": "0.06",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.2",
          "y": "0.24",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.3",
          "y": "0.54",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.4",
          "y": "0.96",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.5",
          "y": "1.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.6",
          "y": "2.16",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.7",
          "y": "2.94",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.8",
          "y": "3.84",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.9",
          "y": "4.86",
          "series": "Mean perturbed score"
        },
        {
          "x": "1",
          "y": "6",
          "series": "Mean perturbed score"
        }
      ],
      "summaryFile": "metr21-programs/perturb-balanced-quadratic-R-summary.csv",
      "summarySHA256": "db0e3f071254ec8bf73e8ce016a3e28b9f84a4c54e9459c5a1a24a06db2b8d2c",
      "pointsFile": "metr21-programs/perturb-balanced-quadratic-R-points.csv",
      "pointsSHA256": "06370f27cda29758e8c654b8a408ef59c26c8c7a7c5020096da38c73bdfcdbe3",
      "fullResultFile": "metr21-programs/perturb-balanced-quadratic-R-full.csv",
      "fullResultSHA256": "b8059d2d0e4481e7e918cd5fa68e5997a9b29a563eefd1408a8039326abb4965",
      "plotFile": "metr21-programs/perturb-balanced-quadratic-R.svg",
      "plotSHA256": "be35a87a7fe5a0e8f019d67c9670dd727414ebc38dae8626263076453d809cb1"
    },
    {
      "api": "perturb",
      "variant": "finite-linear",
      "profile": "finite-linear",
      "language": "R",
      "file": "metr21-programs/perturb-finite-linear-R.R",
      "codeSHA256": "06fc069ed1f9a69ccaa9ae609467b3299df805b459636fead2afc3a779a62fb0",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "유한 표본의 비영 미분",
        "en": "A finite score derivative need not vanish"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"perturb\",\"key\"=\"finite-linear\",\"title\"=\"A finite score derivative need not vanish\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"pair0\",\"y\"=1,\"d\"=0,\"ell\"=0,\"m\"=\"1/2\",\"a\"=1,\"b\"=1),list(\"id\"=\"b\",\"group\"=\"pair0\",\"y\"=2,\"d\"=1,\"ell\"=0,\"m\"=\"1/2\",\"a\"=1,\"b\"=1),list(\"id\"=\"c\",\"group\"=\"pair1\",\"y\"=3,\"d\"=0,\"ell\"=0,\"m\"=\"1/2\",\"a\"=1,\"b\"=1),list(\"id\"=\"d\",\"group\"=\"pair1\",\"y\"=4,\"d\"=1,\"ell\"=0,\"m\"=\"1/2\",\"a\"=1,\"b\"=1)),\"theta\"=1,\"t\"=\"1/10\"),\"xLabel\"=\"Nuisance perturbation t\",\"yLabel\"=\"Mean score units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "M0": "0",
        "M1": "-2.5",
        "M2": "0",
        "t": "0.1",
        "direct": "-0.25"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "-1",
          "y": "2.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.9",
          "y": "2.25",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.8",
          "y": "2",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.7",
          "y": "1.75",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.6",
          "y": "1.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.5",
          "y": "1.25",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.4",
          "y": "1",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.3",
          "y": "0.75",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.2",
          "y": "0.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "-0.1",
          "y": "0.25",
          "series": "Mean perturbed score"
        },
        {
          "x": "0",
          "y": "0",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.1",
          "y": "-0.25",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.2",
          "y": "-0.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.3",
          "y": "-0.75",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.4",
          "y": "-1",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.5",
          "y": "-1.25",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.6",
          "y": "-1.5",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.7",
          "y": "-1.75",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.8",
          "y": "-2",
          "series": "Mean perturbed score"
        },
        {
          "x": "0.9",
          "y": "-2.25",
          "series": "Mean perturbed score"
        },
        {
          "x": "1",
          "y": "-2.5",
          "series": "Mean perturbed score"
        }
      ],
      "summaryFile": "metr21-programs/perturb-finite-linear-R-summary.csv",
      "summarySHA256": "7d6f44b9bd6b7fb2d587094c47d8c1e72fe3463fbe64a8c10cafe3451a50feed",
      "pointsFile": "metr21-programs/perturb-finite-linear-R-points.csv",
      "pointsSHA256": "1c43df3980ec9866e2e7339e9facd8170b93c324f39c97abc4f8881927fab083",
      "fullResultFile": "metr21-programs/perturb-finite-linear-R-full.csv",
      "fullResultSHA256": "d4b5a6296e11745ae25b08364188695774156b156728f8d278ca12c94982a097",
      "plotFile": "metr21-programs/perturb-finite-linear-R.svg",
      "plotSHA256": "e8d4c206a39ec2a5c1ff6383ba83224db2061cad397deffdd335f0a6db64ca71"
    },
    {
      "api": "realdata",
      "variant": "actual-country",
      "profile": "actual-country",
      "language": "Python",
      "file": "metr21-programs/realdata-actual-country-Python.py",
      "codeSHA256": "cc9fd321d4d9f5f1f7ff3db7c4f90ca7f252a3dc1b776cdc02763ce697dd8a8e",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "미국 군 440개 전체",
        "en": "All 440 counties: adjusted post levels"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"realdata\", \"key\": \"actual-country\", \"title\": \"All 440 counties: adjusted post levels\", \"input\": {\"kind\": \"country\"}, \"xLabel\": \"Declared source order, not time\", \"yLabel\": \"Log teen-employment points\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "rows": "440",
        "groups": "440",
        "PLRtheta": "-0.067321594",
        "AIPWtheta": "-0.0757570684",
        "clippedRows": "0",
        "rawPropensityMin": "0.168164173",
        "rawPropensityMax": "0.458294009"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "4777954609767929/562949953421312",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "885611048090882823742382134906597959642105248634344143072799147572470140505720658007275473/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "2835552232914109/562949953421312",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "12182354239784756153245658856653365415816564872507114337250649124033075929352770408758921541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "6745789375439761/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "3808543605448411995407411131259764468924229636637661892275021409511810509551320940437256533/1233413608834353710592143122355658268789071683938634837625920409645067597422048277373648896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "6873386131669513/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "4535111422591038489399493196196051356699032969051113433038099742746612305847104782824950593/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "4",
          "y": "2499780006829611/281474976710656",
          "series": "Observed"
        },
        {
          "x": "4",
          "y": "467735937679516331335005850380943091572232552105950154854487150131918176467937902989291261/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "5",
          "y": "5539406066057373/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "5",
          "y": "523790150658766104482935434020353775197995266949769549173824630393660559758536474981232433/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "6",
          "y": "6260770930341873/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "6",
          "y": "590671592249382918815840408861024126969131721685834547659192223118711699554360584050605939/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "7",
          "y": "5312557439628173/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "7",
          "y": "483650978836567159621980095755706347338853092674660215072970402082909540784699379587308721/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "8",
          "y": "113141172906609/17592186044416",
          "series": "Observed"
        },
        {
          "x": "8",
          "y": "651342927880593962720448563224843953070495278429856849547676193367523882683772392681898613/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "9",
          "y": "4392713485578013/562949953421312",
          "series": "Observed"
        },
        {
          "x": "9",
          "y": "815835651321658727558448177976421699358032863147431336438574456744635418981786209328747825/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "10",
          "y": "6273687705741697/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "10",
          "y": "12950792621182771282453277055011312928523448561906984013485100570179961564545580199805394841/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "11",
          "y": "7207917975409331/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "11",
          "y": "15237023539491973113516084755154660579640843230035382073803069848177455093615698414800370441/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "12",
          "y": "2813180416751917/562949953421312",
          "series": "Observed"
        },
        {
          "x": "12",
          "y": "13445694115859630218005342382839790548707904633447077464974142196415691542957409002561191991/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "13",
          "y": "8565150038444149/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "13",
          "y": "18401382399947292718579807885750972222852910555408710317606657522218359152224193147619894541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "14",
          "y": "7804143460206699/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "14",
          "y": "382162652599355470817026529455625302177318916322969174378705187673720996654651594558045279/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "15",
          "y": "7085760179774827/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "15",
          "y": "59114419906439056718421885072575485657146756924117890858409407600062738849230375889874081/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "16",
          "y": "5352066753334667/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "16",
          "y": "1590090291749523903515133393660230328754250774549707196860047097168107162235135687401007/333406933421691425085008113762349277948869647197402191938895690217877829440795580563456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "17",
          "y": "274558962614841/35184372088832",
          "series": "Observed"
        },
        {
          "x": "17",
          "y": "17907965663353419990263597977728923224460481944269888131645831108991942361980177402581417891/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "18",
          "y": "4088891069842221/562949953421312",
          "series": "Observed"
        },
        {
          "x": "18",
          "y": "5411055037473929319096356591010253834745994376814916832175491003732379011520536590738367843/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "19",
          "y": "441281580702527/140737488355328",
          "series": "Observed"
        },
        {
          "x": "19",
          "y": "478656281651181945790557563707834026774022483828288475155906839683032651254606637064358187/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "20",
          "y": "1222672529951887/281474976710656",
          "series": "Observed"
        },
        {
          "x": "20",
          "y": "471489869933666377918402054274648197029673799522967609043511038375615235477916487309573043/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "21",
          "y": "4406569318025797/562949953421312",
          "series": "Observed"
        },
        {
          "x": "21",
          "y": "16663760906810233458356762689699652838657511838321930319203835222632637167654742432965324629/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "22",
          "y": "366584998386381/70368744177664",
          "series": "Observed"
        },
        {
          "x": "22",
          "y": "11845414723072035696366587043579799504351742072172324877514432958556754206687124078789720479/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "23",
          "y": "1074845185859169/140737488355328",
          "series": "Observed"
        },
        {
          "x": "23",
          "y": "16652463281177063887325524449547600199782981221177638488207578316838454882062994479568101779/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "24",
          "y": "8599846691686853/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "24",
          "y": "17448454278285136973730600107691329424716884763457115989446526508255380073193768190651708391/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "25",
          "y": "1801044360179219/281474976710656",
          "series": "Observed"
        },
        {
          "x": "25",
          "y": "681557854437726008236601949003880803995294733771700227285883942997043571907597909996660945/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "26",
          "y": "2616504700208259/281474976710656",
          "series": "Observed"
        },
        {
          "x": "26",
          "y": "918862922472605936194486186480820872687489375203480122969707735380262477513165824992804315/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "27",
          "y": "6273687705741697/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "27",
          "y": "13793089137361864404338507114863248134704718633136529170477424652599244649229974536962594741/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "28",
          "y": "8717169715100533/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "28",
          "y": "482367738572912746001739635512676374362094549611643244637667760239542437502153638420560829/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "29",
          "y": "5895709518137047/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "29",
          "y": "11777489180328819071113040688597467253716990727489514470879315921915485121591186471238266029/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "30",
          "y": "6924963084019651/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "30",
          "y": "337336568491404211355218859144567724102720980819048275191567620862632329020416589986151501/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "31",
          "y": "5633942679709485/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "31",
          "y": "78276234292574653038224385398526236960066717337015883926177792115992043723027363221809525/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "32",
          "y": "8897409869326665/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "32",
          "y": "450051109903059360293440450793006423971925030975070794615136072216317284809436547139390635/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "33",
          "y": "4034683638976513/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "33",
          "y": "231360810872110195850341544207152605644156588953682812413448210277046745510132217442642781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "34",
          "y": "6299085021105079/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "34",
          "y": "4063265713068884018268556678411712060066973677761589515945798928611050632970165825535279943/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "35",
          "y": "3182068520746707/562949953421312",
          "series": "Observed"
        },
        {
          "x": "35",
          "y": "13630754755566632600203788723586573903489803667454620399184655763047827819425022150207135179/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "36",
          "y": "3729764324967995/562949953421312",
          "series": "Observed"
        },
        {
          "x": "36",
          "y": "350005527036507081580942806175279158049708588910283003703113708606051917858733361063023741/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "37",
          "y": "7864091454143311/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "37",
          "y": "1171035538634054151725699293933760739411434029700837261652279645027155511543733855952500733/179964572133768253831974304729792693739978188415341952841993513680208896367962236813049856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "38",
          "y": "6137323687065183/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "38",
          "y": "296335603797381639495453885526230799597471737244362250018535117157213342675859274720297661/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "39",
          "y": "1663741347722731/281474976710656",
          "series": "Observed"
        },
        {
          "x": "39",
          "y": "647984495095328356371963351874356608639106749606131514397129345691764855066232067987548497/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "40",
          "y": "6107950719308203/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "40",
          "y": "282836675317078770996927715966153157288799140974388541096011542455214421538431003494649741/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "41",
          "y": "3043967096884507/562949953421312",
          "series": "Observed"
        },
        {
          "x": "41",
          "y": "13225552588761029238915727547690724960024677543701713757904817735496873967274823422689134691/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "42",
          "y": "2592480341699211/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "42",
          "y": "8412912350098644582646073669831525005521050425534688108353612900381173955257945473721556541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "43",
          "y": "2923374817327527/562949953421312",
          "series": "Observed"
        },
        {
          "x": "43",
          "y": "11983660117759338619539885539506092936576589347348692989661722114531343981335258260864307041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "44",
          "y": "4609822161187467/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "44",
          "y": "795466694125908323318033676808984240685776137547308262757056631922439040488610983554110233/179964572133768253831974304729792693739978188415341952841993513680208896367962236813049856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "45",
          "y": "3731999734735569/562949953421312",
          "series": "Observed"
        },
        {
          "x": "45",
          "y": "351908424473867284968991859793158696217000456504821921948491856985542916041308920129900461/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "46",
          "y": "2839195934653565/562949953421312",
          "series": "Observed"
        },
        {
          "x": "46",
          "y": "288635138265295016763079361275582290540059007520083616498797161012828357199176393911370381/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "47",
          "y": "2023358307592063/281474976710656",
          "series": "Observed"
        },
        {
          "x": "47",
          "y": "376664110638599023808227756423788150554210463603818119470400169553747238304241236921776941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "48",
          "y": "5115295172116377/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "48",
          "y": "535074534395956358347532116206978921097629528085564361359762630523965916591017252170077229/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "49",
          "y": "1376510906973195/281474976710656",
          "series": "Observed"
        },
        {
          "x": "49",
          "y": "4071670508750820462411840891148068361369335708664513053519633461249006728753274934157494343/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "50",
          "y": "8763600222181975/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "50",
          "y": "392331308886876244592238727281953187200868143329733553444010977413707534527727236175257675/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "51",
          "y": "4664755002480667/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "51",
          "y": "445929131509341266272777315013561991499159262896654578845090072709197744397564379924782447/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "52",
          "y": "7211646124202649/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "52",
          "y": "665483671685376677300269401460366199173954478200612095221620526145506720004423017868404413/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "53",
          "y": "5427154565669929/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "53",
          "y": "12103989771323185985391850264740907373814784861859319444007808683982258471721248693612068091/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "54",
          "y": "2835552232914109/562949953421312",
          "series": "Observed"
        },
        {
          "x": "54",
          "y": "519908596455148643910340872704496574538354596297390090232201566563508062366826661090319921/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "55",
          "y": "3236620513617869/562949953421312",
          "series": "Observed"
        },
        {
          "x": "55",
          "y": "13210215022668936149967555172965940965016405611398895078242389591143194240909233218737039541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "56",
          "y": "5852987323223851/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "56",
          "y": "554975103049849654960582133782773560339943711106166064307254101543504053962317006261014709/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "57",
          "y": "1634846772099417/281474976710656",
          "series": "Observed"
        },
        {
          "x": "57",
          "y": "592010153909426230372041790570399224351710177918927340170194037968331591650991322275477443/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "58",
          "y": "1515600622397201/281474976710656",
          "series": "Observed"
        },
        {
          "x": "58",
          "y": "278974930304180279098746592535318484234092012891162187754335058039943518908059111961304941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "59",
          "y": "8207371807020881/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "59",
          "y": "102834468300255210941547934039418103569022031663727210989054548168556908988284121615600101/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "60",
          "y": "7973295037382877/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "60",
          "y": "721253301611734657485530833763062979231345974185488992802471664389680026790585828067369307/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "61",
          "y": "6824593780351633/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "61",
          "y": "669595094753034113656352048981616326130989758355198284433038655984802383291875350340475341/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "62",
          "y": "8296723089357171/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "62",
          "y": "747326148064534014714036012769365537783142673811080151494097099599604915682817605846266251/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "63",
          "y": "6260770930341873/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "63",
          "y": "588757539133739301078041451812763897565624354319554907382070391808873522863428526917195555/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "64",
          "y": "6781799083786255/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "64",
          "y": "8236977813629910476419928947577867425577192355897021692578294511244925485642037740711231/1365609454613612774698968438959766892022449361850861441756837362868298806798547500924928",
          "series": "Out-of-fold ell"
        },
        {
          "x": "65",
          "y": "7667538750169631/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "65",
          "y": "684257712419354523914391459937516523719352388637477286731866677412095933120208855414924947/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "66",
          "y": "7181469445975875/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "66",
          "y": "15532951453498405924836751397726975743931682011318741930300129381903662222951623592908328441/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "67",
          "y": "4039010716033143/562949953421312",
          "series": "Observed"
        },
        {
          "x": "67",
          "y": "389714938856569384649320465163331164046479398081857636428668907389404962850083072404725021/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "68",
          "y": "7504892676893609/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "68",
          "y": "365774890737643908873278160706155400729517509179886042195698233534567620662072256991306301/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "69",
          "y": "4357606664509319/562949953421312",
          "series": "Observed"
        },
        {
          "x": "69",
          "y": "17803824260483377575492709406962812280685895656450936137821634783724994625264466795180131391/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "70",
          "y": "4343981248036659/562949953421312",
          "series": "Observed"
        },
        {
          "x": "70",
          "y": "18147738970815289570399545323910269634463626136989136294899979261402674261698392355973150991/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "71",
          "y": "870051102570681/140737488355328",
          "series": "Observed"
        },
        {
          "x": "71",
          "y": "15276685917567108736360222761669917256087647072193519879268275791439564353764824045847972841/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "72",
          "y": "8299559110773155/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "72",
          "y": "17690387623193559736182446138636500233805417518897505955004530667706924403471436303360752491/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "73",
          "y": "6983434160989949/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "73",
          "y": "651529129057026496519163632240982820724044770567981472310862873470178384620517288256549435/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "74",
          "y": "7271442471576051/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "74",
          "y": "4975196292768564210706302555005632648834313514250394518826720098630309232983494159891448043/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "75",
          "y": "3713862865590699/562949953421312",
          "series": "Observed"
        },
        {
          "x": "75",
          "y": "16228956617832852481668047798982016453733717815685289768145727049720542612429442556158438241/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "76",
          "y": "3601151251443339/562949953421312",
          "series": "Observed"
        },
        {
          "x": "76",
          "y": "4947479559252419038845784104136685764575769376519161583183866922804824706132599483716683443/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "77",
          "y": "4590899028240761/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "77",
          "y": "471640327448788645906675197369213839750586523369021377451100085735842966285475594379763409/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "78",
          "y": "742108713971015/140737488355328",
          "series": "Observed"
        },
        {
          "x": "78",
          "y": "570348860905617604452707772484034361513160736229439455806057632422139188462883707294020963/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "79",
          "y": "7032491025384775/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "79",
          "y": "4851153745888170584733621324686523486163123877752218972153725551193043173481986567442877443/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "80",
          "y": "1727007984823951/281474976710656",
          "series": "Observed"
        },
        {
          "x": "80",
          "y": "343649698636826478756492225904059410490469769538687060497410273451287705966723223746406541/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "81",
          "y": "8716680937186695/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "81",
          "y": "404923163800315438089758641386221754905662577255165538546852107645147411670798430081807021/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "82",
          "y": "742108713971015/140737488355328",
          "series": "Observed"
        },
        {
          "x": "82",
          "y": "300701343288656706251635256425944352297957185730072783975312827135380821074940415125672461/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "83",
          "y": "6566115937890643/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "83",
          "y": "4618190172568084274932551425147254885216344714794730650706162005250488770731512058705847043/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "84",
          "y": "5889704704400227/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "84",
          "y": "304460425592917771450722584891562200290599605086478479409102778180725984799210088732721981/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "85",
          "y": "8871293549040009/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "85",
          "y": "786178983899835138128403502760191440187885508669916713906254195933738933809810203775591707/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "86",
          "y": "5802090526177927/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "86",
          "y": "567685163475722185817729014693355016295857832393132209506328358839990054615631792890498257/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "87",
          "y": "1464797661047039/281474976710656",
          "series": "Observed"
        },
        {
          "x": "87",
          "y": "541615979113732108666655186058521494243314168251169516319022992048859904116049415123516867/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "88",
          "y": "2744492106015793/562949953421312",
          "series": "Observed"
        },
        {
          "x": "88",
          "y": "544999022909294747046653513159763944845994393092369084921428823733634190047944821828533385/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "89",
          "y": "809602624769901/140737488355328",
          "series": "Observed"
        },
        {
          "x": "89",
          "y": "13238985046654471499858283775315170137344581557773900466967248864197151295252194944056372829/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "90",
          "y": "6673125460503209/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "90",
          "y": "319517969308939550957704027283484321233509241166617443203887839138207825574876203876735981/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "91",
          "y": "7242846651139223/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "91",
          "y": "14557766997625008090678994260815271936833734087135871461092900377489347452780477343262154379/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "92",
          "y": "36811001041355/4398046511104",
          "series": "Observed"
        },
        {
          "x": "92",
          "y": "850013347453821521202173847019422132615161522234652145333547984052170918889135837874399353/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "93",
          "y": "1625391761796595/281474976710656",
          "series": "Observed"
        },
        {
          "x": "93",
          "y": "312615671507612103753367136919072104902807367727094094877453712449506095150165191200614221/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "94",
          "y": "5987670805647099/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "94",
          "y": "555302755612611903854584917718339248777058655511362498400465598842320287156125937182262289/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "95",
          "y": "1535536383894459/281474976710656",
          "series": "Observed"
        },
        {
          "x": "95",
          "y": "550524396438532325992530576265888299373289681654511750703725679387510920123624697626045307/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "96",
          "y": "1656790995168931/281474976710656",
          "series": "Observed"
        },
        {
          "x": "96",
          "y": "13312996677566750307563107631827243221519202796767157882005337147566253511613989687186186379/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "97",
          "y": "5154245127389357/562949953421312",
          "series": "Observed"
        },
        {
          "x": "97",
          "y": "21144515163168143169176266967707741415534941174978038361589188487399891107077998997408645241/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "98",
          "y": "6929754154682655/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "98",
          "y": "14614577618963300983025076372255824296085690224284098942464703848159876682309600059288775041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "99",
          "y": "4919560930046323/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "99",
          "y": "11222402315213939743521406715281038061651220483368921923948203848221955038606694436358601541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "100",
          "y": "215493139351511/35184372088832",
          "series": "Observed"
        },
        {
          "x": "100",
          "y": "87562615292282670340333047255274648119841975837382969518704339324217346115565343901691877/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "101",
          "y": "2487586114335297/562949953421312",
          "series": "Observed"
        },
        {
          "x": "101",
          "y": "476787707491304728728979625223447894028254030309923456680967704418944452292983879222487245/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "102",
          "y": "3756732780121337/562949953421312",
          "series": "Observed"
        },
        {
          "x": "102",
          "y": "5008456593630560740780199448121563282986154188761520656993180250832399573673639150911386093/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "103",
          "y": "5948358586016705/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "103",
          "y": "283589599691512032626516297161801818372902010219882881844674538938752282090548407492872301/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "104",
          "y": "5987670805647099/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "104",
          "y": "303829444177827133975039276737353268351511403740310703456402480225292850907997612037295981/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "105",
          "y": "6082873960950751/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "105",
          "y": "58399225797218981591203460458514863477116264256862033473419855160431347886328029767190731/11691124254354063607508465614745576007479352454394643010672231371043294762294296467996672",
          "series": "Out-of-fold ell"
        },
        {
          "x": "106",
          "y": "6072684751981935/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "106",
          "y": "76324704101366802933494755383830633988115296384972875021896257446131734112432540480177413/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "107",
          "y": "8361550908774301/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "107",
          "y": "755162372062065393619533909620898167092289248420518916841317468649043646433224747987294883/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "108",
          "y": "2155333495820443/562949953421312",
          "series": "Observed"
        },
        {
          "x": "108",
          "y": "415216429221603107416343576327054812938176252398646286778699858794958189298830682696305845/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "109",
          "y": "8940302591212715/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "109",
          "y": "444597953379790818821582159387657434688978642455910641394098344593355185774636688110525965/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "110",
          "y": "3043967096884507/562949953421312",
          "series": "Observed"
        },
        {
          "x": "110",
          "y": "556914298130643768791120539284845020759978557052367625256301135582288540630922702556098611/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "111",
          "y": "1423206670303767/281474976710656",
          "series": "Observed"
        },
        {
          "x": "111",
          "y": "11325942406352134671252797276933670432688612706806161706407157433387642381470882315207793179/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "112",
          "y": "1817419088428245/281474976710656",
          "series": "Observed"
        },
        {
          "x": "112",
          "y": "356341433867518600826201754617202955359533685438844438996146818438178584495243284788020301/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "113",
          "y": "50345186977297/8796093022208",
          "series": "Observed"
        },
        {
          "x": "113",
          "y": "4482979232871734037473951768813559411905234472235866602247557429183873674979878640549723393/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "114",
          "y": "2614559640342001/562949953421312",
          "series": "Observed"
        },
        {
          "x": "114",
          "y": "3580117998171356976883813218982214312828338393255452249873269317308846558497365328936304893/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "115",
          "y": "4571652407313997/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "115",
          "y": "228829980189421771721916879392243442561923569939345216695838878919794403217413163589566741/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "116",
          "y": "5292270405961265/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "116",
          "y": "482660893524824537112750411907077163594870622077616383189971970727326035588982352638445603/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "117",
          "y": "1349895032131027/281474976710656",
          "series": "Observed"
        },
        {
          "x": "117",
          "y": "11671580023052663713581676441735615910225887238350661627288492538471069486952106307807639141/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "118",
          "y": "1233430844940305/281474976710656",
          "series": "Observed"
        },
        {
          "x": "118",
          "y": "792960318224092027271535167107699794260577644401432160029302718242073930841391261662389717/194961619811582274984638830123942084884976370783287115578826306486892971065292423214137344",
          "series": "Out-of-fold ell"
        },
        {
          "x": "119",
          "y": "363439502931411/70368744177664",
          "series": "Observed"
        },
        {
          "x": "119",
          "y": "513365293486075679330099497311173030016153872412517855109573618260945039527196053145256907/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "120",
          "y": "2857068862890945/562949953421312",
          "series": "Observed"
        },
        {
          "x": "120",
          "y": "559497053800426610025457419477728533009026553036082786268465006911045792835670278847154165/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "121",
          "y": "4873921798324663/562949953421312",
          "series": "Observed"
        },
        {
          "x": "121",
          "y": "20650629323515008224919490248870936627973427906063152864491817226717636405114269209097023041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "122",
          "y": "3816756722011637/562949953421312",
          "series": "Observed"
        },
        {
          "x": "122",
          "y": "694824004638356317169930459857954360595962840134617418143874402706317090326573873702516331/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "123",
          "y": "6515467222588601/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "123",
          "y": "348848880292879508259667217258189082139781336668693962836669795423679744099177975001658311/59988190711256084610658101576597564579992729471780650947331171226736298789320745604349952",
          "series": "Out-of-fold ell"
        },
        {
          "x": "124",
          "y": "8727385338453257/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "124",
          "y": "19299978946323533914279795612606632439516467475148743786986388678769180846512010256316016129/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "125",
          "y": "8455376638953317/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "125",
          "y": "18058584827200585809286504780291745501071836321726180860419665297020305890574159460982423141/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "126",
          "y": "7503457495173667/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "126",
          "y": "10927217846760633980140656275821060373147176988941132435619865543764096251341247883140151641/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "127",
          "y": "2935747841841113/562949953421312",
          "series": "Observed"
        },
        {
          "x": "127",
          "y": "15500481122281995704368365457256016479066818207604512107404601530082217899160027331508599029/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "128",
          "y": "7582476122586655/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "128",
          "y": "427341796904040506658238950934036139305601291603939206448818560279412356740969957064548983/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "129",
          "y": "1374386557442745/281474976710656",
          "series": "Observed"
        },
        {
          "x": "129",
          "y": "574298014477335892090092616629018748828317741158079158668975585208071901488766093387267017/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "130",
          "y": "3256004116989537/562949953421312",
          "series": "Observed"
        },
        {
          "x": "130",
          "y": "623685759903217372290074765688751225418624336999532870937763157062234679642742354906551331/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "131",
          "y": "3273064512076349/562949953421312",
          "series": "Observed"
        },
        {
          "x": "131",
          "y": "636476364935897683972147219128093395758122472321284005043337348253756265398131813651760213/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "132",
          "y": "8098523969591991/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "132",
          "y": "736812028774279769845344520029471197746025556379113175222964694565349375398545710218361865/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "133",
          "y": "8006850829473215/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "133",
          "y": "5368871401742274139888006513857778067442122452281575959881950407459478590471616365487180393/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "134",
          "y": "2183174903801095/281474976710656",
          "series": "Observed"
        },
        {
          "x": "134",
          "y": "5743494368363096041690796934774409887511623592358370348487649204748635371729470796420313893/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "135",
          "y": "1166436746258531/140737488355328",
          "series": "Observed"
        },
        {
          "x": "135",
          "y": "428223999370739501898231648485568011795791859558153772013154496681731198316589660488834621/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "136",
          "y": "153954783546759/17592186044416",
          "series": "Observed"
        },
        {
          "x": "136",
          "y": "20202958910626210821589865651810751203142677122095772714904054963641080074117571581493984441/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "137",
          "y": "5154185672359105/562949953421312",
          "series": "Observed"
        },
        {
          "x": "137",
          "y": "480944729308769842623409665456346274889531634788146075529867587902030111247460663603665181/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "138",
          "y": "7867214618162159/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "138",
          "y": "737978626989561661248595894338723481308692686371793940831662379302378305177733447346664131/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "139",
          "y": "3487140226395099/562949953421312",
          "series": "Observed"
        },
        {
          "x": "139",
          "y": "15634287165575242700667415694084408921646028361143245428098073914004297611026228048589268791/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "140",
          "y": "742108713971015/140737488355328",
          "series": "Observed"
        },
        {
          "x": "140",
          "y": "629055183996149047000665665449144347442693415701401596493729871114009554052346078483132257/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "141",
          "y": "2813180416751917/562949953421312",
          "series": "Observed"
        },
        {
          "x": "141",
          "y": "577909084687257480887068810864691941120848770066703560769598666125710093593163178260230659/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "142",
          "y": "6912895445376007/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "142",
          "y": "668200095894778400274376756080556093205738011412471064141030944612362678228709425947332049/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "143",
          "y": "6673125460503209/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "143",
          "y": "644301808371145717724719248866837652087072770365414414391419016800589853609044293032916435/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "144",
          "y": "1727007984823951/281474976710656",
          "series": "Observed"
        },
        {
          "x": "144",
          "y": "14532887825011004989923545536911259093125983584461703219155918650648299721388106631248850929/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "145",
          "y": "4595729864121625/562949953421312",
          "series": "Observed"
        },
        {
          "x": "145",
          "y": "438714995957987023025730305575593948789436646373414751957000790043253756698500632270001661/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "146",
          "y": "3664949629558215/562949953421312",
          "series": "Observed"
        },
        {
          "x": "146",
          "y": "99090334598486592887537258961461492221737526988014783118165276979377067620447094412547741/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "147",
          "y": "7582476122586655/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "147",
          "y": "10600561423445499127795918044807817821426885479811183615744960150242041630170756413586071291/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "148",
          "y": "1503733409152335/281474976710656",
          "series": "Observed"
        },
        {
          "x": "148",
          "y": "4348808994722325600407878511370104033283708404512505877567805558495357007213130742448070043/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "149",
          "y": "6225583694522007/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "149",
          "y": "313396078844342433029022693871429021246078891690144974323971597952070130277679510307053341/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "150",
          "y": "3026012729232385/562949953421312",
          "series": "Observed"
        },
        {
          "x": "150",
          "y": "13121521802116267006026045477654381753769003679270266474856784044372025451695128029333037879/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "151",
          "y": "6225583694522007/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "151",
          "y": "13947814891855585863266090822436337495323680197013787506388286327740970909247483898601093991/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "152",
          "y": "836743563671295/140737488355328",
          "series": "Observed"
        },
        {
          "x": "152",
          "y": "323338860293861631200825666996070359850458854783000036150986337062749967898249607907937821/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "153",
          "y": "224120966348845/35184372088832",
          "series": "Observed"
        },
        {
          "x": "153",
          "y": "355139209975167362994112117255296249425211366122986136098592957662722980061856473065755661/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "154",
          "y": "2820736905422669/562949953421312",
          "series": "Observed"
        },
        {
          "x": "154",
          "y": "275194281727553513762161338521427339096274057752716293096397900040384684662302673688924301/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "155",
          "y": "2959706774795803/562949953421312",
          "series": "Observed"
        },
        {
          "x": "155",
          "y": "5696569974421863719026843046405562160047295144785467491485081983602645071524797291163937/1071488597958305135459670451499031785158199470932726580326985165891096949688997089640448",
          "series": "Out-of-fold ell"
        },
        {
          "x": "156",
          "y": "2884535283537545/562949953421312",
          "series": "Observed"
        },
        {
          "x": "156",
          "y": "578557625180777931522449790356797730178245876510606720120715482524059087026637339167135305/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "157",
          "y": "7085760179774827/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "157",
          "y": "15404786014324730565297323570315876494643396900549192865099066614710961326712796209433187041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "158",
          "y": "5436197987035623/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "158",
          "y": "514528600852190972408598651182003619216288503142613189945361098756996892198242801247191523/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "159",
          "y": "2487586114335297/562949953421312",
          "series": "Observed"
        },
        {
          "x": "159",
          "y": "11034429427056846293698883675842827975197609894792737009701767553505999987255462073698062979/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "160",
          "y": "353524163150581/70368744177664",
          "series": "Observed"
        },
        {
          "x": "160",
          "y": "12721195588373329253907270799312564162993469025861753714418701446734653687085774610944033541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "161",
          "y": "3310445770786763/562949953421312",
          "series": "Observed"
        },
        {
          "x": "161",
          "y": "600866539163546173604157140854859191743942365353985294620458408314865267977723550297539453/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "162",
          "y": "2378157970083179/281474976710656",
          "series": "Observed"
        },
        {
          "x": "162",
          "y": "867442136048311858884404752290738812323749519044840251019657318691303948824177731890184593/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "163",
          "y": "5436197987035623/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "163",
          "y": "11521038317775065545575959130681100690350242763212775620045710751983661251569621199758384629/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "164",
          "y": "5522848416081301/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "164",
          "y": "537726743437214385703370026294893657887680254579901719546123819933768199382375125130089049/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "165",
          "y": "7873435075459281/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "165",
          "y": "5059775206735194503137538100447958229889257718337596680559272963798890166432560559604339133/1233413608834353710592143122355658268789071683938634837625920409645067597422048277373648896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "166",
          "y": "5207256459626429/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "166",
          "y": "507648386730514725077237351997840624191301622453989044071236616453814942974264014440614179/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "167",
          "y": "4355399495669825/562949953421312",
          "series": "Observed"
        },
        {
          "x": "167",
          "y": "798438170512709975859567117674890456440255939569157792272681293251429648683410428633171499/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "168",
          "y": "6962732660207429/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "168",
          "y": "15135313640418017557109494207380272554355986934282278557767832469103903686365126461439534941/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "169",
          "y": "3532376987587967/562949953421312",
          "series": "Observed"
        },
        {
          "x": "169",
          "y": "650991970735602022486503566903148358006843879299166985686345812739477869308918134493605961/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "170",
          "y": "6890842293846027/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "170",
          "y": "328106322501819829483720843532209237457329008853268686052120009231663463102656439727626301/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "171",
          "y": "6243314768165359/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "171",
          "y": "298650240896365068585210330562091063868026387451026478575799094248617870276227958747373821/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "172",
          "y": "187797925834521/35184372088832",
          "series": "Observed"
        },
        {
          "x": "172",
          "y": "12705917517545784351678307652623724373170646104181453640284892360695258798395260937580181579/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "173",
          "y": "7169941359868411/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "173",
          "y": "331972905524062629198726619077340650974748707601850642267588320542701673706642863701005981/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "174",
          "y": "1515600622397201/281474976710656",
          "series": "Observed"
        },
        {
          "x": "174",
          "y": "302893054414437732105173007550086792396530671281097244930065572343672623337106333997618701/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "175",
          "y": "2539388149083743/562949953421312",
          "series": "Observed"
        },
        {
          "x": "175",
          "y": "10582103672999696520115721257048631288809633625510599537703338089167117916272250514487479579/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "176",
          "y": "6252076679364105/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "176",
          "y": "4271436089434632263057153657775454247162637054444830023663164004580721930737926843597305193/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "177",
          "y": "3174111498474269/562949953421312",
          "series": "Observed"
        },
        {
          "x": "177",
          "y": "299925930008937506169413001993997952007515652420249158533948680259291901255988864991406861/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "178",
          "y": "5877598137141035/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "178",
          "y": "83431861563866593377316940193878583484927460567594912545336623994699815222479707667188549/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "179",
          "y": "6762552462859491/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "179",
          "y": "14206744432247292129558270201410080407346087705450630673307178152183037873215935467032451979/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "180",
          "y": "1498294109908573/281474976710656",
          "series": "Observed"
        },
        {
          "x": "180",
          "y": "566067352535071901065621746487839935043545587575192930037614094773608554113839259372507747/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "181",
          "y": "4646740219649259/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "181",
          "y": "241229891897850532842221844273505108494218824495448218079996098410492152503160494374990941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "182",
          "y": "6082873960950751/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "182",
          "y": "298017755712316066934822580771083355730120819727674301055475983591701854586477389435368621/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "183",
          "y": "2962631196714801/562949953421312",
          "series": "Observed"
        },
        {
          "x": "183",
          "y": "13492530727189470201103942608855662184629994848366724758906218258161309225963800808816184291/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "184",
          "y": "1162233169930797/140737488355328",
          "series": "Observed"
        },
        {
          "x": "184",
          "y": "20033584720392526577788220751404391698503609161712642672739353203431671481068764172676821241/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "185",
          "y": "1400826014242967/281474976710656",
          "series": "Observed"
        },
        {
          "x": "185",
          "y": "12316188372623087728691913258338818752473999656154629124938032682842006949826754284937158941/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "186",
          "y": "4682486076124019/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "186",
          "y": "308643344256699546350705037456820441813888361646038307723480701624716250953675577419026979/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "187",
          "y": "8198111440298999/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "187",
          "y": "379558757226455257014823481953013330744132618801367619665724600387250471324197784377025501/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "188",
          "y": "2956767081674845/562949953421312",
          "series": "Observed"
        },
        {
          "x": "188",
          "y": "3977222000575638207973368402353857754438923826405321142420555664907673717194953842372732593/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "189",
          "y": "3254269292955843/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "189",
          "y": "2119460644386292335244893738502865166393529722715417080762004976525986458908252441880141343/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "190",
          "y": "3994632758299459/562949953421312",
          "series": "Observed"
        },
        {
          "x": "190",
          "y": "730511122593693301036631140758473585551726756107218123924417033504367204769575403976589197/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "191",
          "y": "7068986686577743/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "191",
          "y": "641875921113445552839851809476047327604385716948866079790329323317451333723677169438974787/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "192",
          "y": "5595512331017853/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "192",
          "y": "11939584309865164026083023584702439219085304192211908145188827471044555832811234205188732479/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "193",
          "y": "1304560234022139/281474976710656",
          "series": "Observed"
        },
        {
          "x": "193",
          "y": "3603685007945384793018689992894592298846387175025230171221644682121687766577756576438357443/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "194",
          "y": "2415313942550515/562949953421312",
          "series": "Observed"
        },
        {
          "x": "194",
          "y": "10664330072087338711219175149052108234380190143963174306831222211799723634783173302779157791/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "195",
          "y": "2592480341699211/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "195",
          "y": "7151326433593452423428506885311230312011288414204392994611363072756480117888736638442984991/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "196",
          "y": "2539388149083743/562949953421312",
          "series": "Observed"
        },
        {
          "x": "196",
          "y": "44614016556539861617027007280614251790269596510454869188963558994556220713494726211928329/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "197",
          "y": "5371313374261431/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "197",
          "y": "517304175996054719109152334807755372746054940053829900967268332021537490489675894525430193/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "198",
          "y": "2744492106015793/562949953421312",
          "series": "Observed"
        },
        {
          "x": "198",
          "y": "10956823519649445281710192228914374370286002387145215470542152394837504274027000845364506529/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "199",
          "y": "6303262762101971/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "199",
          "y": "12886810120234903970315229221123090415173533444040122544811877601191748236740430568793826791/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "200",
          "y": "5954059357217897/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "200",
          "y": "549787665612504170309498557582513145105667769359903939244740741760483014045988218151602521/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "201",
          "y": "5246845805201601/562949953421312",
          "series": "Observed"
        },
        {
          "x": "201",
          "y": "20605305464752890923011418201113396527644419888828688046486404138461793778381746338116392929/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "202",
          "y": "2614559640342001/562949953421312",
          "series": "Observed"
        },
        {
          "x": "202",
          "y": "260359332126400023141825381441798335667616509786356664753282473396269586326733075277923101/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "203",
          "y": "8131064282924989/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "203",
          "y": "210543270981348706109721828582551797868920895182837253843241647794452319952319743192934541/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "204",
          "y": "5942628803132327/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "204",
          "y": "3897992781544924141389320800161347246725701446148846174543413636664753709347233070331401283/1233413608834353710592143122355658268789071683938634837625920409645067597422048277373648896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "205",
          "y": "4039441600059859/562949953421312",
          "series": "Observed"
        },
        {
          "x": "205",
          "y": "9228199841829444929783545431636360863095028037369084058551528225709316001761946921190607/1365609454613612774698968438959766892022449361850861441756837362868298806798547500924928",
          "series": "Out-of-fold ell"
        },
        {
          "x": "206",
          "y": "1448890887979297/281474976710656",
          "series": "Observed"
        },
        {
          "x": "206",
          "y": "546166825079790642604892541498176509813272851784146171344954698761672027643904361123778689/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "207",
          "y": "4334880826095707/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "207",
          "y": "3066011323603358313539853866150530914377324780392928221079267013806079001815578467794511893/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "208",
          "y": "2962631196714801/562949953421312",
          "series": "Observed"
        },
        {
          "x": "208",
          "y": "555762216122313939652214922041366016621219103363226631985457305584340166222284138641705557/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "209",
          "y": "1447249629820615/281474976710656",
          "series": "Observed"
        },
        {
          "x": "209",
          "y": "11553060800695747024302998648227841910301010867098942939272284874757164968916781173391921879/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "210",
          "y": "1204316420247177/140737488355328",
          "series": "Observed"
        },
        {
          "x": "210",
          "y": "6346858124966127023457388470884781189916215822872863966265014520830735539524555302444582743/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "211",
          "y": "4552071045814873/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "211",
          "y": "469277406081030855661533316585141278633180889165870332078906921991568434125200566367528715/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "212",
          "y": "5261137549412187/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "212",
          "y": "261673945511145800312677419860678745493610099984328766598399072954589888069132524638933261/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "213",
          "y": "1634846772099417/281474976710656",
          "series": "Observed"
        },
        {
          "x": "213",
          "y": "608701603387131422702510037811966536601654443476038614427812318456216899416610738849058169/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "214",
          "y": "8005932102448069/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "214",
          "y": "380326388833324003304673126801678012789236070172266482654679794742566890786787508266778041/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "215",
          "y": "5342318641298757/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "215",
          "y": "11295407668523131370677895032575357513902446811991076909651253793187199641505809983212937179/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "216",
          "y": "6082873960950751/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "216",
          "y": "12689873442470428108006258004937164481929389918270141243571758187127395530176390672051113279/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "217",
          "y": "1071410718493035/140737488355328",
          "series": "Observed"
        },
        {
          "x": "217",
          "y": "764006356445283737100995934563324056892128262757186559009272725794040142343993346256421331/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "218",
          "y": "3174111498474269/562949953421312",
          "series": "Observed"
        },
        {
          "x": "218",
          "y": "13690264001548295596808671406183947955158019294104328675454896748494783267940598859327770591/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "219",
          "y": "4628432500714509/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "219",
          "y": "11087062442742591047979348545920748569513789642660968241986599228103474995537694274071795141/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "220",
          "y": "6303262762101971/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "220",
          "y": "13956905065425630668530422628128689549327671828703907426444689340267045736232681026608890391/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "221",
          "y": "1938386333698471/281474976710656",
          "series": "Observed"
        },
        {
          "x": "221",
          "y": "15649242199981605399547502296417205134166269916312642248602878252572586711726084690295165041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "222",
          "y": "7503457495173667/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "222",
          "y": "160878761417738955419180670885474563394591670118171487221305730886880553745736918225043421/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "223",
          "y": "1458542404138125/281474976710656",
          "series": "Observed"
        },
        {
          "x": "223",
          "y": "518924724988427390906236046048704705340994603046012611978901076367853449380364555311211211/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "224",
          "y": "3063808796637567/562949953421312",
          "series": "Observed"
        },
        {
          "x": "224",
          "y": "13705711183298128184474452218272762729624949001019054486272524417942907393442858867400158141/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "225",
          "y": "8620801768709421/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "225",
          "y": "804242886316995592665083733501126801145437356802665688549489988341160719346993205158367853/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "226",
          "y": "3959015500175305/562949953421312",
          "series": "Observed"
        },
        {
          "x": "226",
          "y": "706867642706019264738877762566572749651717069514144397271706112411908020045471135243296621/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "227",
          "y": "3189914640138173/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "227",
          "y": "4226922672541119922814757697052854672310483697547426520584310336299644665656556116357318777/1169769718869493649907832980743652509309858224699722693472957838921357826391754539284824064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "228",
          "y": "8385422472392973/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "228",
          "y": "756232984848788387834055187864233790490364626486516172718589453369886709741228273569544307/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "229",
          "y": "5207256459626429/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "229",
          "y": "259968880803054359038743309342101572224458750641688829228657989434828097591579170167462541/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "230",
          "y": "4643214425534785/562949953421312",
          "series": "Observed"
        },
        {
          "x": "230",
          "y": "421723437123586157827151018466323669212337693257818588376105008938838814220558106674702781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "231",
          "y": "2223831506648599/281474976710656",
          "series": "Observed"
        },
        {
          "x": "231",
          "y": "771658926059225526738767959618815293290700406208515722570649607811432644136591573045911667/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "232",
          "y": "7336581177285325/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "232",
          "y": "9653225729850337556066895842597046489028815181392464179750776452258379892293898067010230841/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "233",
          "y": "2860576350582855/562949953421312",
          "series": "Observed"
        },
        {
          "x": "233",
          "y": "556077697441004275069459338133958838801152890670269011495430882438570480897168632927674169/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "234",
          "y": "1145565476932253/140737488355328",
          "series": "Observed"
        },
        {
          "x": "234",
          "y": "828269266472669961542945109184030379257759874072234578421586224947983698664098000481777563/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "235",
          "y": "8152246816242303/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "235",
          "y": "392338038286738494919011609136840526514889213143339762053969397314883271141366965111074781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "236",
          "y": "6878401284312925/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "236",
          "y": "13904911298796692825984162002144055100475131213232752259314279717881001649899481457437628629/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "237",
          "y": "2259809230341605/281474976710656",
          "series": "Observed"
        },
        {
          "x": "237",
          "y": "19048790415904393953363354398060386512818270568727613021696346006554950108278489640066270191/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "238",
          "y": "5352066753334667/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "238",
          "y": "10755517710037863852131903296748918952410265988607573272444033043518835949677501371269027641/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "239",
          "y": "2539388149083743/562949953421312",
          "series": "Observed"
        },
        {
          "x": "239",
          "y": "541321173389751883135569074666005461592155619652982447191500192283813621792885819061141453/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "240",
          "y": "7873435075459281/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "240",
          "y": "369450993126009099064689095825631984202310161774259712011331181153433265008050327361564461/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "241",
          "y": "5976578105999727/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "241",
          "y": "600651261605546471012742827836412945317105813601891164468380451697363343707876446018225013/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "242",
          "y": "6725911685499173/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "242",
          "y": "317685255263186937229049981525925147482798194759933647112909260945439926980650770407391181/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "243",
          "y": "441281580702527/140737488355328",
          "series": "Observed"
        },
        {
          "x": "243",
          "y": "10737518267852273665853264343205023019662741883624860206113496405504734390132011030979096141/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "244",
          "y": "7487548561282033/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "244",
          "y": "15032761445563931363787150212188762147613253274811675718816283087507319554500433653816673529/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "245",
          "y": "6092971785648843/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "245",
          "y": "12856501673130944070567850342199542027779167109636955471546580602160345123680478073918008779/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "246",
          "y": "3141108645642449/562949953421312",
          "series": "Observed"
        },
        {
          "x": "246",
          "y": "13869289038795192169032293476611804766036660933435743370957155806785977840295950212241460941/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "247",
          "y": "8282434827716757/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "247",
          "y": "730399444881536463110548736686730500980341148323146187664714909859014111085788320664042995/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "248",
          "y": "3961988834306165/562949953421312",
          "series": "Observed"
        },
        {
          "x": "248",
          "y": "376173221559304581680693046520877782498216107797770559544806121649942142043740724701963021/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "249",
          "y": "7237403127690167/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "249",
          "y": "381500334293553895483350068867601384690037733596982207926609681072028563199421631688519161/59988190711256084610658101576597564579992729471780650947331171226736298789320745604349952",
          "series": "Out-of-fold ell"
        },
        {
          "x": "250",
          "y": "7259021070021055/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "250",
          "y": "345433243697452046321333120764414005845101286394696607332813577321527035108800074484640301/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "251",
          "y": "433704722731523/70368744177664",
          "series": "Observed"
        },
        {
          "x": "251",
          "y": "14963023611927556879699674689992377688450000394983656195321997764247651534634924376476499491/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "252",
          "y": "7450533396441567/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "252",
          "y": "353724339146666290524926953430678003769511407151939247498044343211911639054595394392365181/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "253",
          "y": "6433091233446643/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "253",
          "y": "620402574595515319387484813259139127408038345818530220674439730380328933721266672448861057/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "254",
          "y": "7242846651139223/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "254",
          "y": "338562283175820183240247418134773607265747394661113531648746757677188132862875036879832941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "255",
          "y": "4112076911824975/562949953421312",
          "series": "Observed"
        },
        {
          "x": "255",
          "y": "385808055479712231568127799816399477413453463492855613130861343631929661245907388478069341/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "256",
          "y": "4699942238300533/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "256",
          "y": "419782671369653312015277838171374858995106977667352758808727865546850281669542153965412427/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "257",
          "y": "5207256459626429/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "257",
          "y": "10640919703421114349133678542022477392714933640841531027879856876365574330389007407509842529/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "258",
          "y": "4334880826095707/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "258",
          "y": "3023935628410582035776873343169250109866621124483457208784361888559510979254202276668826593/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "259",
          "y": "4099443026634279/562949953421312",
          "series": "Observed"
        },
        {
          "x": "259",
          "y": "746403588949025352063980018890813325166328774202377858847994029982028593437971644872934405/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "260",
          "y": "7804143460206699/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "260",
          "y": "387976181163345959535889289020468692112785878284585011503168316592684176643619189859271591/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "261",
          "y": "283258943350469/70368744177664",
          "series": "Observed"
        },
        {
          "x": "261",
          "y": "251060048209850699431824398882896626970987434976605134125848846672092551224503729544100211/59988190711256084610658101576597564579992729471780650947331171226736298789320745604349952",
          "series": "Out-of-fold ell"
        },
        {
          "x": "262",
          "y": "5332485391835543/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "262",
          "y": "11100615968287084723661491000364151113626246405204105223167789927811176575164581221309263029/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "263",
          "y": "4181110443955751/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "263",
          "y": "60482634330060946496331265301154740629587579768744720928485211543253561617824404969864369/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "264",
          "y": "1349895032131027/281474976710656",
          "series": "Observed"
        },
        {
          "x": "264",
          "y": "11544663011562186992395121360549909794050066187842996026813275144121989310478230674573323791/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "265",
          "y": "1423206670303767/281474976710656",
          "series": "Observed"
        },
        {
          "x": "265",
          "y": "12315869228106737113221478610275908711215693819690993314321788360864145332332189270354334441/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "266",
          "y": "6387594137996475/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "266",
          "y": "593905964316251805700604534599999031066739456349017390522399799764741747691713394373098269/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "267",
          "y": "435460374981015/70368744177664",
          "series": "Observed"
        },
        {
          "x": "267",
          "y": "631902593123823907444540982872437194759861415085242219743050839248280739221118983297142677/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "268",
          "y": "6025656573915643/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "268",
          "y": "305174169495136927949506855528168083509503212658233037396838055903965025731018886427247181/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "269",
          "y": "3256004116989537/562949953421312",
          "series": "Observed"
        },
        {
          "x": "269",
          "y": "627712247153880415655829005022590759260789451580092075231183602216039815754479779666491251/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "270",
          "y": "5569680585361251/562949953421312",
          "series": "Observed"
        },
        {
          "x": "270",
          "y": "518599342628826446548930293513911226135175703347823610076763638876725924949333208178527741/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "271",
          "y": "7030306931767097/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "271",
          "y": "657183995269874333803948924140409004325069496967550673756760179134705643468032878347506421/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "272",
          "y": "254833297079795/35184372088832",
          "series": "Observed"
        },
        {
          "x": "272",
          "y": "17326467078408237988350299297826921215253876128943448754402605091252145691017640684841335691/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "273",
          "y": "8046550131071181/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "273",
          "y": "16082581694723656963495665744281204032576333497726993847771498523765463820522699929313744529/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "274",
          "y": "6875896500394777/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "274",
          "y": "15026215704626736532643502652650397490260445472869140287565393523415390499531799210145226041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "275",
          "y": "6518915617035721/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "275",
          "y": "14449415367276792168361708725523205222410538425662675054261969515587202867246174825648195391/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "276",
          "y": "1241548458235581/140737488355328",
          "series": "Observed"
        },
        {
          "x": "276",
          "y": "128332731879143305989062429807797322906456036462820232707621622489212443860729260712549261/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "277",
          "y": "206007029117643/35184372088832",
          "series": "Observed"
        },
        {
          "x": "277",
          "y": "327084202291183313407928997674509525554008487851631390559972050482745841090440681313026701/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "278",
          "y": "7564936284596729/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "278",
          "y": "350854784263118589020504721784811292774565582398800956026920719226944494016303894203905741/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "279",
          "y": "7658815630333595/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "279",
          "y": "448385018117733925377735807835905346134436925069192059811473227833408735300751353983421079/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "280",
          "y": "7763848507010619/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "280",
          "y": "16194112601757351328236263059453264021896461998219754825936263194337603973828150316908735329/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "281",
          "y": "1904189188435983/281474976710656",
          "series": "Observed"
        },
        {
          "x": "281",
          "y": "697721278763884832584245673911900838774432567987825071998974890946350597752039053745929411/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "282",
          "y": "4511856059940595/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "282",
          "y": "11467733749237995208832344094865172925867202894330947213875310682003191980047302225297540491/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "283",
          "y": "4229227696846647/562949953421312",
          "series": "Observed"
        },
        {
          "x": "283",
          "y": "17940196701496144347544753088524859496202527542928917453666529456457048933543472885762038841/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "284",
          "y": "2245598383211715/562949953421312",
          "series": "Observed"
        },
        {
          "x": "284",
          "y": "40881652587316342859714687832242662921163460010305087790047632989487281183916054379194409/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "285",
          "y": "3485990175017759/562949953421312",
          "series": "Observed"
        },
        {
          "x": "285",
          "y": "658316803005394057773323059744432927017255110119171792408798238279338506599491803039390217/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "286",
          "y": "6067555358568617/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "286",
          "y": "609122463335391477720287759312621735016730984829231228599410048459349481957738727321764921/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "287",
          "y": "7983654708109301/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "287",
          "y": "727796068073794344092117927483484015942929019732557442330466442575649246621274814115249187/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "288",
          "y": "8005932102448069/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "288",
          "y": "410884870820347939285690530962424488690207134046595596492089350158441455247351852039576851/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "289",
          "y": "6781799083786255/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "289",
          "y": "4584956606258047167180925019289491948889403007108904004802248717078136728543845779367299593/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "290",
          "y": "1272770334415389/281474976710656",
          "series": "Observed"
        },
        {
          "x": "290",
          "y": "516691799642013957477029681839119934082145911680560066305187271936848447046749237415100115/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "291",
          "y": "5250565641627027/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "291",
          "y": "509913900468377651585298081272171264963295494336579705253656084841137076762600116625822105/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "292",
          "y": "4628432500714509/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "292",
          "y": "11749980539806451564703911434086725676969724455733496114378017154344345574181766162528036541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "293",
          "y": "6161229041704337/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "293",
          "y": "14248767920991418049283689670890134836085437505905950575212310668954254134606915601265391041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "294",
          "y": "3818672605721611/562949953421312",
          "series": "Observed"
        },
        {
          "x": "294",
          "y": "16723246496569944389206895974850187124970373395097888189836610062928952850998671005529671441/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "295",
          "y": "3848471841719137/562949953421312",
          "series": "Observed"
        },
        {
          "x": "295",
          "y": "708769841403361603417775191234075269313838676654828769964667816991659700012810469484983739/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "296",
          "y": "3551143723824841/562949953421312",
          "series": "Observed"
        },
        {
          "x": "296",
          "y": "666979402308997310441440732461654158686067164502935951462742145097327580304734355957045277/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "297",
          "y": "5269822510340423/562949953421312",
          "series": "Observed"
        },
        {
          "x": "297",
          "y": "950578740421910104537074419472834243095634577361056456140701277895972750062117907757489665/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "298",
          "y": "847383703516237/140737488355328",
          "series": "Observed"
        },
        {
          "x": "298",
          "y": "660973469724953249170792494219391647052624903072068262768192884649938760256405733339528621/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "299",
          "y": "1674956973903069/281474976710656",
          "series": "Observed"
        },
        {
          "x": "299",
          "y": "13042308276033809208230754724357455836329092563306094952725107938875473755740697838637679079/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "300",
          "y": "2150368135052577/281474976710656",
          "series": "Observed"
        },
        {
          "x": "300",
          "y": "405755895433398944586731464272403224707518302307748953931000120718289903665849043203674781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "301",
          "y": "1447249629820615/281474976710656",
          "series": "Observed"
        },
        {
          "x": "301",
          "y": "559628961685623304737714705833931630014909224904116848935622025669789385036826217515691073/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "302",
          "y": "2172366508752637/281474976710656",
          "series": "Observed"
        },
        {
          "x": "302",
          "y": "789000013908010874823270221866491490393239316283695678780517341400866571175901618633752521/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "303",
          "y": "4767180119087803/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "303",
          "y": "3643533350244062687000531100580562532059468542383310046790836161203720563246630184547619593/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "304",
          "y": "4904940404914277/562949953421312",
          "series": "Observed"
        },
        {
          "x": "304",
          "y": "20085043926562285092475708986601566941418882439686325447885036014289264366004470394028687541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "305",
          "y": "3110553474715889/562949953421312",
          "series": "Observed"
        },
        {
          "x": "305",
          "y": "591941956509424784250632101510136419714801266675781686978056095565591226033174200775135779/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "306",
          "y": "6642693880779571/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "306",
          "y": "14660331857697408667302703023203248882928971968218998612925311114561836604356816329428341191/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "307",
          "y": "742108713971015/140737488355328",
          "series": "Observed"
        },
        {
          "x": "307",
          "y": "579973465286489911238539850700099982858179715383263816883430787175201795319351916898004277/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "308",
          "y": "2332448410669279/281474976710656",
          "series": "Observed"
        },
        {
          "x": "308",
          "y": "18957277386205963554617849726962240150718582448123610895866684415967208820581594234721689641/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "309",
          "y": "1796321514871073/281474976710656",
          "series": "Observed"
        },
        {
          "x": "309",
          "y": "655257806103192816184125859700254019335831729107690575354177886886518698452317839546428075/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "310",
          "y": "7140593914522755/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "310",
          "y": "679934099302675476948939635560064312097193835421137032956105637834783299296005905304795467/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "311",
          "y": "3174111498474269/562949953421312",
          "series": "Observed"
        },
        {
          "x": "311",
          "y": "629156351246536627667787234111085017055257572982320103833672406720026271833487748318828153/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "312",
          "y": "1813861695400167/281474976710656",
          "series": "Observed"
        },
        {
          "x": "312",
          "y": "16069584907965190529913604347141570383452664244809303092270926080120152203210804496966382241/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "313",
          "y": "89931040229551/17592186044416",
          "series": "Observed"
        },
        {
          "x": "313",
          "y": "566665454556177050366235987441096578371565155293135210322704661691463668517013460374906181/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "314",
          "y": "3043967096884507/562949953421312",
          "series": "Observed"
        },
        {
          "x": "314",
          "y": "298950254308294137829840651433221695463304257296426910596737979427047406076176348648133501/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "315",
          "y": "3820581991226759/562949953421312",
          "series": "Observed"
        },
        {
          "x": "315",
          "y": "689809308477379298368583316614499829884248009125077962150798739082549824017519049266581069/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "316",
          "y": "5775752485243985/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "316",
          "y": "1008740406405011709728946379680509493393245957193461097263501056900233225109507366666067377/308353402208588427648035780588914567197267920984658709406480102411266899355512069343412224",
          "series": "Out-of-fold ell"
        },
        {
          "x": "317",
          "y": "7399732302562587/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "317",
          "y": "59152757204020852919268692245219949063885256559863511124671311813023884412849920946521865/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "318",
          "y": "4947709893870347/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "318",
          "y": "479235309401049332338503146563387372401580864363345430832335165194943305617382960441940597/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "319",
          "y": "5445169348501337/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "319",
          "y": "251911927090035447277078378725645563901750029168674909061686719599325616366975407003458621/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "320",
          "y": "6873386131669513/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "320",
          "y": "14211470924072870206449678260990409983224554915672145543254950616459618551185110459082045691/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "321",
          "y": "7156341023059193/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "321",
          "y": "354587341698043025644637037303968494817318468388107726765351898504427306948246840749314997/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "322",
          "y": "1498294109908573/281474976710656",
          "series": "Observed"
        },
        {
          "x": "322",
          "y": "285518256239631484883733008021623846411936809808981421284586784732395181742563679844773821/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "323",
          "y": "7582476122586655/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "323",
          "y": "7359783092674700964460446515678880290898095473311785950015571456779458108164144354213104641/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "324",
          "y": "4590899028240761/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "324",
          "y": "9336818991277416990316725491862513888177370624940343566506856014975864115380402054937949979/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "325",
          "y": "5775752485243985/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "325",
          "y": "544959052892506217260827185599582681686401769084397118664855910136643201448537664759775785/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "326",
          "y": "1423206670303767/281474976710656",
          "series": "Observed"
        },
        {
          "x": "326",
          "y": "257970254617709208951311237255925103917377228411131142701603806084924441509825588157664461/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "327",
          "y": "3254269292955843/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "327",
          "y": "7092237088312486530282053332957724065349203815927916425222931785127854501016062236688046579/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "328",
          "y": "7156341023059193/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "328",
          "y": "223520160100185609351518809186233350303516938748520678305455537080547510227935255166989861/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "329",
          "y": "2781897371632687/562949953421312",
          "series": "Observed"
        },
        {
          "x": "329",
          "y": "282055584212282738071283336109750742058780718548704446776917411113833321118644830056728701/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "330",
          "y": "4682486076124019/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "330",
          "y": "43200929265135906825413947896101191054910268566238039830778210185249298619942776964597813/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "331",
          "y": "7990197938935309/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "331",
          "y": "1243925130110650418939087873643055189308404775584172233949277184368343468595625014806311133/179964572133768253831974304729792693739978188415341952841993513680208896367962236813049856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "332",
          "y": "1592020163226179/281474976710656",
          "series": "Observed"
        },
        {
          "x": "332",
          "y": "608751739273700809158959758703581585258284015487782670331665752266805137288879949300142011/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "333",
          "y": "6122732987319427/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "333",
          "y": "305333629042681564298302144212535103362866481359193710686884523252442857802520935803835101/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "334",
          "y": "6170650853228807/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "334",
          "y": "968961055893189998506060678124989808810843629299872349920801630846810104483948521711565933/179964572133768253831974304729792693739978188415341952841993513680208896367962236813049856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "335",
          "y": "4820931715476159/562949953421312",
          "series": "Observed"
        },
        {
          "x": "335",
          "y": "19222105465543483056696404231460409897307353046822730105974648563056334028106402083546396129/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "336",
          "y": "6685071460177011/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "336",
          "y": "15293891745322992409071660826599925335755875784350618677054525343808080562312173222935695391/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "337",
          "y": "2820736905422669/562949953421312",
          "series": "Observed"
        },
        {
          "x": "337",
          "y": "12254978533470740120357386308833719348230071111766151595028550005773957553248198542793324129/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "338",
          "y": "1374386557442745/281474976710656",
          "series": "Observed"
        },
        {
          "x": "338",
          "y": "549075574328218876651176506316653586564128174271401312005362822701782791835328773897228723/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "339",
          "y": "6814046631495255/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "339",
          "y": "645971605924872050225098962531965206458689399574722763939713118281045116637396762245226017/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "340",
          "y": "8460912350275167/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "340",
          "y": "68719517851825854025488666710602657190191025602334762617730737734252311586807551772877177/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "341",
          "y": "6811394333668367/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "341",
          "y": "333772974657918094727725600976673939150614219935391050519228960885694419307458316623256781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "342",
          "y": "5362060087516377/562949953421312",
          "series": "Observed"
        },
        {
          "x": "342",
          "y": "22342807544357827369406270466944859148583372483744787177056155859363472375040451573609475841/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "343",
          "y": "5471662333343435/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "343",
          "y": "546138547348103339262740923054163389996744273916994284090321861882883950279061333989662619/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "344",
          "y": "2507574602948259/562949953421312",
          "series": "Observed"
        },
        {
          "x": "344",
          "y": "519697756933482889043661981258747682288614070291640007960136520952568099382510348816967659/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "345",
          "y": "6754202116250581/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "345",
          "y": "14023225087761671298469839087227837020738725706736727408072029208870676363803568421427601391/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "346",
          "y": "1349895032131027/281474976710656",
          "series": "Observed"
        },
        {
          "x": "346",
          "y": "532682545067091334477059754715127975539845326943245590175284001451598182907070482872219827/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "347",
          "y": "6004107592555389/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "347",
          "y": "52989672766788609273897027749526726142463590768740997731663076833383319553268433099049177/9559266182295289422892779072718368244157145532956030092297861540078091647589832506474496",
          "series": "Out-of-fold ell"
        },
        {
          "x": "348",
          "y": "5173645011197227/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "348",
          "y": "11529532804602276432001928930821307689807427877587925545850756175087805025488720447921021241/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "349",
          "y": "6189261192755849/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "349",
          "y": "262283680756771258347708045891825543282797110177507067132119127167033035005653855953392941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "350",
          "y": "6117827097610435/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "350",
          "y": "13798358013995512838763825281805523204107047570399373067951629133836594611614723639825612491/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "351",
          "y": "2231444963584117/281474976710656",
          "series": "Observed"
        },
        {
          "x": "351",
          "y": "846674719658369359579391267514495687764320950016137276582445853667724310652950655763233625/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "352",
          "y": "1752614263975735/281474976710656",
          "series": "Observed"
        },
        {
          "x": "352",
          "y": "341183725738821382361147532339874533483565351727057351149396211548290737580501957823270381/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "353",
          "y": "2142960471306857/562949953421312",
          "series": "Observed"
        },
        {
          "x": "353",
          "y": "491049300110107691309718451347314997531097272433760245944651307899010606604303103538319995/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "354",
          "y": "5874530372273483/562949953421312",
          "series": "Observed"
        },
        {
          "x": "354",
          "y": "7800764098832524611562287977348257449966430640218091687494508492139545184485381821482822543/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "355",
          "y": "6189261192755849/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "355",
          "y": "294872375141249706961361094990916544629716310419528619556955559036950855630419345841491181/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "356",
          "y": "2479671893043887/281474976710656",
          "series": "Observed"
        },
        {
          "x": "356",
          "y": "20528103779715522730525835649896723262706456588984117262288073287329552045317844208984266941/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "357",
          "y": "5595512331017853/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "357",
          "y": "376460089084789024552804522889676096765773573734703482265371962284252658009444446577393235/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "358",
          "y": "6243314768165359/4503599627370496",
          "series": "Observed"
        },
        {
          "x": "358",
          "y": "300776813802172620182489793398837667343951540772190920045184480119776045706697627549495343/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "359",
          "y": "1819619842225111/281474976710656",
          "series": "Observed"
        },
        {
          "x": "359",
          "y": "16170817810987476738768069789883441308964039611586878741787125588497267543293623329025787291/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "360",
          "y": "895516593626651/140737488355328",
          "series": "Observed"
        },
        {
          "x": "360",
          "y": "666609071344772450912864479229209592246139841974957230236236858218285013491293345423878089/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "361",
          "y": "6648846354596627/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "361",
          "y": "13823413795701003664546725769905099257609581031165448879498481136835049365893670301905339929/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "362",
          "y": "4600996337247429/562949953421312",
          "series": "Observed"
        },
        {
          "x": "362",
          "y": "844778319755239639015946018468149934175800668682847453123596721081983358294267581653084265/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "363",
          "y": "6608240847729017/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "363",
          "y": "629491478568600144442845967755473514111518449131304270853012806849406921761060423132187793/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "364",
          "y": "2592480341699211/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "364",
          "y": "355702541778233663001761505440561390732215840629175481148288897173724972888832728636255983/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "365",
          "y": "1817419088428245/281474976710656",
          "series": "Observed"
        },
        {
          "x": "365",
          "y": "15460599008003108380187784731790603581789724511087760884285547353986056732077815188086698941/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "366",
          "y": "3540795087676521/562949953421312",
          "series": "Observed"
        },
        {
          "x": "366",
          "y": "95953151170766080822769730396862951099411821456217968333004189644887656020518087496734005/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "367",
          "y": "4734063028474157/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "367",
          "y": "405565359601331009873917236283050893307472936092478505968091983632364654115494204325539757/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "368",
          "y": "6745789375439761/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "368",
          "y": "449067468224867609643031280154120668678701307441866026219838944191997050900260058000303655/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "369",
          "y": "8763600222181975/4503599627370496",
          "series": "Observed"
        },
        {
          "x": "369",
          "y": "365732012295356500465175946074672122281353177943147852520288977067417163435573837615915507/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "370",
          "y": "6661051351151851/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "370",
          "y": "14733451738117188584676401496083049420221894641378857268984503798661939584555902199759712591/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "371",
          "y": "6414357025730155/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "371",
          "y": "13888675861769097337320896933427488407036946099776012539607158605162048087585926979507516741/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "372",
          "y": "2155333495820443/562949953421312",
          "series": "Observed"
        },
        {
          "x": "372",
          "y": "64013761809768868157264842390545312274822507993238034761612487807274517949862902564182993/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "373",
          "y": "2959706774795803/562949953421312",
          "series": "Observed"
        },
        {
          "x": "373",
          "y": "3946785335353798508305462132587239849378446790752877546940306064326763500493105675408919443/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "374",
          "y": "6518915617035721/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "374",
          "y": "308192880476059054353167917133659357290642148482721496169005494478628071483422213076442861/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "375",
          "y": "1349895032131027/281474976710656",
          "series": "Observed"
        },
        {
          "x": "375",
          "y": "262652864501871652877033310251916931173083958687848978851813715056433881306724428734277981/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "376",
          "y": "8469469719751697/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "376",
          "y": "392601801204400760152096855952805119754227708375432734119160608602353750730286354810255443/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "377",
          "y": "1657571786173643/562949953421312",
          "series": "Observed"
        },
        {
          "x": "377",
          "y": "189014710942528811595589098960438880083607627415687076384841419189918227938691086977097661/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "378",
          "y": "7811813854202319/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "378",
          "y": "14860029549273947650215811629313165963960046374460032491827420107138865317263630598736071379/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "379",
          "y": "5207256459626429/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "379",
          "y": "521625808343553727161257693306122759242919925240287190643140169177173816045383633623070339/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "380",
          "y": "224777521605069/35184372088832",
          "series": "Observed"
        },
        {
          "x": "380",
          "y": "15497210478021500054336262823417213920950967691123539121722429675888671768557635829791964891/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "381",
          "y": "5852987323223851/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "381",
          "y": "285623832750383548813337197092568463252193882266739202893783605194329395068439303310664941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "382",
          "y": "8853684227211519/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "382",
          "y": "671798915930585588290726882476773824651436696502053231901129452927891459688269323218970583/179964572133768253831974304729792693739978188415341952841993513680208896367962236813049856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "383",
          "y": "5595512331017853/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "383",
          "y": "1151129005309757494979294395994754023383784255990797432099153485020596099864105050895553059/389923239623164549969277660247884169769952741566574231157652612973785942130584846428274688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "384",
          "y": "5775752485243985/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "384",
          "y": "4154817372138598881544816742654217106449875510800091994522303579278625966566386516707562783/1233413608834353710592143122355658268789071683938634837625920409645067597422048277373648896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "385",
          "y": "6673125460503209/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "385",
          "y": "657395888657991883046111920901391284999071790285679268657354547433657943210779354882464621/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "386",
          "y": "3601151251443339/562949953421312",
          "series": "Observed"
        },
        {
          "x": "386",
          "y": "15029762841278563567983240377162933695238053952504147094452675944999091480212319983416914041/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "387",
          "y": "800846897440563/140737488355328",
          "series": "Observed"
        },
        {
          "x": "387",
          "y": "617502152654026340835002620487871594556582345743472452576754903743216513890566348213360621/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "388",
          "y": "6207568911690599/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "388",
          "y": "12692546927749283839536155027617591467400168910813185915032434424780522420379145765153814679/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "389",
          "y": "2437986132194313/562949953421312",
          "series": "Observed"
        },
        {
          "x": "389",
          "y": "240662767742829074005673099720034576898439214889091290460118177552618314691613928555689381/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "390",
          "y": "8005932102448069/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "390",
          "y": "441306343193198518995347955557852640222226454148063613649235826154606786761269704167964103/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "391",
          "y": "7803043411358229/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "391",
          "y": "703091048711080949550656319740714619992552139989875201282437485278624563140948513256420977/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "392",
          "y": "4892585895141559/562949953421312",
          "series": "Observed"
        },
        {
          "x": "392",
          "y": "1455962126588102962544025875051399729847537593703677688594020663250079729199199030952132633/179964572133768253831974304729792693739978188415341952841993513680208896367962236813049856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "393",
          "y": "3089997237272389/562949953421312",
          "series": "Observed"
        },
        {
          "x": "393",
          "y": "12459252396408713099649293088910168002579266064766171799902609465338156269756297967889652541/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "394",
          "y": "2820736905422669/562949953421312",
          "series": "Observed"
        },
        {
          "x": "394",
          "y": "277685876884156375411944480681205954603247396081771133410160633633390871284482869931929101/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "395",
          "y": "4554146439698831/562949953421312",
          "series": "Observed"
        },
        {
          "x": "395",
          "y": "5724757566348786647077732883575269795408610040059770784095062043811204456568708733289765393/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "396",
          "y": "8195784398671079/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "396",
          "y": "721471765100695070265243533616514324537394089228891809776772547140860545897830265826904939/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "397",
          "y": "7301050207710127/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "397",
          "y": "15934261219258195723740782040591704604495870420558419176262807131232435745472800220878516441/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "398",
          "y": "2592480341699211/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "398",
          "y": "193646143356329003377363091497650626131263208585867486882990162521116233640596952471643341/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "399",
          "y": "6624032129124077/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "399",
          "y": "14979430077754340427538385762113031588369525924688347449146980929623193088314573072607835991/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "400",
          "y": "3368656650488953/562949953421312",
          "series": "Observed"
        },
        {
          "x": "400",
          "y": "309283781640313959236136667143851221469790126681005012102006624418274428069270460355382221/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "401",
          "y": "5196163759979057/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "401",
          "y": "271879863354232259919080017317839674887684796221571471734609850873455475339551691837640221/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "402",
          "y": "150633953142475/17592186044416",
          "series": "Observed"
        },
        {
          "x": "402",
          "y": "847479947846457082517466799295852666161404381203665885900183256657008359557153712549485019/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "403",
          "y": "884150443136341/140737488355328",
          "series": "Observed"
        },
        {
          "x": "403",
          "y": "648008722293561773644845811331841612505632466664331803864749262748629137069792624633948653/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "404",
          "y": "3078244201756955/562949953421312",
          "series": "Observed"
        },
        {
          "x": "404",
          "y": "301688291983558839377736807700305191692476299237002013408335961325615019031994521543056701/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "405",
          "y": "1333543057931813/140737488355328",
          "series": "Observed"
        },
        {
          "x": "405",
          "y": "493294197792543733396791237134454177051398501189448194535260056985723977076857252915105181/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "406",
          "y": "7731479545270147/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "406",
          "y": "15283766615702367643304935568684077373546688020634943568635699634804026905207266119390780579/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "407",
          "y": "4664755002480667/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "407",
          "y": "507158041169820113142475077831171337991250227374280480432268101349358839120542192757543293/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "408",
          "y": "5302459614930081/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "408",
          "y": "287363841922640561010288598353510398476940728843241009464028802071375553150295353735406541/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "409",
          "y": "6821966241453527/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "409",
          "y": "15409035092002280022335110366615193379510880887779433764038259597130340702911341675070594141/2466827217668707421184286244711316537578143367877269675251840819290135194844096554747297792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "410",
          "y": "6429369246893969/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "410",
          "y": "302595814043903499863538781928026779841056253003130516465795769592695769252561877252974941/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "411",
          "y": "4734063028474157/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "411",
          "y": "501019841696447219103390758720381490703380088085795792895116299279149450426990012745378147/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "412",
          "y": "496594830017413/70368744177664",
          "series": "Observed"
        },
        {
          "x": "412",
          "y": "738387274503609878812056876929196631316477713379120538289715322101977285078432338821434233/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "413",
          "y": "6451518811848887/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "413",
          "y": "13883207428128343599618042130141207067279649078804268486139890795318017621282309329549008729/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "414",
          "y": "3461279940799253/562949953421312",
          "series": "Observed"
        },
        {
          "x": "414",
          "y": "92938118681127840248154023072075369826550293317662335062552351967106857364628155346434285/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "415",
          "y": "2935747841841113/562949953421312",
          "series": "Observed"
        },
        {
          "x": "415",
          "y": "72675832856158962923844487954163809821407308914907112068247670380312730746530241346891413/15021704000749740521688652828557435812246942980359475859325210991551286874784022510174208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "416",
          "y": "3540795087676521/562949953421312",
          "series": "Observed"
        },
        {
          "x": "416",
          "y": "313310524668673432343945172587419188377177195760425824205555858746282769529511407625702781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "417",
          "y": "7884750747660475/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "417",
          "y": "668158002490186626511577101116938906988009760695546299227842108922636703850412955894430473/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "418",
          "y": "4266116640718465/562949953421312",
          "series": "Observed"
        },
        {
          "x": "418",
          "y": "799576323729786464891932795468074643772085097948147324722268171006494605436574867090877409/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "419",
          "y": "1974747490165303/281474976710656",
          "series": "Observed"
        },
        {
          "x": "419",
          "y": "353175274896724656365819738121522628386748495200076703350521884402943447421586029758059101/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "420",
          "y": "4152957080022665/562949953421312",
          "series": "Observed"
        },
        {
          "x": "420",
          "y": "373463205145312410765315195372546679022570375016497131573912754182982490507780087666452621/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "421",
          "y": "8760783123364057/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "421",
          "y": "17580358002308897359273113469924705069828164066237936465581262782392594913207985312276642529/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "422",
          "y": "4512042128345337/562949953421312",
          "series": "Observed"
        },
        {
          "x": "422",
          "y": "18220992049931310780158688182693616813193573066922177252082957086341993440040832553287182529/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "423",
          "y": "1402760557780425/281474976710656",
          "series": "Observed"
        },
        {
          "x": "423",
          "y": "268502035462563197743651392442205052834742056903680223527446123939979370012667712799624781/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "424",
          "y": "4354661845483363/562949953421312",
          "series": "Observed"
        },
        {
          "x": "424",
          "y": "761108654197398767884733766277527743140804788749525368313425474347576560316662705068244827/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "425",
          "y": "3553190816820307/562949953421312",
          "series": "Observed"
        },
        {
          "x": "425",
          "y": "625155277518619641563634587473451297016587261713907628662988214674017888692099861440622179/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "426",
          "y": "7692095883023729/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "426",
          "y": "686612933393875442581599672365630449927368685111795135881006346974757232490770676340452899/105151928005248183651820569799902050685728600862516331015276476940859008123488157571219456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "427",
          "y": "7156341023059193/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "427",
          "y": "13575711483732952375174765698848287968418535168718560429922219275954646100085580128309106479/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "428",
          "y": "7907046523888483/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "428",
          "y": "14836352964663987249831178848071191595556074523063169947675270856056393984543615680048026279/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "429",
          "y": "2487586114335297/562949953421312",
          "series": "Observed"
        },
        {
          "x": "429",
          "y": "290347562506239750807730757891717495275093277088275706525531757212826891588010739129133821/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "430",
          "y": "4682486076124019/2251799813685248",
          "series": "Observed"
        },
        {
          "x": "430",
          "y": "574385692410096319752954063840510682498113244892826674315001718791358677774008046700146469/146221214858686706238479122592956563663732278087465336684119729865169728298969317410603008",
          "series": "Out-of-fold ell"
        },
        {
          "x": "431",
          "y": "870051102570681/281474976710656",
          "series": "Observed"
        },
        {
          "x": "431",
          "y": "197471338272263503731516697441766094086107318022840832895936854508361755273161826445635381/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "432",
          "y": "5471662333343435/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "432",
          "y": "560143422632869847890758729579477159515262395614033125859698467980390646986866434030305237/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "433",
          "y": "6315703771635073/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "433",
          "y": "13623619085976491706786934804461684390695819848103235292979850736084839296168860836438914429/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "434",
          "y": "7068986686577743/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "434",
          "y": "4783718532499297491100056826675106777384932131131153753819972085993779225463420333780717243/779846479246329099938555320495768339539905483133148462315305225947571884261169692856549376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "435",
          "y": "4571652407313997/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "435",
          "y": "525873727390235311303695600209528897485655583721982401150204958788788703828294300383633261/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "436",
          "y": "6107950719308203/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "436",
          "y": "12973138446366683476901674404807187957104328732234799349222825398601166357145635202361646429/2339539437738987299815665961487305018619716449399445386945915677842715652783509078569648128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "437",
          "y": "4799350876460745/1125899906842624",
          "series": "Observed"
        },
        {
          "x": "437",
          "y": "464217215261787613269504819988389630336873706930260514818822508204484288478841675557077637/108220348393788818681426715601402210300978146564205384613025501755000791918588706053685248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "438",
          "y": "1233430844940305/281474976710656",
          "series": "Observed"
        },
        {
          "x": "438",
          "y": "220389676453052144602816059878005130040427587426418588459301145549165359656662169727294073/48740404952895568746159707530985521221244092695821778894706576621723242766323105803534336",
          "series": "Out-of-fold ell"
        },
        {
          "x": "439",
          "y": "1447249629820615/281474976710656",
          "series": "Observed"
        },
        {
          "x": "439",
          "y": "306631464107926901256404987163137297117722451519674127509979413391684688753400808845013901/54345330147735702288856322543262932305665752493176557286039997505514086198849679631843328",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/realdata-actual-country-Python-summary.csv",
      "summarySHA256": "798486018d000c2b76ea5e2da66917e06dc4128ef685e6a12d769844c2c37df7",
      "pointsFile": "metr21-programs/realdata-actual-country-Python-points.csv",
      "pointsSHA256": "2fbd1f77aa6d5fa4fc9db68097fbb585d8d42287e30289324358b6cdf6fde584",
      "fullResultFile": "metr21-programs/realdata-actual-country-Python-full.json",
      "fullResultSHA256": "a54976ad970d79f196b05855c276d0c8741f4e103390722cbbebe3e8b353ddaa",
      "plotFile": "metr21-programs/realdata-actual-country-Python.svg",
      "plotSHA256": "228df9a75d481c84a1374673d082fb6e2e21691e3afb2daf82fee50ecc3b2340"
    },
    {
      "api": "realdata",
      "variant": "actual-person",
      "profile": "actual-person",
      "language": "Python",
      "file": "metr21-programs/realdata-actual-person-Python.py",
      "codeSHA256": "2511fb4c2e289edecae462da06768a0d608a2744a7e0777a62d00f5ff6b51e47",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "NSW 실험 722명 전체",
        "en": "All 722 people: NSW experimental earnings"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"realdata\", \"key\": \"actual-person\", \"title\": \"All 722 people: NSW experimental earnings\", \"input\": {\"kind\": \"person\"}, \"xLabel\": \"Declared source order, not time\", \"yLabel\": \"Recorded real earnings\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "rows": "722",
        "groups": "722",
        "PLRtheta": "934.180929",
        "AIPWtheta": "921.818372",
        "clippedRows": "0",
        "rawPropensityMin": "0.35510273",
        "rawPropensityMax": "0.452519698"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "1589513/128",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "5968131/512",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "797823970194945351550393385029796041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "4089915/8192",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "32747890249694821003859003663593891127/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "4279583/256",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "31402710575505058490577750862525448227/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "4",
          "y": "60495/2",
          "series": "Observed"
        },
        {
          "x": "4",
          "y": "1687165356604398059162279286174054915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "5",
          "y": "8997935/2048",
          "series": "Observed"
        },
        {
          "x": "5",
          "y": "17021413261739405480187024328876722649/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "6",
          "y": "4218117/256",
          "series": "Observed"
        },
        {
          "x": "6",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "7",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "7",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "8",
          "y": "8167731/512",
          "series": "Observed"
        },
        {
          "x": "8",
          "y": "15815896376759712308047708080435696351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "9",
          "y": "12655933/1024",
          "series": "Observed"
        },
        {
          "x": "9",
          "y": "14673390553919537784500847827000974751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "10",
          "y": "6956111/1024",
          "series": "Observed"
        },
        {
          "x": "10",
          "y": "751559183286248373853229075763874441/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "11",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "11",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "12",
          "y": "5453721/8192",
          "series": "Observed"
        },
        {
          "x": "12",
          "y": "4767840758132809144278924435322929803/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "13",
          "y": "16720859/1024",
          "series": "Observed"
        },
        {
          "x": "13",
          "y": "2214611080836380537413148868784548311/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "14",
          "y": "12977731/2048",
          "series": "Observed"
        },
        {
          "x": "14",
          "y": "9958762925802853353655029106653832609/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "15",
          "y": "1394893/256",
          "series": "Observed"
        },
        {
          "x": "15",
          "y": "13777955733126779277376802006579029409/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "16",
          "y": "13111265/1024",
          "series": "Observed"
        },
        {
          "x": "16",
          "y": "25799460144396943046408145789155415/4353030059675241931322481311744",
          "series": "Out-of-fold ell"
        },
        {
          "x": "17",
          "y": "10603799/8192",
          "series": "Observed"
        },
        {
          "x": "17",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "18",
          "y": "13050841/131072",
          "series": "Observed"
        },
        {
          "x": "18",
          "y": "817099095936313153064008386883496041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "19",
          "y": "6525417/8192",
          "series": "Observed"
        },
        {
          "x": "19",
          "y": "1978296088249433845951779870686717911/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "20",
          "y": "5125173/2048",
          "series": "Observed"
        },
        {
          "x": "20",
          "y": "1123643770305986553390208019571030915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "21",
          "y": "12892887/1024",
          "series": "Observed"
        },
        {
          "x": "21",
          "y": "677160842058178377893335563577607837/93945438997013692707761812144128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "22",
          "y": "12875741/1024",
          "series": "Observed"
        },
        {
          "x": "22",
          "y": "1176240201089051507896893653823162915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "23",
          "y": "4132957/512",
          "series": "Observed"
        },
        {
          "x": "23",
          "y": "58422025037952991973990217487415295/10498484261569701128483631398912",
          "series": "Out-of-fold ell"
        },
        {
          "x": "24",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "24",
          "y": "14663814907703438584736686957538501849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "25",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "25",
          "y": "18100879306897653753219066466331533051/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "26",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "26",
          "y": "645400670635063441868592619867141941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "27",
          "y": "16313553/4096",
          "series": "Observed"
        },
        {
          "x": "27",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "28",
          "y": "5167529/512",
          "series": "Observed"
        },
        {
          "x": "28",
          "y": "340044154005266173552982694178329683/53292742971176438255733614706688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "29",
          "y": "11376989/4096",
          "series": "Observed"
        },
        {
          "x": "29",
          "y": "15682809884009318942408906489799287449/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "30",
          "y": "3370885/256",
          "series": "Observed"
        },
        {
          "x": "30",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "31",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "31",
          "y": "28874376377627886317820770829459689527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "32",
          "y": "5273089/1024",
          "series": "Observed"
        },
        {
          "x": "32",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "33",
          "y": "4606563/512",
          "series": "Observed"
        },
        {
          "x": "33",
          "y": "4929990597845570814164168107852569683/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "34",
          "y": "1186729/256",
          "series": "Observed"
        },
        {
          "x": "34",
          "y": "631922645182521758549892856694065941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "35",
          "y": "11394335/1024",
          "series": "Observed"
        },
        {
          "x": "35",
          "y": "28183101262834495899169329423134020727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "36",
          "y": "3877507/1024",
          "series": "Observed"
        },
        {
          "x": "36",
          "y": "16705421675110600887582169286957111449/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "37",
          "y": "7520219/1024",
          "series": "Observed"
        },
        {
          "x": "37",
          "y": "6696610218223652320959054734539637683/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "38",
          "y": "8564617/2048",
          "series": "Observed"
        },
        {
          "x": "38",
          "y": "1074127102175646233650840100164922415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "39",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "39",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "40",
          "y": "4646279/512",
          "series": "Observed"
        },
        {
          "x": "40",
          "y": "15811518984868505633847031050665651551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "41",
          "y": "12673663/4096",
          "series": "Observed"
        },
        {
          "x": "41",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "42",
          "y": "15041901/2048",
          "series": "Observed"
        },
        {
          "x": "42",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "43",
          "y": "14161531/1024",
          "series": "Observed"
        },
        {
          "x": "43",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "44",
          "y": "5317885/1024",
          "series": "Observed"
        },
        {
          "x": "44",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "45",
          "y": "13707121/1024",
          "series": "Observed"
        },
        {
          "x": "45",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "46",
          "y": "14874675/2048",
          "series": "Observed"
        },
        {
          "x": "46",
          "y": "841522841303886537717853769151813141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "47",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "47",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "48",
          "y": "2187959/256",
          "series": "Observed"
        },
        {
          "x": "48",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "49",
          "y": "5751429/512",
          "series": "Observed"
        },
        {
          "x": "49",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "50",
          "y": "15547593/4096",
          "series": "Observed"
        },
        {
          "x": "50",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "51",
          "y": "7782507/1024",
          "series": "Observed"
        },
        {
          "x": "51",
          "y": "32289843921811629597132992891894697527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "52",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "52",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "53",
          "y": "10120907/2048",
          "series": "Observed"
        },
        {
          "x": "53",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "54",
          "y": "10610371/1024",
          "series": "Observed"
        },
        {
          "x": "54",
          "y": "27031705316043686224485720927921101827/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "55",
          "y": "11963269/8192",
          "series": "Observed"
        },
        {
          "x": "55",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "56",
          "y": "4560635/256",
          "series": "Observed"
        },
        {
          "x": "56",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "57",
          "y": "8954631/4096",
          "series": "Observed"
        },
        {
          "x": "57",
          "y": "13259405006432637671494277755676983951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "58",
          "y": "5984047/1024",
          "series": "Observed"
        },
        {
          "x": "58",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "59",
          "y": "1119113/128",
          "series": "Observed"
        },
        {
          "x": "59",
          "y": "693388228956403775838873621929349841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "60",
          "y": "16000045/2048",
          "series": "Observed"
        },
        {
          "x": "60",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "61",
          "y": "10195969/2048",
          "series": "Observed"
        },
        {
          "x": "61",
          "y": "6802247146464717067053770920792243333/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "62",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "62",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "63",
          "y": "978567/128",
          "series": "Observed"
        },
        {
          "x": "63",
          "y": "17161447695046235617688469452170815451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "64",
          "y": "13793935/2048",
          "series": "Observed"
        },
        {
          "x": "64",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "65",
          "y": "5464933/512",
          "series": "Observed"
        },
        {
          "x": "65",
          "y": "1052845692909072940725066186737580015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "66",
          "y": "3737855/512",
          "series": "Observed"
        },
        {
          "x": "66",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "67",
          "y": "11250131/4096",
          "series": "Observed"
        },
        {
          "x": "67",
          "y": "1003628054330185435910498118565805641/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "68",
          "y": "14987645/2048",
          "series": "Observed"
        },
        {
          "x": "68",
          "y": "4847501710202519828513245457085218483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "69",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "69",
          "y": "860371552396935302455538385685410015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "70",
          "y": "11902495/2048",
          "series": "Observed"
        },
        {
          "x": "70",
          "y": "15191503288613794216601533932151004249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "71",
          "y": "15164953/2048",
          "series": "Observed"
        },
        {
          "x": "71",
          "y": "638877994882127618977022183048505141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "72",
          "y": "5078401/4096",
          "series": "Observed"
        },
        {
          "x": "72",
          "y": "35593502975663855878037249676018991/5777965496399475405716557922304",
          "series": "Out-of-fold ell"
        },
        {
          "x": "73",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "73",
          "y": "663670140094999975123889665542539541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "74",
          "y": "1325475/2048",
          "series": "Observed"
        },
        {
          "x": "74",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "75",
          "y": "5626843/512",
          "series": "Observed"
        },
        {
          "x": "75",
          "y": "1413533937951273694958505429162575261/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "76",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "76",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "77",
          "y": "13502607/512",
          "series": "Observed"
        },
        {
          "x": "77",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "78",
          "y": "3601925/8192",
          "series": "Observed"
        },
        {
          "x": "78",
          "y": "915301996164301373872169048685763215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "79",
          "y": "12921733/4096",
          "series": "Observed"
        },
        {
          "x": "79",
          "y": "25351845100130609539060057334432023927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "80",
          "y": "3632599/512",
          "series": "Observed"
        },
        {
          "x": "80",
          "y": "42663768676483632329193229083545245027/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "81",
          "y": "13082665/4096",
          "series": "Observed"
        },
        {
          "x": "81",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "82",
          "y": "3926161/8192",
          "series": "Observed"
        },
        {
          "x": "82",
          "y": "13199043601692314543083231661058211849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "83",
          "y": "11162919/4096",
          "series": "Observed"
        },
        {
          "x": "83",
          "y": "20917686233025996826823819502888403427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "84",
          "y": "7127855/4096",
          "series": "Observed"
        },
        {
          "x": "84",
          "y": "17122879129911559653499789936720691599/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "85",
          "y": "4129493/1024",
          "series": "Observed"
        },
        {
          "x": "85",
          "y": "13044026693910541475825978404196001851/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "86",
          "y": "5619973/512",
          "series": "Observed"
        },
        {
          "x": "86",
          "y": "14315445200096500792065084417296368351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "87",
          "y": "8700559/65536",
          "series": "Observed"
        },
        {
          "x": "87",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "88",
          "y": "9473389/1024",
          "series": "Observed"
        },
        {
          "x": "88",
          "y": "1175655859583270689406591962687079715/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "89",
          "y": "1207135/256",
          "series": "Observed"
        },
        {
          "x": "89",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "90",
          "y": "2652997/256",
          "series": "Observed"
        },
        {
          "x": "90",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "91",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "91",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "92",
          "y": "2892861/256",
          "series": "Observed"
        },
        {
          "x": "92",
          "y": "1507158664672135106511106903119838561/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "93",
          "y": "1748763/256",
          "series": "Observed"
        },
        {
          "x": "93",
          "y": "13079245062447517298529173581280279849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "94",
          "y": "7573965/512",
          "series": "Observed"
        },
        {
          "x": "94",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "95",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "95",
          "y": "878090193846137972699486423497686015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "96",
          "y": "1585111/128",
          "series": "Observed"
        },
        {
          "x": "96",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "97",
          "y": "9543133/4096",
          "series": "Observed"
        },
        {
          "x": "97",
          "y": "1204917410725844657733238261344724515/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "98",
          "y": "3759009/256",
          "series": "Observed"
        },
        {
          "x": "98",
          "y": "1045589882852602443898444408063471215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "99",
          "y": "8667769/2048",
          "series": "Observed"
        },
        {
          "x": "99",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "100",
          "y": "3271685/256",
          "series": "Observed"
        },
        {
          "x": "100",
          "y": "14434657545375985841394278239453848351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "101",
          "y": "10176713/4096",
          "series": "Observed"
        },
        {
          "x": "101",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "102",
          "y": "11735617/1024",
          "series": "Observed"
        },
        {
          "x": "102",
          "y": "505943439868556504674648714618360641/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "103",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "103",
          "y": "28142652513012416793896051461370863927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "104",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "104",
          "y": "7242937946399881632608603417976460709/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "105",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "105",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "106",
          "y": "13282321/2048",
          "series": "Observed"
        },
        {
          "x": "106",
          "y": "17884796609174037838861798197103620251/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "107",
          "y": "15056915/512",
          "series": "Observed"
        },
        {
          "x": "107",
          "y": "947485496224401052255813961731305615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "108",
          "y": "11673141/8192",
          "series": "Observed"
        },
        {
          "x": "108",
          "y": "612205621360405547934129810114798741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "109",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "109",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "110",
          "y": "2876187/256",
          "series": "Observed"
        },
        {
          "x": "110",
          "y": "2601376503447496389271803377859491103/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "111",
          "y": "5721603/1024",
          "series": "Observed"
        },
        {
          "x": "111",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "112",
          "y": "2624759/128",
          "series": "Observed"
        },
        {
          "x": "112",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "113",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "113",
          "y": "498886835375285492298335203356397191/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "114",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "114",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "115",
          "y": "4797971/512",
          "series": "Observed"
        },
        {
          "x": "115",
          "y": "947646773997219314923926248167449615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "116",
          "y": "9788867/2048",
          "series": "Observed"
        },
        {
          "x": "116",
          "y": "594495001846321180707826795148958741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "117",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "117",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "118",
          "y": "1337159/64",
          "series": "Observed"
        },
        {
          "x": "118",
          "y": "498815224924598317930652040990596991/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "119",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "119",
          "y": "16298220867866317780575098670868935599/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "120",
          "y": "1513357/256",
          "series": "Observed"
        },
        {
          "x": "120",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "121",
          "y": "12681099/2048",
          "series": "Observed"
        },
        {
          "x": "121",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "122",
          "y": "1857271/128",
          "series": "Observed"
        },
        {
          "x": "122",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "123",
          "y": "2464039/512",
          "series": "Observed"
        },
        {
          "x": "123",
          "y": "748287739764417842793588918985341241/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "124",
          "y": "14919651/2048",
          "series": "Observed"
        },
        {
          "x": "124",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "125",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "125",
          "y": "1205673356911412317076528091121398915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "126",
          "y": "10000589/1024",
          "series": "Observed"
        },
        {
          "x": "126",
          "y": "766520566563290753220141889457361241/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "127",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "127",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "128",
          "y": "9679369/16384",
          "series": "Observed"
        },
        {
          "x": "128",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "129",
          "y": "10309053/1024",
          "series": "Observed"
        },
        {
          "x": "129",
          "y": "40099921473590928025885563809727199927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "130",
          "y": "16483539/2048",
          "series": "Observed"
        },
        {
          "x": "130",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "131",
          "y": "9165917/16384",
          "series": "Observed"
        },
        {
          "x": "131",
          "y": "808534431027822961610952783063394441/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "132",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "132",
          "y": "22749647244162178411473367157214123127/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "133",
          "y": "11565701/1024",
          "series": "Observed"
        },
        {
          "x": "133",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "134",
          "y": "9381619/256",
          "series": "Observed"
        },
        {
          "x": "134",
          "y": "17918798112642557425918208187971561951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "135",
          "y": "11821065/1024",
          "series": "Observed"
        },
        {
          "x": "135",
          "y": "1224358284556344687647753002442128515/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "136",
          "y": "14573299/4096",
          "series": "Observed"
        },
        {
          "x": "136",
          "y": "18683207196629048761689022696032873199/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "137",
          "y": "3214853/256",
          "series": "Observed"
        },
        {
          "x": "137",
          "y": "27652869042311718576283736084557310627/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "138",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "138",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "139",
          "y": "1382953/128",
          "series": "Observed"
        },
        {
          "x": "139",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "140",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "140",
          "y": "24385550963335889321152968922151529527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "141",
          "y": "2174487/128",
          "series": "Observed"
        },
        {
          "x": "141",
          "y": "1670222340560512814061309697533966161/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "142",
          "y": "10060403/4096",
          "series": "Observed"
        },
        {
          "x": "142",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "143",
          "y": "4084189/512",
          "series": "Observed"
        },
        {
          "x": "143",
          "y": "942653695619425698661022788668206415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "144",
          "y": "2632573/256",
          "series": "Observed"
        },
        {
          "x": "144",
          "y": "15203134000108994138796562356864062751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "145",
          "y": "3354415/512",
          "series": "Observed"
        },
        {
          "x": "145",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "146",
          "y": "10469405/2048",
          "series": "Observed"
        },
        {
          "x": "146",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "147",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "147",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "148",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "148",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "149",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "149",
          "y": "2540403604623653558056705641117023503/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "150",
          "y": "10168367/1024",
          "series": "Observed"
        },
        {
          "x": "150",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "151",
          "y": "9787905/1024",
          "series": "Observed"
        },
        {
          "x": "151",
          "y": "645543207483681214119280696851489141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "152",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "152",
          "y": "570479383449788066389576778565147141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "153",
          "y": "11885655/1024",
          "series": "Observed"
        },
        {
          "x": "153",
          "y": "1056253677816225699436499358639679215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "154",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "154",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "155",
          "y": "9874431/1024",
          "series": "Observed"
        },
        {
          "x": "155",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "156",
          "y": "6562765/1024",
          "series": "Observed"
        },
        {
          "x": "156",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "157",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "157",
          "y": "15418613627298237307323214817003606751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "158",
          "y": "1356331/1024",
          "series": "Observed"
        },
        {
          "x": "158",
          "y": "751601291317274334575021006679842041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "159",
          "y": "6956253/4096",
          "series": "Observed"
        },
        {
          "x": "159",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "160",
          "y": "12864375/2048",
          "series": "Observed"
        },
        {
          "x": "160",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "161",
          "y": "3779865/512",
          "series": "Observed"
        },
        {
          "x": "161",
          "y": "613777377136490638162155597870455541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "162",
          "y": "8745009/8192",
          "series": "Observed"
        },
        {
          "x": "162",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "163",
          "y": "10471301/1024",
          "series": "Observed"
        },
        {
          "x": "163",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "164",
          "y": "5806919/1024",
          "series": "Observed"
        },
        {
          "x": "164",
          "y": "7838789696696688758847061584148731709/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "165",
          "y": "9922157/2048",
          "series": "Observed"
        },
        {
          "x": "165",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "166",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "166",
          "y": "773191753635920385550967356214325141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "167",
          "y": "10103529/32768",
          "series": "Observed"
        },
        {
          "x": "167",
          "y": "15070894218679406892934402478022340249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "168",
          "y": "14613745/1024",
          "series": "Observed"
        },
        {
          "x": "168",
          "y": "717515626509824679542614008800139241/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "169",
          "y": "6113543/1024",
          "series": "Observed"
        },
        {
          "x": "169",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "170",
          "y": "5655335/1024",
          "series": "Observed"
        },
        {
          "x": "170",
          "y": "13110572360371297784987929443648571951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "171",
          "y": "12897681/8192",
          "series": "Observed"
        },
        {
          "x": "171",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "172",
          "y": "2339751/256",
          "series": "Observed"
        },
        {
          "x": "172",
          "y": "13092841363170883540604318092323811151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "173",
          "y": "1369593/2048",
          "series": "Observed"
        },
        {
          "x": "173",
          "y": "608849580963648300274486973170807941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "174",
          "y": "12235165/4096",
          "series": "Observed"
        },
        {
          "x": "174",
          "y": "26050198590879462582277118220720410627/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "175",
          "y": "4305097/512",
          "series": "Observed"
        },
        {
          "x": "175",
          "y": "28104180242389816725149301544775575927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "176",
          "y": "7581311/2048",
          "series": "Observed"
        },
        {
          "x": "176",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "177",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "177",
          "y": "16640161259539605939427389213329740249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "178",
          "y": "15493679/2048",
          "series": "Observed"
        },
        {
          "x": "178",
          "y": "886302159319624655972969977425630015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "179",
          "y": "6185303/1024",
          "series": "Observed"
        },
        {
          "x": "179",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "180",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "180",
          "y": "896541517652499905557610245653097215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "181",
          "y": "4596135/512",
          "series": "Observed"
        },
        {
          "x": "181",
          "y": "15452321998619117535188439048247794649/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "182",
          "y": "1237399/2048",
          "series": "Observed"
        },
        {
          "x": "182",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "183",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "183",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "184",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "184",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "185",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "185",
          "y": "13073789191827968879068328430298475849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "186",
          "y": "7719415/128",
          "series": "Observed"
        },
        {
          "x": "186",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "187",
          "y": "13093155/4096",
          "series": "Observed"
        },
        {
          "x": "187",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "188",
          "y": "12079585/1024",
          "series": "Observed"
        },
        {
          "x": "188",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "189",
          "y": "2866519/256",
          "series": "Observed"
        },
        {
          "x": "189",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "190",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "190",
          "y": "898799289549341986883522960135176815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "191",
          "y": "5540123/512",
          "series": "Observed"
        },
        {
          "x": "191",
          "y": "26209430457313026918410891088298044727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "192",
          "y": "8577511/4096",
          "series": "Observed"
        },
        {
          "x": "192",
          "y": "13425819847309684996139954662583043951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "193",
          "y": "12499593/16384",
          "series": "Observed"
        },
        {
          "x": "193",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "194",
          "y": "5067289/512",
          "series": "Observed"
        },
        {
          "x": "194",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "195",
          "y": "4231759/1024",
          "series": "Observed"
        },
        {
          "x": "195",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "196",
          "y": "1845355/128",
          "series": "Observed"
        },
        {
          "x": "196",
          "y": "189564388569836902765482196982493129/31315146332337897569253937381376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "197",
          "y": "2749775/4096",
          "series": "Observed"
        },
        {
          "x": "197",
          "y": "4724822819821333149898790207140051283/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "198",
          "y": "8657805/4096",
          "series": "Observed"
        },
        {
          "x": "198",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "199",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "199",
          "y": "625719485535719619862467254231593941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "200",
          "y": "2430951/256",
          "series": "Observed"
        },
        {
          "x": "200",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "201",
          "y": "6970035/512",
          "series": "Observed"
        },
        {
          "x": "201",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "202",
          "y": "14432575/4096",
          "series": "Observed"
        },
        {
          "x": "202",
          "y": "13087039148445468146397901335498347551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "203",
          "y": "4455329/1024",
          "series": "Observed"
        },
        {
          "x": "203",
          "y": "497593596615503709596122674280685691/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "204",
          "y": "4455329/1024",
          "series": "Observed"
        },
        {
          "x": "204",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "205",
          "y": "2630359/256",
          "series": "Observed"
        },
        {
          "x": "205",
          "y": "25198255034343134740629109657716826327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "206",
          "y": "14002933/8192",
          "series": "Observed"
        },
        {
          "x": "206",
          "y": "869562931458300749742369084706021815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "207",
          "y": "6801441/4096",
          "series": "Observed"
        },
        {
          "x": "207",
          "y": "552147756866176634825474829340371141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "208",
          "y": "16563173/2048",
          "series": "Observed"
        },
        {
          "x": "208",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "209",
          "y": "2465089/512",
          "series": "Observed"
        },
        {
          "x": "209",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "210",
          "y": "11574415/1024",
          "series": "Observed"
        },
        {
          "x": "210",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "211",
          "y": "13050823/16384",
          "series": "Observed"
        },
        {
          "x": "211",
          "y": "20971157788586438343681382119637215/4353030059675241931322481311744",
          "series": "Out-of-fold ell"
        },
        {
          "x": "212",
          "y": "14945293/8192",
          "series": "Observed"
        },
        {
          "x": "212",
          "y": "5061013973038845013464132413995764083/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "213",
          "y": "1360745/512",
          "series": "Observed"
        },
        {
          "x": "213",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "214",
          "y": "11732375/262144",
          "series": "Observed"
        },
        {
          "x": "214",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "215",
          "y": "1433079/128",
          "series": "Observed"
        },
        {
          "x": "215",
          "y": "4519463414013115477123917387246002083/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "216",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "216",
          "y": "13829488751289576294116451152039785951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "217",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "217",
          "y": "13055017969613423847152839752534940849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "218",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "218",
          "y": "928237341034684978124504678719524015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "219",
          "y": "8492243/2048",
          "series": "Observed"
        },
        {
          "x": "219",
          "y": "524051312442887254401276919403343141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "220",
          "y": "11564861/1024",
          "series": "Observed"
        },
        {
          "x": "220",
          "y": "999908051765957075307869652000597615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "221",
          "y": "9034813/1024",
          "series": "Observed"
        },
        {
          "x": "221",
          "y": "862253824491440831372308866098387715/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "222",
          "y": "10164299/4096",
          "series": "Observed"
        },
        {
          "x": "222",
          "y": "853720363319234412561705967373192115/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "223",
          "y": "16721387/4096",
          "series": "Observed"
        },
        {
          "x": "223",
          "y": "13347858876168141629806807888229444751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "224",
          "y": "4647893/256",
          "series": "Observed"
        },
        {
          "x": "224",
          "y": "605783318008339344696430509241056741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "225",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "225",
          "y": "887335019742857049339415465711548015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "226",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "226",
          "y": "14931653759976134586681623503345515449/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "227",
          "y": "4569089/16384",
          "series": "Observed"
        },
        {
          "x": "227",
          "y": "12988077637167855429651885776470813849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "228",
          "y": "167773/128",
          "series": "Observed"
        },
        {
          "x": "228",
          "y": "507630430325763636633446742724439241/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "229",
          "y": "2222981/2048",
          "series": "Observed"
        },
        {
          "x": "229",
          "y": "13599461462156497992553585386912897049/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "230",
          "y": "9788129/16384",
          "series": "Observed"
        },
        {
          "x": "230",
          "y": "888140182805354210777097185705838015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "231",
          "y": "10820997/8192",
          "series": "Observed"
        },
        {
          "x": "231",
          "y": "27501123518769189840681078720994254227/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "232",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "232",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "233",
          "y": "3500735/256",
          "series": "Observed"
        },
        {
          "x": "233",
          "y": "20892794304327928818331097450288544427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "234",
          "y": "2823355/512",
          "series": "Observed"
        },
        {
          "x": "234",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "235",
          "y": "11408783/1024",
          "series": "Observed"
        },
        {
          "x": "235",
          "y": "521717158713326850046209638537688141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "236",
          "y": "6934141/1024",
          "series": "Observed"
        },
        {
          "x": "236",
          "y": "17259067520370983021787502420317905451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "237",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "237",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "238",
          "y": "927157/256",
          "series": "Observed"
        },
        {
          "x": "238",
          "y": "12980016385472733594012814583879411101/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "239",
          "y": "5575885/1024",
          "series": "Observed"
        },
        {
          "x": "239",
          "y": "13171128739543396675473310913077528751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "240",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "240",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "241",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "241",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "242",
          "y": "10944555/2048",
          "series": "Observed"
        },
        {
          "x": "242",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "243",
          "y": "12185729/4096",
          "series": "Observed"
        },
        {
          "x": "243",
          "y": "893350069654029777296106785551406415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "244",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "244",
          "y": "550292556425709290487420054931643541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "245",
          "y": "1263473/32",
          "series": "Observed"
        },
        {
          "x": "245",
          "y": "13875588481388133290057352069794615551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "246",
          "y": "4344307/256",
          "series": "Observed"
        },
        {
          "x": "246",
          "y": "820912148393889930768417861511571541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "247",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "247",
          "y": "1015749376187867499903995584430426415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "248",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "248",
          "y": "860384548722606222207377672658921315/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "249",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "249",
          "y": "15887289875287135219801318698616041049/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "250",
          "y": "9393795/512",
          "series": "Observed"
        },
        {
          "x": "250",
          "y": "13370348280061557395422389704135300751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "251",
          "y": "14065133/2048",
          "series": "Observed"
        },
        {
          "x": "251",
          "y": "543716616234934063587861935277919941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "252",
          "y": "8804887/1024",
          "series": "Observed"
        },
        {
          "x": "252",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "253",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "253",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "254",
          "y": "11812259/2048",
          "series": "Observed"
        },
        {
          "x": "254",
          "y": "1459790620175475817650554900841137761/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "255",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "255",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "256",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "256",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "257",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "257",
          "y": "942497419117111575756659727952696815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "258",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "258",
          "y": "7243441079114555883054868202006586109/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "259",
          "y": "7091331/2048",
          "series": "Observed"
        },
        {
          "x": "259",
          "y": "881513148619528235726395218993448815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "260",
          "y": "7171",
          "series": "Observed"
        },
        {
          "x": "260",
          "y": "977554922279768167306820482112604015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "261",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "261",
          "y": "22291266862670824975477355895322756249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "262",
          "y": "9138581/1024",
          "series": "Observed"
        },
        {
          "x": "262",
          "y": "14845777920736027300099259489952973849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "263",
          "y": "4384053/512",
          "series": "Observed"
        },
        {
          "x": "263",
          "y": "631117522140121510067973384442485141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "264",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "264",
          "y": "32622499378972385854899167373175430627/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "265",
          "y": "9955331/1024",
          "series": "Observed"
        },
        {
          "x": "265",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "266",
          "y": "6482829/1024",
          "series": "Observed"
        },
        {
          "x": "266",
          "y": "27273525910142301158528309036637209027/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "267",
          "y": "15433609/2048",
          "series": "Observed"
        },
        {
          "x": "267",
          "y": "2456419749699806094810271658095359903/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "268",
          "y": "8764647/2048",
          "series": "Observed"
        },
        {
          "x": "268",
          "y": "505048238714064085234827922391502141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "269",
          "y": "6552407/512",
          "series": "Observed"
        },
        {
          "x": "269",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "270",
          "y": "10422243/2048",
          "series": "Observed"
        },
        {
          "x": "270",
          "y": "16573719911223870457452018609885283799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "271",
          "y": "66633/4",
          "series": "Observed"
        },
        {
          "x": "271",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "272",
          "y": "1298381/256",
          "series": "Observed"
        },
        {
          "x": "272",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "273",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "273",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "274",
          "y": "10475139/2048",
          "series": "Observed"
        },
        {
          "x": "274",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "275",
          "y": "7312029/512",
          "series": "Observed"
        },
        {
          "x": "275",
          "y": "852748470024135770472525856544272365/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "276",
          "y": "8564187/65536",
          "series": "Observed"
        },
        {
          "x": "276",
          "y": "4640875127174404561247322150451364083/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "277",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "277",
          "y": "16081166412438929513200683156751429849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "278",
          "y": "8386991/1024",
          "series": "Observed"
        },
        {
          "x": "278",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "279",
          "y": "1207033/64",
          "series": "Observed"
        },
        {
          "x": "279",
          "y": "14425924048891244434419175009026809951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "280",
          "y": "11686129/1024",
          "series": "Observed"
        },
        {
          "x": "280",
          "y": "8719351416291771134204895855726715009/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "281",
          "y": "16165645/8192",
          "series": "Observed"
        },
        {
          "x": "281",
          "y": "727970205773155903435050928635709441/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "282",
          "y": "636747/128",
          "series": "Observed"
        },
        {
          "x": "282",
          "y": "25803692966269266750915932636460065527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "283",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "283",
          "y": "3015497065602351654824020802389085503/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "284",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "284",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "285",
          "y": "14918439/2048",
          "series": "Observed"
        },
        {
          "x": "285",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "286",
          "y": "9617075/512",
          "series": "Observed"
        },
        {
          "x": "286",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "287",
          "y": "8563419/4096",
          "series": "Observed"
        },
        {
          "x": "287",
          "y": "538381674682213511613451501919341941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "288",
          "y": "12252989/1024",
          "series": "Observed"
        },
        {
          "x": "288",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "289",
          "y": "5478439/1024",
          "series": "Observed"
        },
        {
          "x": "289",
          "y": "17191805085901564492061181654026499051/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "290",
          "y": "4909/2",
          "series": "Observed"
        },
        {
          "x": "290",
          "y": "17546659364100071388538395340218816251/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "291",
          "y": "7072475/32768",
          "series": "Observed"
        },
        {
          "x": "291",
          "y": "506974210406475999799568833579193541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "292",
          "y": "8984693/2048",
          "series": "Observed"
        },
        {
          "x": "292",
          "y": "26679770836488626242903120178955975427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "293",
          "y": "13013389/2048",
          "series": "Observed"
        },
        {
          "x": "293",
          "y": "26270383266426606832331714529050280827/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "294",
          "y": "2894405/256",
          "series": "Observed"
        },
        {
          "x": "294",
          "y": "17712623362980684767813790465053037199/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "295",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "295",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "296",
          "y": "1562559/256",
          "series": "Observed"
        },
        {
          "x": "296",
          "y": "3173783320747332581365070569665445803/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "297",
          "y": "13979463/4096",
          "series": "Observed"
        },
        {
          "x": "297",
          "y": "18934781049176739917491317971411907599/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "298",
          "y": "11827327/2048",
          "series": "Observed"
        },
        {
          "x": "298",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "299",
          "y": "4803223/512",
          "series": "Observed"
        },
        {
          "x": "299",
          "y": "771949075249766529923531612615480041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "300",
          "y": "5339607/256",
          "series": "Observed"
        },
        {
          "x": "300",
          "y": "17190622040855129734234967275279607851/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "301",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "301",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "302",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "302",
          "y": "33266150554893963645730689152845881827/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "303",
          "y": "1903787/1024",
          "series": "Observed"
        },
        {
          "x": "303",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "304",
          "y": "2398711/128",
          "series": "Observed"
        },
        {
          "x": "304",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "305",
          "y": "13545759/1024",
          "series": "Observed"
        },
        {
          "x": "305",
          "y": "511967441161948070235776543689414641/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "306",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "306",
          "y": "14349106949288138651249922538501681049/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "307",
          "y": "6602863/512",
          "series": "Observed"
        },
        {
          "x": "307",
          "y": "983384211156241496311190538885476041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "308",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "308",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "309",
          "y": "4439203/1024",
          "series": "Observed"
        },
        {
          "x": "309",
          "y": "16591574685392725131148833036761058799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "310",
          "y": "2212713/512",
          "series": "Observed"
        },
        {
          "x": "310",
          "y": "726102695909115319364976757909142041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "311",
          "y": "8070593/512",
          "series": "Observed"
        },
        {
          "x": "311",
          "y": "4743817628978626176711853946415614603/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "312",
          "y": "8625483/2048",
          "series": "Observed"
        },
        {
          "x": "312",
          "y": "16947365807797247508354870779816307599/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "313",
          "y": "5502643/512",
          "series": "Observed"
        },
        {
          "x": "313",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "314",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "314",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "315",
          "y": "8588755/8192",
          "series": "Observed"
        },
        {
          "x": "315",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "316",
          "y": "10852757/4096",
          "series": "Observed"
        },
        {
          "x": "316",
          "y": "25886058718966381025881227852883095427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "317",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "317",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "318",
          "y": "14527881/8192",
          "series": "Observed"
        },
        {
          "x": "318",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "319",
          "y": "6376819/256",
          "series": "Observed"
        },
        {
          "x": "319",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "320",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "320",
          "y": "16678917292218090609090035855303961199/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "321",
          "y": "6575647/1024",
          "series": "Observed"
        },
        {
          "x": "321",
          "y": "1025600618705532810026165902067376841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "322",
          "y": "15955391/1024",
          "series": "Observed"
        },
        {
          "x": "322",
          "y": "27042131970913224891042320018436116627/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "323",
          "y": "14798949/2048",
          "series": "Observed"
        },
        {
          "x": "323",
          "y": "13404878920406072316167893125198124751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "324",
          "y": "6481703/512",
          "series": "Observed"
        },
        {
          "x": "324",
          "y": "1035235050237860872287449468144493615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "325",
          "y": "12310571/2048",
          "series": "Observed"
        },
        {
          "x": "325",
          "y": "8793084406054157446367526256849037609/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "326",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "326",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "327",
          "y": "2705733/256",
          "series": "Observed"
        },
        {
          "x": "327",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "328",
          "y": "15318335/2048",
          "series": "Observed"
        },
        {
          "x": "328",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "329",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "329",
          "y": "13915188420364525242603175482583063551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "330",
          "y": "5228027/512",
          "series": "Observed"
        },
        {
          "x": "330",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "331",
          "y": "4914453/512",
          "series": "Observed"
        },
        {
          "x": "331",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "332",
          "y": "6752681/512",
          "series": "Observed"
        },
        {
          "x": "332",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "333",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "333",
          "y": "62971370782058044944609432958607295/10498484261569701128483631398912",
          "series": "Out-of-fold ell"
        },
        {
          "x": "334",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "334",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "335",
          "y": "14136053/8192",
          "series": "Observed"
        },
        {
          "x": "335",
          "y": "1840308984926681509115277935031391111/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "336",
          "y": "3872639/2048",
          "series": "Observed"
        },
        {
          "x": "336",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "337",
          "y": "3198071/1024",
          "series": "Observed"
        },
        {
          "x": "337",
          "y": "25342958820566060320881620697267105527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "338",
          "y": "3917115/1024",
          "series": "Observed"
        },
        {
          "x": "338",
          "y": "765201099316757454119583247660294441/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "339",
          "y": "887083/128",
          "series": "Observed"
        },
        {
          "x": "339",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "340",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "340",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "341",
          "y": "2854871/1024",
          "series": "Observed"
        },
        {
          "x": "341",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "342",
          "y": "4299087/512",
          "series": "Observed"
        },
        {
          "x": "342",
          "y": "14016786152917469112928227355723412351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "343",
          "y": "13868281/4096",
          "series": "Observed"
        },
        {
          "x": "343",
          "y": "269333664132729596897815237975249667/50269749948430607902045092708352",
          "series": "Out-of-fold ell"
        },
        {
          "x": "344",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "344",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "345",
          "y": "6772659/4096",
          "series": "Observed"
        },
        {
          "x": "345",
          "y": "8808142468377665928435913813721501309/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "346",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "346",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "347",
          "y": "14931825/1024",
          "series": "Observed"
        },
        {
          "x": "347",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "348",
          "y": "15584293/2048",
          "series": "Observed"
        },
        {
          "x": "348",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "349",
          "y": "1091177/32",
          "series": "Observed"
        },
        {
          "x": "349",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "350",
          "y": "5546671/512",
          "series": "Observed"
        },
        {
          "x": "350",
          "y": "1329127703600212752901312771248434415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "351",
          "y": "88653/4",
          "series": "Observed"
        },
        {
          "x": "351",
          "y": "880748987677431152246268425702791215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "352",
          "y": "7275045/2048",
          "series": "Observed"
        },
        {
          "x": "352",
          "y": "898799274462553135783179825215959215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "353",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "353",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "354",
          "y": "4431917/2048",
          "series": "Observed"
        },
        {
          "x": "354",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "355",
          "y": "9578597/2048",
          "series": "Observed"
        },
        {
          "x": "355",
          "y": "14733143000460837868755500693917693049/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "356",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "356",
          "y": "571724091487326857097618880479418341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "357",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "357",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "358",
          "y": "2565303/256",
          "series": "Observed"
        },
        {
          "x": "358",
          "y": "59166920150687220315933718937197695/10498484261569701128483631398912",
          "series": "Out-of-fold ell"
        },
        {
          "x": "359",
          "y": "13703381/8192",
          "series": "Observed"
        },
        {
          "x": "359",
          "y": "13460993210997961573215952888140900751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "360",
          "y": "3268355/1024",
          "series": "Observed"
        },
        {
          "x": "360",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "361",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "361",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "362",
          "y": "14000525/4096",
          "series": "Observed"
        },
        {
          "x": "362",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "363",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "363",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "364",
          "y": "9621393/4096",
          "series": "Observed"
        },
        {
          "x": "364",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "365",
          "y": "1094057/64",
          "series": "Observed"
        },
        {
          "x": "365",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "366",
          "y": "4593271/1024",
          "series": "Observed"
        },
        {
          "x": "366",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "367",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "367",
          "y": "787997871041400450864674183812206741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "368",
          "y": "12631411/2048",
          "series": "Observed"
        },
        {
          "x": "368",
          "y": "14887806372755841971686886957739280351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "369",
          "y": "4507477/512",
          "series": "Observed"
        },
        {
          "x": "369",
          "y": "881466190907706110737658752069379541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "370",
          "y": "147193/16",
          "series": "Observed"
        },
        {
          "x": "370",
          "y": "14224019595779460906149342134249393951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "371",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "371",
          "y": "21085840298141561088439829799370707527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "372",
          "y": "8137991/1024",
          "series": "Observed"
        },
        {
          "x": "372",
          "y": "586286206569327062928156924005539941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "373",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "373",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "374",
          "y": "1239853/256",
          "series": "Observed"
        },
        {
          "x": "374",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "375",
          "y": "8687861/1024",
          "series": "Observed"
        },
        {
          "x": "375",
          "y": "581306648053873679705041511008588341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "376",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "376",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "377",
          "y": "4753627/2048",
          "series": "Observed"
        },
        {
          "x": "377",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "378",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "378",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "379",
          "y": "14791383/1024",
          "series": "Observed"
        },
        {
          "x": "379",
          "y": "13026423603107781065771910943975763151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "380",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "380",
          "y": "4425791681770566299861862190953245683/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "381",
          "y": "9563177/512",
          "series": "Observed"
        },
        {
          "x": "381",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "382",
          "y": "5461791/4096",
          "series": "Observed"
        },
        {
          "x": "382",
          "y": "501010117501473215778670895166740991/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "383",
          "y": "2330613/512",
          "series": "Observed"
        },
        {
          "x": "383",
          "y": "894632744670453115694351833701954015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "384",
          "y": "321173/256",
          "series": "Observed"
        },
        {
          "x": "384",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "385",
          "y": "10223395/1024",
          "series": "Observed"
        },
        {
          "x": "385",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "386",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "386",
          "y": "1402046609122496802056830363826336111/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "387",
          "y": "12466107/2048",
          "series": "Observed"
        },
        {
          "x": "387",
          "y": "8184105818711617067842517686464982909/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "388",
          "y": "11504581/16384",
          "series": "Observed"
        },
        {
          "x": "388",
          "y": "21257163463153822222598040039520108127/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "389",
          "y": "2496169/256",
          "series": "Observed"
        },
        {
          "x": "389",
          "y": "23731370672082533559644986900156215/4353030059675241931322481311744",
          "series": "Out-of-fold ell"
        },
        {
          "x": "390",
          "y": "4259757/1024",
          "series": "Observed"
        },
        {
          "x": "390",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "391",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "391",
          "y": "26197304981611011443558383657304975927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "392",
          "y": "6769201/4096",
          "series": "Observed"
        },
        {
          "x": "392",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "393",
          "y": "7048835/4096",
          "series": "Observed"
        },
        {
          "x": "393",
          "y": "14125760073246405209942173548098832351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "394",
          "y": "3475693/512",
          "series": "Observed"
        },
        {
          "x": "394",
          "y": "427734306949275348332648762245487011/64982847494312737044107071062016",
          "series": "Out-of-fold ell"
        },
        {
          "x": "395",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "395",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "396",
          "y": "11778867/512",
          "series": "Observed"
        },
        {
          "x": "396",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "397",
          "y": "4882795/1024",
          "series": "Observed"
        },
        {
          "x": "397",
          "y": "1147942816448373660299313772523898915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "398",
          "y": "4453163/256",
          "series": "Observed"
        },
        {
          "x": "398",
          "y": "27187077212366374994917093910837222227/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "399",
          "y": "9192437/2048",
          "series": "Observed"
        },
        {
          "x": "399",
          "y": "32078001778194752715614903540608205027/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "400",
          "y": "2659923/128",
          "series": "Observed"
        },
        {
          "x": "400",
          "y": "516065368507618748458680630723961041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "401",
          "y": "2981253/2048",
          "series": "Observed"
        },
        {
          "x": "401",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "402",
          "y": "7225785/4096",
          "series": "Observed"
        },
        {
          "x": "402",
          "y": "861219343181331247912747819929028815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "403",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "403",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "404",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "404",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "405",
          "y": "14496109/2048",
          "series": "Observed"
        },
        {
          "x": "405",
          "y": "1200679426130048613644237508686361315/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "406",
          "y": "4570561/4096",
          "series": "Observed"
        },
        {
          "x": "406",
          "y": "25737629910202515159225974416740667727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "407",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "407",
          "y": "14247138018449182862536688645711488351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "408",
          "y": "7521459/512",
          "series": "Observed"
        },
        {
          "x": "408",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "409",
          "y": "9495835/32768",
          "series": "Observed"
        },
        {
          "x": "409",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "410",
          "y": "11387423/1024",
          "series": "Observed"
        },
        {
          "x": "410",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "411",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "411",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "412",
          "y": "3182057/256",
          "series": "Observed"
        },
        {
          "x": "412",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "413",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "413",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "414",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "414",
          "y": "25812118754052208345624056179103959927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "415",
          "y": "11125633/1024",
          "series": "Observed"
        },
        {
          "x": "415",
          "y": "13024907457070896394435090249867540551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "416",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "416",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "417",
          "y": "15372587/2048",
          "series": "Observed"
        },
        {
          "x": "417",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "418",
          "y": "9556451/2048",
          "series": "Observed"
        },
        {
          "x": "418",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "419",
          "y": "9680719/1024",
          "series": "Observed"
        },
        {
          "x": "419",
          "y": "1725244078375147448674671705915297361/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "420",
          "y": "14608987/32768",
          "series": "Observed"
        },
        {
          "x": "420",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "421",
          "y": "10722427/512",
          "series": "Observed"
        },
        {
          "x": "421",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "422",
          "y": "14977423/1024",
          "series": "Observed"
        },
        {
          "x": "422",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "423",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "423",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "424",
          "y": "8529739/1024",
          "series": "Observed"
        },
        {
          "x": "424",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "425",
          "y": "12023527/512",
          "series": "Observed"
        },
        {
          "x": "425",
          "y": "18319001534997688599321508018339408351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "426",
          "y": "11961135/4096",
          "series": "Observed"
        },
        {
          "x": "426",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "427",
          "y": "5746551/1024",
          "series": "Observed"
        },
        {
          "x": "427",
          "y": "5074167256055269744946907932884844083/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "428",
          "y": "1450257/256",
          "series": "Observed"
        },
        {
          "x": "428",
          "y": "738184867223889877219548178216758741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "429",
          "y": "150197/64",
          "series": "Observed"
        },
        {
          "x": "429",
          "y": "1425912592132102482983191615349695215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "430",
          "y": "8143401/1024",
          "series": "Observed"
        },
        {
          "x": "430",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "431",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "431",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "432",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "432",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "433",
          "y": "449637/32",
          "series": "Observed"
        },
        {
          "x": "433",
          "y": "566500770419462929860190976435517141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "434",
          "y": "9094825/1024",
          "series": "Observed"
        },
        {
          "x": "434",
          "y": "177187832831480884723779772698285129/31315146332337897569253937381376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "435",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "435",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "436",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "436",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "437",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "437",
          "y": "507273733836682938291725705425432341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "438",
          "y": "3940225/2048",
          "series": "Observed"
        },
        {
          "x": "438",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "439",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "439",
          "y": "15858559679766896107854840937014709849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "440",
          "y": "4326477/256",
          "series": "Observed"
        },
        {
          "x": "440",
          "y": "19155421775434690695353623921129409999/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "441",
          "y": "4337745/512",
          "series": "Observed"
        },
        {
          "x": "441",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "442",
          "y": "1961465/256",
          "series": "Observed"
        },
        {
          "x": "442",
          "y": "31066286962568226166545948572262809527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "443",
          "y": "733273/4096",
          "series": "Observed"
        },
        {
          "x": "443",
          "y": "531011714965174424635333714942389741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "444",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "444",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "445",
          "y": "13664299/2048",
          "series": "Observed"
        },
        {
          "x": "445",
          "y": "13596186925438324387056465651140153951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "446",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "446",
          "y": "13423371453841631349044341457544141449/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "447",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "447",
          "y": "21093210135855559675512574203229714327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "448",
          "y": "5893493/2048",
          "series": "Observed"
        },
        {
          "x": "448",
          "y": "17485402660661098529627957999283041051/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "449",
          "y": "16102351/4096",
          "series": "Observed"
        },
        {
          "x": "449",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "450",
          "y": "7323783/1024",
          "series": "Observed"
        },
        {
          "x": "450",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "451",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "451",
          "y": "746567602307491819685702386329251541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "452",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "452",
          "y": "601422820185497406122751181242815541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "453",
          "y": "15556517/1024",
          "series": "Observed"
        },
        {
          "x": "453",
          "y": "1445812671717835890020919182150378115/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "454",
          "y": "7950005/16384",
          "series": "Observed"
        },
        {
          "x": "454",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "455",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "455",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "456",
          "y": "4355735/256",
          "series": "Observed"
        },
        {
          "x": "456",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "457",
          "y": "14876549/1024",
          "series": "Observed"
        },
        {
          "x": "457",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "458",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "458",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "459",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "459",
          "y": "518389894370932595641511027703663141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "460",
          "y": "15274199/2048",
          "series": "Observed"
        },
        {
          "x": "460",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "461",
          "y": "12603043/2048",
          "series": "Observed"
        },
        {
          "x": "461",
          "y": "570129077917518166390532669317152741/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "462",
          "y": "4067881/1024",
          "series": "Observed"
        },
        {
          "x": "462",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "463",
          "y": "6006373/512",
          "series": "Observed"
        },
        {
          "x": "463",
          "y": "1133146312501557338866653535589740515/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "464",
          "y": "15756083/2048",
          "series": "Observed"
        },
        {
          "x": "464",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "465",
          "y": "2107081/128",
          "series": "Observed"
        },
        {
          "x": "465",
          "y": "890714822528435952609872608515170415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "466",
          "y": "4985423/512",
          "series": "Observed"
        },
        {
          "x": "466",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "467",
          "y": "5940703/512",
          "series": "Observed"
        },
        {
          "x": "467",
          "y": "513253714219561724868494854081112241/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "468",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "468",
          "y": "22420413040232097655429467076612857127/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "469",
          "y": "5514733/512",
          "series": "Observed"
        },
        {
          "x": "469",
          "y": "15275389905908124941647995913138525151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "470",
          "y": "8974487/1024",
          "series": "Observed"
        },
        {
          "x": "470",
          "y": "528630671887382298150104895195430341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "471",
          "y": "13953069/1024",
          "series": "Observed"
        },
        {
          "x": "471",
          "y": "24271358393105902540204518655891624727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "472",
          "y": "16511001/8192",
          "series": "Observed"
        },
        {
          "x": "472",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "473",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "473",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "474",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "474",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "475",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "475",
          "y": "898799289549341986883522960135176815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "476",
          "y": "13477041/4096",
          "series": "Observed"
        },
        {
          "x": "476",
          "y": "13182017858157609396234605675784429/2614618986522887358987625037824",
          "series": "Out-of-fold ell"
        },
        {
          "x": "477",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "477",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "478",
          "y": "5650517/1024",
          "series": "Observed"
        },
        {
          "x": "478",
          "y": "21641066600042853157833259929846014327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "479",
          "y": "9603741/1024",
          "series": "Observed"
        },
        {
          "x": "479",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "480",
          "y": "9931897/2048",
          "series": "Observed"
        },
        {
          "x": "480",
          "y": "989065463267659429603322773776612015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "481",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "481",
          "y": "21980954826659641344522226191382050727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "482",
          "y": "738193/128",
          "series": "Observed"
        },
        {
          "x": "482",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "483",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "483",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "484",
          "y": "860597/128",
          "series": "Observed"
        },
        {
          "x": "484",
          "y": "17067594990962933102947677571328928251/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "485",
          "y": "9951017/2048",
          "series": "Observed"
        },
        {
          "x": "485",
          "y": "12932950132234505055335909559462436249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "486",
          "y": "11132491/2048",
          "series": "Observed"
        },
        {
          "x": "486",
          "y": "24546760047423133937120037660780695927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "487",
          "y": "1054081/8192",
          "series": "Observed"
        },
        {
          "x": "487",
          "y": "14134883913385557550769109699468185849/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "488",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "488",
          "y": "946235148424788409117821261734270415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "489",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "489",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "490",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "490",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "491",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "491",
          "y": "13159298526968492292064716077290904249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "492",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "492",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "493",
          "y": "8999705/16384",
          "series": "Observed"
        },
        {
          "x": "493",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "494",
          "y": "10950953/1024",
          "series": "Observed"
        },
        {
          "x": "494",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "495",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "495",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "496",
          "y": "4650885/4096",
          "series": "Observed"
        },
        {
          "x": "496",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "497",
          "y": "9706553/8192",
          "series": "Observed"
        },
        {
          "x": "497",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "498",
          "y": "15931931/2048",
          "series": "Observed"
        },
        {
          "x": "498",
          "y": "13151259464596685432383724734448411751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "499",
          "y": "9468289/2048",
          "series": "Observed"
        },
        {
          "x": "499",
          "y": "1031015184875474999710553753466468015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "500",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "500",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "501",
          "y": "2205563/128",
          "series": "Observed"
        },
        {
          "x": "501",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "502",
          "y": "14696831/2048",
          "series": "Observed"
        },
        {
          "x": "502",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "503",
          "y": "13730611/512",
          "series": "Observed"
        },
        {
          "x": "503",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "504",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "504",
          "y": "22233316744140517632939514381584361927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "505",
          "y": "8268005/4096",
          "series": "Observed"
        },
        {
          "x": "505",
          "y": "13362463284131406411898205959629456751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "506",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "506",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "507",
          "y": "9488167/1024",
          "series": "Observed"
        },
        {
          "x": "507",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "508",
          "y": "5512211/8192",
          "series": "Observed"
        },
        {
          "x": "508",
          "y": "36560170833012720916331655797340348727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "509",
          "y": "8884335/4096",
          "series": "Observed"
        },
        {
          "x": "509",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "510",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "510",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "511",
          "y": "15497871/4096",
          "series": "Observed"
        },
        {
          "x": "511",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "512",
          "y": "13063619/2048",
          "series": "Observed"
        },
        {
          "x": "512",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "513",
          "y": "10356589/8192",
          "series": "Observed"
        },
        {
          "x": "513",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "514",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "514",
          "y": "13446563797143499956672705014890824351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "515",
          "y": "4663843/16384",
          "series": "Observed"
        },
        {
          "x": "515",
          "y": "15093569948583485887799329290743501151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "516",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "516",
          "y": "929224952406455708786802760542055215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "517",
          "y": "4215503/1024",
          "series": "Observed"
        },
        {
          "x": "517",
          "y": "7790312636208424112808456645538774909/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "518",
          "y": "33571/8",
          "series": "Observed"
        },
        {
          "x": "518",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "519",
          "y": "8621219/2048",
          "series": "Observed"
        },
        {
          "x": "519",
          "y": "683550956178228342981813878565384541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "520",
          "y": "94855/8",
          "series": "Observed"
        },
        {
          "x": "520",
          "y": "14007162763910441840840050249433135551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "521",
          "y": "3086151/512",
          "series": "Observed"
        },
        {
          "x": "521",
          "y": "13074471006638354824672574072772472049/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "522",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "522",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "523",
          "y": "7543849/1024",
          "series": "Observed"
        },
        {
          "x": "523",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "524",
          "y": "9495835/32768",
          "series": "Observed"
        },
        {
          "x": "524",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "525",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "525",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "526",
          "y": "16313549/8192",
          "series": "Observed"
        },
        {
          "x": "526",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "527",
          "y": "2500337/128",
          "series": "Observed"
        },
        {
          "x": "527",
          "y": "28927114804826738353157681023025385527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "528",
          "y": "1019597/1024",
          "series": "Observed"
        },
        {
          "x": "528",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "529",
          "y": "4378385/512",
          "series": "Observed"
        },
        {
          "x": "529",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "530",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "530",
          "y": "549697240121050351239135105654598341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "531",
          "y": "2176577/512",
          "series": "Observed"
        },
        {
          "x": "531",
          "y": "21085840298141561088439829799370707527/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "532",
          "y": "203681/32",
          "series": "Observed"
        },
        {
          "x": "532",
          "y": "508980018812879691509077195763312541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "533",
          "y": "6797311/4096",
          "series": "Observed"
        },
        {
          "x": "533",
          "y": "663294545767007567144884768442483541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "534",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "534",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "535",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "535",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "536",
          "y": "3777665/1024",
          "series": "Observed"
        },
        {
          "x": "536",
          "y": "884020523894517346679303604471111615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "537",
          "y": "2605445/512",
          "series": "Observed"
        },
        {
          "x": "537",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "538",
          "y": "356707/64",
          "series": "Observed"
        },
        {
          "x": "538",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "539",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "539",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "540",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "540",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "541",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "541",
          "y": "4321119079960542282856275955100297083/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "542",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "542",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "543",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "543",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "544",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "544",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "545",
          "y": "15602973/2048",
          "series": "Observed"
        },
        {
          "x": "545",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "546",
          "y": "5629533/1024",
          "series": "Observed"
        },
        {
          "x": "546",
          "y": "864084071680441947143321469454374015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "547",
          "y": "9899683/16384",
          "series": "Observed"
        },
        {
          "x": "547",
          "y": "13093313196819445444929632629772405151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "548",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "548",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "549",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "549",
          "y": "507159858445961207049837302737722441/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "550",
          "y": "7617609/8192",
          "series": "Observed"
        },
        {
          "x": "550",
          "y": "503156051823132261329595417339411441/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "551",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "551",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "552",
          "y": "639261/128",
          "series": "Observed"
        },
        {
          "x": "552",
          "y": "886252308797563407664166420600875215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "553",
          "y": "11057725/1024",
          "series": "Observed"
        },
        {
          "x": "553",
          "y": "16764270199445471882904883066019923451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "554",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "554",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "555",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "555",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "556",
          "y": "4514875/16384",
          "series": "Observed"
        },
        {
          "x": "556",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "557",
          "y": "4683313/4096",
          "series": "Observed"
        },
        {
          "x": "557",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "558",
          "y": "5448315/512",
          "series": "Observed"
        },
        {
          "x": "558",
          "y": "986963532588471384467508942771297507/213170971884705753022934458826752",
          "series": "Out-of-fold ell"
        },
        {
          "x": "559",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "559",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "560",
          "y": "8967889/4096",
          "series": "Observed"
        },
        {
          "x": "560",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "561",
          "y": "16607273/1024",
          "series": "Observed"
        },
        {
          "x": "561",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "562",
          "y": "5663547/512",
          "series": "Observed"
        },
        {
          "x": "562",
          "y": "21757968497906337949765269409462180727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "563",
          "y": "45873/32",
          "series": "Observed"
        },
        {
          "x": "563",
          "y": "508108249991345153661675452012593941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "564",
          "y": "1664563/512",
          "series": "Observed"
        },
        {
          "x": "564",
          "y": "504256455581928362452181546994538191/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "565",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "565",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "566",
          "y": "2702633/1024",
          "series": "Observed"
        },
        {
          "x": "566",
          "y": "14054115377242521718760804647338317151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "567",
          "y": "13223315/2048",
          "series": "Observed"
        },
        {
          "x": "567",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "568",
          "y": "15190913/4096",
          "series": "Observed"
        },
        {
          "x": "568",
          "y": "14181761109849373157702859618897662751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "569",
          "y": "4683729/256",
          "series": "Observed"
        },
        {
          "x": "569",
          "y": "14084208311685759464597920356144117951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "570",
          "y": "10416789/32768",
          "series": "Observed"
        },
        {
          "x": "570",
          "y": "13020876418556435401201558041818422751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "571",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "571",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "572",
          "y": "13198927/131072",
          "series": "Observed"
        },
        {
          "x": "572",
          "y": "897846766276741702844270916682978815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "573",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "573",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "574",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "574",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "575",
          "y": "5003409/512",
          "series": "Observed"
        },
        {
          "x": "575",
          "y": "12702200157726974659605199948948042249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "576",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "576",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "577",
          "y": "191453/16",
          "series": "Observed"
        },
        {
          "x": "577",
          "y": "13226121933907729814695405850623649151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "578",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "578",
          "y": "13158322516919586723304934267588313951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "579",
          "y": "15147607/2048",
          "series": "Observed"
        },
        {
          "x": "579",
          "y": "9270218099349924040527164162479654909/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "580",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "580",
          "y": "20909587561033312358064426594329427227/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "581",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "581",
          "y": "501010117501473215778670895166740991/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "582",
          "y": "677061/1024",
          "series": "Observed"
        },
        {
          "x": "582",
          "y": "12956529269937818563878895807889433601/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "583",
          "y": "2982067/256",
          "series": "Observed"
        },
        {
          "x": "583",
          "y": "13919792250667242274132108880859584351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "584",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "584",
          "y": "7419259416450862092967445625201594509/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "585",
          "y": "8096093/1024",
          "series": "Observed"
        },
        {
          "x": "585",
          "y": "24427229105032812989612122237576735927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "586",
          "y": "1488725/128",
          "series": "Observed"
        },
        {
          "x": "586",
          "y": "886008381823721604541275262960914015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "587",
          "y": "795285/512",
          "series": "Observed"
        },
        {
          "x": "587",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "588",
          "y": "8423149/512",
          "series": "Observed"
        },
        {
          "x": "588",
          "y": "955906594764941688485833765853620815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "589",
          "y": "3554991/512",
          "series": "Observed"
        },
        {
          "x": "589",
          "y": "1944585251256832390702300234291959761/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "590",
          "y": "7843039/1024",
          "series": "Observed"
        },
        {
          "x": "590",
          "y": "606434359930343308500669207990213141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "591",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "591",
          "y": "13034744258193718105446081019594297151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "592",
          "y": "2021557/256",
          "series": "Observed"
        },
        {
          "x": "592",
          "y": "545418916780126015631572085644686141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "593",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "593",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "594",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "594",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "595",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "595",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "596",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "596",
          "y": "13390071037083703598243425874302538249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "597",
          "y": "14401245/4096",
          "series": "Observed"
        },
        {
          "x": "597",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "598",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "598",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "599",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "599",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "600",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "600",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "601",
          "y": "4425947/512",
          "series": "Observed"
        },
        {
          "x": "601",
          "y": "13108276880105673434523881704291217551/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "602",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "602",
          "y": "630315417392358526899891953797341141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "603",
          "y": "5656617/512",
          "series": "Observed"
        },
        {
          "x": "603",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "604",
          "y": "12799579/16384",
          "series": "Observed"
        },
        {
          "x": "604",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "605",
          "y": "5715543/512",
          "series": "Observed"
        },
        {
          "x": "605",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "606",
          "y": "15745909/32768",
          "series": "Observed"
        },
        {
          "x": "606",
          "y": "13035298980127169284965440860599101951/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "607",
          "y": "740267/256",
          "series": "Observed"
        },
        {
          "x": "607",
          "y": "862473184515487223973947699657389515/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "608",
          "y": "12353959/1024",
          "series": "Observed"
        },
        {
          "x": "608",
          "y": "512353978571023133473538873179162941/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "609",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "609",
          "y": "13031325684308944535558297016346602449/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "610",
          "y": "4916449/512",
          "series": "Observed"
        },
        {
          "x": "610",
          "y": "21441968130982885491248969165317908727/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "611",
          "y": "13389571/4096",
          "series": "Observed"
        },
        {
          "x": "611",
          "y": "22018123026970445350619000637341978327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "612",
          "y": "6628465/32768",
          "series": "Observed"
        },
        {
          "x": "612",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "613",
          "y": "8529443/2048",
          "series": "Observed"
        },
        {
          "x": "613",
          "y": "924650230683503105039030610946860015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "614",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "614",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "615",
          "y": "1157487/64",
          "series": "Observed"
        },
        {
          "x": "615",
          "y": "502718380588991821614086802959306991/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "616",
          "y": "14707515/4096",
          "series": "Observed"
        },
        {
          "x": "616",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "617",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "617",
          "y": "2385566575564404431860094347922526703/478771991901840400934682191986688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "618",
          "y": "5729003/1024",
          "series": "Observed"
        },
        {
          "x": "618",
          "y": "519673365985684909980018679151068641/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "619",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "619",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "620",
          "y": "16001171/8192",
          "series": "Observed"
        },
        {
          "x": "620",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "621",
          "y": "11256347/8192",
          "series": "Observed"
        },
        {
          "x": "621",
          "y": "13135531212535740213229966714285843751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "622",
          "y": "2308353/256",
          "series": "Observed"
        },
        {
          "x": "622",
          "y": "26221503824734492056923336774384787127/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "623",
          "y": "7491023/1024",
          "series": "Observed"
        },
        {
          "x": "623",
          "y": "21196770041734762274141390573530988327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "624",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "624",
          "y": "880382012853719774724768866924084415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "625",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "625",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "626",
          "y": "5701109/512",
          "series": "Observed"
        },
        {
          "x": "626",
          "y": "859763949891518996817436986913140915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "627",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "627",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "628",
          "y": "4928563/1024",
          "series": "Observed"
        },
        {
          "x": "628",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "629",
          "y": "6798835/512",
          "series": "Observed"
        },
        {
          "x": "629",
          "y": "12941476667197308197590513455580667249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "630",
          "y": "3608105/512",
          "series": "Observed"
        },
        {
          "x": "630",
          "y": "12803708985574675658816040002453467249/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "631",
          "y": "2079927/256",
          "series": "Observed"
        },
        {
          "x": "631",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "632",
          "y": "10826539/2048",
          "series": "Observed"
        },
        {
          "x": "632",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "633",
          "y": "75007/16",
          "series": "Observed"
        },
        {
          "x": "633",
          "y": "871695879035886039604269261311483415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "634",
          "y": "3305987/1024",
          "series": "Observed"
        },
        {
          "x": "634",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "635",
          "y": "3001141/512",
          "series": "Observed"
        },
        {
          "x": "635",
          "y": "4557839976401168306336874978990915283/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "636",
          "y": "4413315/1024",
          "series": "Observed"
        },
        {
          "x": "636",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "637",
          "y": "9538095/2048",
          "series": "Observed"
        },
        {
          "x": "637",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "638",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "638",
          "y": "13171128739543396675473310913077528751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "639",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "639",
          "y": "13101828759376795431960006170970975751/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "640",
          "y": "4569087/8192",
          "series": "Observed"
        },
        {
          "x": "640",
          "y": "4544229596142282441267162343982817283/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "641",
          "y": "11499907/2048",
          "series": "Observed"
        },
        {
          "x": "641",
          "y": "563056734040266905130288599386109541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "642",
          "y": "11739867/1024",
          "series": "Observed"
        },
        {
          "x": "642",
          "y": "4402702599565012691258791113341031283/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "643",
          "y": "15897739/4096",
          "series": "Observed"
        },
        {
          "x": "643",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "644",
          "y": "13406227/2048",
          "series": "Observed"
        },
        {
          "x": "644",
          "y": "522507944856200088287398413158694141/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "645",
          "y": "6392919/512",
          "series": "Observed"
        },
        {
          "x": "645",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "646",
          "y": "15738345/1024",
          "series": "Observed"
        },
        {
          "x": "646",
          "y": "13126272768507755440233658397299706151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "647",
          "y": "5569203/512",
          "series": "Observed"
        },
        {
          "x": "647",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "648",
          "y": "9788125/4096",
          "series": "Observed"
        },
        {
          "x": "648",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "649",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "649",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "650",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "650",
          "y": "872438037782292399621476666788173615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "651",
          "y": "163215/32",
          "series": "Observed"
        },
        {
          "x": "651",
          "y": "871999285674773305829969837966832615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "652",
          "y": "14257551/4096",
          "series": "Observed"
        },
        {
          "x": "652",
          "y": "1406824167340686350745556567985589961/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "653",
          "y": "7117865/2048",
          "series": "Observed"
        },
        {
          "x": "653",
          "y": "7142893910421009213110610100431840509/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "654",
          "y": "9448501/1024",
          "series": "Observed"
        },
        {
          "x": "654",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "655",
          "y": "2565295/512",
          "series": "Observed"
        },
        {
          "x": "655",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "656",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "656",
          "y": "519101945688919366797014580302554041/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "657",
          "y": "14357389/2048",
          "series": "Observed"
        },
        {
          "x": "657",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "658",
          "y": "4604859/512",
          "series": "Observed"
        },
        {
          "x": "658",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "659",
          "y": "6186901/2048",
          "series": "Observed"
        },
        {
          "x": "659",
          "y": "863472008200147231772509364255950815/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "660",
          "y": "16509921/2048",
          "series": "Observed"
        },
        {
          "x": "660",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "661",
          "y": "14725297/1024",
          "series": "Observed"
        },
        {
          "x": "661",
          "y": "13109631267028467642457467952663746351/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "662",
          "y": "13207941/1024",
          "series": "Observed"
        },
        {
          "x": "662",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "663",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "663",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "664",
          "y": "16615399/4096",
          "series": "Observed"
        },
        {
          "x": "664",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "665",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "665",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "666",
          "y": "2263703/128",
          "series": "Observed"
        },
        {
          "x": "666",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "667",
          "y": "3920719/2048",
          "series": "Observed"
        },
        {
          "x": "667",
          "y": "21144233155429143443747655239261418127/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "668",
          "y": "4185041/512",
          "series": "Observed"
        },
        {
          "x": "668",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "669",
          "y": "11699493/2048",
          "series": "Observed"
        },
        {
          "x": "669",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "670",
          "y": "5432575/2048",
          "series": "Observed"
        },
        {
          "x": "670",
          "y": "7419899257663201106631459609167648909/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "671",
          "y": "4289265/1024",
          "series": "Observed"
        },
        {
          "x": "671",
          "y": "871394946630370353834842811407820615/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "672",
          "y": "9180867/2048",
          "series": "Observed"
        },
        {
          "x": "672",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "673",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "673",
          "y": "4160084547747099886894756619875154483/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "674",
          "y": "5498921/512",
          "series": "Observed"
        },
        {
          "x": "674",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "675",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "675",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "676",
          "y": "6846923/2048",
          "series": "Observed"
        },
        {
          "x": "676",
          "y": "499303391769634338537686513239135791/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "677",
          "y": "6092117/8192",
          "series": "Observed"
        },
        {
          "x": "677",
          "y": "946762899385588750221023870885136015/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "678",
          "y": "12523137/1024",
          "series": "Observed"
        },
        {
          "x": "678",
          "y": "13029197117121330104154785002300341251/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "679",
          "y": "5317723/1024",
          "series": "Observed"
        },
        {
          "x": "679",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "680",
          "y": "16678207/8192",
          "series": "Observed"
        },
        {
          "x": "680",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "681",
          "y": "15346487/4096",
          "series": "Observed"
        },
        {
          "x": "681",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "682",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "682",
          "y": "602319916589250958864193407305491541/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "683",
          "y": "8984691/4096",
          "series": "Observed"
        },
        {
          "x": "683",
          "y": "12926574524665722017868277260378589151/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "684",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "684",
          "y": "21283737095720116492856359452439838327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "685",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "685",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "686",
          "y": "12846285/8192",
          "series": "Observed"
        },
        {
          "x": "686",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "687",
          "y": "774113/256",
          "series": "Observed"
        },
        {
          "x": "687",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "688",
          "y": "5695525/4096",
          "series": "Observed"
        },
        {
          "x": "688",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "689",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "689",
          "y": "954104568357410859100426474826606415/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "690",
          "y": "10209977/1024",
          "series": "Observed"
        },
        {
          "x": "690",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "691",
          "y": "3157587/1024",
          "series": "Observed"
        },
        {
          "x": "691",
          "y": "45023757720301434022576266978865750327/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "692",
          "y": "14928507/4096",
          "series": "Observed"
        },
        {
          "x": "692",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "693",
          "y": "3119977/256",
          "series": "Observed"
        },
        {
          "x": "693",
          "y": "847635673733649308614875306357343215/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "694",
          "y": "6330245/1024",
          "series": "Observed"
        },
        {
          "x": "694",
          "y": "20472047015497766281113862090138927927/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "695",
          "y": "1409481/128",
          "series": "Observed"
        },
        {
          "x": "695",
          "y": "22880030346093676867094388307295217049/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "696",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "696",
          "y": "490760559251121118471262561424472341/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "697",
          "y": "6299365/2048",
          "series": "Observed"
        },
        {
          "x": "697",
          "y": "339807330709685230166746448320010483/53292742971176438255733614706688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "698",
          "y": "11410299/1024",
          "series": "Observed"
        },
        {
          "x": "698",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "699",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "699",
          "y": "698830647890944986728117403659189641/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "700",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "700",
          "y": "1592054129859430518903969469927449361/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "701",
          "y": "11130003/8192",
          "series": "Observed"
        },
        {
          "x": "701",
          "y": "19975858517211759883755933584408187599/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "702",
          "y": "4479017/1024",
          "series": "Observed"
        },
        {
          "x": "702",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "703",
          "y": "16170117/1024",
          "series": "Observed"
        },
        {
          "x": "703",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "704",
          "y": "4336269/512",
          "series": "Observed"
        },
        {
          "x": "704",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "705",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "705",
          "y": "26241041457194855813682527798425138427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "706",
          "y": "6684589/1024",
          "series": "Observed"
        },
        {
          "x": "706",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "707",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "707",
          "y": "5666666156907645518891413227890078533/845508950973123234369856309297152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "708",
          "y": "3179863/512",
          "series": "Observed"
        },
        {
          "x": "708",
          "y": "16827694450665040659982390124290500251/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "709",
          "y": "11493089/1024",
          "series": "Observed"
        },
        {
          "x": "709",
          "y": "16934874759640868104030099178383172451/2664296747266822218808389913542656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "710",
          "y": "9955685/1024",
          "series": "Observed"
        },
        {
          "x": "710",
          "y": "30134277302981599166750306664864777/4732321043102703763425204109312",
          "series": "Out-of-fold ell"
        },
        {
          "x": "711",
          "y": "8729987/8192",
          "series": "Observed"
        },
        {
          "x": "711",
          "y": "1137722405236446786358108070968835115/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "712",
          "y": "9048643/1024",
          "series": "Observed"
        },
        {
          "x": "712",
          "y": "8844942066981905032142549776700097409/1436315975705521202804046575960064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "713",
          "y": "6100315/2048",
          "series": "Observed"
        },
        {
          "x": "713",
          "y": "1900474324957099414081695843497770711/281836316991041078123285436432384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "714",
          "y": "7364391/2048",
          "series": "Observed"
        },
        {
          "x": "714",
          "y": "16203386072911356815091753849453622799/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "715",
          "y": "8103307/1024",
          "series": "Observed"
        },
        {
          "x": "715",
          "y": "18206768843994466052457239849713633999/2536526852919369703109568927891456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "716",
          "y": "7806327/2048",
          "series": "Observed"
        },
        {
          "x": "716",
          "y": "25375268813647306445924231017482115427/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "717",
          "y": "5619681/1024",
          "series": "Observed"
        },
        {
          "x": "717",
          "y": "30798602919508557450460759987757088227/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "718",
          "y": "11402787/1024",
          "series": "Observed"
        },
        {
          "x": "718",
          "y": "27430083724280189298745563998831321827/4308947927116563608412139727880192",
          "series": "Out-of-fold ell"
        },
        {
          "x": "719",
          "y": "1269881/128",
          "series": "Observed"
        },
        {
          "x": "719",
          "y": "672979179989656341205391085021936841/106585485942352876511467229413376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "720",
          "y": "4492607/512",
          "series": "Observed"
        },
        {
          "x": "720",
          "y": "1150658389409507955987484043204441715/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "721",
          "y": "3973973/1024",
          "series": "Observed"
        },
        {
          "x": "721",
          "y": "1112285681319435660061084086600870915/178474232446684919184221733781504",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/realdata-actual-person-Python-summary.csv",
      "summarySHA256": "4410251bfcb3b77be7e321a8b297a5eb63a4d96bb1f31d1087701983175b5da5",
      "pointsFile": "metr21-programs/realdata-actual-person-Python-points.csv",
      "pointsSHA256": "a1acf5836f278d486d752992e57a1db88f841179c36f12a66140672bd4af5569",
      "fullResultFile": "metr21-programs/realdata-actual-person-Python-full.json",
      "fullResultSHA256": "cc7173586a791e8cc37e867cb3fdb14d8d7ed94438808ebcb87474c3773e4d50",
      "plotFile": "metr21-programs/realdata-actual-person-Python.svg",
      "plotSHA256": "370915bfae9ac3820208a79b071fc343662ac2af4a340d1cc0b1f2320bde4ff9"
    },
    {
      "api": "realdata",
      "variant": "actual-country",
      "profile": "actual-country",
      "language": "R",
      "file": "metr21-programs/realdata-actual-country-R.R",
      "codeSHA256": "20d349721f36388be77cc87c7bb455e3c86147601b304e43d86441f77446577e",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "미국 군 440개 전체",
        "en": "All 440 counties: adjusted post levels"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"realdata\",\"key\"=\"actual-country\",\"title\"=\"All 440 counties: adjusted post levels\",\"input\"=list(\"kind\"=\"country\"),\"xLabel\"=\"Declared source order, not time\",\"yLabel\"=\"Log teen-employment points\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "rows": "440",
        "groups": "440",
        "PLRtheta": "-0.067321594",
        "AIPWtheta": "-0.0757570684",
        "clippedRows": "0",
        "rawPropensityMin": "0.168164173",
        "rawPropensityMax": "0.458294009"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "8.48735234940522",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "8.18340599744098",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "5.03695260241363",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "4.93847082297793",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "2.99573227355399",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "3.08780734878359",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "6.10479323241498",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "5.81539000724082",
          "series": "Out-of-fold ell"
        },
        {
          "x": "4",
          "y": "8.88100262425557",
          "series": "Observed"
        },
        {
          "x": "4",
          "y": "8.60673652010201",
          "series": "Out-of-fold ell"
        },
        {
          "x": "5",
          "y": "4.91998092582813",
          "series": "Observed"
        },
        {
          "x": "5",
          "y": "4.84003386084856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "6",
          "y": "5.56068163101553",
          "series": "Observed"
        },
        {
          "x": "6",
          "y": "5.61731585387481",
          "series": "Out-of-fold ell"
        },
        {
          "x": "7",
          "y": "4.71849887129509",
          "series": "Observed"
        },
        {
          "x": "7",
          "y": "4.46913160061796",
          "series": "Out-of-fold ell"
        },
        {
          "x": "8",
          "y": "6.43133108193348",
          "series": "Observed"
        },
        {
          "x": "8",
          "y": "6.01867335993512",
          "series": "Out-of-fold ell"
        },
        {
          "x": "9",
          "y": "7.80302664363222",
          "series": "Observed"
        },
        {
          "x": "9",
          "y": "7.53865297451291",
          "series": "Out-of-fold ell"
        },
        {
          "x": "10",
          "y": "5.57215403217776",
          "series": "Observed"
        },
        {
          "x": "10",
          "y": "5.249979620957",
          "series": "Out-of-fold ell"
        },
        {
          "x": "11",
          "y": "6.40191719672719",
          "series": "Observed"
        },
        {
          "x": "11",
          "y": "6.1767696701076",
          "series": "Out-of-fold ell"
        },
        {
          "x": "12",
          "y": "4.99721227376411",
          "series": "Observed"
        },
        {
          "x": "12",
          "y": "5.45060230386406",
          "series": "Out-of-fold ell"
        },
        {
          "x": "13",
          "y": "7.60738142563979",
          "series": "Observed"
        },
        {
          "x": "13",
          "y": "7.4595343638772",
          "series": "Out-of-fold ell"
        },
        {
          "x": "14",
          "y": "3.46573590279973",
          "series": "Observed"
        },
        {
          "x": "14",
          "y": "3.63438559662247",
          "series": "Out-of-fold ell"
        },
        {
          "x": "15",
          "y": "6.29341927884648",
          "series": "Observed"
        },
        {
          "x": "15",
          "y": "6.18399140468804",
          "series": "Out-of-fold ell"
        },
        {
          "x": "16",
          "y": "4.75359019110636",
          "series": "Observed"
        },
        {
          "x": "16",
          "y": "4.76921783068735",
          "series": "Out-of-fold ell"
        },
        {
          "x": "17",
          "y": "7.80343505695217",
          "series": "Observed"
        },
        {
          "x": "17",
          "y": "7.25951357074675",
          "series": "Out-of-fold ell"
        },
        {
          "x": "18",
          "y": "7.26332961747684",
          "series": "Observed"
        },
        {
          "x": "18",
          "y": "6.93861571665151",
          "series": "Out-of-fold ell"
        },
        {
          "x": "19",
          "y": "3.13549421592915",
          "series": "Observed"
        },
        {
          "x": "19",
          "y": "4.55204474831211",
          "series": "Out-of-fold ell"
        },
        {
          "x": "20",
          "y": "4.34380542185368",
          "series": "Observed"
        },
        {
          "x": "20",
          "y": "4.35675801207018",
          "series": "Out-of-fold ell"
        },
        {
          "x": "21",
          "y": "7.82763954636642",
          "series": "Observed"
        },
        {
          "x": "21",
          "y": "7.1226672386915",
          "series": "Out-of-fold ell"
        },
        {
          "x": "22",
          "y": "5.20948615284142",
          "series": "Observed"
        },
        {
          "x": "22",
          "y": "5.06313957866848",
          "series": "Out-of-fold ell"
        },
        {
          "x": "23",
          "y": "7.63723438878947",
          "series": "Observed"
        },
        {
          "x": "23",
          "y": "7.11783824309906",
          "series": "Out-of-fold ell"
        },
        {
          "x": "24",
          "y": "7.63819824428578",
          "series": "Observed"
        },
        {
          "x": "24",
          "y": "7.07323729579039",
          "series": "Out-of-fold ell"
        },
        {
          "x": "25",
          "y": "6.39859493453521",
          "series": "Observed"
        },
        {
          "x": "25",
          "y": "6.2978715606948",
          "series": "Out-of-fold ell"
        },
        {
          "x": "26",
          "y": "9.29569203907569",
          "series": "Observed"
        },
        {
          "x": "26",
          "y": "8.73843152383041",
          "series": "Out-of-fold ell"
        },
        {
          "x": "27",
          "y": "5.57215403217776",
          "series": "Observed"
        },
        {
          "x": "27",
          "y": "5.59142895723241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "28",
          "y": "3.87120101090789",
          "series": "Observed"
        },
        {
          "x": "28",
          "y": "4.45727393907186",
          "series": "Out-of-fold ell"
        },
        {
          "x": "29",
          "y": "5.23644196282995",
          "series": "Observed"
        },
        {
          "x": "29",
          "y": "5.03410585448862",
          "series": "Out-of-fold ell"
        },
        {
          "x": "30",
          "y": "6.15060276844628",
          "series": "Observed"
        },
        {
          "x": "30",
          "y": "6.20727793122919",
          "series": "Out-of-fold ell"
        },
        {
          "x": "31",
          "y": "5.00394630594546",
          "series": "Observed"
        },
        {
          "x": "31",
          "y": "5.21087582931124",
          "series": "Out-of-fold ell"
        },
        {
          "x": "32",
          "y": "3.95124371858143",
          "series": "Observed"
        },
        {
          "x": "32",
          "y": "4.15865515665711",
          "series": "Out-of-fold ell"
        },
        {
          "x": "33",
          "y": "3.58351893845611",
          "series": "Observed"
        },
        {
          "x": "33",
          "y": "4.25723443473733",
          "series": "Out-of-fold ell"
        },
        {
          "x": "34",
          "y": "5.59471137960184",
          "series": "Observed"
        },
        {
          "x": "34",
          "y": "5.21034052368329",
          "series": "Out-of-fold ell"
        },
        {
          "x": "35",
          "y": "5.65248918026865",
          "series": "Observed"
        },
        {
          "x": "35",
          "y": "5.8262556021453",
          "series": "Out-of-fold ell"
        },
        {
          "x": "36",
          "y": "6.62539236800796",
          "series": "Observed"
        },
        {
          "x": "36",
          "y": "6.44039747453978",
          "series": "Out-of-fold ell"
        },
        {
          "x": "37",
          "y": "6.98471632011827",
          "series": "Observed"
        },
        {
          "x": "37",
          "y": "6.50703371641179",
          "series": "Out-of-fold ell"
        },
        {
          "x": "38",
          "y": "5.4510384535657",
          "series": "Observed"
        },
        {
          "x": "38",
          "y": "5.45282553242026",
          "series": "Out-of-fold ell"
        },
        {
          "x": "39",
          "y": "5.91079664404053",
          "series": "Observed"
        },
        {
          "x": "39",
          "y": "5.98764007612933",
          "series": "Out-of-fold ell"
        },
        {
          "x": "40",
          "y": "5.4249500174814",
          "series": "Observed"
        },
        {
          "x": "40",
          "y": "5.20443384092428",
          "series": "Out-of-fold ell"
        },
        {
          "x": "41",
          "y": "5.40717177146012",
          "series": "Observed"
        },
        {
          "x": "41",
          "y": "5.36136154734823",
          "series": "Out-of-fold ell"
        },
        {
          "x": "42",
          "y": "2.30258509299405",
          "series": "Observed"
        },
        {
          "x": "42",
          "y": "3.41041816380205",
          "series": "Out-of-fold ell"
        },
        {
          "x": "43",
          "y": "5.19295685089021",
          "series": "Observed"
        },
        {
          "x": "43",
          "y": "4.85792439451215",
          "series": "Out-of-fold ell"
        },
        {
          "x": "44",
          "y": "4.0943445622221",
          "series": "Observed"
        },
        {
          "x": "44",
          "y": "4.42012938821446",
          "series": "Out-of-fold ell"
        },
        {
          "x": "45",
          "y": "6.62936325343745",
          "series": "Observed"
        },
        {
          "x": "45",
          "y": "6.47541239545731",
          "series": "Out-of-fold ell"
        },
        {
          "x": "46",
          "y": "5.04342511691925",
          "series": "Observed"
        },
        {
          "x": "46",
          "y": "5.31113045924371",
          "series": "Out-of-fold ell"
        },
        {
          "x": "47",
          "y": "7.18841273649695",
          "series": "Observed"
        },
        {
          "x": "47",
          "y": "6.93093794102736",
          "series": "Out-of-fold ell"
        },
        {
          "x": "48",
          "y": "4.54329478227",
          "series": "Observed"
        },
        {
          "x": "48",
          "y": "4.94430615256332",
          "series": "Out-of-fold ell"
        },
        {
          "x": "49",
          "y": "4.89034912822175",
          "series": "Observed"
        },
        {
          "x": "49",
          "y": "5.22111802400625",
          "series": "Out-of-fold ell"
        },
        {
          "x": "50",
          "y": "3.89182029811063",
          "series": "Observed"
        },
        {
          "x": "50",
          "y": "3.62530073789148",
          "series": "Out-of-fold ell"
        },
        {
          "x": "51",
          "y": "4.14313472639153",
          "series": "Observed"
        },
        {
          "x": "51",
          "y": "4.24080794302778",
          "series": "Out-of-fold ell"
        },
        {
          "x": "52",
          "y": "6.40522845803084",
          "series": "Observed"
        },
        {
          "x": "52",
          "y": "6.14933957950159",
          "series": "Out-of-fold ell"
        },
        {
          "x": "53",
          "y": "4.82028156560504",
          "series": "Observed"
        },
        {
          "x": "53",
          "y": "4.90670351155041",
          "series": "Out-of-fold ell"
        },
        {
          "x": "54",
          "y": "5.03695260241363",
          "series": "Observed"
        },
        {
          "x": "54",
          "y": "4.80416672254022",
          "series": "Out-of-fold ell"
        },
        {
          "x": "55",
          "y": "5.74939298590825",
          "series": "Observed"
        },
        {
          "x": "55",
          "y": "5.35514401983668",
          "series": "Out-of-fold ell"
        },
        {
          "x": "56",
          "y": "5.19849703126583",
          "series": "Observed"
        },
        {
          "x": "56",
          "y": "5.12819549453328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "57",
          "y": "5.80814248998044",
          "series": "Observed"
        },
        {
          "x": "57",
          "y": "5.63004564100697",
          "series": "Out-of-fold ell"
        },
        {
          "x": "58",
          "y": "5.38449506278909",
          "series": "Observed"
        },
        {
          "x": "58",
          "y": "5.1333744692653",
          "series": "Out-of-fold ell"
        },
        {
          "x": "59",
          "y": "7.28961052145117",
          "series": "Observed"
        },
        {
          "x": "59",
          "y": "6.84572591066384",
          "series": "Out-of-fold ell"
        },
        {
          "x": "60",
          "y": "7.08170858610557",
          "series": "Observed"
        },
        {
          "x": "60",
          "y": "6.85915432359677",
          "series": "Out-of-fold ell"
        },
        {
          "x": "61",
          "y": "6.06145691892802",
          "series": "Observed"
        },
        {
          "x": "61",
          "y": "6.18733079953257",
          "series": "Out-of-fold ell"
        },
        {
          "x": "62",
          "y": "7.36897040219479",
          "series": "Observed"
        },
        {
          "x": "62",
          "y": "7.10710837396376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "63",
          "y": "5.56068163101553",
          "series": "Observed"
        },
        {
          "x": "63",
          "y": "5.5991131147339",
          "series": "Out-of-fold ell"
        },
        {
          "x": "64",
          "y": "6.02344759296103",
          "series": "Observed"
        },
        {
          "x": "64",
          "y": "6.0317228954456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "65",
          "y": "6.81014245011514",
          "series": "Observed"
        },
        {
          "x": "65",
          "y": "6.50732445329203",
          "series": "Out-of-fold ell"
        },
        {
          "x": "66",
          "y": "6.37842618365159",
          "series": "Observed"
        },
        {
          "x": "66",
          "y": "6.29673263787722",
          "series": "Out-of-fold ell"
        },
        {
          "x": "67",
          "y": "7.17472430983638",
          "series": "Observed"
        },
        {
          "x": "67",
          "y": "7.17108420902302",
          "series": "Out-of-fold ell"
        },
        {
          "x": "68",
          "y": "6.66568371778241",
          "series": "Observed"
        },
        {
          "x": "68",
          "y": "6.73056709276214",
          "series": "Out-of-fold ell"
        },
        {
          "x": "69",
          "y": "7.74066440191724",
          "series": "Observed"
        },
        {
          "x": "69",
          "y": "7.2172968309102",
          "series": "Out-of-fold ell"
        },
        {
          "x": "70",
          "y": "7.71646080017636",
          "series": "Observed"
        },
        {
          "x": "70",
          "y": "7.35671263914704",
          "series": "Out-of-fold ell"
        },
        {
          "x": "71",
          "y": "6.18208490671663",
          "series": "Observed"
        },
        {
          "x": "71",
          "y": "6.19284796606244",
          "series": "Out-of-fold ell"
        },
        {
          "x": "72",
          "y": "7.37148929521428",
          "series": "Observed"
        },
        {
          "x": "72",
          "y": "7.17131199805392",
          "series": "Out-of-fold ell"
        },
        {
          "x": "73",
          "y": "6.20253551718792",
          "series": "Observed"
        },
        {
          "x": "73",
          "y": "6.19607401801048",
          "series": "Out-of-fold ell"
        },
        {
          "x": "74",
          "y": "6.45833828334479",
          "series": "Observed"
        },
        {
          "x": "74",
          "y": "6.37971245004115",
          "series": "Out-of-fold ell"
        },
        {
          "x": "75",
          "y": "6.59714570188665",
          "series": "Observed"
        },
        {
          "x": "75",
          "y": "6.57887852930784",
          "series": "Out-of-fold ell"
        },
        {
          "x": "76",
          "y": "6.39692965521615",
          "series": "Observed"
        },
        {
          "x": "76",
          "y": "6.34417118101736",
          "series": "Out-of-fold ell"
        },
        {
          "x": "77",
          "y": "4.07753744390572",
          "series": "Observed"
        },
        {
          "x": "77",
          "y": "4.35814830065598",
          "series": "Out-of-fold ell"
        },
        {
          "x": "78",
          "y": "5.27299955856375",
          "series": "Observed"
        },
        {
          "x": "78",
          "y": "5.42404568061892",
          "series": "Out-of-fold ell"
        },
        {
          "x": "79",
          "y": "6.24610676548156",
          "series": "Observed"
        },
        {
          "x": "79",
          "y": "6.22065223731791",
          "series": "Out-of-fold ell"
        },
        {
          "x": "80",
          "y": "6.13556489108174",
          "series": "Observed"
        },
        {
          "x": "80",
          "y": "6.32344486090393",
          "series": "Out-of-fold ell"
        },
        {
          "x": "81",
          "y": "7.74196789982069",
          "series": "Observed"
        },
        {
          "x": "81",
          "y": "7.45092839991124",
          "series": "Out-of-fold ell"
        },
        {
          "x": "82",
          "y": "5.27299955856375",
          "series": "Observed"
        },
        {
          "x": "82",
          "y": "5.53315882838896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "83",
          "y": "5.83188247728352",
          "series": "Observed"
        },
        {
          "x": "83",
          "y": "5.92192219298248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "84",
          "y": "5.23110861685459",
          "series": "Observed"
        },
        {
          "x": "84",
          "y": "5.60232911945247",
          "series": "Out-of-fold ell"
        },
        {
          "x": "85",
          "y": "7.87929148508227",
          "series": "Observed"
        },
        {
          "x": "85",
          "y": "7.4766007510637",
          "series": "Out-of-fold ell"
        },
        {
          "x": "86",
          "y": "5.15329159449778",
          "series": "Observed"
        },
        {
          "x": "86",
          "y": "5.24564161824768",
          "series": "Out-of-fold ell"
        },
        {
          "x": "87",
          "y": "5.2040066870768",
          "series": "Observed"
        },
        {
          "x": "87",
          "y": "5.15079456352621",
          "series": "Out-of-fold ell"
        },
        {
          "x": "88",
          "y": "4.87519732320115",
          "series": "Observed"
        },
        {
          "x": "88",
          "y": "5.03601245974712",
          "series": "Out-of-fold ell"
        },
        {
          "x": "89",
          "y": "5.75257263882563",
          "series": "Observed"
        },
        {
          "x": "89",
          "y": "5.65879969069857",
          "series": "Out-of-fold ell"
        },
        {
          "x": "90",
          "y": "5.92692602597041",
          "series": "Observed"
        },
        {
          "x": "90",
          "y": "5.87940064841528",
          "series": "Out-of-fold ell"
        },
        {
          "x": "91",
          "y": "6.43294009273918",
          "series": "Observed"
        },
        {
          "x": "91",
          "y": "6.22249266791337",
          "series": "Out-of-fold ell"
        },
        {
          "x": "92",
          "y": "8.36985260351753",
          "series": "Observed"
        },
        {
          "x": "92",
          "y": "7.85446877661879",
          "series": "Out-of-fold ell"
        },
        {
          "x": "93",
          "y": "5.77455154554441",
          "series": "Observed"
        },
        {
          "x": "93",
          "y": "5.75239253598752",
          "series": "Out-of-fold ell"
        },
        {
          "x": "94",
          "y": "5.31811999384422",
          "series": "Observed"
        },
        {
          "x": "94",
          "y": "5.13122313737148",
          "series": "Out-of-fold ell"
        },
        {
          "x": "95",
          "y": "5.4553211153577",
          "series": "Observed"
        },
        {
          "x": "95",
          "y": "5.23551404983326",
          "series": "Out-of-fold ell"
        },
        {
          "x": "96",
          "y": "5.88610403145016",
          "series": "Observed"
        },
        {
          "x": "96",
          "y": "5.69043481927064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "97",
          "y": "9.1557785839835",
          "series": "Observed"
        },
        {
          "x": "97",
          "y": "8.57154283515282",
          "series": "Out-of-fold ell"
        },
        {
          "x": "98",
          "y": "6.15485809401642",
          "series": "Observed"
        },
        {
          "x": "98",
          "y": "5.92444315284267",
          "series": "Out-of-fold ell"
        },
        {
          "x": "99",
          "y": "4.36944785246702",
          "series": "Observed"
        },
        {
          "x": "99",
          "y": "4.54932645255136",
          "series": "Out-of-fold ell"
        },
        {
          "x": "100",
          "y": "6.12468339089421",
          "series": "Observed"
        },
        {
          "x": "100",
          "y": "5.82907340524832",
          "series": "Out-of-fold ell"
        },
        {
          "x": "101",
          "y": "4.4188406077966",
          "series": "Observed"
        },
        {
          "x": "101",
          "y": "4.40571218414844",
          "series": "Out-of-fold ell"
        },
        {
          "x": "102",
          "y": "6.67329796776765",
          "series": "Observed"
        },
        {
          "x": "102",
          "y": "6.42236225580054",
          "series": "Out-of-fold ell"
        },
        {
          "x": "103",
          "y": "5.28320372873799",
          "series": "Observed"
        },
        {
          "x": "103",
          "y": "5.21828828568314",
          "series": "Out-of-fold ell"
        },
        {
          "x": "104",
          "y": "5.31811999384422",
          "series": "Observed"
        },
        {
          "x": "104",
          "y": "5.59071852819512",
          "series": "Out-of-fold ell"
        },
        {
          "x": "105",
          "y": "5.40267738187228",
          "series": "Observed"
        },
        {
          "x": "105",
          "y": "4.99517621459456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "106",
          "y": "5.39362754635236",
          "series": "Observed"
        },
        {
          "x": "106",
          "y": "5.08096179351939",
          "series": "Out-of-fold ell"
        },
        {
          "x": "107",
          "y": "7.4265490723973",
          "series": "Observed"
        },
        {
          "x": "107",
          "y": "7.18163124906635",
          "series": "Out-of-fold ell"
        },
        {
          "x": "108",
          "y": "3.8286413964891",
          "series": "Observed"
        },
        {
          "x": "108",
          "y": "3.83676855031668",
          "series": "Out-of-fold ell"
        },
        {
          "x": "109",
          "y": "3.97029191355212",
          "series": "Observed"
        },
        {
          "x": "109",
          "y": "4.10826577421467",
          "series": "Out-of-fold ell"
        },
        {
          "x": "110",
          "y": "5.40717177146012",
          "series": "Observed"
        },
        {
          "x": "110",
          "y": "5.29628232877335",
          "series": "Out-of-fold ell"
        },
        {
          "x": "111",
          "y": "5.05624580534831",
          "series": "Observed"
        },
        {
          "x": "111",
          "y": "4.84109915979786",
          "series": "Out-of-fold ell"
        },
        {
          "x": "112",
          "y": "6.45676965557216",
          "series": "Observed"
        },
        {
          "x": "112",
          "y": "6.55698351447711",
          "series": "Out-of-fold ell"
        },
        {
          "x": "113",
          "y": "5.72358510195238",
          "series": "Observed"
        },
        {
          "x": "113",
          "y": "5.74854070919734",
          "series": "Out-of-fold ell"
        },
        {
          "x": "114",
          "y": "4.64439089914137",
          "series": "Observed"
        },
        {
          "x": "114",
          "y": "4.59079843718898",
          "series": "Out-of-fold ell"
        },
        {
          "x": "115",
          "y": "4.06044301054642",
          "series": "Observed"
        },
        {
          "x": "115",
          "y": "4.21066501146199",
          "series": "Out-of-fold ell"
        },
        {
          "x": "116",
          "y": "4.70048036579242",
          "series": "Observed"
        },
        {
          "x": "116",
          "y": "4.59012880392202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "117",
          "y": "4.79579054559674",
          "series": "Observed"
        },
        {
          "x": "117",
          "y": "4.73141367155944",
          "series": "Out-of-fold ell"
        },
        {
          "x": "118",
          "y": "4.38202663467388",
          "series": "Observed"
        },
        {
          "x": "118",
          "y": "4.06726369523623",
          "series": "Out-of-fold ell"
        },
        {
          "x": "119",
          "y": "5.16478597392351",
          "series": "Observed"
        },
        {
          "x": "119",
          "y": "4.88212915563901",
          "series": "Out-of-fold ell"
        },
        {
          "x": "120",
          "y": "5.07517381523383",
          "series": "Observed"
        },
        {
          "x": "120",
          "y": "5.16998015719323",
          "series": "Out-of-fold ell"
        },
        {
          "x": "121",
          "y": "8.65782432115598",
          "series": "Observed"
        },
        {
          "x": "121",
          "y": "8.37133187748393",
          "series": "Out-of-fold ell"
        },
        {
          "x": "122",
          "y": "6.77992190747225",
          "series": "Observed"
        },
        {
          "x": "122",
          "y": "6.60781041127156",
          "series": "Out-of-fold ell"
        },
        {
          "x": "123",
          "y": "5.78689738136671",
          "series": "Observed"
        },
        {
          "x": "123",
          "y": "5.81529257936799",
          "series": "Out-of-fold ell"
        },
        {
          "x": "124",
          "y": "7.75147531802146",
          "series": "Observed"
        },
        {
          "x": "124",
          "y": "8.2494779250123",
          "series": "Out-of-fold ell"
        },
        {
          "x": "125",
          "y": "7.50988306115491",
          "series": "Observed"
        },
        {
          "x": "125",
          "y": "7.32057141977986",
          "series": "Out-of-fold ell"
        },
        {
          "x": "126",
          "y": "3.3322045101752",
          "series": "Observed"
        },
        {
          "x": "126",
          "y": "4.42966486201149",
          "series": "Out-of-fold ell"
        },
        {
          "x": "127",
          "y": "5.21493575760899",
          "series": "Observed"
        },
        {
          "x": "127",
          "y": "6.62544126089287",
          "series": "Out-of-fold ell"
        },
        {
          "x": "128",
          "y": "3.36729582998647",
          "series": "Observed"
        },
        {
          "x": "128",
          "y": "4.06404147799091",
          "series": "Out-of-fold ell"
        },
        {
          "x": "129",
          "y": "4.88280192258637",
          "series": "Observed"
        },
        {
          "x": "129",
          "y": "5.30674704897085",
          "series": "Out-of-fold ell"
        },
        {
          "x": "130",
          "y": "5.78382518232974",
          "series": "Observed"
        },
        {
          "x": "130",
          "y": "5.93128220979543",
          "series": "Out-of-fold ell"
        },
        {
          "x": "131",
          "y": "5.81413053182507",
          "series": "Observed"
        },
        {
          "x": "131",
          "y": "5.88130027654233",
          "series": "Out-of-fold ell"
        },
        {
          "x": "132",
          "y": "7.1929342212158",
          "series": "Observed"
        },
        {
          "x": "132",
          "y": "6.80844258690789",
          "series": "Out-of-fold ell"
        },
        {
          "x": "133",
          "y": "7.11151211649616",
          "series": "Observed"
        },
        {
          "x": "133",
          "y": "6.88452348586729",
          "series": "Out-of-fold ell"
        },
        {
          "x": "134",
          "y": "7.75619534394812",
          "series": "Observed"
        },
        {
          "x": "134",
          "y": "7.36490388969096",
          "series": "Out-of-fold ell"
        },
        {
          "x": "135",
          "y": "8.28803156777646",
          "series": "Observed"
        },
        {
          "x": "135",
          "y": "7.87968346510418",
          "series": "Out-of-fold ell"
        },
        {
          "x": "136",
          "y": "8.75131624677346",
          "series": "Observed"
        },
        {
          "x": "136",
          "y": "8.1898556842255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "137",
          "y": "9.15567297063387",
          "series": "Observed"
        },
        {
          "x": "137",
          "y": "8.84978944835447",
          "series": "Out-of-fold ell"
        },
        {
          "x": "138",
          "y": "6.98749024700099",
          "series": "Observed"
        },
        {
          "x": "138",
          "y": "7.01821298942545",
          "series": "Out-of-fold ell"
        },
        {
          "x": "139",
          "y": "6.19440539110467",
          "series": "Observed"
        },
        {
          "x": "139",
          "y": "6.33781200952961",
          "series": "Out-of-fold ell"
        },
        {
          "x": "140",
          "y": "5.27299955856375",
          "series": "Observed"
        },
        {
          "x": "140",
          "y": "5.81272554868482",
          "series": "Out-of-fold ell"
        },
        {
          "x": "141",
          "y": "4.99721227376411",
          "series": "Observed"
        },
        {
          "x": "141",
          "y": "5.49594378011228",
          "series": "Out-of-fold ell"
        },
        {
          "x": "142",
          "y": "6.13988455222626",
          "series": "Observed"
        },
        {
          "x": "142",
          "y": "6.17444044315357",
          "series": "Out-of-fold ell"
        },
        {
          "x": "143",
          "y": "5.92692602597041",
          "series": "Observed"
        },
        {
          "x": "143",
          "y": "6.12734184330875",
          "series": "Out-of-fold ell"
        },
        {
          "x": "144",
          "y": "6.13556489108174",
          "series": "Observed"
        },
        {
          "x": "144",
          "y": "6.21185844982212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "145",
          "y": "8.16365617616843",
          "series": "Observed"
        },
        {
          "x": "145",
          "y": "8.07272666787299",
          "series": "Out-of-fold ell"
        },
        {
          "x": "146",
          "y": "6.51025834052315",
          "series": "Observed"
        },
        {
          "x": "146",
          "y": "6.59647764285203",
          "series": "Out-of-fold ell"
        },
        {
          "x": "147",
          "y": "3.36729582998647",
          "series": "Observed"
        },
        {
          "x": "147",
          "y": "4.29724520125233",
          "series": "Out-of-fold ell"
        },
        {
          "x": "148",
          "y": "5.34233425196481",
          "series": "Observed"
        },
        {
          "x": "148",
          "y": "5.57649372082204",
          "series": "Out-of-fold ell"
        },
        {
          "x": "149",
          "y": "5.52942908751142",
          "series": "Observed"
        },
        {
          "x": "149",
          "y": "5.76675269047749",
          "series": "Out-of-fold ell"
        },
        {
          "x": "150",
          "y": "5.37527840768417",
          "series": "Observed"
        },
        {
          "x": "150",
          "y": "5.60859184096395",
          "series": "Out-of-fold ell"
        },
        {
          "x": "151",
          "y": "5.52942908751142",
          "series": "Observed"
        },
        {
          "x": "151",
          "y": "5.65415153195734",
          "series": "Out-of-fold ell"
        },
        {
          "x": "152",
          "y": "5.94542060860658",
          "series": "Observed"
        },
        {
          "x": "152",
          "y": "5.94970827143524",
          "series": "Out-of-fold ell"
        },
        {
          "x": "153",
          "y": "6.36990098282823",
          "series": "Observed"
        },
        {
          "x": "153",
          "y": "6.53486157890173",
          "series": "Out-of-fold ell"
        },
        {
          "x": "154",
          "y": "5.01063529409626",
          "series": "Observed"
        },
        {
          "x": "154",
          "y": "5.06380734056538",
          "series": "Out-of-fold ell"
        },
        {
          "x": "155",
          "y": "5.25749537202778",
          "series": "Observed"
        },
        {
          "x": "155",
          "y": "5.31650078710734",
          "series": "Out-of-fold ell"
        },
        {
          "x": "156",
          "y": "5.12396397940326",
          "series": "Observed"
        },
        {
          "x": "156",
          "y": "5.34610758298006",
          "series": "Out-of-fold ell"
        },
        {
          "x": "157",
          "y": "6.29341927884648",
          "series": "Observed"
        },
        {
          "x": "157",
          "y": "6.24477705774754",
          "series": "Out-of-fold ell"
        },
        {
          "x": "158",
          "y": "4.8283137373023",
          "series": "Observed"
        },
        {
          "x": "158",
          "y": "4.89319226582808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "159",
          "y": "4.4188406077966",
          "series": "Observed"
        },
        {
          "x": "159",
          "y": "4.71649643902603",
          "series": "Out-of-fold ell"
        },
        {
          "x": "160",
          "y": "5.02388052084628",
          "series": "Observed"
        },
        {
          "x": "160",
          "y": "5.15690580080253",
          "series": "Out-of-fold ell"
        },
        {
          "x": "161",
          "y": "5.8805329864007",
          "series": "Observed"
        },
        {
          "x": "161",
          "y": "5.5522510145424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "162",
          "y": "8.44891435066294",
          "series": "Observed"
        },
        {
          "x": "162",
          "y": "8.01551786630636",
          "series": "Out-of-fold ell"
        },
        {
          "x": "163",
          "y": "4.8283137373023",
          "series": "Observed"
        },
        {
          "x": "163",
          "y": "4.92448989400642",
          "series": "Out-of-fold ell"
        },
        {
          "x": "164",
          "y": "4.90527477843843",
          "series": "Observed"
        },
        {
          "x": "164",
          "y": "4.96881364196455",
          "series": "Out-of-fold ell"
        },
        {
          "x": "165",
          "y": "3.49650756146648",
          "series": "Observed"
        },
        {
          "x": "165",
          "y": "4.10225342942095",
          "series": "Out-of-fold ell"
        },
        {
          "x": "166",
          "y": "4.62497281328427",
          "series": "Observed"
        },
        {
          "x": "166",
          "y": "4.82776109160051",
          "series": "Out-of-fold ell"
        },
        {
          "x": "167",
          "y": "7.7367436824535",
          "series": "Observed"
        },
        {
          "x": "167",
          "y": "7.59318621787762",
          "series": "Out-of-fold ell"
        },
        {
          "x": "168",
          "y": "6.18414889093748",
          "series": "Observed"
        },
        {
          "x": "168",
          "y": "6.13553861089702",
          "series": "Out-of-fold ell"
        },
        {
          "x": "169",
          "y": "6.27476202124194",
          "series": "Observed"
        },
        {
          "x": "169",
          "y": "6.01543037328611",
          "series": "Out-of-fold ell"
        },
        {
          "x": "170",
          "y": "6.12029741895095",
          "series": "Observed"
        },
        {
          "x": "170",
          "y": "6.03743360487231",
          "series": "Out-of-fold ell"
        },
        {
          "x": "171",
          "y": "5.54517744447956",
          "series": "Observed"
        },
        {
          "x": "171",
          "y": "5.49541681105802",
          "series": "Out-of-fold ell"
        },
        {
          "x": "172",
          "y": "5.33753807970132",
          "series": "Observed"
        },
        {
          "x": "172",
          "y": "5.43094820826155",
          "series": "Out-of-fold ell"
        },
        {
          "x": "173",
          "y": "6.36818718635049",
          "series": "Observed"
        },
        {
          "x": "173",
          "y": "6.10858199999167",
          "series": "Out-of-fold ell"
        },
        {
          "x": "174",
          "y": "5.38449506278909",
          "series": "Observed"
        },
        {
          "x": "174",
          "y": "5.57348816523949",
          "series": "Out-of-fold ell"
        },
        {
          "x": "175",
          "y": "4.51085950651685",
          "series": "Observed"
        },
        {
          "x": "175",
          "y": "4.5231567813307",
          "series": "Out-of-fold ell"
        },
        {
          "x": "176",
          "y": "5.55295958492162",
          "series": "Observed"
        },
        {
          "x": "176",
          "y": "5.47727816064862",
          "series": "Out-of-fold ell"
        },
        {
          "x": "177",
          "y": "5.63835466933375",
          "series": "Observed"
        },
        {
          "x": "177",
          "y": "5.51889056876829",
          "series": "Out-of-fold ell"
        },
        {
          "x": "178",
          "y": "5.22035582507832",
          "series": "Observed"
        },
        {
          "x": "178",
          "y": "5.55408770933727",
          "series": "Out-of-fold ell"
        },
        {
          "x": "179",
          "y": "6.00635315960173",
          "series": "Observed"
        },
        {
          "x": "179",
          "y": "6.07245349365736",
          "series": "Out-of-fold ell"
        },
        {
          "x": "180",
          "y": "5.32300997913841",
          "series": "Observed"
        },
        {
          "x": "180",
          "y": "5.38332832572333",
          "series": "Out-of-fold ell"
        },
        {
          "x": "181",
          "y": "4.12713438504509",
          "series": "Observed"
        },
        {
          "x": "181",
          "y": "4.43883386561597",
          "series": "Out-of-fold ell"
        },
        {
          "x": "182",
          "y": "5.40267738187228",
          "series": "Observed"
        },
        {
          "x": "182",
          "y": "5.48377854918106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "183",
          "y": "5.26269018890489",
          "series": "Observed"
        },
        {
          "x": "183",
          "y": "5.46958888346492",
          "series": "Out-of-fold ell"
        },
        {
          "x": "184",
          "y": "8.25816336153762",
          "series": "Observed"
        },
        {
          "x": "184",
          "y": "8.12119494097581",
          "series": "Out-of-fold ell"
        },
        {
          "x": "185",
          "y": "4.97673374242057",
          "series": "Observed"
        },
        {
          "x": "185",
          "y": "4.99272437259006",
          "series": "Out-of-fold ell"
        },
        {
          "x": "186",
          "y": "2.07944154167984",
          "series": "Observed"
        },
        {
          "x": "186",
          "y": "2.85198993384883",
          "series": "Out-of-fold ell"
        },
        {
          "x": "187",
          "y": "7.28138566357028",
          "series": "Observed"
        },
        {
          "x": "187",
          "y": "6.98420188440552",
          "series": "Out-of-fold ell"
        },
        {
          "x": "188",
          "y": "5.25227342804663",
          "series": "Observed"
        },
        {
          "x": "188",
          "y": "5.10000635563474",
          "series": "Out-of-fold ell"
        },
        {
          "x": "189",
          "y": "2.89037175789616",
          "series": "Observed"
        },
        {
          "x": "189",
          "y": "2.71779215626471",
          "series": "Out-of-fold ell"
        },
        {
          "x": "190",
          "y": "7.09589322109753",
          "series": "Observed"
        },
        {
          "x": "190",
          "y": "6.75021965310565",
          "series": "Out-of-fold ell"
        },
        {
          "x": "191",
          "y": "6.27852142416584",
          "series": "Observed"
        },
        {
          "x": "191",
          "y": "6.10427153633749",
          "series": "Out-of-fold ell"
        },
        {
          "x": "192",
          "y": "4.969813299576",
          "series": "Observed"
        },
        {
          "x": "192",
          "y": "5.10339091415533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "193",
          "y": "4.63472898822964",
          "series": "Observed"
        },
        {
          "x": "193",
          "y": "4.62101850024139",
          "series": "Out-of-fold ell"
        },
        {
          "x": "194",
          "y": "4.29045944114839",
          "series": "Observed"
        },
        {
          "x": "194",
          "y": "4.32309567354528",
          "series": "Out-of-fold ell"
        },
        {
          "x": "195",
          "y": "2.30258509299405",
          "series": "Observed"
        },
        {
          "x": "195",
          "y": "2.89899770132739",
          "series": "Out-of-fold ell"
        },
        {
          "x": "196",
          "y": "4.51085950651685",
          "series": "Observed"
        },
        {
          "x": "196",
          "y": "4.6670963759927",
          "series": "Out-of-fold ell"
        },
        {
          "x": "197",
          "y": "4.77068462446567",
          "series": "Observed"
        },
        {
          "x": "197",
          "y": "4.7801008190595",
          "series": "Out-of-fold ell"
        },
        {
          "x": "198",
          "y": "4.87519732320115",
          "series": "Observed"
        },
        {
          "x": "198",
          "y": "4.68332499247739",
          "series": "Out-of-fold ell"
        },
        {
          "x": "199",
          "y": "5.59842195899838",
          "series": "Observed"
        },
        {
          "x": "199",
          "y": "5.22404245742581",
          "series": "Out-of-fold ell"
        },
        {
          "x": "200",
          "y": "5.28826703069454",
          "series": "Observed"
        },
        {
          "x": "200",
          "y": "5.08026146443323",
          "series": "Out-of-fold ell"
        },
        {
          "x": "201",
          "y": "9.32027043134838",
          "series": "Observed"
        },
        {
          "x": "201",
          "y": "8.80741958539777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "202",
          "y": "4.64439089914137",
          "series": "Observed"
        },
        {
          "x": "202",
          "y": "4.79083173142242",
          "series": "Out-of-fold ell"
        },
        {
          "x": "203",
          "y": "3.61091791264422",
          "series": "Observed"
        },
        {
          "x": "203",
          "y": "3.87417410859395",
          "series": "Out-of-fold ell"
        },
        {
          "x": "204",
          "y": "2.63905732961526",
          "series": "Observed"
        },
        {
          "x": "204",
          "y": "3.16032898747464",
          "series": "Out-of-fold ell"
        },
        {
          "x": "205",
          "y": "7.17548971362422",
          "series": "Observed"
        },
        {
          "x": "205",
          "y": "6.7575687987899",
          "series": "Out-of-fold ell"
        },
        {
          "x": "206",
          "y": "5.14749447681345",
          "series": "Observed"
        },
        {
          "x": "206",
          "y": "5.0468034263983",
          "series": "Out-of-fold ell"
        },
        {
          "x": "207",
          "y": "3.85014760171006",
          "series": "Observed"
        },
        {
          "x": "207",
          "y": "3.93155756318408",
          "series": "Out-of-fold ell"
        },
        {
          "x": "208",
          "y": "5.26269018890489",
          "series": "Observed"
        },
        {
          "x": "208",
          "y": "5.13546873920627",
          "series": "Out-of-fold ell"
        },
        {
          "x": "209",
          "y": "5.14166355650266",
          "series": "Observed"
        },
        {
          "x": "209",
          "y": "4.93817740976449",
          "series": "Out-of-fold ell"
        },
        {
          "x": "210",
          "y": "8.5571828396324",
          "series": "Observed"
        },
        {
          "x": "210",
          "y": "8.13859944729114",
          "series": "Out-of-fold ell"
        },
        {
          "x": "211",
          "y": "4.04305126783455",
          "series": "Observed"
        },
        {
          "x": "211",
          "y": "4.46285118098461",
          "series": "Out-of-fold ell"
        },
        {
          "x": "212",
          "y": "4.67282883446191",
          "series": "Observed"
        },
        {
          "x": "212",
          "y": "4.81502172863418",
          "series": "Out-of-fold ell"
        },
        {
          "x": "213",
          "y": "5.80814248998044",
          "series": "Observed"
        },
        {
          "x": "213",
          "y": "5.62465019214508",
          "series": "Out-of-fold ell"
        },
        {
          "x": "214",
          "y": "3.55534806148941",
          "series": "Observed"
        },
        {
          "x": "214",
          "y": "3.51437039778696",
          "series": "Out-of-fold ell"
        },
        {
          "x": "215",
          "y": "4.74493212836325",
          "series": "Observed"
        },
        {
          "x": "215",
          "y": "4.82804755770198",
          "series": "Out-of-fold ell"
        },
        {
          "x": "216",
          "y": "5.40267738187228",
          "series": "Observed"
        },
        {
          "x": "216",
          "y": "5.42409041616088",
          "series": "Out-of-fold ell"
        },
        {
          "x": "217",
          "y": "7.61283103040736",
          "series": "Observed"
        },
        {
          "x": "217",
          "y": "7.26573797493425",
          "series": "Out-of-fold ell"
        },
        {
          "x": "218",
          "y": "5.63835466933375",
          "series": "Observed"
        },
        {
          "x": "218",
          "y": "5.54974580444527",
          "series": "Out-of-fold ell"
        },
        {
          "x": "219",
          "y": "4.11087386417331",
          "series": "Observed"
        },
        {
          "x": "219",
          "y": "4.49446250768244",
          "series": "Out-of-fold ell"
        },
        {
          "x": "220",
          "y": "5.59842195899838",
          "series": "Observed"
        },
        {
          "x": "220",
          "y": "5.65783649761077",
          "series": "Out-of-fold ell"
        },
        {
          "x": "221",
          "y": "6.88653164253051",
          "series": "Observed"
        },
        {
          "x": "221",
          "y": "6.34387446672128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "222",
          "y": "3.3322045101752",
          "series": "Observed"
        },
        {
          "x": "222",
          "y": "2.96030516293479",
          "series": "Out-of-fold ell"
        },
        {
          "x": "223",
          "y": "5.18178355029209",
          "series": "Observed"
        },
        {
          "x": "223",
          "y": "4.93499962228489",
          "series": "Out-of-fold ell"
        },
        {
          "x": "224",
          "y": "5.44241771052179",
          "series": "Observed"
        },
        {
          "x": "224",
          "y": "5.55600776784473",
          "series": "Out-of-fold ell"
        },
        {
          "x": "225",
          "y": "7.65681009148038",
          "series": "Observed"
        },
        {
          "x": "225",
          "y": "7.43153111456029",
          "series": "Out-of-fold ell"
        },
        {
          "x": "226",
          "y": "7.03262426102801",
          "series": "Observed"
        },
        {
          "x": "226",
          "y": "6.53174429021326",
          "series": "Out-of-fold ell"
        },
        {
          "x": "227",
          "y": "2.83321334405622",
          "series": "Observed"
        },
        {
          "x": "227",
          "y": "3.61346562862491",
          "series": "Out-of-fold ell"
        },
        {
          "x": "228",
          "y": "7.44775128004791",
          "series": "Observed"
        },
        {
          "x": "228",
          "y": "7.19181282925259",
          "series": "Out-of-fold ell"
        },
        {
          "x": "229",
          "y": "4.62497281328427",
          "series": "Observed"
        },
        {
          "x": "229",
          "y": "4.7836470971165",
          "series": "Out-of-fold ell"
        },
        {
          "x": "230",
          "y": "8.24800570160062",
          "series": "Observed"
        },
        {
          "x": "230",
          "y": "7.76006762636547",
          "series": "Out-of-fold ell"
        },
        {
          "x": "231",
          "y": "7.900636613018",
          "series": "Observed"
        },
        {
          "x": "231",
          "y": "7.33851428782848",
          "series": "Out-of-fold ell"
        },
        {
          "x": "232",
          "y": "3.25809653802148",
          "series": "Observed"
        },
        {
          "x": "232",
          "y": "3.91321518617473",
          "series": "Out-of-fold ell"
        },
        {
          "x": "233",
          "y": "5.08140436498446",
          "series": "Observed"
        },
        {
          "x": "233",
          "y": "5.13838391480284",
          "series": "Out-of-fold ell"
        },
        {
          "x": "234",
          "y": "8.13973227971767",
          "series": "Observed"
        },
        {
          "x": "234",
          "y": "7.87688140564889",
          "series": "Out-of-fold ell"
        },
        {
          "x": "235",
          "y": "7.24064969425547",
          "series": "Observed"
        },
        {
          "x": "235",
          "y": "7.21935145522501",
          "series": "Out-of-fold ell"
        },
        {
          "x": "236",
          "y": "6.10924758276437",
          "series": "Observed"
        },
        {
          "x": "236",
          "y": "5.94343958237989",
          "series": "Out-of-fold ell"
        },
        {
          "x": "237",
          "y": "8.02845516411425",
          "series": "Observed"
        },
        {
          "x": "237",
          "y": "7.72197999092397",
          "series": "Out-of-fold ell"
        },
        {
          "x": "238",
          "y": "4.75359019110636",
          "series": "Observed"
        },
        {
          "x": "238",
          "y": "4.36006122885349",
          "series": "Out-of-fold ell"
        },
        {
          "x": "239",
          "y": "4.51085950651685",
          "series": "Observed"
        },
        {
          "x": "239",
          "y": "5.00202763550538",
          "series": "Out-of-fold ell"
        },
        {
          "x": "240",
          "y": "6.99301512293296",
          "series": "Observed"
        },
        {
          "x": "240",
          "y": "6.79821048324983",
          "series": "Out-of-fold ell"
        },
        {
          "x": "241",
          "y": "5.30826769740121",
          "series": "Observed"
        },
        {
          "x": "241",
          "y": "5.5502617624175",
          "series": "Out-of-fold ell"
        },
        {
          "x": "242",
          "y": "5.97380961186926",
          "series": "Observed"
        },
        {
          "x": "242",
          "y": "5.84567716121278",
          "series": "Out-of-fold ell"
        },
        {
          "x": "243",
          "y": "3.13549421592915",
          "series": "Observed"
        },
        {
          "x": "243",
          "y": "4.35276463261981",
          "series": "Out-of-fold ell"
        },
        {
          "x": "244",
          "y": "6.65027904858742",
          "series": "Observed"
        },
        {
          "x": "244",
          "y": "6.42552170870525",
          "series": "Out-of-fold ell"
        },
        {
          "x": "245",
          "y": "5.41164605185504",
          "series": "Observed"
        },
        {
          "x": "245",
          "y": "5.49531307989231",
          "series": "Out-of-fold ell"
        },
        {
          "x": "246",
          "y": "5.57972982598622",
          "series": "Observed"
        },
        {
          "x": "246",
          "y": "5.62231879859931",
          "series": "Out-of-fold ell"
        },
        {
          "x": "247",
          "y": "7.35627987655075",
          "series": "Observed"
        },
        {
          "x": "247",
          "y": "6.946134595317",
          "series": "Out-of-fold ell"
        },
        {
          "x": "248",
          "y": "7.03790596344718",
          "series": "Observed"
        },
        {
          "x": "248",
          "y": "6.92190516713566",
          "series": "Out-of-fold ell"
        },
        {
          "x": "249",
          "y": "6.4281052726846",
          "series": "Observed"
        },
        {
          "x": "249",
          "y": "6.35959060892246",
          "series": "Out-of-fold ell"
        },
        {
          "x": "250",
          "y": "6.44730586254121",
          "series": "Observed"
        },
        {
          "x": "250",
          "y": "6.35626359722915",
          "series": "Out-of-fold ell"
        },
        {
          "x": "251",
          "y": "6.16331480403464",
          "series": "Observed"
        },
        {
          "x": "251",
          "y": "6.06569584799233",
          "series": "Out-of-fold ell"
        },
        {
          "x": "252",
          "y": "6.61740297797448",
          "series": "Observed"
        },
        {
          "x": "252",
          "y": "6.50882676000092",
          "series": "Out-of-fold ell"
        },
        {
          "x": "253",
          "y": "5.71373280550937",
          "series": "Observed"
        },
        {
          "x": "253",
          "y": "5.73277192139517",
          "series": "Out-of-fold ell"
        },
        {
          "x": "254",
          "y": "6.43294009273918",
          "series": "Observed"
        },
        {
          "x": "254",
          "y": "6.22983211722979",
          "series": "Out-of-fold ell"
        },
        {
          "x": "255",
          "y": "7.30451594646016",
          "series": "Observed"
        },
        {
          "x": "255",
          "y": "7.09919425332238",
          "series": "Out-of-fold ell"
        },
        {
          "x": "256",
          "y": "4.17438726989564",
          "series": "Observed"
        },
        {
          "x": "256",
          "y": "3.99215382288284",
          "series": "Out-of-fold ell"
        },
        {
          "x": "257",
          "y": "4.62497281328427",
          "series": "Observed"
        },
        {
          "x": "257",
          "y": "4.5482967851591",
          "series": "Out-of-fold ell"
        },
        {
          "x": "258",
          "y": "3.85014760171006",
          "series": "Observed"
        },
        {
          "x": "258",
          "y": "3.87760374494868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "259",
          "y": "7.28207365809346",
          "series": "Observed"
        },
        {
          "x": "259",
          "y": "6.89707250094073",
          "series": "Out-of-fold ell"
        },
        {
          "x": "260",
          "y": "3.46573590279973",
          "series": "Observed"
        },
        {
          "x": "260",
          "y": "3.68967253880482",
          "series": "Out-of-fold ell"
        },
        {
          "x": "261",
          "y": "4.02535169073515",
          "series": "Observed"
        },
        {
          "x": "261",
          "y": "4.18515786579213",
          "series": "Out-of-fold ell"
        },
        {
          "x": "262",
          "y": "4.7361984483945",
          "series": "Observed"
        },
        {
          "x": "262",
          "y": "4.74478685386691",
          "series": "Out-of-fold ell"
        },
        {
          "x": "263",
          "y": "3.71357206670431",
          "series": "Observed"
        },
        {
          "x": "263",
          "y": "4.02634976212035",
          "series": "Out-of-fold ell"
        },
        {
          "x": "264",
          "y": "4.79579054559674",
          "series": "Observed"
        },
        {
          "x": "264",
          "y": "4.67996417782051",
          "series": "Out-of-fold ell"
        },
        {
          "x": "265",
          "y": "5.05624580534831",
          "series": "Observed"
        },
        {
          "x": "265",
          "y": "4.99259499809878",
          "series": "Out-of-fold ell"
        },
        {
          "x": "266",
          "y": "5.67332326717149",
          "series": "Observed"
        },
        {
          "x": "266",
          "y": "5.48793247416988",
          "series": "Out-of-fold ell"
        },
        {
          "x": "267",
          "y": "6.18826412308259",
          "series": "Observed"
        },
        {
          "x": "267",
          "y": "5.83903676621403",
          "series": "Out-of-fold ell"
        },
        {
          "x": "268",
          "y": "5.35185813347607",
          "series": "Observed"
        },
        {
          "x": "268",
          "y": "5.61546261041257",
          "series": "Out-of-fold ell"
        },
        {
          "x": "269",
          "y": "5.78382518232974",
          "series": "Observed"
        },
        {
          "x": "269",
          "y": "5.96957430131525",
          "series": "Out-of-fold ell"
        },
        {
          "x": "270",
          "y": "9.89374020108125",
          "series": "Observed"
        },
        {
          "x": "270",
          "y": "9.54266615400138",
          "series": "Out-of-fold ell"
        },
        {
          "x": "271",
          "y": "6.24416690066374",
          "series": "Observed"
        },
        {
          "x": "271",
          "y": "6.07264719642681",
          "series": "Out-of-fold ell"
        },
        {
          "x": "272",
          "y": "7.24279792279376",
          "series": "Observed"
        },
        {
          "x": "272",
          "y": "7.02378624425214",
          "series": "Out-of-fold ell"
        },
        {
          "x": "273",
          "y": "7.14677217945264",
          "series": "Observed"
        },
        {
          "x": "273",
          "y": "6.87425116041917",
          "series": "Out-of-fold ell"
        },
        {
          "x": "274",
          "y": "6.10702288774225",
          "series": "Observed"
        },
        {
          "x": "274",
          "y": "6.09131259660228",
          "series": "Out-of-fold ell"
        },
        {
          "x": "275",
          "y": "5.78996017089725",
          "series": "Observed"
        },
        {
          "x": "275",
          "y": "5.85748984111353",
          "series": "Out-of-fold ell"
        },
        {
          "x": "276",
          "y": "8.82173238093444",
          "series": "Observed"
        },
        {
          "x": "276",
          "y": "8.54315408376694",
          "series": "Out-of-fold ell"
        },
        {
          "x": "277",
          "y": "5.85507192220243",
          "series": "Observed"
        },
        {
          "x": "277",
          "y": "6.01862572923961",
          "series": "Out-of-fold ell"
        },
        {
          "x": "278",
          "y": "6.71901315438526",
          "series": "Observed"
        },
        {
          "x": "278",
          "y": "6.45602452518613",
          "series": "Out-of-fold ell"
        },
        {
          "x": "279",
          "y": "3.40119738166216",
          "series": "Observed"
        },
        {
          "x": "279",
          "y": "4.26416354529759",
          "series": "Out-of-fold ell"
        },
        {
          "x": "280",
          "y": "6.89568269774787",
          "series": "Observed"
        },
        {
          "x": "280",
          "y": "6.92192332410856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "281",
          "y": "6.76503897678054",
          "series": "Observed"
        },
        {
          "x": "281",
          "y": "6.63536363050862",
          "series": "Out-of-fold ell"
        },
        {
          "x": "282",
          "y": "4.00733318523247",
          "series": "Observed"
        },
        {
          "x": "282",
          "y": "4.64877866885045",
          "series": "Out-of-fold ell"
        },
        {
          "x": "283",
          "y": "7.51261754467451",
          "series": "Observed"
        },
        {
          "x": "283",
          "y": "7.27257935740253",
          "series": "Out-of-fold ell"
        },
        {
          "x": "284",
          "y": "3.98898404656427",
          "series": "Observed"
        },
        {
          "x": "284",
          "y": "4.27665176465462",
          "series": "Out-of-fold ell"
        },
        {
          "x": "285",
          "y": "6.19236248947487",
          "series": "Observed"
        },
        {
          "x": "285",
          "y": "6.08311480027704",
          "series": "Out-of-fold ell"
        },
        {
          "x": "286",
          "y": "5.3890717298165",
          "series": "Observed"
        },
        {
          "x": "286",
          "y": "5.62853910910484",
          "series": "Out-of-fold ell"
        },
        {
          "x": "287",
          "y": "7.09090982207998",
          "series": "Observed"
        },
        {
          "x": "287",
          "y": "6.92137635400722",
          "series": "Out-of-fold ell"
        },
        {
          "x": "288",
          "y": "3.55534806148941",
          "series": "Observed"
        },
        {
          "x": "288",
          "y": "3.90753530263221",
          "series": "Out-of-fold ell"
        },
        {
          "x": "289",
          "y": "6.02344759296103",
          "series": "Observed"
        },
        {
          "x": "289",
          "y": "5.87930666903711",
          "series": "Out-of-fold ell"
        },
        {
          "x": "290",
          "y": "4.52178857704904",
          "series": "Observed"
        },
        {
          "x": "290",
          "y": "4.91376439256755",
          "series": "Out-of-fold ell"
        },
        {
          "x": "291",
          "y": "4.66343909411207",
          "series": "Observed"
        },
        {
          "x": "291",
          "y": "4.71181166976952",
          "series": "Out-of-fold ell"
        },
        {
          "x": "292",
          "y": "4.11087386417331",
          "series": "Observed"
        },
        {
          "x": "292",
          "y": "4.76319559620834",
          "series": "Out-of-fold ell"
        },
        {
          "x": "293",
          "y": "5.47227067367148",
          "series": "Observed"
        },
        {
          "x": "293",
          "y": "5.7761515759735",
          "series": "Out-of-fold ell"
        },
        {
          "x": "294",
          "y": "6.78332520060396",
          "series": "Observed"
        },
        {
          "x": "294",
          "y": "6.77925327594463",
          "series": "Out-of-fold ell"
        },
        {
          "x": "295",
          "y": "6.83625927727707",
          "series": "Observed"
        },
        {
          "x": "295",
          "y": "6.74043600387419",
          "series": "Out-of-fold ell"
        },
        {
          "x": "296",
          "y": "6.30809844150953",
          "series": "Observed"
        },
        {
          "x": "296",
          "y": "6.16316073833004",
          "series": "Out-of-fold ell"
        },
        {
          "x": "297",
          "y": "9.36108525866861",
          "series": "Observed"
        },
        {
          "x": "297",
          "y": "8.78373387750495",
          "series": "Out-of-fold ell"
        },
        {
          "x": "298",
          "y": "6.02102334934953",
          "series": "Observed"
        },
        {
          "x": "298",
          "y": "6.10766348043737",
          "series": "Out-of-fold ell"
        },
        {
          "x": "299",
          "y": "5.95064255258773",
          "series": "Observed"
        },
        {
          "x": "299",
          "y": "5.57473324264128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "300",
          "y": "7.63964228785801",
          "series": "Observed"
        },
        {
          "x": "300",
          "y": "7.46625136567149",
          "series": "Out-of-fold ell"
        },
        {
          "x": "301",
          "y": "5.14166355650266",
          "series": "Observed"
        },
        {
          "x": "301",
          "y": "5.17119903965992",
          "series": "Out-of-fold ell"
        },
        {
          "x": "302",
          "y": "7.71779621101358",
          "series": "Observed"
        },
        {
          "x": "302",
          "y": "7.29068077878499",
          "series": "Out-of-fold ell"
        },
        {
          "x": "303",
          "y": "4.23410650459726",
          "series": "Observed"
        },
        {
          "x": "303",
          "y": "4.67211617569307",
          "series": "Out-of-fold ell"
        },
        {
          "x": "304",
          "y": "8.71292443512011",
          "series": "Observed"
        },
        {
          "x": "304",
          "y": "8.14205542354273",
          "series": "Out-of-fold ell"
        },
        {
          "x": "305",
          "y": "5.52545293913178",
          "series": "Observed"
        },
        {
          "x": "305",
          "y": "5.62939708038336",
          "series": "Out-of-fold ell"
        },
        {
          "x": "306",
          "y": "5.89989735358249",
          "series": "Observed"
        },
        {
          "x": "306",
          "y": "5.9429909613014",
          "series": "Out-of-fold ell"
        },
        {
          "x": "307",
          "y": "5.27299955856375",
          "series": "Observed"
        },
        {
          "x": "307",
          "y": "5.35919052095545",
          "series": "Out-of-fold ell"
        },
        {
          "x": "308",
          "y": "8.28652137368124",
          "series": "Observed"
        },
        {
          "x": "308",
          "y": "7.68488252862788",
          "series": "Out-of-fold ell"
        },
        {
          "x": "309",
          "y": "6.3818160174061",
          "series": "Observed"
        },
        {
          "x": "309",
          "y": "6.23153391985822",
          "series": "Out-of-fold ell"
        },
        {
          "x": "310",
          "y": "6.34212141872115",
          "series": "Observed"
        },
        {
          "x": "310",
          "y": "6.46620668019269",
          "series": "Out-of-fold ell"
        },
        {
          "x": "311",
          "y": "5.63835466933375",
          "series": "Observed"
        },
        {
          "x": "311",
          "y": "5.81366037519286",
          "series": "Out-of-fold ell"
        },
        {
          "x": "312",
          "y": "6.44413125670044",
          "series": "Observed"
        },
        {
          "x": "312",
          "y": "6.51427258174647",
          "series": "Out-of-fold ell"
        },
        {
          "x": "313",
          "y": "5.11198778835654",
          "series": "Observed"
        },
        {
          "x": "313",
          "y": "5.23621909342051",
          "series": "Out-of-fold ell"
        },
        {
          "x": "314",
          "y": "5.40717177146012",
          "series": "Observed"
        },
        {
          "x": "314",
          "y": "5.50093731136804",
          "series": "Out-of-fold ell"
        },
        {
          "x": "315",
          "y": "6.78671695060508",
          "series": "Observed"
        },
        {
          "x": "315",
          "y": "6.37411834941912",
          "series": "Out-of-fold ell"
        },
        {
          "x": "316",
          "y": "2.56494935746154",
          "series": "Observed"
        },
        {
          "x": "316",
          "y": "3.27137757903718",
          "series": "Out-of-fold ell"
        },
        {
          "x": "317",
          "y": "6.57228254269401",
          "series": "Observed"
        },
        {
          "x": "317",
          "y": "6.18800189010089",
          "series": "Out-of-fold ell"
        },
        {
          "x": "318",
          "y": "4.39444915467244",
          "series": "Observed"
        },
        {
          "x": "318",
          "y": "4.42832902050197",
          "series": "Out-of-fold ell"
        },
        {
          "x": "319",
          "y": "4.83628190695148",
          "series": "Observed"
        },
        {
          "x": "319",
          "y": "4.63539234015548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "320",
          "y": "6.10479323241498",
          "series": "Observed"
        },
        {
          "x": "320",
          "y": "5.76103215591383",
          "series": "Out-of-fold ell"
        },
        {
          "x": "321",
          "y": "3.17805383034795",
          "series": "Observed"
        },
        {
          "x": "321",
          "y": "3.37214303555466",
          "series": "Out-of-fold ell"
        },
        {
          "x": "322",
          "y": "5.32300997913841",
          "series": "Observed"
        },
        {
          "x": "322",
          "y": "5.25377719600674",
          "series": "Out-of-fold ell"
        },
        {
          "x": "323",
          "y": "3.36729582998647",
          "series": "Observed"
        },
        {
          "x": "323",
          "y": "2.98350165749756",
          "series": "Out-of-fold ell"
        },
        {
          "x": "324",
          "y": "4.07753744390572",
          "series": "Observed"
        },
        {
          "x": "324",
          "y": "3.99087907673867",
          "series": "Out-of-fold ell"
        },
        {
          "x": "325",
          "y": "5.12989871492307",
          "series": "Observed"
        },
        {
          "x": "325",
          "y": "5.03564312054815",
          "series": "Out-of-fold ell"
        },
        {
          "x": "326",
          "y": "5.05624580534831",
          "series": "Observed"
        },
        {
          "x": "326",
          "y": "4.74687068633913",
          "series": "Out-of-fold ell"
        },
        {
          "x": "327",
          "y": "2.89037175789616",
          "series": "Observed"
        },
        {
          "x": "327",
          "y": "3.03146720842063",
          "series": "Out-of-fold ell"
        },
        {
          "x": "328",
          "y": "3.17805383034795",
          "series": "Observed"
        },
        {
          "x": "328",
          "y": "4.11295983468227",
          "series": "Out-of-fold ell"
        },
        {
          "x": "329",
          "y": "4.9416424226093",
          "series": "Observed"
        },
        {
          "x": "329",
          "y": "5.19006110452407",
          "series": "Out-of-fold ell"
        },
        {
          "x": "330",
          "y": "4.15888308335967",
          "series": "Observed"
        },
        {
          "x": "330",
          "y": "4.51927255097765",
          "series": "Out-of-fold ell"
        },
        {
          "x": "331",
          "y": "7.09672137849476",
          "series": "Observed"
        },
        {
          "x": "331",
          "y": "6.91205560828958",
          "series": "Out-of-fold ell"
        },
        {
          "x": "332",
          "y": "5.65599181081985",
          "series": "Observed"
        },
        {
          "x": "332",
          "y": "5.78925894010539",
          "series": "Out-of-fold ell"
        },
        {
          "x": "333",
          "y": "5.4380793089232",
          "series": "Observed"
        },
        {
          "x": "333",
          "y": "5.61839680084091",
          "series": "Out-of-fold ell"
        },
        {
          "x": "334",
          "y": "5.48063892334199",
          "series": "Observed"
        },
        {
          "x": "334",
          "y": "5.3841766988058",
          "series": "Out-of-fold ell"
        },
        {
          "x": "335",
          "y": "8.56369502506766",
          "series": "Observed"
        },
        {
          "x": "335",
          "y": "8.21619210835802",
          "series": "Out-of-fold ell"
        },
        {
          "x": "336",
          "y": "5.93753620508243",
          "series": "Observed"
        },
        {
          "x": "336",
          "y": "6.19982284765635",
          "series": "Out-of-fold ell"
        },
        {
          "x": "337",
          "y": "5.01063529409626",
          "series": "Observed"
        },
        {
          "x": "337",
          "y": "5.23820130397733",
          "series": "Out-of-fold ell"
        },
        {
          "x": "338",
          "y": "4.88280192258637",
          "series": "Observed"
        },
        {
          "x": "338",
          "y": "5.22173568040346",
          "series": "Out-of-fold ell"
        },
        {
          "x": "339",
          "y": "6.05208916892442",
          "series": "Observed"
        },
        {
          "x": "339",
          "y": "5.96904016215445",
          "series": "Out-of-fold ell"
        },
        {
          "x": "340",
          "y": "7.51479976048867",
          "series": "Observed"
        },
        {
          "x": "340",
          "y": "7.18878589018698",
          "series": "Out-of-fold ell"
        },
        {
          "x": "341",
          "y": "6.04973345523196",
          "series": "Observed"
        },
        {
          "x": "341",
          "y": "6.14170479322822",
          "series": "Out-of-fold ell"
        },
        {
          "x": "342",
          "y": "9.52493210973482",
          "series": "Observed"
        },
        {
          "x": "342",
          "y": "9.05730542630914",
          "series": "Out-of-fold ell"
        },
        {
          "x": "343",
          "y": "4.85981240436167",
          "series": "Observed"
        },
        {
          "x": "343",
          "y": "5.19380440956676",
          "series": "Out-of-fold ell"
        },
        {
          "x": "344",
          "y": "4.45434729625351",
          "series": "Observed"
        },
        {
          "x": "344",
          "y": "4.94235119405082",
          "series": "Out-of-fold ell"
        },
        {
          "x": "345",
          "y": "5.99893656194668",
          "series": "Observed"
        },
        {
          "x": "345",
          "y": "5.68472124327152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "346",
          "y": "4.79579054559674",
          "series": "Observed"
        },
        {
          "x": "346",
          "y": "5.06583716696574",
          "series": "Out-of-fold ell"
        },
        {
          "x": "347",
          "y": "5.33271879326537",
          "series": "Observed"
        },
        {
          "x": "347",
          "y": "5.54327829733739",
          "series": "Out-of-fold ell"
        },
        {
          "x": "348",
          "y": "4.59511985013459",
          "series": "Observed"
        },
        {
          "x": "348",
          "y": "4.67383070935075",
          "series": "Out-of-fold ell"
        },
        {
          "x": "349",
          "y": "5.4971682252932",
          "series": "Observed"
        },
        {
          "x": "349",
          "y": "4.82624137241899",
          "series": "Out-of-fold ell"
        },
        {
          "x": "350",
          "y": "5.43372200355424",
          "series": "Observed"
        },
        {
          "x": "350",
          "y": "5.59356484927864",
          "series": "Out-of-fold ell"
        },
        {
          "x": "351",
          "y": "7.92768504561578",
          "series": "Observed"
        },
        {
          "x": "351",
          "y": "7.82361849896765",
          "series": "Out-of-fold ell"
        },
        {
          "x": "352",
          "y": "6.22653666928747",
          "series": "Observed"
        },
        {
          "x": "352",
          "y": "6.27806887567573",
          "series": "Out-of-fold ell"
        },
        {
          "x": "353",
          "y": "3.80666248977032",
          "series": "Observed"
        },
        {
          "x": "353",
          "y": "4.66990296255528",
          "series": "Out-of-fold ell"
        },
        {
          "x": "354",
          "y": "10.4352622050525",
          "series": "Observed"
        },
        {
          "x": "354",
          "y": "10.0029484089887",
          "series": "Out-of-fold ell"
        },
        {
          "x": "355",
          "y": "5.4971682252932",
          "series": "Observed"
        },
        {
          "x": "355",
          "y": "5.42590088862558",
          "series": "Out-of-fold ell"
        },
        {
          "x": "356",
          "y": "8.80956425335415",
          "series": "Observed"
        },
        {
          "x": "356",
          "y": "8.32166259261392",
          "series": "Out-of-fold ell"
        },
        {
          "x": "357",
          "y": "2.484906649788",
          "series": "Observed"
        },
        {
          "x": "357",
          "y": "3.58015393751031",
          "series": "Out-of-fold ell"
        },
        {
          "x": "358",
          "y": "1.38629436111989",
          "series": "Observed"
        },
        {
          "x": "358",
          "y": "2.86040227229273",
          "series": "Out-of-fold ell"
        },
        {
          "x": "359",
          "y": "6.46458830368996",
          "series": "Observed"
        },
        {
          "x": "359",
          "y": "6.55531027676508",
          "series": "Out-of-fold ell"
        },
        {
          "x": "360",
          "y": "6.36302810354046",
          "series": "Observed"
        },
        {
          "x": "360",
          "y": "6.15973872971778",
          "series": "Out-of-fold ell"
        },
        {
          "x": "361",
          "y": "5.90536184805457",
          "series": "Observed"
        },
        {
          "x": "361",
          "y": "5.90860473335745",
          "series": "Out-of-fold ell"
        },
        {
          "x": "362",
          "y": "8.17301131172497",
          "series": "Observed"
        },
        {
          "x": "362",
          "y": "7.8060949931642",
          "series": "Out-of-fold ell"
        },
        {
          "x": "363",
          "y": "5.86929691313377",
          "series": "Observed"
        },
        {
          "x": "363",
          "y": "5.81675708784476",
          "series": "Out-of-fold ell"
        },
        {
          "x": "364",
          "y": "2.30258509299405",
          "series": "Observed"
        },
        {
          "x": "364",
          "y": "3.2868360438456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "365",
          "y": "6.45676965557216",
          "series": "Observed"
        },
        {
          "x": "365",
          "y": "6.26740247442797",
          "series": "Out-of-fold ell"
        },
        {
          "x": "366",
          "y": "6.289715570909",
          "series": "Observed"
        },
        {
          "x": "366",
          "y": "6.38763426346153",
          "series": "Out-of-fold ell"
        },
        {
          "x": "367",
          "y": "4.20469261939097",
          "series": "Observed"
        },
        {
          "x": "367",
          "y": "3.74758874482248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "368",
          "y": "2.99573227355399",
          "series": "Observed"
        },
        {
          "x": "368",
          "y": "4.14956590779781",
          "series": "Out-of-fold ell"
        },
        {
          "x": "369",
          "y": "1.94591014905531",
          "series": "Observed"
        },
        {
          "x": "369",
          "y": "3.37951242740914",
          "series": "Out-of-fold ell"
        },
        {
          "x": "370",
          "y": "5.91620206260743",
          "series": "Observed"
        },
        {
          "x": "370",
          "y": "5.97263222676826",
          "series": "Out-of-fold ell"
        },
        {
          "x": "371",
          "y": "5.6970934865054",
          "series": "Observed"
        },
        {
          "x": "371",
          "y": "5.63017780989732",
          "series": "Out-of-fold ell"
        },
        {
          "x": "372",
          "y": "3.8286413964891",
          "series": "Observed"
        },
        {
          "x": "372",
          "y": "4.2614181324951",
          "series": "Out-of-fold ell"
        },
        {
          "x": "373",
          "y": "5.25749537202778",
          "series": "Observed"
        },
        {
          "x": "373",
          "y": "5.06097730821087",
          "series": "Out-of-fold ell"
        },
        {
          "x": "374",
          "y": "5.78996017089725",
          "series": "Observed"
        },
        {
          "x": "374",
          "y": "5.67100944346549",
          "series": "Out-of-fold ell"
        },
        {
          "x": "375",
          "y": "4.79579054559674",
          "series": "Observed"
        },
        {
          "x": "375",
          "y": "4.83303466531272",
          "series": "Out-of-fold ell"
        },
        {
          "x": "376",
          "y": "3.76120011569356",
          "series": "Observed"
        },
        {
          "x": "376",
          "y": "3.73366241258844",
          "series": "Out-of-fold ell"
        },
        {
          "x": "377",
          "y": "2.94443897916644",
          "series": "Observed"
        },
        {
          "x": "377",
          "y": "3.47803041086876",
          "series": "Out-of-fold ell"
        },
        {
          "x": "378",
          "y": "6.93828448401696",
          "series": "Observed"
        },
        {
          "x": "378",
          "y": "6.35169012736763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "379",
          "y": "4.62497281328427",
          "series": "Observed"
        },
        {
          "x": "379",
          "y": "4.96068705765927",
          "series": "Out-of-fold ell"
        },
        {
          "x": "380",
          "y": "6.38856140554563",
          "series": "Observed"
        },
        {
          "x": "380",
          "y": "6.28224399626467",
          "series": "Out-of-fold ell"
        },
        {
          "x": "381",
          "y": "5.19849703126583",
          "series": "Observed"
        },
        {
          "x": "381",
          "y": "5.25571989302348",
          "series": "Out-of-fold ell"
        },
        {
          "x": "382",
          "y": "3.93182563272433",
          "series": "Observed"
        },
        {
          "x": "382",
          "y": "3.73295092453664",
          "series": "Out-of-fold ell"
        },
        {
          "x": "383",
          "y": "2.484906649788",
          "series": "Observed"
        },
        {
          "x": "383",
          "y": "2.95219388929539",
          "series": "Out-of-fold ell"
        },
        {
          "x": "384",
          "y": "2.56494935746154",
          "series": "Observed"
        },
        {
          "x": "384",
          "y": "3.36855158916654",
          "series": "Out-of-fold ell"
        },
        {
          "x": "385",
          "y": "5.92692602597041",
          "series": "Observed"
        },
        {
          "x": "385",
          "y": "6.07460517744667",
          "series": "Out-of-fold ell"
        },
        {
          "x": "386",
          "y": "6.39692965521615",
          "series": "Observed"
        },
        {
          "x": "386",
          "y": "6.09275053138199",
          "series": "Out-of-fold ell"
        },
        {
          "x": "387",
          "y": "5.69035945432406",
          "series": "Observed"
        },
        {
          "x": "387",
          "y": "5.70597084392187",
          "series": "Out-of-fold ell"
        },
        {
          "x": "388",
          "y": "5.51342874616498",
          "series": "Observed"
        },
        {
          "x": "388",
          "y": "5.42523315615309",
          "series": "Out-of-fold ell"
        },
        {
          "x": "389",
          "y": "4.33073334028633",
          "series": "Observed"
        },
        {
          "x": "389",
          "y": "4.42839830190737",
          "series": "Out-of-fold ell"
        },
        {
          "x": "390",
          "y": "3.55534806148941",
          "series": "Observed"
        },
        {
          "x": "390",
          "y": "4.19684499908717",
          "series": "Out-of-fold ell"
        },
        {
          "x": "391",
          "y": "6.93049476595163",
          "series": "Observed"
        },
        {
          "x": "391",
          "y": "6.49684702688903",
          "series": "Out-of-fold ell"
        },
        {
          "x": "392",
          "y": "8.6909784171879",
          "series": "Observed"
        },
        {
          "x": "392",
          "y": "8.09027082011385",
          "series": "Out-of-fold ell"
        },
        {
          "x": "393",
          "y": "5.48893772615669",
          "series": "Observed"
        },
        {
          "x": "393",
          "y": "5.05071952634908",
          "series": "Out-of-fold ell"
        },
        {
          "x": "394",
          "y": "5.01063529409626",
          "series": "Observed"
        },
        {
          "x": "394",
          "y": "5.10965479700423",
          "series": "Out-of-fold ell"
        },
        {
          "x": "395",
          "y": "8.08978917578932",
          "series": "Observed"
        },
        {
          "x": "395",
          "y": "7.34087761976099",
          "series": "Out-of-fold ell"
        },
        {
          "x": "396",
          "y": "7.27931883541462",
          "series": "Observed"
        },
        {
          "x": "396",
          "y": "6.8612319221069",
          "series": "Out-of-fold ell"
        },
        {
          "x": "397",
          "y": "6.48463523563525",
          "series": "Observed"
        },
        {
          "x": "397",
          "y": "6.45941519743608",
          "series": "Out-of-fold ell"
        },
        {
          "x": "398",
          "y": "2.30258509299405",
          "series": "Observed"
        },
        {
          "x": "398",
          "y": "3.56325268113945",
          "series": "Out-of-fold ell"
        },
        {
          "x": "399",
          "y": "5.88332238848828",
          "series": "Observed"
        },
        {
          "x": "399",
          "y": "6.07234668503081",
          "series": "Out-of-fold ell"
        },
        {
          "x": "400",
          "y": "5.98393628068719",
          "series": "Observed"
        },
        {
          "x": "400",
          "y": "5.69108294676907",
          "series": "Out-of-fold ell"
        },
        {
          "x": "401",
          "y": "4.61512051684126",
          "series": "Observed"
        },
        {
          "x": "401",
          "y": "5.00281924160064",
          "series": "Out-of-fold ell"
        },
        {
          "x": "402",
          "y": "8.56254889313703",
          "series": "Observed"
        },
        {
          "x": "402",
          "y": "8.05957592907054",
          "series": "Out-of-fold ell"
        },
        {
          "x": "403",
          "y": "6.28226674689601",
          "series": "Observed"
        },
        {
          "x": "403",
          "y": "5.98786394528696",
          "series": "Out-of-fold ell"
        },
        {
          "x": "404",
          "y": "5.46806014113513",
          "series": "Observed"
        },
        {
          "x": "404",
          "y": "5.55131951840997",
          "series": "Out-of-fold ell"
        },
        {
          "x": "405",
          "y": "9.4753933263676",
          "series": "Observed"
        },
        {
          "x": "405",
          "y": "9.07703010454705",
          "series": "Out-of-fold ell"
        },
        {
          "x": "406",
          "y": "6.86693328446188",
          "series": "Observed"
        },
        {
          "x": "406",
          "y": "6.53280999206969",
          "series": "Out-of-fold ell"
        },
        {
          "x": "407",
          "y": "4.14313472639153",
          "series": "Observed"
        },
        {
          "x": "407",
          "y": "4.68634640986729",
          "series": "Out-of-fold ell"
        },
        {
          "x": "408",
          "y": "4.70953020131233",
          "series": "Observed"
        },
        {
          "x": "408",
          "y": "5.28773753221211",
          "series": "Out-of-fold ell"
        },
        {
          "x": "409",
          "y": "6.0591231955818",
          "series": "Observed"
        },
        {
          "x": "409",
          "y": "6.24649954469236",
          "series": "Out-of-fold ell"
        },
        {
          "x": "410",
          "y": "5.71042701737487",
          "series": "Observed"
        },
        {
          "x": "410",
          "y": "5.56801869123452",
          "series": "Out-of-fold ell"
        },
        {
          "x": "411",
          "y": "4.20469261939097",
          "series": "Observed"
        },
        {
          "x": "411",
          "y": "4.76472330275715",
          "series": "Out-of-fold ell"
        },
        {
          "x": "412",
          "y": "7.05703698169789",
          "series": "Observed"
        },
        {
          "x": "412",
          "y": "6.8229984976281",
          "series": "Out-of-fold ell"
        },
        {
          "x": "413",
          "y": "5.73009978297357",
          "series": "Observed"
        },
        {
          "x": "413",
          "y": "5.93416259806484",
          "series": "Out-of-fold ell"
        },
        {
          "x": "414",
          "y": "6.14846829591765",
          "series": "Observed"
        },
        {
          "x": "414",
          "y": "6.18692251401634",
          "series": "Out-of-fold ell"
        },
        {
          "x": "415",
          "y": "5.21493575760899",
          "series": "Observed"
        },
        {
          "x": "415",
          "y": "4.83805518019338",
          "series": "Out-of-fold ell"
        },
        {
          "x": "416",
          "y": "6.289715570909",
          "series": "Observed"
        },
        {
          "x": "416",
          "y": "5.76517842134643",
          "series": "Out-of-fold ell"
        },
        {
          "x": "417",
          "y": "7.00306545878646",
          "series": "Observed"
        },
        {
          "x": "417",
          "y": "6.17405148298834",
          "series": "Out-of-fold ell"
        },
        {
          "x": "418",
          "y": "7.57814547241947",
          "series": "Observed"
        },
        {
          "x": "418",
          "y": "7.38841017975948",
          "series": "Out-of-fold ell"
        },
        {
          "x": "419",
          "y": "7.01571242048723",
          "series": "Observed"
        },
        {
          "x": "419",
          "y": "6.49872351380757",
          "series": "Out-of-fold ell"
        },
        {
          "x": "420",
          "y": "7.37713371283395",
          "series": "Observed"
        },
        {
          "x": "420",
          "y": "6.87203857498092",
          "series": "Out-of-fold ell"
        },
        {
          "x": "421",
          "y": "7.78113850984502",
          "series": "Observed"
        },
        {
          "x": "421",
          "y": "7.51445251091776",
          "series": "Out-of-fold ell"
        },
        {
          "x": "422",
          "y": "8.0149968943483",
          "series": "Observed"
        },
        {
          "x": "422",
          "y": "7.7882816403987",
          "series": "Out-of-fold ell"
        },
        {
          "x": "423",
          "y": "4.98360662170834",
          "series": "Observed"
        },
        {
          "x": "423",
          "y": "4.94066435391321",
          "series": "Out-of-fold ell"
        },
        {
          "x": "424",
          "y": "7.73543335249969",
          "series": "Observed"
        },
        {
          "x": "424",
          "y": "7.23818068423254",
          "series": "Out-of-fold ell"
        },
        {
          "x": "425",
          "y": "6.31173480915291",
          "series": "Observed"
        },
        {
          "x": "425",
          "y": "5.94525739449511",
          "series": "Out-of-fold ell"
        },
        {
          "x": "426",
          "y": "6.83195356556585",
          "series": "Observed"
        },
        {
          "x": "426",
          "y": "6.52972272043939",
          "series": "Out-of-fold ell"
        },
        {
          "x": "427",
          "y": "6.35610766069589",
          "series": "Observed"
        },
        {
          "x": "427",
          "y": "5.80272820570746",
          "series": "Out-of-fold ell"
        },
        {
          "x": "428",
          "y": "7.02286808608264",
          "series": "Observed"
        },
        {
          "x": "428",
          "y": "6.34156993694553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "429",
          "y": "4.4188406077966",
          "series": "Observed"
        },
        {
          "x": "429",
          "y": "5.34264051238516",
          "series": "Out-of-fold ell"
        },
        {
          "x": "430",
          "y": "2.07944154167984",
          "series": "Observed"
        },
        {
          "x": "430",
          "y": "3.92819669132967",
          "series": "Out-of-fold ell"
        },
        {
          "x": "431",
          "y": "3.09104245335832",
          "series": "Observed"
        },
        {
          "x": "431",
          "y": "3.63363950012713",
          "series": "Out-of-fold ell"
        },
        {
          "x": "432",
          "y": "4.85981240436167",
          "series": "Observed"
        },
        {
          "x": "432",
          "y": "5.17595286788985",
          "series": "Out-of-fold ell"
        },
        {
          "x": "433",
          "y": "5.60947179518496",
          "series": "Observed"
        },
        {
          "x": "433",
          "y": "5.82320557038476",
          "series": "Out-of-fold ell"
        },
        {
          "x": "434",
          "y": "6.27852142416584",
          "series": "Observed"
        },
        {
          "x": "434",
          "y": "6.13417981590742",
          "series": "Out-of-fold ell"
        },
        {
          "x": "435",
          "y": "4.06044301054642",
          "series": "Observed"
        },
        {
          "x": "435",
          "y": "4.85928695661468",
          "series": "Out-of-fold ell"
        },
        {
          "x": "436",
          "y": "5.4249500174814",
          "series": "Observed"
        },
        {
          "x": "436",
          "y": "5.54516766723299",
          "series": "Out-of-fold ell"
        },
        {
          "x": "437",
          "y": "4.26267987704132",
          "series": "Observed"
        },
        {
          "x": "437",
          "y": "4.28955572728899",
          "series": "Out-of-fold ell"
        },
        {
          "x": "438",
          "y": "4.38202663467388",
          "series": "Observed"
        },
        {
          "x": "438",
          "y": "4.5217038443986",
          "series": "Out-of-fold ell"
        },
        {
          "x": "439",
          "y": "5.14166355650266",
          "series": "Observed"
        },
        {
          "x": "439",
          "y": "5.64227806279511",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/realdata-actual-country-R-summary.csv",
      "summarySHA256": "4f8078c1f1a62c515bdb164c793dd7551afc3734ddcc461c2a6994c70ae49e74",
      "pointsFile": "metr21-programs/realdata-actual-country-R-points.csv",
      "pointsSHA256": "27ac3a31b14422911c5bd2a55a76ff312a2ae50cf439e07328ae7bf1df50ebb2",
      "fullResultFile": "metr21-programs/realdata-actual-country-R-full.csv",
      "fullResultSHA256": "ac13598e78874fcf66c8b73ae1efe859ecf0e40c75f28332a944f2293019e2b6",
      "plotFile": "metr21-programs/realdata-actual-country-R.svg",
      "plotSHA256": "902a3a81d7077f24b0a8c5e1cbfdfc1b0d623c725a3642b4a00f3c40f35e1ba2"
    },
    {
      "api": "realdata",
      "variant": "actual-company",
      "profile": "actual-company",
      "language": "Python",
      "file": "metr21-programs/realdata-actual-company-Python.py",
      "codeSHA256": "801f3c989f95e33358d8e1425d31a2a94dbfb62d2701b764a06f8229835d84ac",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "점포 384개 완전쌍 전체",
        "en": "All 384 records: NJPA post FTE"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"realdata\", \"key\": \"actual-company\", \"title\": \"All 384 records: NJPA post FTE\", \"input\": {\"kind\": \"company\"}, \"xLabel\": \"Declared source order, not time\", \"yLabel\": \"FTE employees\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "rows": "384",
        "groups": "383",
        "PLRtheta": "1.15262893",
        "AIPWtheta": "0.912249575",
        "clippedRows": "0",
        "rawPropensityMin": "0.631501042",
        "rawPropensityMax": "0.889101706"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "3042312559928023072324037/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "114832132680917952021316/7769983472290646961637",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "5058671968749798159731323/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "21910652031995902305625271/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "4",
          "y": "71/2",
          "series": "Observed"
        },
        {
          "x": "4",
          "y": "14149890287865912048217/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "5",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "5",
          "y": "7973215712301006740460949/211330676388270858261106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "6",
          "y": "73/2",
          "series": "Observed"
        },
        {
          "x": "6",
          "y": "7487308871971157046191/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "7",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "7",
          "y": "10746874134981249851400271/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "8",
          "y": "17/2",
          "series": "Observed"
        },
        {
          "x": "8",
          "y": "698276012245078434056777/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "9",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "9",
          "y": "597036106424480834016889/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "10",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "10",
          "y": "1030406097101199260283939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "11",
          "y": "61/2",
          "series": "Observed"
        },
        {
          "x": "11",
          "y": "45130300679030181844289/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "12",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "12",
          "y": "2664594441439030953161462/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "13",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "13",
          "y": "39552311678103577856069/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "14",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "14",
          "y": "24389587178378105949713617/1690645411106166866088848",
          "series": "Out-of-fold ell"
        },
        {
          "x": "15",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "15",
          "y": "7513564279585397090027/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "16",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "16",
          "y": "53442363784421193616331/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "17",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "17",
          "y": "718425789913992851999639/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "18",
          "y": "29/2",
          "series": "Observed"
        },
        {
          "x": "18",
          "y": "57064205052272569956841/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "19",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "19",
          "y": "12380113521619930233367/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "20",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "20",
          "y": "20456283463560081550601471/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "21",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "21",
          "y": "68993466194948604576726/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "22",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "22",
          "y": "4138299059793457413147049/211330676388270858261106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "23",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "23",
          "y": "1219883663951275723210052/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "24",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "24",
          "y": "584984599393594562080939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "25",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "25",
          "y": "16175478120684837533425621/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "26",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "26",
          "y": "47704757140996306761929/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "27",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "27",
          "y": "24726445320626075515491/1071721858246985787812",
          "series": "Out-of-fold ell"
        },
        {
          "x": "28",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "28",
          "y": "7756841561098384469501/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "29",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "29",
          "y": "7179271512968611419551/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "30",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "30",
          "y": "20183601176045271267803971/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "31",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "31",
          "y": "709032576277565341991939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "32",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "32",
          "y": "41912230101572525697239/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "33",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "33",
          "y": "26862850465687516129139/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "34",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "34",
          "y": "3113624742164670549049753/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "35",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "35",
          "y": "814479683023201460432189/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "36",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "36",
          "y": "15440196594493228187104/706789546924905502599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "37",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "37",
          "y": "8353952826179467518711473/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "38",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "38",
          "y": "10682566569140204438351/471193031283270335066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "39",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "39",
          "y": "428325149965806829622139/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "40",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "40",
          "y": "2916406520431692365936512/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "41",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "41",
          "y": "986217237987949596518789/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "42",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "42",
          "y": "171610630732262164152587/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "43",
          "y": "75/2",
          "series": "Observed"
        },
        {
          "x": "43",
          "y": "195282575922332857078107/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "44",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "44",
          "y": "373597840937685934894557/15539966944581293923274",
          "series": "Out-of-fold ell"
        },
        {
          "x": "45",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "45",
          "y": "5290184667598755419349473/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "46",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "46",
          "y": "4491741511830560525324549/211330676388270858261106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "47",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "47",
          "y": "8477139225507486680811/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "48",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "48",
          "y": "5049146698402759038262663/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "49",
          "y": "63/2",
          "series": "Observed"
        },
        {
          "x": "49",
          "y": "10682566569140204438351/471193031283270335066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "50",
          "y": "49/2",
          "series": "Observed"
        },
        {
          "x": "50",
          "y": "733135590339337885863839/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "51",
          "y": "55/2",
          "series": "Observed"
        },
        {
          "x": "51",
          "y": "9021599252303824629608023/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "52",
          "y": "69/2",
          "series": "Observed"
        },
        {
          "x": "52",
          "y": "40410463832092286161949/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "53",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "53",
          "y": "408239304914329709728889/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "54",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "54",
          "y": "55373206130895787304561/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "55",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "55",
          "y": "342398151684624739874657/15539966944581293923274",
          "series": "Out-of-fold ell"
        },
        {
          "x": "56",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "56",
          "y": "2178252941903199314493611/76847518686643948458584",
          "series": "Out-of-fold ell"
        },
        {
          "x": "57",
          "y": "47/2",
          "series": "Observed"
        },
        {
          "x": "57",
          "y": "8873476987482612366071/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "58",
          "y": "71/2",
          "series": "Observed"
        },
        {
          "x": "58",
          "y": "43413996371052765232529/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "59",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "59",
          "y": "821513308565837213394139/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "60",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "60",
          "y": "20183601176045271267803971/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "61",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "61",
          "y": "7679832221347748062841/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "62",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "62",
          "y": "54569974372905973208969/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "63",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "63",
          "y": "2767952607215863624993743/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "64",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "64",
          "y": "6379353741311972368491/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "65",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "65",
          "y": "118943125445126378010617/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "66",
          "y": "107/4",
          "series": "Observed"
        },
        {
          "x": "66",
          "y": "14765965005871003301497/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "67",
          "y": "87/2",
          "series": "Observed"
        },
        {
          "x": "67",
          "y": "44272148525041473538409/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "68",
          "y": "165/4",
          "series": "Observed"
        },
        {
          "x": "68",
          "y": "7102262173217975012891/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "69",
          "y": "57/4",
          "series": "Observed"
        },
        {
          "x": "69",
          "y": "14728270941524802266579/706789546924905502599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "70",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "70",
          "y": "121902118593885214626307/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "71",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "71",
          "y": "6340849071436654165161/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "72",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "72",
          "y": "158799803005571840453516/7769983472290646961637",
          "series": "Out-of-fold ell"
        },
        {
          "x": "73",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "73",
          "y": "6871234153966065792911/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "74",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "74",
          "y": "42770382255561234003119/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "75",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "75",
          "y": "6832729484090747589581/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "76",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "76",
          "y": "150897678690950307842757/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "77",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "77",
          "y": "6802905109940472605121/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "78",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "78",
          "y": "112355447550520402682647/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "79",
          "y": "69/2",
          "series": "Observed"
        },
        {
          "x": "79",
          "y": "321028812848833053687499/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "80",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "80",
          "y": "2040422732429159754238/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "81",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "81",
          "y": "8939195264011305120771/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "82",
          "y": "38",
          "series": "Observed"
        },
        {
          "x": "82",
          "y": "733135590339337885863839/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "83",
          "y": "36",
          "series": "Observed"
        },
        {
          "x": "83",
          "y": "5502186813442985026528/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "84",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "84",
          "y": "4536765640205688182413/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "85",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "85",
          "y": "318069819700074217071809/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "86",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "86",
          "y": "809648028824415305293793/38423759343321974229292",
          "series": "Out-of-fold ell"
        },
        {
          "x": "87",
          "y": "53",
          "series": "Observed"
        },
        {
          "x": "87",
          "y": "10038952453648673208941/471193031283270335066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "88",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "88",
          "y": "40839539909086640314889/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "89",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "89",
          "y": "13325369677052798878877/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "90",
          "y": "45",
          "series": "Observed"
        },
        {
          "x": "90",
          "y": "133939746540811573916537/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "91",
          "y": "8",
          "series": "Observed"
        },
        {
          "x": "91",
          "y": "47006222629505881322231/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "92",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "92",
          "y": "477405791270001215989189/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "93",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "93",
          "y": "897839519761450268988489/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "94",
          "y": "15/2",
          "series": "Observed"
        },
        {
          "x": "94",
          "y": "11250498292966572676950371/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "95",
          "y": "15/2",
          "series": "Observed"
        },
        {
          "x": "95",
          "y": "25146546157710099517379/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "96",
          "y": "37/2",
          "series": "Observed"
        },
        {
          "x": "96",
          "y": "27291926542681870282079/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "97",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "97",
          "y": "6956923789441745418441/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "98",
          "y": "67/2",
          "series": "Observed"
        },
        {
          "x": "98",
          "y": "1268574535041802287374007/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "99",
          "y": "37",
          "series": "Observed"
        },
        {
          "x": "99",
          "y": "7650007847197473078381/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "100",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "100",
          "y": "57304048477370380992791/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "101",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "101",
          "y": "23403244504003591103167/942386062566540670132",
          "series": "Out-of-fold ell"
        },
        {
          "x": "102",
          "y": "33",
          "series": "Observed"
        },
        {
          "x": "102",
          "y": "166177614579443089964016/7769983472290646961637",
          "series": "Out-of-fold ell"
        },
        {
          "x": "103",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "103",
          "y": "42341306178566879850179/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "104",
          "y": "49/2",
          "series": "Observed"
        },
        {
          "x": "104",
          "y": "119136621884506355640107/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "105",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "105",
          "y": "489457298300887487925139/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "106",
          "y": "47/2",
          "series": "Observed"
        },
        {
          "x": "106",
          "y": "1293725976806252398607372/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "107",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "107",
          "y": "7937115648213897326657/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "108",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "108",
          "y": "7495989167696200265061/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "109",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "109",
          "y": "734494465955174547914239/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "110",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "110",
          "y": "1394331743864052843540832/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "111",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "111",
          "y": "696981069246679070055989/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "112",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "112",
          "y": "3406738574576544243958/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "113",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "113",
          "y": "10028847568274470280708223/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "114",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "114",
          "y": "71750097909526608151766/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "115",
          "y": "95/4",
          "series": "Observed"
        },
        {
          "x": "115",
          "y": "6462343238345038263810649/211330676388270858261106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "116",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "116",
          "y": "6297432983569401070449673/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "117",
          "y": "36",
          "series": "Observed"
        },
        {
          "x": "117",
          "y": "29778348940795370147863/1413579093849811005198",
          "series": "Out-of-fold ell"
        },
        {
          "x": "118",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "118",
          "y": "59234890823844974681021/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "119",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "119",
          "y": "58591276708353443451611/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "120",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "120",
          "y": "5502186813442985026528/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "121",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "121",
          "y": "140375887695726886210637/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "122",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "122",
          "y": "77762908468125084812721/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "123",
          "y": "67/4",
          "series": "Observed"
        },
        {
          "x": "123",
          "y": "617996564656607252533389/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "124",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "124",
          "y": "72047283604788244621991/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "125",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "125",
          "y": "13764843589112730014917/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "126",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "126",
          "y": "88024560227700209538061/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "127",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "127",
          "y": "70270601335147189843921/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "128",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "128",
          "y": "304463596737326579874259/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "129",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "129",
          "y": "65027417863268755745711/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "130",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "130",
          "y": "139466428964276627461297/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "131",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "131",
          "y": "162733651285985654305517/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "132",
          "y": "93/4",
          "series": "Observed"
        },
        {
          "x": "132",
          "y": "77762908468125084812721/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "133",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "133",
          "y": "7359545600084124276707/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "134",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "134",
          "y": "5562296126735120985281423/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "135",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "135",
          "y": "7513564279585397090027/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "136",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "136",
          "y": "748578895773978656523507/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "137",
          "y": "29/2",
          "series": "Observed"
        },
        {
          "x": "137",
          "y": "73324418744986829889186/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "138",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "138",
          "y": "10243249976995927025850171/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "139",
          "y": "13/2",
          "series": "Observed"
        },
        {
          "x": "139",
          "y": "492599854130533613280539/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "140",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "140",
          "y": "2117432072179796160898/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "141",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "141",
          "y": "1619690975493460552608289/112832445604470893558434",
          "series": "Out-of-fold ell"
        },
        {
          "x": "142",
          "y": "93/2",
          "series": "Observed"
        },
        {
          "x": "142",
          "y": "19012705364818185306109/706789546924905502599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "143",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "143",
          "y": "18268148576728224028334/706789546924905502599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "144",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "144",
          "y": "6705924411242849327631/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "145",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "145",
          "y": "7063757503342656809561/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "146",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "146",
          "y": "12495627531245884843357/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "147",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "147",
          "y": "5200055348989459705662853/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "148",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "148",
          "y": "5200055348989459705662853/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "149",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "149",
          "y": "2308823775663445615856037/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "150",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "150",
          "y": "785358787473178397586289/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "151",
          "y": "59/2",
          "series": "Observed"
        },
        {
          "x": "151",
          "y": "19468763699354695335792621/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "152",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "152",
          "y": "837581984607018909308739/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "153",
          "y": "63/2",
          "series": "Observed"
        },
        {
          "x": "153",
          "y": "121711078346472480557747/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "154",
          "y": "55/2",
          "series": "Observed"
        },
        {
          "x": "154",
          "y": "757238604401110429735739/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "155",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "155",
          "y": "10892372996249785799618873/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "156",
          "y": "29/2",
          "series": "Observed"
        },
        {
          "x": "156",
          "y": "605586894487839413542389/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "157",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "157",
          "y": "22953534044964546808329521/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "158",
          "y": "44",
          "series": "Observed"
        },
        {
          "x": "158",
          "y": "48777447333482192144279/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "159",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "159",
          "y": "76188587632664863075301/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "160",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "160",
          "y": "6297432983569401070449673/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "161",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "161",
          "y": "634065240697788948447989/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "162",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "162",
          "y": "15151020671868997929649/706789546924905502599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "163",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "163",
          "y": "8449925618854112129441/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "164",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "164",
          "y": "21442661571008578331679221/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "165",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "165",
          "y": "797410294504064669522239/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "166",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "166",
          "y": "640578129123286689067153/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "167",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "167",
          "y": "27506464581179047358549/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "168",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "168",
          "y": "2127027704608968021478062/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "169",
          "y": "37/2",
          "series": "Observed"
        },
        {
          "x": "169",
          "y": "68993466194948604576726/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "170",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "170",
          "y": "593893550594834708661489/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "171",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "171",
          "y": "726460127934583699956939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "172",
          "y": "33",
          "series": "Observed"
        },
        {
          "x": "172",
          "y": "43843072448047119385469/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "173",
          "y": "15/2",
          "series": "Observed"
        },
        {
          "x": "173",
          "y": "2213693746868091669223/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "174",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "174",
          "y": "54489748590306445039201/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "175",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "175",
          "y": "6871234153966065792911/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "176",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "176",
          "y": "7718336891223066266171/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "177",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "177",
          "y": "413131087105274432330789/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "178",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "178",
          "y": "5038372588606094006574423/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "179",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "179",
          "y": "35921033866188448939461867/1690645411106166866088848",
          "series": "Out-of-fold ell"
        },
        {
          "x": "180",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "180",
          "y": "11648524793988884370097/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "181",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "181",
          "y": "44369636740898641530560567/1690645411106166866088848",
          "series": "Out-of-fold ell"
        },
        {
          "x": "182",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "182",
          "y": "805444632524655517479539/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "183",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "183",
          "y": "8026374250225611892811/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "184",
          "y": "35",
          "series": "Observed"
        },
        {
          "x": "184",
          "y": "7756841561098384469501/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "185",
          "y": "71/4",
          "series": "Observed"
        },
        {
          "x": "185",
          "y": "713049745287860765970589/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "186",
          "y": "49/2",
          "series": "Observed"
        },
        {
          "x": "186",
          "y": "8603944298355384942761/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "187",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "187",
          "y": "6948243493716702199571/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "188",
          "y": "30",
          "series": "Observed"
        },
        {
          "x": "188",
          "y": "101340029397114974308666/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "189",
          "y": "39",
          "series": "Observed"
        },
        {
          "x": "189",
          "y": "42555844217064056926649/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "190",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "190",
          "y": "2912413208049069659182833/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "191",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "191",
          "y": "457319946218524096095939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "192",
          "y": "77/2",
          "series": "Observed"
        },
        {
          "x": "192",
          "y": "13573758287754794536597/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "193",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "193",
          "y": "645242134548025921760689/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "194",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "194",
          "y": "20183601176045271267803971/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "195",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "195",
          "y": "318069819700074217071809/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "196",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "196",
          "y": "10028847568274470280708223/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "197",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "197",
          "y": "128147219501387792851847/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "198",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "198",
          "y": "73324418744986829889186/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "199",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "199",
          "y": "124929148923930136704797/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "200",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "200",
          "y": "537663326424432575668939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "201",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "201",
          "y": "24932008119212922440909/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "202",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "202",
          "y": "2059675067366818855903/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "203",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "203",
          "y": "822421208628955331920827/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "204",
          "y": "59",
          "series": "Observed"
        },
        {
          "x": "204",
          "y": "32795075334200490776578921/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "205",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "205",
          "y": "601927888615425556618789/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "206",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "206",
          "y": "654151085749266068341239/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "207",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "207",
          "y": "943903704533304326372239/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "208",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "208",
          "y": "44057610486544296461939/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "209",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "209",
          "y": "7256280852719247826211/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "210",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "210",
          "y": "12940322978299616845577/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "211",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "211",
          "y": "7602822881597111656181/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "212",
          "y": "121/4",
          "series": "Observed"
        },
        {
          "x": "212",
          "y": "73431955918086859500261/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "213",
          "y": "44",
          "series": "Observed"
        },
        {
          "x": "213",
          "y": "450133705853551798832759/19211879671660987114646",
          "series": "Out-of-fold ell"
        },
        {
          "x": "214",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "214",
          "y": "365413710080215602922849/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "215",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "215",
          "y": "3503000249264839752283/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "216",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "216",
          "y": "9777035489281808867933173/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "217",
          "y": "57/2",
          "series": "Observed"
        },
        {
          "x": "217",
          "y": "2538688401942700246773937/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "218",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "218",
          "y": "74803915319366248197031/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "219",
          "y": "41",
          "series": "Observed"
        },
        {
          "x": "219",
          "y": "20435413255037932680579021/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "220",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "220",
          "y": "40625001870589463238419/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "221",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "221",
          "y": "501508805331773759861089/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "222",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "222",
          "y": "533472868181302826048423/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "223",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "223",
          "y": "151492050081473580783207/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "224",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "224",
          "y": "5514250233346571174271/285137008157454934372",
          "series": "Out-of-fold ell"
        },
        {
          "x": "225",
          "y": "91/4",
          "series": "Observed"
        },
        {
          "x": "225",
          "y": "17393939755360736290987071/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "226",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "226",
          "y": "31709191287269963836093/1413579093849811005198",
          "series": "Out-of-fold ell"
        },
        {
          "x": "227",
          "y": "55/2",
          "series": "Observed"
        },
        {
          "x": "227",
          "y": "7321999129247940580911/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "228",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "228",
          "y": "2434729815159776322243562/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "229",
          "y": "121/2",
          "series": "Observed"
        },
        {
          "x": "229",
          "y": "811337127193555335076789/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "230",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "230",
          "y": "749204266380519581778439/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "231",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "231",
          "y": "74709091058285444767456/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "232",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "232",
          "y": "616906183933215996141633/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "233",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "233",
          "y": "7102262173217975012891/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "234",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "234",
          "y": "3013018975106870104116293/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "235",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "235",
          "y": "822421208628955331920827/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "236",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "236",
          "y": "657293641578912193696639/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "237",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "237",
          "y": "11111642646134558591291/471193031283270335066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "238",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "238",
          "y": "41912230101572525697239/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "239",
          "y": "85/4",
          "series": "Observed"
        },
        {
          "x": "239",
          "y": "76283411893745666504876/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "240",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "240",
          "y": "153856671839709144458447/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "241",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "241",
          "y": "23205346123957208221104571/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "242",
          "y": "33",
          "series": "Observed"
        },
        {
          "x": "242",
          "y": "7602822881597111656181/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "243",
          "y": "151/4",
          "series": "Observed"
        },
        {
          "x": "243",
          "y": "46417528910013244303109/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "244",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "244",
          "y": "516702868192306157152439/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "245",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "245",
          "y": "11461711611671825783411621/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "246",
          "y": "51/4",
          "series": "Observed"
        },
        {
          "x": "246",
          "y": "457319946218524096095939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "247",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "247",
          "y": "6045620904576739657674623/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "248",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "248",
          "y": "13224396164620455672836971/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "249",
          "y": "8",
          "series": "Observed"
        },
        {
          "x": "249",
          "y": "3063321858635770326583023/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "250",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "250",
          "y": "674236930800743188234489/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "251",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "251",
          "y": "256740409312861980304919/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "252",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "252",
          "y": "11111642646134558591291/471193031283270335066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "253",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "253",
          "y": "4697026513700457480995553/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "254",
          "y": "47/2",
          "series": "Observed"
        },
        {
          "x": "254",
          "y": "4965841717200042335353/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "255",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "255",
          "y": "10958087453686502957861521/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "256",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "256",
          "y": "47919295179493483838399/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "257",
          "y": "30",
          "series": "Observed"
        },
        {
          "x": "257",
          "y": "6615450305582124898421/285137008157454934372",
          "series": "Out-of-fold ell"
        },
        {
          "x": "258",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "258",
          "y": "893822350751154845009839/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "259",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "259",
          "y": "6986748163592020402901/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "260",
          "y": "87/4",
          "series": "Observed"
        },
        {
          "x": "260",
          "y": "177760290195678263495316/7769983472290646961637",
          "series": "Out-of-fold ell"
        },
        {
          "x": "261",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "261",
          "y": "476531178089351917365939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "262",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "262",
          "y": "73526780179167662929836/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "263",
          "y": "57/2",
          "series": "Observed"
        },
        {
          "x": "263",
          "y": "17938162673633467422850971/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "264",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "264",
          "y": "12224656794100001881717/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "265",
          "y": "47/2",
          "series": "Observed"
        },
        {
          "x": "265",
          "y": "7294785522594566029541/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "266",
          "y": "61/2",
          "series": "Observed"
        },
        {
          "x": "266",
          "y": "649455108569563198914223/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "267",
          "y": "99/4",
          "series": "Observed"
        },
        {
          "x": "267",
          "y": "24280717037469676530691/1071721858246985787812",
          "series": "Out-of-fold ell"
        },
        {
          "x": "268",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "268",
          "y": "7217776182843929622881/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "269",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "269",
          "y": "41483154024578171544299/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "270",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "270",
          "y": "14938514901956950076691/1071721858246985787812",
          "series": "Out-of-fold ell"
        },
        {
          "x": "271",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "271",
          "y": "2868558374273664069927203/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "272",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "272",
          "y": "7744592298837306310007/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "273",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "273",
          "y": "2868558374273664069927203/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "274",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "274",
          "y": "3214230509222470993983213/225664891208941787116868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "275",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "275",
          "y": "493474467311182911903789/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "276",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "276",
          "y": "15671853962699514707875521/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "277",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "277",
          "y": "15168229804714191882325421/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "278",
          "y": "57/2",
          "series": "Observed"
        },
        {
          "x": "278",
          "y": "12264599511993975623377/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "279",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "279",
          "y": "2411391861261354018581189/112832445604470893558434",
          "series": "Out-of-fold ell"
        },
        {
          "x": "280",
          "y": "47/2",
          "series": "Observed"
        },
        {
          "x": "280",
          "y": "40692154910837635526939/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "281",
          "y": "61/2",
          "series": "Observed"
        },
        {
          "x": "281",
          "y": "773307280442292125650339/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "282",
          "y": "53/2",
          "series": "Observed"
        },
        {
          "x": "282",
          "y": "40410463832092286161949/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "283",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "283",
          "y": "20183601176045271267803971/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "284",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "284",
          "y": "44701224602035827691349/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "285",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "285",
          "y": "7333290192469884232871/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "286",
          "y": "75/2",
          "series": "Observed"
        },
        {
          "x": "286",
          "y": "8206648337341124749967/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "287",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "287",
          "y": "897875533922305665620922/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "288",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "288",
          "y": "265996685803461703870289/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "289",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "289",
          "y": "63096575516794162057481/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "290",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "290",
          "y": "5287648774945807950058/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "291",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "291",
          "y": "694839225894988039695939/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "292",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "292",
          "y": "668860886174611102205439/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "293",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "293",
          "y": "647973128716178211590047/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "294",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "294",
          "y": "580967430383299138102289/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "295",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "295",
          "y": "18672728702089302791153671/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "296",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "296",
          "y": "19468763699354695335792621/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "297",
          "y": "57/4",
          "series": "Observed"
        },
        {
          "x": "297",
          "y": "306233847105038870609049/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "298",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "298",
          "y": "139061706095914961379997/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "299",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "299",
          "y": "38479621485617692473719/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "300",
          "y": "95/2",
          "series": "Observed"
        },
        {
          "x": "300",
          "y": "9525223410289147455158123/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "301",
          "y": "31/2",
          "series": "Observed"
        },
        {
          "x": "301",
          "y": "14492786618800551091891/1071721858246985787812",
          "series": "Out-of-fold ell"
        },
        {
          "x": "302",
          "y": "21/2",
          "series": "Observed"
        },
        {
          "x": "302",
          "y": "444393826006988525536739/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "303",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "303",
          "y": "954096550544417130784111/76847518686643948458584",
          "series": "Out-of-fold ell"
        },
        {
          "x": "304",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "304",
          "y": "5562296126735120985281423/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "305",
          "y": "17/2",
          "series": "Observed"
        },
        {
          "x": "305",
          "y": "404222135904034285750239/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "306",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "306",
          "y": "568915923352412866166339/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "307",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "307",
          "y": "4138299059793457413147049/211330676388270858261106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "308",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "308",
          "y": "27847506594320776459633/1413579093849811005198",
          "series": "Out-of-fold ell"
        },
        {
          "x": "309",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "309",
          "y": "7143443764119938468806373/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "310",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "310",
          "y": "53442363784421193616331/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "311",
          "y": "25/2",
          "series": "Observed"
        },
        {
          "x": "311",
          "y": "11263478095235702336797/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "312",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "312",
          "y": "50224293206963537469281/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "313",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "313",
          "y": "18344684165811234220460771/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "314",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "314",
          "y": "9824414415151496132471/471193031283270335066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "315",
          "y": "47/2",
          "series": "Observed"
        },
        {
          "x": "315",
          "y": "20399711965043112032587/942386062566540670132",
          "series": "Out-of-fold ell"
        },
        {
          "x": "316",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "316",
          "y": "13710416375805980912177/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "317",
          "y": "65/2",
          "series": "Observed"
        },
        {
          "x": "317",
          "y": "2383914628637555472542337/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "318",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "318",
          "y": "17897563913346059116537171/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "319",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "319",
          "y": "576950261373003714123639/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "320",
          "y": "87/2",
          "series": "Observed"
        },
        {
          "x": "320",
          "y": "577857765412685375283773/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "321",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "321",
          "y": "4965841717200042335353/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "322",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "322",
          "y": "6447682785337565556281/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "323",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "323",
          "y": "700998238256974494034639/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "324",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "324",
          "y": "318449116744397430790109/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "325",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "325",
          "y": "1422816704925215076168461/76847518686643948458584",
          "series": "Out-of-fold ell"
        },
        {
          "x": "326",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "326",
          "y": "5793808825584078244899573/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "327",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "327",
          "y": "2001918062553841550908/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "328",
          "y": "37/2",
          "series": "Observed"
        },
        {
          "x": "328",
          "y": "621139120486253377888789/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "329",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "329",
          "y": "11648524793988884370097/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "330",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "330",
          "y": "599152225040662976447493/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "331",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "331",
          "y": "8603944298355384942761/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "332",
          "y": "61/2",
          "series": "Observed"
        },
        {
          "x": "332",
          "y": "632459743765656606656683/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "333",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "333",
          "y": "740295315179279435197889/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "334",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "334",
          "y": "82106573930182536306681/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "335",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "335",
          "y": "7205526920582851463387/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "336",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "336",
          "y": "8360667016842397563287/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "337",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "337",
          "y": "5611359539725077583687581/451329782417883574233736",
          "series": "Out-of-fold ell"
        },
        {
          "x": "338",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "338",
          "y": "10993945406108474913487/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "339",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "339",
          "y": "11802543473490157183417/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "340",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "340",
          "y": "509800922991232133122903/26548810730463739660808",
          "series": "Out-of-fold ell"
        },
        {
          "x": "341",
          "y": "27/2",
          "series": "Observed"
        },
        {
          "x": "341",
          "y": "6590410401616894717641/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "342",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "342",
          "y": "117849393653523293181287/5654316375399244020792",
          "series": "Out-of-fold ell"
        },
        {
          "x": "343",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "343",
          "y": "9273411331296486042383073/422661352776541716522212",
          "series": "Out-of-fold ell"
        },
        {
          "x": "344",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "344",
          "y": "41268615986080994467829/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "345",
          "y": "39/2",
          "series": "Observed"
        },
        {
          "x": "345",
          "y": "2271450751681068974218/154332398433596790763",
          "series": "Out-of-fold ell"
        },
        {
          "x": "346",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "346",
          "y": "3211669511532865888418599/211330676388270858261106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "347",
          "y": "29/2",
          "series": "Observed"
        },
        {
          "x": "347",
          "y": "589876381584539284682839/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "348",
          "y": "29/2",
          "series": "Observed"
        },
        {
          "x": "348",
          "y": "17337435849840588569360571/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "349",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "349",
          "y": "277023212661773718170449/13274405365231869830404",
          "series": "Out-of-fold ell"
        },
        {
          "x": "350",
          "y": "63/2",
          "series": "Observed"
        },
        {
          "x": "350",
          "y": "199453002851273552980026/7769983472290646961637",
          "series": "Out-of-fold ell"
        },
        {
          "x": "351",
          "y": "23/2",
          "series": "Observed"
        },
        {
          "x": "351",
          "y": "668860886174611102205439/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "352",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "352",
          "y": "18672728702089302791153671/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "353",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "353",
          "y": "86545063653320791230216/3318601341307967457601",
          "series": "Out-of-fold ell"
        },
        {
          "x": "354",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "354",
          "y": "2412782362446369540386412/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "355",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "355",
          "y": "16658232070148011488953271/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "356",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "356",
          "y": "773307280442292125650339/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "357",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "357",
          "y": "2160970283453708127611362/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "358",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "358",
          "y": "505525974342069183839739/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "359",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "359",
          "y": "1472006349783507201813649/112832445604470893558434",
          "series": "Out-of-fold ell"
        },
        {
          "x": "360",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "360",
          "y": "14805907723764977043157/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "361",
          "y": "33/2",
          "series": "Observed"
        },
        {
          "x": "361",
          "y": "57304048477370380992791/2827158187699622010396",
          "series": "Out-of-fold ell"
        },
        {
          "x": "362",
          "y": "71/2",
          "series": "Observed"
        },
        {
          "x": "362",
          "y": "669345148609798465632589/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "363",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "363",
          "y": "1493390018152499904200061/76847518686643948458584",
          "series": "Out-of-fold ell"
        },
        {
          "x": "364",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "364",
          "y": "2258008589141224766154812/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "365",
          "y": "45/2",
          "series": "Observed"
        },
        {
          "x": "365",
          "y": "15883067281404767814336771/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "366",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "366",
          "y": "625156289496548801867439/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "367",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "367",
          "y": "613104782465662529931489/31079933889162587846548",
          "series": "Out-of-fold ell"
        },
        {
          "x": "368",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "368",
          "y": "7256280852719247826211/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "369",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "369",
          "y": "7294785522594566029541/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "370",
          "y": "17/2",
          "series": "Observed"
        },
        {
          "x": "370",
          "y": "1416975696521936884628012/105665338194135429130553",
          "series": "Out-of-fold ell"
        },
        {
          "x": "371",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "371",
          "y": "162733651285985654305517/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "372",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "372",
          "y": "7448804202095838842861/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "373",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "373",
          "y": "171610630732262164152587/6637202682615934915202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "374",
          "y": "51/2",
          "series": "Observed"
        },
        {
          "x": "374",
          "y": "13941444395057890132157/617329593734387163052",
          "series": "Out-of-fold ell"
        },
        {
          "x": "375",
          "y": "43/2",
          "series": "Observed"
        },
        {
          "x": "375",
          "y": "8873476987482612366071/308664796867193581526",
          "series": "Out-of-fold ell"
        },
        {
          "x": "376",
          "y": "19/2",
          "series": "Observed"
        },
        {
          "x": "376",
          "y": "1472006349783507201813649/112832445604470893558434",
          "series": "Out-of-fold ell"
        },
        {
          "x": "377",
          "y": "73/2",
          "series": "Observed"
        },
        {
          "x": "377",
          "y": "16286739872819800932451371/845322705553083433044424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "378",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "378",
          "y": "23644779888229859982089/1884772125133081340264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "379",
          "y": "95/4",
          "series": "Observed"
        },
        {
          "x": "379",
          "y": "698276012245078434056777/56416222802235446779217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "380",
          "y": "35/2",
          "series": "Observed"
        },
        {
          "x": "380",
          "y": "209141113720034134837757/15539966944581293923274",
          "series": "Out-of-fold ell"
        },
        {
          "x": "381",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "381",
          "y": "29778348940795370147863/1413579093849811005198",
          "series": "Out-of-fold ell"
        },
        {
          "x": "382",
          "y": "41/2",
          "series": "Observed"
        },
        {
          "x": "382",
          "y": "4751303678702865258883/235596515641635167533",
          "series": "Out-of-fold ell"
        },
        {
          "x": "383",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "383",
          "y": "7052466440120713157601/308664796867193581526",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/realdata-actual-company-Python-summary.csv",
      "summarySHA256": "b6ce41ed4c9f2204114fedcddb07a24548605de158d3a162d4b27b11391409ed",
      "pointsFile": "metr21-programs/realdata-actual-company-Python-points.csv",
      "pointsSHA256": "58ce2649fa742884607382e991cdd0f888309bff46c6622b59c5fa5d6ff580c7",
      "fullResultFile": "metr21-programs/realdata-actual-company-Python-full.json",
      "fullResultSHA256": "1bab5ef92d9407d2c60aa72d9251a1257b6bf2692a5f10a178a3d3de4aca7b1f",
      "plotFile": "metr21-programs/realdata-actual-company-Python.svg",
      "plotSHA256": "a47f48f22a64619ea45e3094b7357f2bb1f86d03a73514fcec5a2f12eb7d8a3b"
    },
    {
      "api": "realdata",
      "variant": "actual-person",
      "profile": "actual-person",
      "language": "R",
      "file": "metr21-programs/realdata-actual-person-R.R",
      "codeSHA256": "9062669fb73b03f5a7a40aadf3ce95b418b19c52d651d0779961259094322500",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "NSW 실험 722명 전체",
        "en": "All 722 people: NSW experimental earnings"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"realdata\",\"key\"=\"actual-person\",\"title\"=\"All 722 people: NSW experimental earnings\",\"input\"=list(\"kind\"=\"person\"),\"xLabel\"=\"Declared source order, not time\",\"yLabel\"=\"Recorded real earnings\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "rows": "722",
        "groups": "722",
        "PLRtheta": "934.180929",
        "AIPWtheta": "921.818372",
        "clippedRows": "0",
        "rawPropensityMin": "0.35510273",
        "rawPropensityMax": "0.452519698"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "12418.0703125",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "11656.505859375",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "7485.2965499116",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "499.257202148438",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "7599.97354426348",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "16717.12109375",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "7287.79068734742",
          "series": "Out-of-fold ell"
        },
        {
          "x": "4",
          "y": "30247.5",
          "series": "Observed"
        },
        {
          "x": "4",
          "y": "9453.27139652162",
          "series": "Out-of-fold ell"
        },
        {
          "x": "5",
          "y": "4393.52294921875",
          "series": "Observed"
        },
        {
          "x": "5",
          "y": "6710.5196391471",
          "series": "Out-of-fold ell"
        },
        {
          "x": "6",
          "y": "16477.01953125",
          "series": "Observed"
        },
        {
          "x": "6",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "7",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "7",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "8",
          "y": "15952.599609375",
          "series": "Observed"
        },
        {
          "x": "8",
          "y": "5936.23679231096",
          "series": "Out-of-fold ell"
        },
        {
          "x": "9",
          "y": "12359.3095703125",
          "series": "Observed"
        },
        {
          "x": "9",
          "y": "5507.41600723429",
          "series": "Out-of-fold ell"
        },
        {
          "x": "10",
          "y": "6793.0771484375",
          "series": "Observed"
        },
        {
          "x": "10",
          "y": "7051.23382082934",
          "series": "Out-of-fold ell"
        },
        {
          "x": "11",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "11",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "12",
          "y": "665.737426757812",
          "series": "Observed"
        },
        {
          "x": "12",
          "y": "9958.47885586074",
          "series": "Out-of-fold ell"
        },
        {
          "x": "13",
          "y": "16328.9638671875",
          "series": "Observed"
        },
        {
          "x": "13",
          "y": "7857.7917298954",
          "series": "Out-of-fold ell"
        },
        {
          "x": "14",
          "y": "6336.78271484375",
          "series": "Observed"
        },
        {
          "x": "14",
          "y": "6933.54602625727",
          "series": "Out-of-fold ell"
        },
        {
          "x": "15",
          "y": "5448.80078125",
          "series": "Observed"
        },
        {
          "x": "15",
          "y": "9592.56595775106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "16",
          "y": "12803.9697265625",
          "series": "Observed"
        },
        {
          "x": "16",
          "y": "5926.78198650476",
          "series": "Out-of-fold ell"
        },
        {
          "x": "17",
          "y": "1294.40905761719",
          "series": "Observed"
        },
        {
          "x": "17",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "18",
          "y": "99.5700149536133",
          "series": "Observed"
        },
        {
          "x": "18",
          "y": "7666.13848698165",
          "series": "Out-of-fold ell"
        },
        {
          "x": "19",
          "y": "796.559692382812",
          "series": "Observed"
        },
        {
          "x": "19",
          "y": "7019.30861632825",
          "series": "Out-of-fold ell"
        },
        {
          "x": "20",
          "y": "2502.52587890625",
          "series": "Observed"
        },
        {
          "x": "20",
          "y": "6295.83192431797",
          "series": "Out-of-fold ell"
        },
        {
          "x": "21",
          "y": "12590.7099609375",
          "series": "Observed"
        },
        {
          "x": "21",
          "y": "7208.02254252816",
          "series": "Out-of-fold ell"
        },
        {
          "x": "22",
          "y": "12573.9658203125",
          "series": "Observed"
        },
        {
          "x": "22",
          "y": "6590.53234163887",
          "series": "Out-of-fold ell"
        },
        {
          "x": "23",
          "y": "8072.181640625",
          "series": "Observed"
        },
        {
          "x": "23",
          "y": "5564.80569788633",
          "series": "Out-of-fold ell"
        },
        {
          "x": "24",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "24",
          "y": "5781.06038610488",
          "series": "Out-of-fold ell"
        },
        {
          "x": "25",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "25",
          "y": "6793.86758455735",
          "series": "Out-of-fold ell"
        },
        {
          "x": "26",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "26",
          "y": "6055.23974421931",
          "series": "Out-of-fold ell"
        },
        {
          "x": "27",
          "y": "3982.80102539062",
          "series": "Observed"
        },
        {
          "x": "27",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "28",
          "y": "10092.830078125",
          "series": "Observed"
        },
        {
          "x": "28",
          "y": "6380.68403026619",
          "series": "Out-of-fold ell"
        },
        {
          "x": "29",
          "y": "2777.58520507812",
          "series": "Observed"
        },
        {
          "x": "29",
          "y": "6182.78882636684",
          "series": "Out-of-fold ell"
        },
        {
          "x": "30",
          "y": "13167.51953125",
          "series": "Observed"
        },
        {
          "x": "30",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "31",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "31",
          "y": "6701.026994529",
          "series": "Out-of-fold ell"
        },
        {
          "x": "32",
          "y": "5149.5009765625",
          "series": "Observed"
        },
        {
          "x": "32",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "33",
          "y": "8997.193359375",
          "series": "Observed"
        },
        {
          "x": "33",
          "y": "5830.79645954249",
          "series": "Out-of-fold ell"
        },
        {
          "x": "34",
          "y": "4635.66015625",
          "series": "Observed"
        },
        {
          "x": "34",
          "y": "5928.78701631383",
          "series": "Out-of-fold ell"
        },
        {
          "x": "35",
          "y": "11127.2802734375",
          "series": "Observed"
        },
        {
          "x": "35",
          "y": "6540.59917630378",
          "series": "Out-of-fold ell"
        },
        {
          "x": "36",
          "y": "3786.6279296875",
          "series": "Observed"
        },
        {
          "x": "36",
          "y": "6585.94315919967",
          "series": "Out-of-fold ell"
        },
        {
          "x": "37",
          "y": "7343.9638671875",
          "series": "Observed"
        },
        {
          "x": "37",
          "y": "7920.21209298413",
          "series": "Out-of-fold ell"
        },
        {
          "x": "38",
          "y": "4181.94189453125",
          "series": "Observed"
        },
        {
          "x": "38",
          "y": "6018.38757029824",
          "series": "Out-of-fold ell"
        },
        {
          "x": "39",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "39",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "40",
          "y": "9074.763671875",
          "series": "Observed"
        },
        {
          "x": "40",
          "y": "5934.59381020106",
          "series": "Out-of-fold ell"
        },
        {
          "x": "41",
          "y": "3094.15600585938",
          "series": "Observed"
        },
        {
          "x": "41",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "42",
          "y": "7344.67822265625",
          "series": "Observed"
        },
        {
          "x": "42",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "43",
          "y": "13829.6201171875",
          "series": "Observed"
        },
        {
          "x": "43",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "44",
          "y": "5193.2470703125",
          "series": "Observed"
        },
        {
          "x": "44",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "45",
          "y": "13385.8603515625",
          "series": "Observed"
        },
        {
          "x": "45",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "46",
          "y": "7263.02490234375",
          "series": "Observed"
        },
        {
          "x": "46",
          "y": "7895.28549655463",
          "series": "Out-of-fold ell"
        },
        {
          "x": "47",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "47",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "48",
          "y": "8546.71484375",
          "series": "Observed"
        },
        {
          "x": "48",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "49",
          "y": "11233.259765625",
          "series": "Observed"
        },
        {
          "x": "49",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "50",
          "y": "3795.79907226562",
          "series": "Observed"
        },
        {
          "x": "50",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "51",
          "y": "7600.1044921875",
          "series": "Observed"
        },
        {
          "x": "51",
          "y": "7493.67234600562",
          "series": "Out-of-fold ell"
        },
        {
          "x": "52",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "52",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "53",
          "y": "4941.84912109375",
          "series": "Observed"
        },
        {
          "x": "53",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "54",
          "y": "10361.6904296875",
          "series": "Observed"
        },
        {
          "x": "54",
          "y": "6273.38871884038",
          "series": "Out-of-fold ell"
        },
        {
          "x": "55",
          "y": "1460.35998535156",
          "series": "Observed"
        },
        {
          "x": "55",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "56",
          "y": "17814.98046875",
          "series": "Observed"
        },
        {
          "x": "56",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "57",
          "y": "2186.18920898438",
          "series": "Observed"
        },
        {
          "x": "57",
          "y": "4976.69976891082",
          "series": "Out-of-fold ell"
        },
        {
          "x": "58",
          "y": "5843.7958984375",
          "series": "Observed"
        },
        {
          "x": "58",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "59",
          "y": "8743.0703125",
          "series": "Observed"
        },
        {
          "x": "59",
          "y": "6505.46575667371",
          "series": "Out-of-fold ell"
        },
        {
          "x": "60",
          "y": "7812.52197265625",
          "series": "Observed"
        },
        {
          "x": "60",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "61",
          "y": "4978.50048828125",
          "series": "Observed"
        },
        {
          "x": "61",
          "y": "8045.15095746271",
          "series": "Out-of-fold ell"
        },
        {
          "x": "62",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "62",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "63",
          "y": "7645.0546875",
          "series": "Observed"
        },
        {
          "x": "63",
          "y": "6441.26736732737",
          "series": "Out-of-fold ell"
        },
        {
          "x": "64",
          "y": "6735.31982421875",
          "series": "Observed"
        },
        {
          "x": "64",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "65",
          "y": "10673.697265625",
          "series": "Observed"
        },
        {
          "x": "65",
          "y": "5899.14677584388",
          "series": "Out-of-fold ell"
        },
        {
          "x": "66",
          "y": "7300.498046875",
          "series": "Observed"
        },
        {
          "x": "66",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "67",
          "y": "2746.61401367188",
          "series": "Observed"
        },
        {
          "x": "67",
          "y": "9416.17937430056",
          "series": "Out-of-fold ell"
        },
        {
          "x": "68",
          "y": "7318.18603515625",
          "series": "Observed"
        },
        {
          "x": "68",
          "y": "5733.23523615377",
          "series": "Out-of-fold ell"
        },
        {
          "x": "69",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "69",
          "y": "4820.70459473163",
          "series": "Out-of-fold ell"
        },
        {
          "x": "70",
          "y": "5811.76513671875",
          "series": "Observed"
        },
        {
          "x": "70",
          "y": "5989.09618131163",
          "series": "Out-of-fold ell"
        },
        {
          "x": "71",
          "y": "7404.76220703125",
          "series": "Observed"
        },
        {
          "x": "71",
          "y": "5994.04308413687",
          "series": "Out-of-fold ell"
        },
        {
          "x": "72",
          "y": "1239.84399414062",
          "series": "Observed"
        },
        {
          "x": "72",
          "y": "6160.21383267932",
          "series": "Out-of-fold ell"
        },
        {
          "x": "73",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "73",
          "y": "6226.64647280351",
          "series": "Out-of-fold ell"
        },
        {
          "x": "74",
          "y": "647.20458984375",
          "series": "Observed"
        },
        {
          "x": "74",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "75",
          "y": "10989.927734375",
          "series": "Observed"
        },
        {
          "x": "75",
          "y": "5015.44283945567",
          "series": "Out-of-fold ell"
        },
        {
          "x": "76",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "76",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "77",
          "y": "26372.279296875",
          "series": "Observed"
        },
        {
          "x": "77",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "78",
          "y": "439.688110351562",
          "series": "Observed"
        },
        {
          "x": "78",
          "y": "5128.48260287505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "79",
          "y": "3154.71997070312",
          "series": "Observed"
        },
        {
          "x": "79",
          "y": "5883.53480453764",
          "series": "Out-of-fold ell"
        },
        {
          "x": "80",
          "y": "7094.919921875",
          "series": "Observed"
        },
        {
          "x": "80",
          "y": "9901.20312385235",
          "series": "Out-of-fold ell"
        },
        {
          "x": "81",
          "y": "3194.01000976562",
          "series": "Observed"
        },
        {
          "x": "81",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "82",
          "y": "479.267700195312",
          "series": "Observed"
        },
        {
          "x": "82",
          "y": "5203.58914651391",
          "series": "Out-of-fold ell"
        },
        {
          "x": "83",
          "y": "2725.32202148438",
          "series": "Observed"
        },
        {
          "x": "83",
          "y": "4854.4764492022",
          "series": "Out-of-fold ell"
        },
        {
          "x": "84",
          "y": "1740.19897460938",
          "series": "Observed"
        },
        {
          "x": "84",
          "y": "6750.52152915483",
          "series": "Out-of-fold ell"
        },
        {
          "x": "85",
          "y": "4032.7080078125",
          "series": "Observed"
        },
        {
          "x": "85",
          "y": "4895.86105875474",
          "series": "Out-of-fold ell"
        },
        {
          "x": "86",
          "y": "10976.509765625",
          "series": "Observed"
        },
        {
          "x": "86",
          "y": "5373.06710102096",
          "series": "Out-of-fold ell"
        },
        {
          "x": "87",
          "y": "132.759994506836",
          "series": "Observed"
        },
        {
          "x": "87",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "88",
          "y": "9251.3564453125",
          "series": "Observed"
        },
        {
          "x": "88",
          "y": "6587.25824712242",
          "series": "Out-of-fold ell"
        },
        {
          "x": "89",
          "y": "4715.37109375",
          "series": "Observed"
        },
        {
          "x": "89",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "90",
          "y": "10363.26953125",
          "series": "Observed"
        },
        {
          "x": "90",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "91",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "91",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "92",
          "y": "11300.23828125",
          "series": "Observed"
        },
        {
          "x": "92",
          "y": "5347.63823471354",
          "series": "Out-of-fold ell"
        },
        {
          "x": "93",
          "y": "6831.10546875",
          "series": "Observed"
        },
        {
          "x": "93",
          "y": "5156.35978676677",
          "series": "Out-of-fold ell"
        },
        {
          "x": "94",
          "y": "14792.900390625",
          "series": "Observed"
        },
        {
          "x": "94",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "95",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "95",
          "y": "4919.98302392726",
          "series": "Out-of-fold ell"
        },
        {
          "x": "96",
          "y": "12383.6796875",
          "series": "Observed"
        },
        {
          "x": "96",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "97",
          "y": "2329.86645507812",
          "series": "Observed"
        },
        {
          "x": "97",
          "y": "6751.21217336393",
          "series": "Out-of-fold ell"
        },
        {
          "x": "98",
          "y": "14683.62890625",
          "series": "Observed"
        },
        {
          "x": "98",
          "y": "5858.49211126289",
          "series": "Out-of-fold ell"
        },
        {
          "x": "99",
          "y": "4232.30908203125",
          "series": "Observed"
        },
        {
          "x": "99",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "100",
          "y": "12780.01953125",
          "series": "Observed"
        },
        {
          "x": "100",
          "y": "5417.81149572916",
          "series": "Out-of-fold ell"
        },
        {
          "x": "101",
          "y": "2484.54907226562",
          "series": "Observed"
        },
        {
          "x": "101",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "102",
          "y": "11460.5634765625",
          "series": "Observed"
        },
        {
          "x": "102",
          "y": "4746.83241714728",
          "series": "Out-of-fold ell"
        },
        {
          "x": "103",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "103",
          "y": "6531.21202414826",
          "series": "Out-of-fold ell"
        },
        {
          "x": "104",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "104",
          "y": "5042.71905967079",
          "series": "Out-of-fold ell"
        },
        {
          "x": "105",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "105",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "106",
          "y": "6485.50830078125",
          "series": "Observed"
        },
        {
          "x": "106",
          "y": "6712.76449499149",
          "series": "Out-of-fold ell"
        },
        {
          "x": "107",
          "y": "29408.037109375",
          "series": "Observed"
        },
        {
          "x": "107",
          "y": "5308.80835421125",
          "series": "Out-of-fold ell"
        },
        {
          "x": "108",
          "y": "1424.94396972656",
          "series": "Observed"
        },
        {
          "x": "108",
          "y": "5743.79912938164",
          "series": "Out-of-fold ell"
        },
        {
          "x": "109",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "109",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "110",
          "y": "11235.10546875",
          "series": "Observed"
        },
        {
          "x": "110",
          "y": "5433.43501175574",
          "series": "Out-of-fold ell"
        },
        {
          "x": "111",
          "y": "5587.5029296875",
          "series": "Observed"
        },
        {
          "x": "111",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "112",
          "y": "20505.9296875",
          "series": "Observed"
        },
        {
          "x": "112",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "113",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "113",
          "y": "4680.62636262793",
          "series": "Out-of-fold ell"
        },
        {
          "x": "114",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "114",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "115",
          "y": "9371.037109375",
          "series": "Observed"
        },
        {
          "x": "115",
          "y": "5309.71200159276",
          "series": "Out-of-fold ell"
        },
        {
          "x": "116",
          "y": "4779.72021484375",
          "series": "Observed"
        },
        {
          "x": "116",
          "y": "5577.63560948491",
          "series": "Out-of-fold ell"
        },
        {
          "x": "117",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "117",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "118",
          "y": "20893.109375",
          "series": "Observed"
        },
        {
          "x": "118",
          "y": "4679.95450332125",
          "series": "Out-of-fold ell"
        },
        {
          "x": "119",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "119",
          "y": "6425.40836857618",
          "series": "Out-of-fold ell"
        },
        {
          "x": "120",
          "y": "5911.55078125",
          "series": "Observed"
        },
        {
          "x": "120",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "121",
          "y": "6191.94287109375",
          "series": "Observed"
        },
        {
          "x": "121",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "122",
          "y": "14509.9296875",
          "series": "Observed"
        },
        {
          "x": "122",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "123",
          "y": "4812.576171875",
          "series": "Observed"
        },
        {
          "x": "123",
          "y": "7020.5406782039",
          "series": "Out-of-fold ell"
        },
        {
          "x": "124",
          "y": "7284.98583984375",
          "series": "Observed"
        },
        {
          "x": "124",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "125",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "125",
          "y": "6755.4477774352",
          "series": "Out-of-fold ell"
        },
        {
          "x": "126",
          "y": "9766.2001953125",
          "series": "Observed"
        },
        {
          "x": "126",
          "y": "7191.60362019521",
          "series": "Out-of-fold ell"
        },
        {
          "x": "127",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "127",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "128",
          "y": "590.781799316406",
          "series": "Observed"
        },
        {
          "x": "128",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "129",
          "y": "10067.4345703125",
          "series": "Observed"
        },
        {
          "x": "129",
          "y": "9306.19774289655",
          "series": "Out-of-fold ell"
        },
        {
          "x": "130",
          "y": "8048.60302734375",
          "series": "Observed"
        },
        {
          "x": "130",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "131",
          "y": "559.443176269531",
          "series": "Observed"
        },
        {
          "x": "131",
          "y": "7585.78359782608",
          "series": "Out-of-fold ell"
        },
        {
          "x": "132",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "132",
          "y": "5279.62918767172",
          "series": "Out-of-fold ell"
        },
        {
          "x": "133",
          "y": "11294.6298828125",
          "series": "Observed"
        },
        {
          "x": "133",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "134",
          "y": "36646.94921875",
          "series": "Observed"
        },
        {
          "x": "134",
          "y": "6725.52640055002",
          "series": "Out-of-fold ell"
        },
        {
          "x": "135",
          "y": "11544.0087890625",
          "series": "Observed"
        },
        {
          "x": "135",
          "y": "6860.14035623934",
          "series": "Out-of-fold ell"
        },
        {
          "x": "136",
          "y": "3557.93432617188",
          "series": "Observed"
        },
        {
          "x": "136",
          "y": "7365.66505303342",
          "series": "Out-of-fold ell"
        },
        {
          "x": "137",
          "y": "12558.01953125",
          "series": "Observed"
        },
        {
          "x": "137",
          "y": "6417.54542176988",
          "series": "Out-of-fold ell"
        },
        {
          "x": "138",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "138",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "139",
          "y": "10804.3203125",
          "series": "Observed"
        },
        {
          "x": "139",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "140",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "140",
          "y": "5659.28188871246",
          "series": "Out-of-fold ell"
        },
        {
          "x": "141",
          "y": "16988.1796875",
          "series": "Observed"
        },
        {
          "x": "141",
          "y": "5926.21404648006",
          "series": "Out-of-fold ell"
        },
        {
          "x": "142",
          "y": "2456.15307617188",
          "series": "Observed"
        },
        {
          "x": "142",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "143",
          "y": "7976.931640625",
          "series": "Observed"
        },
        {
          "x": "143",
          "y": "5281.73553513403",
          "series": "Out-of-fold ell"
        },
        {
          "x": "144",
          "y": "10283.48828125",
          "series": "Observed"
        },
        {
          "x": "144",
          "y": "5706.2465041498",
          "series": "Out-of-fold ell"
        },
        {
          "x": "145",
          "y": "6551.591796875",
          "series": "Observed"
        },
        {
          "x": "145",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "146",
          "y": "5112.01416015625",
          "series": "Observed"
        },
        {
          "x": "146",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "147",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "147",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "148",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "148",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "149",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "149",
          "y": "5306.08232643754",
          "series": "Out-of-fold ell"
        },
        {
          "x": "150",
          "y": "9930.0458984375",
          "series": "Observed"
        },
        {
          "x": "150",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "151",
          "y": "9558.5009765625",
          "series": "Observed"
        },
        {
          "x": "151",
          "y": "6056.57704495362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "152",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "152",
          "y": "5352.31770447933",
          "series": "Out-of-fold ell"
        },
        {
          "x": "153",
          "y": "11607.0849609375",
          "series": "Observed"
        },
        {
          "x": "153",
          "y": "5918.24188475923",
          "series": "Out-of-fold ell"
        },
        {
          "x": "154",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "154",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "155",
          "y": "9642.9990234375",
          "series": "Observed"
        },
        {
          "x": "155",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "156",
          "y": "6408.9501953125",
          "series": "Observed"
        },
        {
          "x": "156",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "157",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "157",
          "y": "5787.12324110123",
          "series": "Out-of-fold ell"
        },
        {
          "x": "158",
          "y": "1324.5419921875",
          "series": "Observed"
        },
        {
          "x": "158",
          "y": "7051.62888429087",
          "series": "Out-of-fold ell"
        },
        {
          "x": "159",
          "y": "1698.30395507812",
          "series": "Observed"
        },
        {
          "x": "159",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "160",
          "y": "6281.43310546875",
          "series": "Observed"
        },
        {
          "x": "160",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "161",
          "y": "7382.548828125",
          "series": "Observed"
        },
        {
          "x": "161",
          "y": "5758.54556284009",
          "series": "Out-of-fold ell"
        },
        {
          "x": "162",
          "y": "1067.50598144531",
          "series": "Observed"
        },
        {
          "x": "162",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "163",
          "y": "10225.8798828125",
          "series": "Observed"
        },
        {
          "x": "163",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "164",
          "y": "5670.8193359375",
          "series": "Observed"
        },
        {
          "x": "164",
          "y": "5457.56632195521",
          "series": "Out-of-fold ell"
        },
        {
          "x": "165",
          "y": "4844.80322265625",
          "series": "Observed"
        },
        {
          "x": "165",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "166",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "166",
          "y": "7254.19363433877",
          "series": "Out-of-fold ell"
        },
        {
          "x": "167",
          "y": "308.335235595703",
          "series": "Observed"
        },
        {
          "x": "167",
          "y": "5941.54727805615",
          "series": "Out-of-fold ell"
        },
        {
          "x": "168",
          "y": "14271.2353515625",
          "series": "Observed"
        },
        {
          "x": "168",
          "y": "6731.8323894296",
          "series": "Out-of-fold ell"
        },
        {
          "x": "169",
          "y": "5970.2568359375",
          "series": "Observed"
        },
        {
          "x": "169",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "170",
          "y": "5522.7880859375",
          "series": "Observed"
        },
        {
          "x": "170",
          "y": "4920.83788107343",
          "series": "Out-of-fold ell"
        },
        {
          "x": "171",
          "y": "1574.42395019531",
          "series": "Observed"
        },
        {
          "x": "171",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "172",
          "y": "9139.65234375",
          "series": "Observed"
        },
        {
          "x": "172",
          "y": "4914.18284265903",
          "series": "Out-of-fold ell"
        },
        {
          "x": "173",
          "y": "668.74658203125",
          "series": "Observed"
        },
        {
          "x": "173",
          "y": "5712.31228699325",
          "series": "Out-of-fold ell"
        },
        {
          "x": "174",
          "y": "2987.10083007812",
          "series": "Observed"
        },
        {
          "x": "174",
          "y": "6045.60533835729",
          "series": "Out-of-fold ell"
        },
        {
          "x": "175",
          "y": "8408.392578125",
          "series": "Observed"
        },
        {
          "x": "175",
          "y": "6522.28356382028",
          "series": "Out-of-fold ell"
        },
        {
          "x": "176",
          "y": "3701.81201171875",
          "series": "Observed"
        },
        {
          "x": "176",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "177",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "177",
          "y": "6560.21490187968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "178",
          "y": "7565.27294921875",
          "series": "Observed"
        },
        {
          "x": "178",
          "y": "4965.99507485982",
          "series": "Out-of-fold ell"
        },
        {
          "x": "179",
          "y": "6040.3349609375",
          "series": "Observed"
        },
        {
          "x": "179",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "180",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "180",
          "y": "5023.36670880667",
          "series": "Out-of-fold ell"
        },
        {
          "x": "181",
          "y": "8976.826171875",
          "series": "Observed"
        },
        {
          "x": "181",
          "y": "6091.92131391574",
          "series": "Out-of-fold ell"
        },
        {
          "x": "182",
          "y": "604.19873046875",
          "series": "Observed"
        },
        {
          "x": "182",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "183",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "183",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "184",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "184",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "185",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "185",
          "y": "5154.20886507901",
          "series": "Out-of-fold ell"
        },
        {
          "x": "186",
          "y": "60307.9296875",
          "series": "Observed"
        },
        {
          "x": "186",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "187",
          "y": "3196.57104492188",
          "series": "Observed"
        },
        {
          "x": "187",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "188",
          "y": "11796.4697265625",
          "series": "Observed"
        },
        {
          "x": "188",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "189",
          "y": "11197.33984375",
          "series": "Observed"
        },
        {
          "x": "189",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "190",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "190",
          "y": "5036.01711702465",
          "series": "Out-of-fold ell"
        },
        {
          "x": "191",
          "y": "10820.552734375",
          "series": "Observed"
        },
        {
          "x": "191",
          "y": "6082.55910738093",
          "series": "Out-of-fold ell"
        },
        {
          "x": "192",
          "y": "2094.11889648438",
          "series": "Observed"
        },
        {
          "x": "192",
          "y": "5039.16084463287",
          "series": "Out-of-fold ell"
        },
        {
          "x": "193",
          "y": "762.914611816406",
          "series": "Observed"
        },
        {
          "x": "193",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "194",
          "y": "9897.048828125",
          "series": "Observed"
        },
        {
          "x": "194",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "195",
          "y": "4132.5771484375",
          "series": "Observed"
        },
        {
          "x": "195",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "196",
          "y": "14416.8359375",
          "series": "Observed"
        },
        {
          "x": "196",
          "y": "6053.44093104497",
          "series": "Out-of-fold ell"
        },
        {
          "x": "197",
          "y": "671.331787109375",
          "series": "Observed"
        },
        {
          "x": "197",
          "y": "5588.14050919672",
          "series": "Out-of-fold ell"
        },
        {
          "x": "198",
          "y": "2113.72192382812",
          "series": "Observed"
        },
        {
          "x": "198",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "199",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "199",
          "y": "5870.58810121804",
          "series": "Out-of-fold ell"
        },
        {
          "x": "200",
          "y": "9495.90234375",
          "series": "Observed"
        },
        {
          "x": "200",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "201",
          "y": "13613.349609375",
          "series": "Observed"
        },
        {
          "x": "201",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "202",
          "y": "3523.57788085938",
          "series": "Observed"
        },
        {
          "x": "202",
          "y": "4912.00507671334",
          "series": "Out-of-fold ell"
        },
        {
          "x": "203",
          "y": "4350.9072265625",
          "series": "Observed"
        },
        {
          "x": "203",
          "y": "4668.49301493666",
          "series": "Out-of-fold ell"
        },
        {
          "x": "204",
          "y": "4350.9072265625",
          "series": "Observed"
        },
        {
          "x": "204",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "205",
          "y": "10274.83984375",
          "series": "Observed"
        },
        {
          "x": "205",
          "y": "5847.89035759018",
          "series": "Out-of-fold ell"
        },
        {
          "x": "206",
          "y": "1709.34240722656",
          "series": "Observed"
        },
        {
          "x": "206",
          "y": "4872.20434870374",
          "series": "Out-of-fold ell"
        },
        {
          "x": "207",
          "y": "1660.50805664062",
          "series": "Observed"
        },
        {
          "x": "207",
          "y": "5180.32780903028",
          "series": "Out-of-fold ell"
        },
        {
          "x": "208",
          "y": "8087.48681640625",
          "series": "Observed"
        },
        {
          "x": "208",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "209",
          "y": "4814.626953125",
          "series": "Observed"
        },
        {
          "x": "209",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "210",
          "y": "11303.1396484375",
          "series": "Observed"
        },
        {
          "x": "210",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "211",
          "y": "796.559020996094",
          "series": "Observed"
        },
        {
          "x": "211",
          "y": "4817.60003976426",
          "series": "Out-of-fold ell"
        },
        {
          "x": "212",
          "y": "1824.37658691406",
          "series": "Observed"
        },
        {
          "x": "212",
          "y": "5985.76037215687",
          "series": "Out-of-fold ell"
        },
        {
          "x": "213",
          "y": "2657.705078125",
          "series": "Observed"
        },
        {
          "x": "213",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "214",
          "y": "44.7554588317871",
          "series": "Observed"
        },
        {
          "x": "214",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "215",
          "y": "11195.9296875",
          "series": "Observed"
        },
        {
          "x": "215",
          "y": "5345.25791691681",
          "series": "Out-of-fold ell"
        },
        {
          "x": "216",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "216",
          "y": "5190.67133399333",
          "series": "Out-of-fold ell"
        },
        {
          "x": "217",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "217",
          "y": "5146.80850099733",
          "series": "Out-of-fold ell"
        },
        {
          "x": "218",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "218",
          "y": "5200.95998346414",
          "series": "Out-of-fold ell"
        },
        {
          "x": "219",
          "y": "4146.60302734375",
          "series": "Observed"
        },
        {
          "x": "219",
          "y": "4916.723021053",
          "series": "Out-of-fold ell"
        },
        {
          "x": "220",
          "y": "11293.8095703125",
          "series": "Observed"
        },
        {
          "x": "220",
          "y": "5602.53453990708",
          "series": "Out-of-fold ell"
        },
        {
          "x": "221",
          "y": "8823.0595703125",
          "series": "Observed"
        },
        {
          "x": "221",
          "y": "4831.25105888336",
          "series": "Out-of-fold ell"
        },
        {
          "x": "222",
          "y": "2481.51831054688",
          "series": "Observed"
        },
        {
          "x": "222",
          "y": "4783.43765156275",
          "series": "Out-of-fold ell"
        },
        {
          "x": "223",
          "y": "4082.36987304688",
          "series": "Observed"
        },
        {
          "x": "223",
          "y": "5009.89947529722",
          "series": "Out-of-fold ell"
        },
        {
          "x": "224",
          "y": "18155.83203125",
          "series": "Observed"
        },
        {
          "x": "224",
          "y": "5683.54417726236",
          "series": "Out-of-fold ell"
        },
        {
          "x": "225",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "225",
          "y": "4971.78224317579",
          "series": "Out-of-fold ell"
        },
        {
          "x": "226",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "226",
          "y": "5886.65313863751",
          "series": "Out-of-fold ell"
        },
        {
          "x": "227",
          "y": "278.875061035156",
          "series": "Observed"
        },
        {
          "x": "227",
          "y": "5120.41795347818",
          "series": "Out-of-fold ell"
        },
        {
          "x": "228",
          "y": "1310.7265625",
          "series": "Observed"
        },
        {
          "x": "228",
          "y": "4762.65999856976",
          "series": "Out-of-fold ell"
        },
        {
          "x": "229",
          "y": "1085.43994140625",
          "series": "Observed"
        },
        {
          "x": "229",
          "y": "5361.44982912538",
          "series": "Out-of-fold ell"
        },
        {
          "x": "230",
          "y": "597.419982910156",
          "series": "Observed"
        },
        {
          "x": "230",
          "y": "4976.29361185608",
          "series": "Out-of-fold ell"
        },
        {
          "x": "231",
          "y": "1320.92248535156",
          "series": "Observed"
        },
        {
          "x": "231",
          "y": "6382.32904735338",
          "series": "Out-of-fold ell"
        },
        {
          "x": "232",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "232",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "233",
          "y": "13674.74609375",
          "series": "Observed"
        },
        {
          "x": "233",
          "y": "4848.69964959378",
          "series": "Out-of-fold ell"
        },
        {
          "x": "234",
          "y": "5514.365234375",
          "series": "Observed"
        },
        {
          "x": "234",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "235",
          "y": "11141.3896484375",
          "series": "Observed"
        },
        {
          "x": "235",
          "y": "4894.82366290941",
          "series": "Out-of-fold ell"
        },
        {
          "x": "236",
          "y": "6771.6220703125",
          "series": "Observed"
        },
        {
          "x": "236",
          "y": "6477.9073645142",
          "series": "Out-of-fold ell"
        },
        {
          "x": "237",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "237",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "238",
          "y": "3621.70703125",
          "series": "Observed"
        },
        {
          "x": "238",
          "y": "4871.8358414048",
          "series": "Out-of-fold ell"
        },
        {
          "x": "239",
          "y": "5445.2001953125",
          "series": "Observed"
        },
        {
          "x": "239",
          "y": "4943.5667228341",
          "series": "Out-of-fold ell"
        },
        {
          "x": "240",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "240",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "241",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "241",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "242",
          "y": "5344.02099609375",
          "series": "Observed"
        },
        {
          "x": "242",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "243",
          "y": "2975.03149414062",
          "series": "Observed"
        },
        {
          "x": "243",
          "y": "5005.48486695914",
          "series": "Out-of-fold ell"
        },
        {
          "x": "244",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "244",
          "y": "5162.92205791825",
          "series": "Out-of-fold ell"
        },
        {
          "x": "245",
          "y": "39483.53125",
          "series": "Observed"
        },
        {
          "x": "245",
          "y": "5207.97411009958",
          "series": "Out-of-fold ell"
        },
        {
          "x": "246",
          "y": "16969.94921875",
          "series": "Observed"
        },
        {
          "x": "246",
          "y": "7701.9130807161",
          "series": "Out-of-fold ell"
        },
        {
          "x": "247",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "247",
          "y": "5691.294268439",
          "series": "Out-of-fold ell"
        },
        {
          "x": "248",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "248",
          "y": "4820.77741379068",
          "series": "Out-of-fold ell"
        },
        {
          "x": "249",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "249",
          "y": "6263.40299019581",
          "series": "Out-of-fold ell"
        },
        {
          "x": "250",
          "y": "18347.255859375",
          "series": "Observed"
        },
        {
          "x": "250",
          "y": "5018.34050346591",
          "series": "Out-of-fold ell"
        },
        {
          "x": "251",
          "y": "6867.74072265625",
          "series": "Observed"
        },
        {
          "x": "251",
          "y": "5101.22566339853",
          "series": "Out-of-fold ell"
        },
        {
          "x": "252",
          "y": "8598.5224609375",
          "series": "Observed"
        },
        {
          "x": "252",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "253",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "253",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "254",
          "y": "5767.70458984375",
          "series": "Observed"
        },
        {
          "x": "254",
          "y": "5179.56889218744",
          "series": "Out-of-fold ell"
        },
        {
          "x": "255",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "255",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "256",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "256",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "257",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "257",
          "y": "5280.85991011986",
          "series": "Out-of-fold ell"
        },
        {
          "x": "258",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "258",
          "y": "5043.06935356377",
          "series": "Out-of-fold ell"
        },
        {
          "x": "259",
          "y": "3462.56396484375",
          "series": "Observed"
        },
        {
          "x": "259",
          "y": "4939.1620097476",
          "series": "Out-of-fold ell"
        },
        {
          "x": "260",
          "y": "7171",
          "series": "Observed"
        },
        {
          "x": "260",
          "y": "5477.28884376511",
          "series": "Out-of-fold ell"
        },
        {
          "x": "261",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "261",
          "y": "8788.10600290515",
          "series": "Out-of-fold ell"
        },
        {
          "x": "262",
          "y": "8924.3955078125",
          "series": "Observed"
        },
        {
          "x": "262",
          "y": "5852.79745950631",
          "series": "Out-of-fold ell"
        },
        {
          "x": "263",
          "y": "8562.603515625",
          "series": "Observed"
        },
        {
          "x": "263",
          "y": "5921.23323884327",
          "series": "Out-of-fold ell"
        },
        {
          "x": "264",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "264",
          "y": "7570.87343146486",
          "series": "Out-of-fold ell"
        },
        {
          "x": "265",
          "y": "9722.0029296875",
          "series": "Observed"
        },
        {
          "x": "265",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "266",
          "y": "6330.8876953125",
          "series": "Observed"
        },
        {
          "x": "266",
          "y": "6329.50928427511",
          "series": "Out-of-fold ell"
        },
        {
          "x": "267",
          "y": "7535.94189453125",
          "series": "Observed"
        },
        {
          "x": "267",
          "y": "5130.66718865925",
          "series": "Out-of-fold ell"
        },
        {
          "x": "268",
          "y": "4279.61279296875",
          "series": "Observed"
        },
        {
          "x": "268",
          "y": "4738.43351417679",
          "series": "Out-of-fold ell"
        },
        {
          "x": "269",
          "y": "12797.669921875",
          "series": "Observed"
        },
        {
          "x": "269",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "270",
          "y": "5088.98583984375",
          "series": "Observed"
        },
        {
          "x": "270",
          "y": "6534.02107379571",
          "series": "Out-of-fold ell"
        },
        {
          "x": "271",
          "y": "16658.25",
          "series": "Observed"
        },
        {
          "x": "271",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "272",
          "y": "5071.80078125",
          "series": "Observed"
        },
        {
          "x": "272",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "273",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "273",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "274",
          "y": "5114.81396484375",
          "series": "Observed"
        },
        {
          "x": "274",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "275",
          "y": "14281.306640625",
          "series": "Observed"
        },
        {
          "x": "275",
          "y": "4777.99208509764",
          "series": "Out-of-fold ell"
        },
        {
          "x": "276",
          "y": "130.679122924805",
          "series": "Observed"
        },
        {
          "x": "276",
          "y": "5488.85392855164",
          "series": "Out-of-fold ell"
        },
        {
          "x": "277",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "277",
          "y": "6339.83684971858",
          "series": "Out-of-fold ell"
        },
        {
          "x": "278",
          "y": "8190.4208984375",
          "series": "Observed"
        },
        {
          "x": "278",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "279",
          "y": "18859.890625",
          "series": "Observed"
        },
        {
          "x": "279",
          "y": "5414.53352134672",
          "series": "Out-of-fold ell"
        },
        {
          "x": "280",
          "y": "11412.2353515625",
          "series": "Observed"
        },
        {
          "x": "280",
          "y": "6070.6359629599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "281",
          "y": "1973.34533691406",
          "series": "Observed"
        },
        {
          "x": "281",
          "y": "6829.91872051774",
          "series": "Out-of-fold ell"
        },
        {
          "x": "282",
          "y": "4974.5859375",
          "series": "Observed"
        },
        {
          "x": "282",
          "y": "5988.39749347735",
          "series": "Out-of-fold ell"
        },
        {
          "x": "283",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "283",
          "y": "6298.3990638713",
          "series": "Out-of-fold ell"
        },
        {
          "x": "284",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "284",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "285",
          "y": "7284.39404296875",
          "series": "Observed"
        },
        {
          "x": "285",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "286",
          "y": "18783.349609375",
          "series": "Observed"
        },
        {
          "x": "286",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "287",
          "y": "2090.67846679688",
          "series": "Observed"
        },
        {
          "x": "287",
          "y": "5051.17249241045",
          "series": "Out-of-fold ell"
        },
        {
          "x": "288",
          "y": "11965.8095703125",
          "series": "Observed"
        },
        {
          "x": "288",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "289",
          "y": "5350.0380859375",
          "series": "Observed"
        },
        {
          "x": "289",
          "y": "6452.66151510256",
          "series": "Out-of-fold ell"
        },
        {
          "x": "290",
          "y": "2454.5",
          "series": "Observed"
        },
        {
          "x": "290",
          "y": "6585.85023687784",
          "series": "Out-of-fold ell"
        },
        {
          "x": "291",
          "y": "215.834808349609",
          "series": "Observed"
        },
        {
          "x": "291",
          "y": "4756.50325111502",
          "series": "Out-of-fold ell"
        },
        {
          "x": "292",
          "y": "4387.05712890625",
          "series": "Observed"
        },
        {
          "x": "292",
          "y": "6191.7134501883",
          "series": "Out-of-fold ell"
        },
        {
          "x": "293",
          "y": "6354.19384765625",
          "series": "Observed"
        },
        {
          "x": "293",
          "y": "6096.70474342586",
          "series": "Out-of-fold ell"
        },
        {
          "x": "294",
          "y": "11306.26953125",
          "series": "Observed"
        },
        {
          "x": "294",
          "y": "6983.02221503969",
          "series": "Out-of-fold ell"
        },
        {
          "x": "295",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "295",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "296",
          "y": "6103.74609375",
          "series": "Observed"
        },
        {
          "x": "296",
          "y": "6629.00790862894",
          "series": "Out-of-fold ell"
        },
        {
          "x": "297",
          "y": "3412.95483398438",
          "series": "Observed"
        },
        {
          "x": "297",
          "y": "7464.8454942963",
          "series": "Out-of-fold ell"
        },
        {
          "x": "298",
          "y": "5775.06201171875",
          "series": "Observed"
        },
        {
          "x": "298",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "299",
          "y": "9381.294921875",
          "series": "Observed"
        },
        {
          "x": "299",
          "y": "7242.53465117453",
          "series": "Out-of-fold ell"
        },
        {
          "x": "300",
          "y": "20857.83984375",
          "series": "Observed"
        },
        {
          "x": "300",
          "y": "6452.21747858612",
          "series": "Out-of-fold ell"
        },
        {
          "x": "301",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "301",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "302",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "302",
          "y": "7720.24891402083",
          "series": "Out-of-fold ell"
        },
        {
          "x": "303",
          "y": "1859.1669921875",
          "series": "Observed"
        },
        {
          "x": "303",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "304",
          "y": "18739.9296875",
          "series": "Observed"
        },
        {
          "x": "304",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "305",
          "y": "13228.2802734375",
          "series": "Observed"
        },
        {
          "x": "305",
          "y": "4803.35044340697",
          "series": "Out-of-fold ell"
        },
        {
          "x": "306",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "306",
          "y": "5656.989963569",
          "series": "Out-of-fold ell"
        },
        {
          "x": "307",
          "y": "12896.216796875",
          "series": "Observed"
        },
        {
          "x": "307",
          "y": "9226.24879421302",
          "series": "Out-of-fold ell"
        },
        {
          "x": "308",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "308",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "309",
          "y": "4335.1591796875",
          "series": "Observed"
        },
        {
          "x": "309",
          "y": "6541.06013752504",
          "series": "Out-of-fold ell"
        },
        {
          "x": "310",
          "y": "4321.705078125",
          "series": "Observed"
        },
        {
          "x": "310",
          "y": "6812.39748066477",
          "series": "Out-of-fold ell"
        },
        {
          "x": "311",
          "y": "15762.876953125",
          "series": "Observed"
        },
        {
          "x": "311",
          "y": "9908.30230092328",
          "series": "Out-of-fold ell"
        },
        {
          "x": "312",
          "y": "4211.66162109375",
          "series": "Observed"
        },
        {
          "x": "312",
          "y": "6681.32718101998",
          "series": "Out-of-fold ell"
        },
        {
          "x": "313",
          "y": "10747.349609375",
          "series": "Observed"
        },
        {
          "x": "313",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "314",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "314",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "315",
          "y": "1048.43200683594",
          "series": "Observed"
        },
        {
          "x": "315",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "316",
          "y": "2649.59887695312",
          "series": "Observed"
        },
        {
          "x": "316",
          "y": "6007.51254292568",
          "series": "Out-of-fold ell"
        },
        {
          "x": "317",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "317",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "318",
          "y": "1773.42297363281",
          "series": "Observed"
        },
        {
          "x": "318",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "319",
          "y": "24909.44921875",
          "series": "Observed"
        },
        {
          "x": "319",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "320",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "320",
          "y": "6575.49407490869",
          "series": "Out-of-fold ell"
        },
        {
          "x": "321",
          "y": "6421.5302734375",
          "series": "Observed"
        },
        {
          "x": "321",
          "y": "9622.32905951409",
          "series": "Out-of-fold ell"
        },
        {
          "x": "322",
          "y": "15581.4365234375",
          "series": "Observed"
        },
        {
          "x": "322",
          "y": "6275.80848697077",
          "series": "Out-of-fold ell"
        },
        {
          "x": "323",
          "y": "7226.04931640625",
          "series": "Observed"
        },
        {
          "x": "323",
          "y": "5031.3010118552",
          "series": "Out-of-fold ell"
        },
        {
          "x": "324",
          "y": "12659.576171875",
          "series": "Observed"
        },
        {
          "x": "324",
          "y": "5800.47346917216",
          "series": "Out-of-fold ell"
        },
        {
          "x": "325",
          "y": "6011.02099609375",
          "series": "Observed"
        },
        {
          "x": "325",
          "y": "6121.97076046235",
          "series": "Out-of-fold ell"
        },
        {
          "x": "326",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "326",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "327",
          "y": "10569.26953125",
          "series": "Observed"
        },
        {
          "x": "327",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "328",
          "y": "7479.65576171875",
          "series": "Observed"
        },
        {
          "x": "328",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "329",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "329",
          "y": "5222.83729642333",
          "series": "Out-of-fold ell"
        },
        {
          "x": "330",
          "y": "10210.990234375",
          "series": "Observed"
        },
        {
          "x": "330",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "331",
          "y": "9598.541015625",
          "series": "Observed"
        },
        {
          "x": "331",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "332",
          "y": "13188.830078125",
          "series": "Observed"
        },
        {
          "x": "332",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "333",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "333",
          "y": "5998.13927545411",
          "series": "Out-of-fold ell"
        },
        {
          "x": "334",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "334",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "335",
          "y": "1725.59240722656",
          "series": "Observed"
        },
        {
          "x": "335",
          "y": "6529.70846544656",
          "series": "Out-of-fold ell"
        },
        {
          "x": "336",
          "y": "1890.93701171875",
          "series": "Observed"
        },
        {
          "x": "336",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "337",
          "y": "3123.1162109375",
          "series": "Observed"
        },
        {
          "x": "337",
          "y": "5881.4725193314",
          "series": "Out-of-fold ell"
        },
        {
          "x": "338",
          "y": "3825.3076171875",
          "series": "Observed"
        },
        {
          "x": "338",
          "y": "7179.22419315721",
          "series": "Out-of-fold ell"
        },
        {
          "x": "339",
          "y": "6930.3359375",
          "series": "Observed"
        },
        {
          "x": "339",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "340",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "340",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "341",
          "y": "2787.9599609375",
          "series": "Observed"
        },
        {
          "x": "341",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "342",
          "y": "8396.654296875",
          "series": "Observed"
        },
        {
          "x": "342",
          "y": "5260.97033571679",
          "series": "Out-of-fold ell"
        },
        {
          "x": "343",
          "y": "3385.81079101562",
          "series": "Observed"
        },
        {
          "x": "343",
          "y": "5357.76812912391",
          "series": "Out-of-fold ell"
        },
        {
          "x": "344",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "344",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "345",
          "y": "1653.48120117188",
          "series": "Observed"
        },
        {
          "x": "345",
          "y": "6132.45456944186",
          "series": "Out-of-fold ell"
        },
        {
          "x": "346",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "346",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "347",
          "y": "14581.8603515625",
          "series": "Observed"
        },
        {
          "x": "347",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "348",
          "y": "7609.51806640625",
          "series": "Observed"
        },
        {
          "x": "348",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "349",
          "y": "34099.28125",
          "series": "Observed"
        },
        {
          "x": "349",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "350",
          "y": "10833.341796875",
          "series": "Observed"
        },
        {
          "x": "350",
          "y": "7447.16862137093",
          "series": "Out-of-fold ell"
        },
        {
          "x": "351",
          "y": "22163.25",
          "series": "Observed"
        },
        {
          "x": "351",
          "y": "4934.88037798697",
          "series": "Out-of-fold ell"
        },
        {
          "x": "352",
          "y": "3552.26806640625",
          "series": "Observed"
        },
        {
          "x": "352",
          "y": "5036.01703249263",
          "series": "Out-of-fold ell"
        },
        {
          "x": "353",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "353",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "354",
          "y": "2164.02197265625",
          "series": "Observed"
        },
        {
          "x": "354",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "355",
          "y": "4677.04931640625",
          "series": "Observed"
        },
        {
          "x": "355",
          "y": "5808.39228392319",
          "series": "Out-of-fold ell"
        },
        {
          "x": "356",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "356",
          "y": "5363.99573011794",
          "series": "Out-of-fold ell"
        },
        {
          "x": "357",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "357",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "358",
          "y": "10020.71484375",
          "series": "Observed"
        },
        {
          "x": "358",
          "y": "5635.75833201666",
          "series": "Out-of-fold ell"
        },
        {
          "x": "359",
          "y": "1672.77600097656",
          "series": "Observed"
        },
        {
          "x": "359",
          "y": "5052.36258866696",
          "series": "Out-of-fold ell"
        },
        {
          "x": "360",
          "y": "3191.7529296875",
          "series": "Observed"
        },
        {
          "x": "360",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "361",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "361",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "362",
          "y": "3418.09692382812",
          "series": "Observed"
        },
        {
          "x": "362",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "363",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "363",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "364",
          "y": "2348.97290039062",
          "series": "Observed"
        },
        {
          "x": "364",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "365",
          "y": "17094.640625",
          "series": "Observed"
        },
        {
          "x": "365",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "366",
          "y": "4485.6162109375",
          "series": "Observed"
        },
        {
          "x": "366",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "367",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "367",
          "y": "7393.10670748916",
          "series": "Out-of-fold ell"
        },
        {
          "x": "368",
          "y": "6167.68115234375",
          "series": "Observed"
        },
        {
          "x": "368",
          "y": "5587.89346120268",
          "series": "Out-of-fold ell"
        },
        {
          "x": "369",
          "y": "8803.666015625",
          "series": "Observed"
        },
        {
          "x": "369",
          "y": "8270.03961293989",
          "series": "Out-of-fold ell"
        },
        {
          "x": "370",
          "y": "9199.5625",
          "series": "Observed"
        },
        {
          "x": "370",
          "y": "5338.75200289578",
          "series": "Out-of-fold ell"
        },
        {
          "x": "371",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "371",
          "y": "4893.50083936885",
          "series": "Out-of-fold ell"
        },
        {
          "x": "372",
          "y": "7947.2568359375",
          "series": "Observed"
        },
        {
          "x": "372",
          "y": "5500.61953919713",
          "series": "Out-of-fold ell"
        },
        {
          "x": "373",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "373",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "374",
          "y": "4843.17578125",
          "series": "Observed"
        },
        {
          "x": "374",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "375",
          "y": "8484.2392578125",
          "series": "Observed"
        },
        {
          "x": "375",
          "y": "5453.90062178142",
          "series": "Out-of-fold ell"
        },
        {
          "x": "376",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "376",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "377",
          "y": "2321.10693359375",
          "series": "Observed"
        },
        {
          "x": "377",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "378",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "378",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "379",
          "y": "14444.7099609375",
          "series": "Observed"
        },
        {
          "x": "379",
          "y": "4889.25402790473",
          "series": "Out-of-fold ell"
        },
        {
          "x": "380",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "380",
          "y": "5234.47052414618",
          "series": "Out-of-fold ell"
        },
        {
          "x": "381",
          "y": "18678.080078125",
          "series": "Observed"
        },
        {
          "x": "381",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "382",
          "y": "1333.44506835938",
          "series": "Observed"
        },
        {
          "x": "382",
          "y": "4700.54729376987",
          "series": "Out-of-fold ell"
        },
        {
          "x": "383",
          "y": "4551.978515625",
          "series": "Observed"
        },
        {
          "x": "383",
          "y": "5012.67175886415",
          "series": "Out-of-fold ell"
        },
        {
          "x": "384",
          "y": "1254.58203125",
          "series": "Observed"
        },
        {
          "x": "384",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "385",
          "y": "9983.7841796875",
          "series": "Observed"
        },
        {
          "x": "385",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "386",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "386",
          "y": "4974.68397292129",
          "series": "Out-of-fold ell"
        },
        {
          "x": "387",
          "y": "6086.96630859375",
          "series": "Observed"
        },
        {
          "x": "387",
          "y": "5697.98425774076",
          "series": "Out-of-fold ell"
        },
        {
          "x": "388",
          "y": "702.183898925781",
          "series": "Observed"
        },
        {
          "x": "388",
          "y": "4933.26069906316",
          "series": "Out-of-fold ell"
        },
        {
          "x": "389",
          "y": "9750.66015625",
          "series": "Observed"
        },
        {
          "x": "389",
          "y": "5451.69005192972",
          "series": "Out-of-fold ell"
        },
        {
          "x": "390",
          "y": "4159.9189453125",
          "series": "Observed"
        },
        {
          "x": "390",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "391",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "391",
          "y": "6079.74508504715",
          "series": "Out-of-fold ell"
        },
        {
          "x": "392",
          "y": "1652.63696289062",
          "series": "Observed"
        },
        {
          "x": "392",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "393",
          "y": "1720.90698242188",
          "series": "Observed"
        },
        {
          "x": "393",
          "y": "5301.87190587436",
          "series": "Out-of-fold ell"
        },
        {
          "x": "394",
          "y": "6788.462890625",
          "series": "Observed"
        },
        {
          "x": "394",
          "y": "6582.26475819962",
          "series": "Out-of-fold ell"
        },
        {
          "x": "395",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "395",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "396",
          "y": "23005.599609375",
          "series": "Observed"
        },
        {
          "x": "396",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "397",
          "y": "4768.3544921875",
          "series": "Observed"
        },
        {
          "x": "397",
          "y": "6431.9806882559",
          "series": "Out-of-fold ell"
        },
        {
          "x": "398",
          "y": "17395.16796875",
          "series": "Observed"
        },
        {
          "x": "398",
          "y": "6309.44668448552",
          "series": "Out-of-fold ell"
        },
        {
          "x": "399",
          "y": "4488.49462890625",
          "series": "Observed"
        },
        {
          "x": "399",
          "y": "7444.50903579624",
          "series": "Out-of-fold ell"
        },
        {
          "x": "400",
          "y": "20780.6484375",
          "series": "Observed"
        },
        {
          "x": "400",
          "y": "4841.79777335476",
          "series": "Out-of-fold ell"
        },
        {
          "x": "401",
          "y": "1455.68994140625",
          "series": "Observed"
        },
        {
          "x": "401",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "402",
          "y": "1764.10766601562",
          "series": "Observed"
        },
        {
          "x": "402",
          "y": "4825.45480865761",
          "series": "Out-of-fold ell"
        },
        {
          "x": "403",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "403",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "404",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "404",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "405",
          "y": "7078.17822265625",
          "series": "Observed"
        },
        {
          "x": "405",
          "y": "6727.46653491687",
          "series": "Out-of-fold ell"
        },
        {
          "x": "406",
          "y": "1115.85961914062",
          "series": "Observed"
        },
        {
          "x": "406",
          "y": "5973.06589579175",
          "series": "Out-of-fold ell"
        },
        {
          "x": "407",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "407",
          "y": "5347.42912292509",
          "series": "Out-of-fold ell"
        },
        {
          "x": "408",
          "y": "14690.349609375",
          "series": "Observed"
        },
        {
          "x": "408",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "409",
          "y": "289.789886474609",
          "series": "Observed"
        },
        {
          "x": "409",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "410",
          "y": "11120.5302734375",
          "series": "Observed"
        },
        {
          "x": "410",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "411",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "411",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "412",
          "y": "12429.91015625",
          "series": "Observed"
        },
        {
          "x": "412",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "413",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "413",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "414",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "414",
          "y": "5990.35290995615",
          "series": "Out-of-fold ell"
        },
        {
          "x": "415",
          "y": "10864.8759765625",
          "series": "Observed"
        },
        {
          "x": "415",
          "y": "4888.68496740558",
          "series": "Out-of-fold ell"
        },
        {
          "x": "416",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "416",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "417",
          "y": "7506.14599609375",
          "series": "Observed"
        },
        {
          "x": "417",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "418",
          "y": "4666.23583984375",
          "series": "Observed"
        },
        {
          "x": "418",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "419",
          "y": "9453.8271484375",
          "series": "Observed"
        },
        {
          "x": "419",
          "y": "6121.43990807966",
          "series": "Out-of-fold ell"
        },
        {
          "x": "420",
          "y": "445.830902099609",
          "series": "Observed"
        },
        {
          "x": "420",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "421",
          "y": "20942.240234375",
          "series": "Observed"
        },
        {
          "x": "421",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "422",
          "y": "14626.3896484375",
          "series": "Observed"
        },
        {
          "x": "422",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "423",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "423",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "424",
          "y": "8329.8232421875",
          "series": "Observed"
        },
        {
          "x": "424",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "425",
          "y": "23483.451171875",
          "series": "Observed"
        },
        {
          "x": "425",
          "y": "6875.7361783331",
          "series": "Out-of-fold ell"
        },
        {
          "x": "426",
          "y": "2920.19897460938",
          "series": "Observed"
        },
        {
          "x": "426",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "427",
          "y": "5611.8662109375",
          "series": "Observed"
        },
        {
          "x": "427",
          "y": "6001.31701765576",
          "series": "Out-of-fold ell"
        },
        {
          "x": "428",
          "y": "5665.06640625",
          "series": "Observed"
        },
        {
          "x": "428",
          "y": "6925.75410898947",
          "series": "Out-of-fold ell"
        },
        {
          "x": "429",
          "y": "2346.828125",
          "series": "Observed"
        },
        {
          "x": "429",
          "y": "7989.45916496972",
          "series": "Out-of-fold ell"
        },
        {
          "x": "430",
          "y": "7952.5400390625",
          "series": "Observed"
        },
        {
          "x": "430",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "431",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "431",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "432",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "432",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "433",
          "y": "14051.15625",
          "series": "Observed"
        },
        {
          "x": "433",
          "y": "5314.98979819688",
          "series": "Out-of-fold ell"
        },
        {
          "x": "434",
          "y": "8881.6650390625",
          "series": "Observed"
        },
        {
          "x": "434",
          "y": "5658.21506791128",
          "series": "Out-of-fold ell"
        },
        {
          "x": "435",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "435",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "436",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "436",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "437",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "437",
          "y": "4759.31342200798",
          "series": "Out-of-fold ell"
        },
        {
          "x": "438",
          "y": "1923.93798828125",
          "series": "Observed"
        },
        {
          "x": "438",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "439",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "439",
          "y": "6252.07640183851",
          "series": "Out-of-fold ell"
        },
        {
          "x": "440",
          "y": "16900.30078125",
          "series": "Observed"
        },
        {
          "x": "440",
          "y": "7551.83086407625",
          "series": "Out-of-fold ell"
        },
        {
          "x": "441",
          "y": "8472.158203125",
          "series": "Observed"
        },
        {
          "x": "441",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "442",
          "y": "7661.97265625",
          "series": "Observed"
        },
        {
          "x": "442",
          "y": "7209.71510634081",
          "series": "Out-of-fold ell"
        },
        {
          "x": "443",
          "y": "179.021728515625",
          "series": "Observed"
        },
        {
          "x": "443",
          "y": "4982.02649516815",
          "series": "Out-of-fold ell"
        },
        {
          "x": "444",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "444",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "445",
          "y": "6672.02099609375",
          "series": "Observed"
        },
        {
          "x": "445",
          "y": "5103.10532765767",
          "series": "Out-of-fold ell"
        },
        {
          "x": "446",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "446",
          "y": "5292.0281283016",
          "series": "Out-of-fold ell"
        },
        {
          "x": "447",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "447",
          "y": "4895.21119601243",
          "series": "Out-of-fold ell"
        },
        {
          "x": "448",
          "y": "2877.68212890625",
          "series": "Observed"
        },
        {
          "x": "448",
          "y": "6562.85853991248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "449",
          "y": "3931.23803710938",
          "series": "Observed"
        },
        {
          "x": "449",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "450",
          "y": "7152.1318359375",
          "series": "Observed"
        },
        {
          "x": "450",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "451",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "451",
          "y": "7004.40210697426",
          "series": "Out-of-fold ell"
        },
        {
          "x": "452",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "452",
          "y": "5642.63337421738",
          "series": "Out-of-fold ell"
        },
        {
          "x": "453",
          "y": "15191.9111328125",
          "series": "Observed"
        },
        {
          "x": "453",
          "y": "8100.96030052819",
          "series": "Out-of-fold ell"
        },
        {
          "x": "454",
          "y": "485.229797363281",
          "series": "Observed"
        },
        {
          "x": "454",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "455",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "455",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "456",
          "y": "17014.58984375",
          "series": "Observed"
        },
        {
          "x": "456",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "457",
          "y": "14527.8798828125",
          "series": "Observed"
        },
        {
          "x": "457",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "458",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "458",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "459",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "459",
          "y": "4863.6068015049",
          "series": "Out-of-fold ell"
        },
        {
          "x": "460",
          "y": "7458.10498046875",
          "series": "Observed"
        },
        {
          "x": "460",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "461",
          "y": "6153.82958984375",
          "series": "Observed"
        },
        {
          "x": "461",
          "y": "5349.03108877202",
          "series": "Out-of-fold ell"
        },
        {
          "x": "462",
          "y": "3972.5400390625",
          "series": "Observed"
        },
        {
          "x": "462",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "463",
          "y": "11731.197265625",
          "series": "Observed"
        },
        {
          "x": "463",
          "y": "6349.07514080531",
          "series": "Out-of-fold ell"
        },
        {
          "x": "464",
          "y": "7693.39990234375",
          "series": "Observed"
        },
        {
          "x": "464",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "465",
          "y": "16461.5703125",
          "series": "Observed"
        },
        {
          "x": "465",
          "y": "4990.71944626246",
          "series": "Out-of-fold ell"
        },
        {
          "x": "466",
          "y": "9737.154296875",
          "series": "Observed"
        },
        {
          "x": "466",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "467",
          "y": "11602.935546875",
          "series": "Observed"
        },
        {
          "x": "467",
          "y": "4815.41843790211",
          "series": "Out-of-fold ell"
        },
        {
          "x": "468",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "468",
          "y": "5203.22209027837",
          "series": "Out-of-fold ell"
        },
        {
          "x": "469",
          "y": "10770.962890625",
          "series": "Observed"
        },
        {
          "x": "469",
          "y": "5733.36657096415",
          "series": "Out-of-fold ell"
        },
        {
          "x": "470",
          "y": "8764.1474609375",
          "series": "Observed"
        },
        {
          "x": "470",
          "y": "4959.68721457342",
          "series": "Out-of-fold ell"
        },
        {
          "x": "471",
          "y": "13626.0439453125",
          "series": "Observed"
        },
        {
          "x": "471",
          "y": "5632.78062386511",
          "series": "Out-of-fold ell"
        },
        {
          "x": "472",
          "y": "2015.50305175781",
          "series": "Observed"
        },
        {
          "x": "472",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "473",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "473",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "474",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "474",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "475",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "475",
          "y": "5036.01711702465",
          "series": "Out-of-fold ell"
        },
        {
          "x": "476",
          "y": "3290.29321289062",
          "series": "Observed"
        },
        {
          "x": "476",
          "y": "5041.65919627472",
          "series": "Out-of-fold ell"
        },
        {
          "x": "477",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "477",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "478",
          "y": "5518.0830078125",
          "series": "Observed"
        },
        {
          "x": "478",
          "y": "5022.35510061606",
          "series": "Out-of-fold ell"
        },
        {
          "x": "479",
          "y": "9378.6533203125",
          "series": "Observed"
        },
        {
          "x": "479",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "480",
          "y": "4849.55908203125",
          "series": "Observed"
        },
        {
          "x": "480",
          "y": "5541.78297734448",
          "series": "Out-of-fold ell"
        },
        {
          "x": "481",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "481",
          "y": "5101.23473257397",
          "series": "Out-of-fold ell"
        },
        {
          "x": "482",
          "y": "5767.1328125",
          "series": "Observed"
        },
        {
          "x": "482",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "483",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "483",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "484",
          "y": "6723.4140625",
          "series": "Observed"
        },
        {
          "x": "484",
          "y": "6406.04129719101",
          "series": "Out-of-fold ell"
        },
        {
          "x": "485",
          "y": "4858.89501953125",
          "series": "Observed"
        },
        {
          "x": "485",
          "y": "5098.68449346379",
          "series": "Out-of-fold ell"
        },
        {
          "x": "486",
          "y": "5435.78662109375",
          "series": "Observed"
        },
        {
          "x": "486",
          "y": "5696.69452094056",
          "series": "Out-of-fold ell"
        },
        {
          "x": "487",
          "y": "128.671997070312",
          "series": "Observed"
        },
        {
          "x": "487",
          "y": "5572.53470315809",
          "series": "Out-of-fold ell"
        },
        {
          "x": "488",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "488",
          "y": "5301.80259330968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "489",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "489",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "490",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "490",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "491",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "491",
          "y": "5187.92005368405",
          "series": "Out-of-fold ell"
        },
        {
          "x": "492",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "492",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "493",
          "y": "549.298400878906",
          "series": "Observed"
        },
        {
          "x": "493",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "494",
          "y": "10694.2900390625",
          "series": "Observed"
        },
        {
          "x": "494",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "495",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "495",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "496",
          "y": "1135.46997070312",
          "series": "Observed"
        },
        {
          "x": "496",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "497",
          "y": "1184.88195800781",
          "series": "Observed"
        },
        {
          "x": "497",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "498",
          "y": "7779.26318359375",
          "series": "Observed"
        },
        {
          "x": "498",
          "y": "4936.10911700731",
          "series": "Out-of-fold ell"
        },
        {
          "x": "499",
          "y": "4623.18798828125",
          "series": "Observed"
        },
        {
          "x": "499",
          "y": "5776.82935369097",
          "series": "Out-of-fold ell"
        },
        {
          "x": "500",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "500",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "501",
          "y": "17230.9609375",
          "series": "Observed"
        },
        {
          "x": "501",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "502",
          "y": "7176.18701171875",
          "series": "Observed"
        },
        {
          "x": "502",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "503",
          "y": "26817.599609375",
          "series": "Observed"
        },
        {
          "x": "503",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "504",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "504",
          "y": "5159.8016778584",
          "series": "Out-of-fold ell"
        },
        {
          "x": "505",
          "y": "2018.55590820312",
          "series": "Observed"
        },
        {
          "x": "505",
          "y": "5015.38099982269",
          "series": "Out-of-fold ell"
        },
        {
          "x": "506",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "506",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "507",
          "y": "9265.7880859375",
          "series": "Observed"
        },
        {
          "x": "507",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "508",
          "y": "672.877319335938",
          "series": "Observed"
        },
        {
          "x": "508",
          "y": "8484.70936558239",
          "series": "Out-of-fold ell"
        },
        {
          "x": "509",
          "y": "2169.02709960938",
          "series": "Observed"
        },
        {
          "x": "509",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "510",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "510",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "511",
          "y": "3783.65991210938",
          "series": "Observed"
        },
        {
          "x": "511",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "512",
          "y": "6378.72021484375",
          "series": "Observed"
        },
        {
          "x": "512",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "513",
          "y": "1264.23205566406",
          "series": "Observed"
        },
        {
          "x": "513",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "514",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "514",
          "y": "5046.94674530444",
          "series": "Out-of-fold ell"
        },
        {
          "x": "515",
          "y": "284.658386230469",
          "series": "Observed"
        },
        {
          "x": "515",
          "y": "5665.1234379456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "516",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "516",
          "y": "5206.49361909451",
          "series": "Out-of-fold ell"
        },
        {
          "x": "517",
          "y": "4116.7021484375",
          "series": "Observed"
        },
        {
          "x": "517",
          "y": "5423.81534980965",
          "series": "Out-of-fold ell"
        },
        {
          "x": "518",
          "y": "4196.375",
          "series": "Observed"
        },
        {
          "x": "518",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "519",
          "y": "4209.57958984375",
          "series": "Observed"
        },
        {
          "x": "519",
          "y": "6413.17108173555",
          "series": "Out-of-fold ell"
        },
        {
          "x": "520",
          "y": "11856.875",
          "series": "Observed"
        },
        {
          "x": "520",
          "y": "5257.35835480028",
          "series": "Out-of-fold ell"
        },
        {
          "x": "521",
          "y": "6027.638671875",
          "series": "Observed"
        },
        {
          "x": "521",
          "y": "5154.47766365672",
          "series": "Out-of-fold ell"
        },
        {
          "x": "522",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "522",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "523",
          "y": "7367.0400390625",
          "series": "Observed"
        },
        {
          "x": "523",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "524",
          "y": "289.789886474609",
          "series": "Observed"
        },
        {
          "x": "524",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "525",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "525",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "526",
          "y": "1991.40002441406",
          "series": "Observed"
        },
        {
          "x": "526",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "527",
          "y": "19533.8828125",
          "series": "Observed"
        },
        {
          "x": "527",
          "y": "6713.26627615665",
          "series": "Out-of-fold ell"
        },
        {
          "x": "528",
          "y": "995.7001953125",
          "series": "Observed"
        },
        {
          "x": "528",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "529",
          "y": "8551.533203125",
          "series": "Observed"
        },
        {
          "x": "529",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "530",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "530",
          "y": "5157.33671673042",
          "series": "Out-of-fold ell"
        },
        {
          "x": "531",
          "y": "4251.126953125",
          "series": "Observed"
        },
        {
          "x": "531",
          "y": "4893.50083936885",
          "series": "Out-of-fold ell"
        },
        {
          "x": "532",
          "y": "6365.03125",
          "series": "Observed"
        },
        {
          "x": "532",
          "y": "4775.32202731771",
          "series": "Out-of-fold ell"
        },
        {
          "x": "533",
          "y": "1659.49975585938",
          "series": "Observed"
        },
        {
          "x": "533",
          "y": "6223.12259406269",
          "series": "Out-of-fold ell"
        },
        {
          "x": "534",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "534",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "535",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "535",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "536",
          "y": "3689.1259765625",
          "series": "Observed"
        },
        {
          "x": "536",
          "y": "4953.21095810623",
          "series": "Out-of-fold ell"
        },
        {
          "x": "537",
          "y": "5088.759765625",
          "series": "Observed"
        },
        {
          "x": "537",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "538",
          "y": "5573.546875",
          "series": "Observed"
        },
        {
          "x": "538",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "539",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "539",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "540",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "540",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "541",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "541",
          "y": "5110.67218742892",
          "series": "Out-of-fold ell"
        },
        {
          "x": "542",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "542",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "543",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "543",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "544",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "544",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "545",
          "y": "7618.63916015625",
          "series": "Observed"
        },
        {
          "x": "545",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "546",
          "y": "5497.5908203125",
          "series": "Observed"
        },
        {
          "x": "546",
          "y": "4841.50602490232",
          "series": "Out-of-fold ell"
        },
        {
          "x": "547",
          "y": "604.228698730469",
          "series": "Observed"
        },
        {
          "x": "547",
          "y": "4914.35993766508",
          "series": "Out-of-fold ell"
        },
        {
          "x": "548",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "548",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "549",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "549",
          "y": "4758.24502709741",
          "series": "Out-of-fold ell"
        },
        {
          "x": "550",
          "y": "929.883911132812",
          "series": "Observed"
        },
        {
          "x": "550",
          "y": "4720.68075099142",
          "series": "Out-of-fold ell"
        },
        {
          "x": "551",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "551",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "552",
          "y": "4994.2265625",
          "series": "Observed"
        },
        {
          "x": "552",
          "y": "4965.71575990563",
          "series": "Out-of-fold ell"
        },
        {
          "x": "553",
          "y": "10798.5595703125",
          "series": "Observed"
        },
        {
          "x": "553",
          "y": "6292.19332142456",
          "series": "Out-of-fold ell"
        },
        {
          "x": "554",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "554",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "555",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "555",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "556",
          "y": "275.566101074219",
          "series": "Observed"
        },
        {
          "x": "556",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "557",
          "y": "1143.38696289062",
          "series": "Observed"
        },
        {
          "x": "557",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "558",
          "y": "10641.240234375",
          "series": "Observed"
        },
        {
          "x": "558",
          "y": "4629.91524531902",
          "series": "Out-of-fold ell"
        },
        {
          "x": "559",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "559",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "560",
          "y": "2189.42602539062",
          "series": "Observed"
        },
        {
          "x": "560",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "561",
          "y": "16218.0400390625",
          "series": "Observed"
        },
        {
          "x": "561",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "562",
          "y": "11061.615234375",
          "series": "Observed"
        },
        {
          "x": "562",
          "y": "5049.48513324602",
          "series": "Out-of-fold ell"
        },
        {
          "x": "563",
          "y": "1433.53125",
          "series": "Observed"
        },
        {
          "x": "563",
          "y": "4767.14296978631",
          "series": "Out-of-fold ell"
        },
        {
          "x": "564",
          "y": "3251.099609375",
          "series": "Observed"
        },
        {
          "x": "564",
          "y": "4731.00489361804",
          "series": "Out-of-fold ell"
        },
        {
          "x": "565",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "565",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "566",
          "y": "2639.2900390625",
          "series": "Observed"
        },
        {
          "x": "566",
          "y": "5274.98124661226",
          "series": "Out-of-fold ell"
        },
        {
          "x": "567",
          "y": "6456.69677734375",
          "series": "Observed"
        },
        {
          "x": "567",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "568",
          "y": "3708.71899414062",
          "series": "Observed"
        },
        {
          "x": "568",
          "y": "5322.89097466256",
          "series": "Out-of-fold ell"
        },
        {
          "x": "569",
          "y": "18295.81640625",
          "series": "Observed"
        },
        {
          "x": "569",
          "y": "5286.27613501915",
          "series": "Out-of-fold ell"
        },
        {
          "x": "570",
          "y": "317.895172119141",
          "series": "Observed"
        },
        {
          "x": "570",
          "y": "4887.1719833438",
          "series": "Out-of-fold ell"
        },
        {
          "x": "571",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "571",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "572",
          "y": "100.699821472168",
          "series": "Observed"
        },
        {
          "x": "572",
          "y": "5030.68008175888",
          "series": "Out-of-fold ell"
        },
        {
          "x": "573",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "573",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "574",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "574",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "575",
          "y": "9772.283203125",
          "series": "Observed"
        },
        {
          "x": "575",
          "y": "5007.71365503488",
          "series": "Out-of-fold ell"
        },
        {
          "x": "576",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "576",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "577",
          "y": "11965.8125",
          "series": "Observed"
        },
        {
          "x": "577",
          "y": "4964.20751460054",
          "series": "Out-of-fold ell"
        },
        {
          "x": "578",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "578",
          "y": "4938.76011762507",
          "series": "Out-of-fold ell"
        },
        {
          "x": "579",
          "y": "7396.29248046875",
          "series": "Observed"
        },
        {
          "x": "579",
          "y": "6454.16346831092",
          "series": "Out-of-fold ell"
        },
        {
          "x": "580",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "580",
          "y": "4852.5969481895",
          "series": "Out-of-fold ell"
        },
        {
          "x": "581",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "581",
          "y": "4700.54729376987",
          "series": "Out-of-fold ell"
        },
        {
          "x": "582",
          "y": "661.1923828125",
          "series": "Observed"
        },
        {
          "x": "582",
          "y": "4863.02033856751",
          "series": "Out-of-fold ell"
        },
        {
          "x": "583",
          "y": "11648.69921875",
          "series": "Observed"
        },
        {
          "x": "583",
          "y": "5224.56526846978",
          "series": "Out-of-fold ell"
        },
        {
          "x": "584",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "584",
          "y": "5165.47858684542",
          "series": "Out-of-fold ell"
        },
        {
          "x": "585",
          "y": "7906.3408203125",
          "series": "Observed"
        },
        {
          "x": "585",
          "y": "5668.95435224693",
          "series": "Out-of-fold ell"
        },
        {
          "x": "586",
          "y": "11630.6640625",
          "series": "Observed"
        },
        {
          "x": "586",
          "y": "4964.3490249406",
          "series": "Out-of-fold ell"
        },
        {
          "x": "587",
          "y": "1553.291015625",
          "series": "Observed"
        },
        {
          "x": "587",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "588",
          "y": "16451.462890625",
          "series": "Observed"
        },
        {
          "x": "588",
          "y": "5355.99218811879",
          "series": "Out-of-fold ell"
        },
        {
          "x": "589",
          "y": "6943.341796875",
          "series": "Observed"
        },
        {
          "x": "589",
          "y": "6899.69721438932",
          "series": "Out-of-fold ell"
        },
        {
          "x": "590",
          "y": "7659.2177734375",
          "series": "Observed"
        },
        {
          "x": "590",
          "y": "5689.65234401929",
          "series": "Out-of-fold ell"
        },
        {
          "x": "591",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "591",
          "y": "4892.37704905261",
          "series": "Out-of-fold ell"
        },
        {
          "x": "592",
          "y": "7896.70703125",
          "series": "Observed"
        },
        {
          "x": "592",
          "y": "5117.19688621693",
          "series": "Out-of-fold ell"
        },
        {
          "x": "593",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "593",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "594",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "594",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "595",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "595",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "596",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "596",
          "y": "5278.89977654786",
          "series": "Out-of-fold ell"
        },
        {
          "x": "597",
          "y": "3515.92895507812",
          "series": "Observed"
        },
        {
          "x": "597",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "598",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "598",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "599",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "599",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "600",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "600",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "601",
          "y": "8644.427734375",
          "series": "Observed"
        },
        {
          "x": "601",
          "y": "4919.97631027882",
          "series": "Out-of-fold ell"
        },
        {
          "x": "602",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "602",
          "y": "5913.70777943694",
          "series": "Out-of-fold ell"
        },
        {
          "x": "603",
          "y": "11048.080078125",
          "series": "Observed"
        },
        {
          "x": "603",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "604",
          "y": "781.224304199219",
          "series": "Observed"
        },
        {
          "x": "604",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "605",
          "y": "11163.169921875",
          "series": "Observed"
        },
        {
          "x": "605",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "606",
          "y": "480.527008056641",
          "series": "Observed"
        },
        {
          "x": "606",
          "y": "4892.58525481423",
          "series": "Out-of-fold ell"
        },
        {
          "x": "607",
          "y": "2891.66796875",
          "series": "Observed"
        },
        {
          "x": "607",
          "y": "4832.48014400696",
          "series": "Out-of-fold ell"
        },
        {
          "x": "608",
          "y": "12064.4130859375",
          "series": "Observed"
        },
        {
          "x": "608",
          "y": "4806.97699167156",
          "series": "Out-of-fold ell"
        },
        {
          "x": "609",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "609",
          "y": "5137.46805767531",
          "series": "Out-of-fold ell"
        },
        {
          "x": "610",
          "y": "9602.439453125",
          "series": "Observed"
        },
        {
          "x": "610",
          "y": "4976.14928137024",
          "series": "Out-of-fold ell"
        },
        {
          "x": "611",
          "y": "3268.93823242188",
          "series": "Observed"
        },
        {
          "x": "611",
          "y": "5109.860550509",
          "series": "Out-of-fold ell"
        },
        {
          "x": "612",
          "y": "202.284698486328",
          "series": "Observed"
        },
        {
          "x": "612",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "613",
          "y": "4164.76708984375",
          "series": "Observed"
        },
        {
          "x": "613",
          "y": "5180.86122577791",
          "series": "Out-of-fold ell"
        },
        {
          "x": "614",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "614",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "615",
          "y": "18085.734375",
          "series": "Observed"
        },
        {
          "x": "615",
          "y": "4716.57445799786",
          "series": "Out-of-fold ell"
        },
        {
          "x": "616",
          "y": "3590.70190429688",
          "series": "Observed"
        },
        {
          "x": "616",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "617",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "617",
          "y": "4982.67780052911",
          "series": "Out-of-fold ell"
        },
        {
          "x": "618",
          "y": "5594.7294921875",
          "series": "Observed"
        },
        {
          "x": "618",
          "y": "4875.64851246962",
          "series": "Out-of-fold ell"
        },
        {
          "x": "619",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "619",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "620",
          "y": "1953.26794433594",
          "series": "Observed"
        },
        {
          "x": "620",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "621",
          "y": "1374.06579589844",
          "series": "Observed"
        },
        {
          "x": "621",
          "y": "4930.20577606863",
          "series": "Out-of-fold ell"
        },
        {
          "x": "622",
          "y": "9017.00390625",
          "series": "Observed"
        },
        {
          "x": "622",
          "y": "6085.3610366745",
          "series": "Out-of-fold ell"
        },
        {
          "x": "623",
          "y": "7315.4521484375",
          "series": "Observed"
        },
        {
          "x": "623",
          "y": "4919.24488303554",
          "series": "Out-of-fold ell"
        },
        {
          "x": "624",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "624",
          "y": "4932.8241997999",
          "series": "Out-of-fold ell"
        },
        {
          "x": "625",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "625",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "626",
          "y": "11134.978515625",
          "series": "Observed"
        },
        {
          "x": "626",
          "y": "4817.30016767745",
          "series": "Out-of-fold ell"
        },
        {
          "x": "627",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "627",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "628",
          "y": "4813.0498046875",
          "series": "Observed"
        },
        {
          "x": "628",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "629",
          "y": "13278.974609375",
          "series": "Observed"
        },
        {
          "x": "629",
          "y": "5102.04599344279",
          "series": "Out-of-fold ell"
        },
        {
          "x": "630",
          "y": "7047.080078125",
          "series": "Observed"
        },
        {
          "x": "630",
          "y": "5047.73248145924",
          "series": "Out-of-fold ell"
        },
        {
          "x": "631",
          "y": "8124.71484375",
          "series": "Observed"
        },
        {
          "x": "631",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "632",
          "y": "5286.39599609375",
          "series": "Observed"
        },
        {
          "x": "632",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "633",
          "y": "4687.9375",
          "series": "Observed"
        },
        {
          "x": "633",
          "y": "4884.15536005337",
          "series": "Out-of-fold ell"
        },
        {
          "x": "634",
          "y": "3228.5029296875",
          "series": "Observed"
        },
        {
          "x": "634",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "635",
          "y": "5861.603515625",
          "series": "Observed"
        },
        {
          "x": "635",
          "y": "5390.64662905745",
          "series": "Out-of-fold ell"
        },
        {
          "x": "636",
          "y": "4309.8779296875",
          "series": "Observed"
        },
        {
          "x": "636",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "637",
          "y": "4657.27294921875",
          "series": "Observed"
        },
        {
          "x": "637",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "638",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "638",
          "y": "4943.5667228341",
          "series": "Out-of-fold ell"
        },
        {
          "x": "639",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "639",
          "y": "4917.55611412931",
          "series": "Out-of-fold ell"
        },
        {
          "x": "640",
          "y": "557.749877929688",
          "series": "Observed"
        },
        {
          "x": "640",
          "y": "5374.54936569528",
          "series": "Out-of-fold ell"
        },
        {
          "x": "641",
          "y": "5615.18896484375",
          "series": "Observed"
        },
        {
          "x": "641",
          "y": "5282.67736514142",
          "series": "Out-of-fold ell"
        },
        {
          "x": "642",
          "y": "11464.7138671875",
          "series": "Observed"
        },
        {
          "x": "642",
          "y": "5207.16261430207",
          "series": "Out-of-fold ell"
        },
        {
          "x": "643",
          "y": "3881.28393554688",
          "series": "Observed"
        },
        {
          "x": "643",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "644",
          "y": "6546.00927734375",
          "series": "Observed"
        },
        {
          "x": "644",
          "y": "4902.24292957486",
          "series": "Out-of-fold ell"
        },
        {
          "x": "645",
          "y": "12486.169921875",
          "series": "Observed"
        },
        {
          "x": "645",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "646",
          "y": "15369.4775390625",
          "series": "Observed"
        },
        {
          "x": "646",
          "y": "4926.73077125263",
          "series": "Out-of-fold ell"
        },
        {
          "x": "647",
          "y": "10877.349609375",
          "series": "Observed"
        },
        {
          "x": "647",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "648",
          "y": "2389.67895507812",
          "series": "Observed"
        },
        {
          "x": "648",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "649",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "649",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "650",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "650",
          "y": "4888.31371241736",
          "series": "Out-of-fold ell"
        },
        {
          "x": "651",
          "y": "5100.46875",
          "series": "Observed"
        },
        {
          "x": "651",
          "y": "4885.85536253959",
          "series": "Out-of-fold ell"
        },
        {
          "x": "652",
          "y": "3480.84741210938",
          "series": "Observed"
        },
        {
          "x": "652",
          "y": "4991.63550801512",
          "series": "Out-of-fold ell"
        },
        {
          "x": "653",
          "y": "3475.52001953125",
          "series": "Observed"
        },
        {
          "x": "653",
          "y": "4973.06583734989",
          "series": "Out-of-fold ell"
        },
        {
          "x": "654",
          "y": "9227.0517578125",
          "series": "Observed"
        },
        {
          "x": "654",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "655",
          "y": "5010.341796875",
          "series": "Observed"
        },
        {
          "x": "655",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "656",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "656",
          "y": "4870.28736698426",
          "series": "Out-of-fold ell"
        },
        {
          "x": "657",
          "y": "7010.44384765625",
          "series": "Observed"
        },
        {
          "x": "657",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "658",
          "y": "8993.865234375",
          "series": "Observed"
        },
        {
          "x": "658",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "659",
          "y": "3020.94775390625",
          "series": "Observed"
        },
        {
          "x": "659",
          "y": "4838.07660278405",
          "series": "Out-of-fold ell"
        },
        {
          "x": "660",
          "y": "8061.48486328125",
          "series": "Observed"
        },
        {
          "x": "660",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "661",
          "y": "14380.1728515625",
          "series": "Observed"
        },
        {
          "x": "661",
          "y": "4920.48465715279",
          "series": "Out-of-fold ell"
        },
        {
          "x": "662",
          "y": "12898.3798828125",
          "series": "Observed"
        },
        {
          "x": "662",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "663",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "663",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "664",
          "y": "4056.49389648438",
          "series": "Observed"
        },
        {
          "x": "664",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "665",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "665",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "666",
          "y": "17685.1796875",
          "series": "Observed"
        },
        {
          "x": "666",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "667",
          "y": "1914.41357421875",
          "series": "Observed"
        },
        {
          "x": "667",
          "y": "4907.05237405325",
          "series": "Out-of-fold ell"
        },
        {
          "x": "668",
          "y": "8173.908203125",
          "series": "Observed"
        },
        {
          "x": "668",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "669",
          "y": "5712.64306640625",
          "series": "Observed"
        },
        {
          "x": "669",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "670",
          "y": "2652.62451171875",
          "series": "Observed"
        },
        {
          "x": "670",
          "y": "5165.92406069878",
          "series": "Out-of-fold ell"
        },
        {
          "x": "671",
          "y": "4188.7353515625",
          "series": "Observed"
        },
        {
          "x": "671",
          "y": "4882.46922081976",
          "series": "Out-of-fold ell"
        },
        {
          "x": "672",
          "y": "4482.84521484375",
          "series": "Observed"
        },
        {
          "x": "672",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "673",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "673",
          "y": "4920.21349148241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "674",
          "y": "10740.080078125",
          "series": "Observed"
        },
        {
          "x": "674",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "675",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "675",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "676",
          "y": "3343.22412109375",
          "series": "Observed"
        },
        {
          "x": "676",
          "y": "4684.5345532288",
          "series": "Out-of-fold ell"
        },
        {
          "x": "677",
          "y": "743.666625976562",
          "series": "Observed"
        },
        {
          "x": "677",
          "y": "5304.75960818833",
          "series": "Out-of-fold ell"
        },
        {
          "x": "678",
          "y": "12229.6259765625",
          "series": "Observed"
        },
        {
          "x": "678",
          "y": "4890.29502081079",
          "series": "Out-of-fold ell"
        },
        {
          "x": "679",
          "y": "5193.0888671875",
          "series": "Observed"
        },
        {
          "x": "679",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "680",
          "y": "2035.91394042969",
          "series": "Observed"
        },
        {
          "x": "680",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "681",
          "y": "3746.70092773438",
          "series": "Observed"
        },
        {
          "x": "681",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "682",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "682",
          "y": "5651.05005868264",
          "series": "Out-of-fold ell"
        },
        {
          "x": "683",
          "y": "2193.52807617188",
          "series": "Observed"
        },
        {
          "x": "683",
          "y": "4851.77731719505",
          "series": "Out-of-fold ell"
        },
        {
          "x": "684",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "684",
          "y": "4939.42778045188",
          "series": "Out-of-fold ell"
        },
        {
          "x": "685",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "685",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "686",
          "y": "1568.15002441406",
          "series": "Observed"
        },
        {
          "x": "686",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "687",
          "y": "3023.87890625",
          "series": "Observed"
        },
        {
          "x": "687",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "688",
          "y": "1390.50903320312",
          "series": "Observed"
        },
        {
          "x": "688",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "689",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "689",
          "y": "5345.89534454184",
          "series": "Out-of-fold ell"
        },
        {
          "x": "690",
          "y": "9970.6806640625",
          "series": "Observed"
        },
        {
          "x": "690",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "691",
          "y": "3083.5810546875",
          "series": "Observed"
        },
        {
          "x": "691",
          "y": "10448.8980794971",
          "series": "Out-of-fold ell"
        },
        {
          "x": "692",
          "y": "3644.65502929688",
          "series": "Observed"
        },
        {
          "x": "692",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "693",
          "y": "12187.41015625",
          "series": "Observed"
        },
        {
          "x": "693",
          "y": "4749.34483322046",
          "series": "Out-of-fold ell"
        },
        {
          "x": "694",
          "y": "6181.8798828125",
          "series": "Observed"
        },
        {
          "x": "694",
          "y": "4751.05463369968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "695",
          "y": "11011.5703125",
          "series": "Observed"
        },
        {
          "x": "695",
          "y": "9020.22003818344",
          "series": "Out-of-fold ell"
        },
        {
          "x": "696",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "696",
          "y": "4604.38449862255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "697",
          "y": "3075.86181640625",
          "series": "Observed"
        },
        {
          "x": "697",
          "y": "6376.24021141999",
          "series": "Out-of-fold ell"
        },
        {
          "x": "698",
          "y": "11142.8701171875",
          "series": "Observed"
        },
        {
          "x": "698",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "699",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "699",
          "y": "6556.5272955542",
          "series": "Out-of-fold ell"
        },
        {
          "x": "700",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "700",
          "y": "5648.86082410039",
          "series": "Out-of-fold ell"
        },
        {
          "x": "701",
          "y": "1358.64294433594",
          "series": "Observed"
        },
        {
          "x": "701",
          "y": "7875.27973308105",
          "series": "Out-of-fold ell"
        },
        {
          "x": "702",
          "y": "4374.0400390625",
          "series": "Observed"
        },
        {
          "x": "702",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "703",
          "y": "15791.1298828125",
          "series": "Observed"
        },
        {
          "x": "703",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "704",
          "y": "8469.275390625",
          "series": "Observed"
        },
        {
          "x": "704",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "705",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "705",
          "y": "6089.89523685302",
          "series": "Out-of-fold ell"
        },
        {
          "x": "706",
          "y": "6527.9189453125",
          "series": "Observed"
        },
        {
          "x": "706",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        },
        {
          "x": "707",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "707",
          "y": "6702.07707486207",
          "series": "Out-of-fold ell"
        },
        {
          "x": "708",
          "y": "6210.669921875",
          "series": "Observed"
        },
        {
          "x": "708",
          "y": "6315.99857182868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "709",
          "y": "11223.7197265625",
          "series": "Observed"
        },
        {
          "x": "709",
          "y": "6356.22693944042",
          "series": "Out-of-fold ell"
        },
        {
          "x": "710",
          "y": "9722.3486328125",
          "series": "Observed"
        },
        {
          "x": "710",
          "y": "6367.75844844718",
          "series": "Out-of-fold ell"
        },
        {
          "x": "711",
          "y": "1065.67224121094",
          "series": "Observed"
        },
        {
          "x": "711",
          "y": "6374.71521596998",
          "series": "Out-of-fold ell"
        },
        {
          "x": "712",
          "y": "8836.5654296875",
          "series": "Observed"
        },
        {
          "x": "712",
          "y": "6158.07539329029",
          "series": "Out-of-fold ell"
        },
        {
          "x": "713",
          "y": "2978.66943359375",
          "series": "Observed"
        },
        {
          "x": "713",
          "y": "6743.18464436047",
          "series": "Out-of-fold ell"
        },
        {
          "x": "714",
          "y": "3595.89404296875",
          "series": "Observed"
        },
        {
          "x": "714",
          "y": "6388.02071196777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "715",
          "y": "7913.3857421875",
          "series": "Observed"
        },
        {
          "x": "715",
          "y": "7177.83406197325",
          "series": "Out-of-fold ell"
        },
        {
          "x": "716",
          "y": "3811.68310546875",
          "series": "Observed"
        },
        {
          "x": "716",
          "y": "5888.97086779783",
          "series": "Out-of-fold ell"
        },
        {
          "x": "717",
          "y": "5487.9697265625",
          "series": "Observed"
        },
        {
          "x": "717",
          "y": "7147.59227552749",
          "series": "Out-of-fold ell"
        },
        {
          "x": "718",
          "y": "11135.5341796875",
          "series": "Observed"
        },
        {
          "x": "718",
          "y": "6365.84247204762",
          "series": "Out-of-fold ell"
        },
        {
          "x": "719",
          "y": "9920.9453125",
          "series": "Observed"
        },
        {
          "x": "719",
          "y": "6313.98519263345",
          "series": "Out-of-fold ell"
        },
        {
          "x": "720",
          "y": "8774.623046875",
          "series": "Observed"
        },
        {
          "x": "720",
          "y": "6447.19617860376",
          "series": "Out-of-fold ell"
        },
        {
          "x": "721",
          "y": "3880.8330078125",
          "series": "Observed"
        },
        {
          "x": "721",
          "y": "6232.19198688362",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/realdata-actual-person-R-summary.csv",
      "summarySHA256": "91260805e369f7bfa67a27971390802e484bad2cdc110fc2e7caea65d5419b47",
      "pointsFile": "metr21-programs/realdata-actual-person-R-points.csv",
      "pointsSHA256": "47bce82d352963f97c0dfc562b8c5fdc30517a7e1eab5e1d2ad0de90d35d5da6",
      "fullResultFile": "metr21-programs/realdata-actual-person-R-full.csv",
      "fullResultSHA256": "0ffd04cf490d920474daefb283c943bbef75b39411d70b3db529ddb46c39750e",
      "plotFile": "metr21-programs/realdata-actual-person-R.svg",
      "plotSHA256": "a5f1a4ee39db821e60fd70912132fde47dc07cf37817d54b430dc4765c27e0cc"
    },
    {
      "api": "aipw",
      "variant": "raw-support-undefined",
      "profile": "raw-support-undefined",
      "language": "Python",
      "file": "metr21-programs/aipw-raw-support-undefined-Python.py",
      "codeSHA256": "c2fb4a4054fe20390bd29ab949b64539ddccd6521936ae5ab388cb919ab769fd",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "원성향 지원 위반과 미정의",
        "en": "Raw e=0 makes the whole positive-weight score undefined"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"aipw\", \"key\": \"raw-support-undefined\", \"title\": \"Raw e=0 makes the whole positive-weight score undefined\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"pair0\", \"y\": 1, \"d\": 0, \"e\": 0, \"mu0\": 1, \"mu1\": 3}, {\"id\": \"b\", \"group\": \"pair0\", \"y\": 2, \"d\": 1, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"c\", \"group\": \"pair1\", \"y\": 3, \"d\": 0, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}, {\"id\": \"d\", \"group\": \"pair1\", \"y\": 4, \"d\": 1, \"e\": \"1/2\", \"mu0\": 1, \"mu1\": 3}]}, \"xLabel\": \"Constructed row order\", \"yLabel\": \"Pseudo-outcome units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "defined": "0",
        "theta": "undefined",
        "rowHC0": "undefined",
        "groupHC0": "undefined",
        "clippedRows": "undefined",
        "invalidRows": "1"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [],
      "summaryFile": "metr21-programs/aipw-raw-support-undefined-Python-summary.csv",
      "summarySHA256": "16675c2fc05bfa6cdff521426f77bfa8afe257e517d5ca6b741ae11fa95f9f36",
      "pointsFile": "metr21-programs/aipw-raw-support-undefined-Python-points.csv",
      "pointsSHA256": "25985483525a6b3c1c73189424f2105073009975762a4d5913b5d8798d2c5f7d",
      "fullResultFile": "metr21-programs/aipw-raw-support-undefined-Python-full.json",
      "fullResultSHA256": "04e442e336017002131b84ddff92e5d9dbec786398d69ac8dac38adfad5dfc65",
      "plotFile": "metr21-programs/aipw-raw-support-undefined-Python.svg",
      "plotSHA256": "2ed71a3b51bde3da41f31edbbcb9fa08096b5fddf34c8bd6f4b33147a4434a14"
    },
    {
      "api": "aipw",
      "variant": "raw-support-undefined",
      "profile": "raw-support-undefined",
      "language": "R",
      "file": "metr21-programs/aipw-raw-support-undefined-R.R",
      "codeSHA256": "5eb035d1434d52275becc5e4b1ad511f9b67f19e6c30f4fc0739b3663f2a734e",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "원성향 지원 위반과 미정의",
        "en": "Raw e=0 makes the whole positive-weight score undefined"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"aipw\",\"key\"=\"raw-support-undefined\",\"title\"=\"Raw e=0 makes the whole positive-weight score undefined\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"pair0\",\"y\"=1,\"d\"=0,\"e\"=0,\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"b\",\"group\"=\"pair0\",\"y\"=2,\"d\"=1,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"c\",\"group\"=\"pair1\",\"y\"=3,\"d\"=0,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3),list(\"id\"=\"d\",\"group\"=\"pair1\",\"y\"=4,\"d\"=1,\"e\"=\"1/2\",\"mu0\"=1,\"mu1\"=3))),\"xLabel\"=\"Constructed row order\",\"yLabel\"=\"Pseudo-outcome units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab=spec$yLabel,axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend('bottomleft',inset=c(0,-.25),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xpd=TRUE,cex=.8);mtext('Finite calculation;inspect code and full values. No automatic causal guarantee.',side=1,line=4.8,cex=.65)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "defined": "0",
        "theta": "undefined",
        "rowHC0": "undefined",
        "groupHC0": "undefined",
        "clippedRows": "undefined",
        "invalidRows": "1"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [],
      "summaryFile": "metr21-programs/aipw-raw-support-undefined-R-summary.csv",
      "summarySHA256": "b1c87ebfec36811e899b84b83f6edaafbbee1f99f545eb898f6d1b11185f72ba",
      "pointsFile": "metr21-programs/aipw-raw-support-undefined-R-points.csv",
      "pointsSHA256": "293edd9d790fd02722c629d7efcfa3ef4061d455e3a385f5cc6db5f3f2f406a6",
      "fullResultFile": "metr21-programs/aipw-raw-support-undefined-R-full.csv",
      "fullResultSHA256": "bdda742d9e340f353b7004dcc55739d11be150c83c8af0cd014edc7239abea88",
      "plotFile": "metr21-programs/aipw-raw-support-undefined-R.svg",
      "plotSHA256": "85fa4f4c39907babbf7b1ccc28dd5074f50962c49ea779d94296cd9e9120c1fa"
    },
    {
      "api": "crossfit",
      "variant": "group-leak-reject",
      "profile": "group-leak-reject",
      "language": "Python",
      "file": "metr21-programs/crossfit-group-leak-reject-Python.py",
      "codeSHA256": "e5719e2dbef8487d2f66f215db5317e0ebb5f6e3b8b73207a9f29b5fbb23a2a1",
      "returnCode": 1,
      "expectedRejection": true,
      "title": {
        "ko": "동일 그룹의 fold 누출 거절",
        "en": "A group spanning folds is genuinely rejected"
      },
      "code": "\"\"\"METR21 actual-source study. Python standard library only.\n\nRead three factual native CSV exports;reconstruct analytical frames and deterministic\ngroup folds. No engine,derived CSV,expected coefficients or model-answer import.\nNative R binary64 measurements are recovered from their17-digit exports then represented\nas exact Fraction storage values;this does not claim exact real-world measurement.\nActual-source AIPW uses the declared exact1/1000 grid,ties to even,then1/20 clipping.\nPLR uses unrounded exact nuisance predictions. No inference/causality certificate.\n\"\"\"\nfrom pathlib import Path\nfrom fractions import Fraction as Q\nfrom collections import defaultdict,Counter\nimport argparse,csv,json,hashlib,sys\nsys.set_int_max_str_digits(200000)\nZERO=Q(0);ONE=Q(1);LAM=Q(1,100);CLIP=Q(1,20);GRID=1000;K=5\nFILES={'country':'actual2500-county-mpdta-all6-fields.csv','person':'actual38408-NSW-all15-fields.csv','company':'actual410-NJPA-all46-fields.csv'}\ndef factual(p):\n with p.open(encoding='utf-8-sig',newline='')as f:return list(csv.DictReader(f))\ndef native(s):return None if s=='.'else Q.from_float(float(s))\ndef encoded(v):\n if v is None:return''\n if isinstance(v,(list,dict)):return json.dumps(v,ensure_ascii=False,separators=(',',':'),default=str)\n return str(v)\ndef write_csv(p,rr,head):\n with p.open('w',encoding='utf8',newline='')as f:\n  w=csv.DictWriter(f,fieldnames=head);w.writeheader();w.writerows({k:encoded(r.get(k))for k in head}for r in rr)\ndef reconstruct(source):\n raw={k:factual(source/v)for k,v in FILES.items()};assert[len(raw[k])for k in FILES]==[2500,38408,410]\n models={};ledger=[];by=defaultdict(dict)\n for r in raw['country']:by[r['countyreal']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[2003],g[2007];cohort=int(b['first.treat']);eligible=cohort in[0,2007];idx='county:'+str(int(key))\n  ledger.append(dict(kind='country',id=idx,nativeID=key,sourceRows=[int(r['sourceRow'])for r in g.values()],eligible=eligible,reason=''if eligible else'earlier-cohort-outside-declared-target',nativeTreatment=cohort))\n  if eligible:rr.append(dict(id=idx,group=idx,y=native(b['lemp']),d=Q(cohort==2007),x=[native(a['lemp']),native(a['lpop'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['country']=rr;by=defaultdict(dict)\n for r in raw['person']:by[r['id']][int(r['year'])]=r\n rr=[]\n for key,g in by.items():\n  a,b=g[1975],g[1978];eligible=a['experimental']=='1';idx='nsw-id:'+str(int(key));assert(a['treated']!='.')==eligible\n  ledger.append(dict(kind='person',id=idx,nativeID=key,sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],eligible=eligible,reason=''if eligible else'outside-full-experimental-frame',nativeTreatment=a['treated']))\n  if eligible:\n   assert a['treated']==b['treated']and a['re74']==b['re74']and a['black']==b['black']\n   rr.append(dict(id=idx,group=idx,y=native(b['re']),d=Q(a['treated']),x=[native(a['re74']),native(a['black'])],sourceRows=[int(a['sourceRow']),int(b['sourceRow'])],nativeID=key))\n models['person']=rr;rr=[]\n for r in raw['company']:\n  def fte(suffix):\n   ss=[r[t+suffix]for t in['EMPFT','NMGRS','EMPPT']]\n   return None if'.'in ss else Q(ss[0])+Q(ss[1])+Q(ss[2])/2\n  pre,post=fte(''),fte('2');eligible=pre is not None and post is not None;idx='njpa-row:'+r['sourceRow']\n  ledger.append(dict(kind='company',id=idx,nativeID=r['SHEET'],sourceRows=[int(r['sourceRow'])],eligible=eligible,reason=''if eligible else'baseline-FTE-missing'if pre is None else'post-FTE-missing',nativeTreatment=r['STATE']))\n  if eligible:rr.append(dict(id=idx,group='sheet:'+r['SHEET'],y=post,d=Q(r['STATE']),x=[pre]+[Q(int(r['CHAIN'])==j)for j in[2,3,4]]+[Q(r['CO_OWNED'])],sourceRows=[int(r['sourceRow'])],nativeID=r['SHEET']))\n models['company']=rr\n for kind,rr in models.items():\n  groups=sorted({r['group']for r in rr},key=lambda g:(hashlib.sha256(('METR21|'+kind+'|'+g).encode('utf8')).hexdigest(),g));folds={g:i%K for i,g in enumerate(groups)}\n  for r in rr:assert None not in r['x']and r['y']is not None;r['fold']=folds[r['group']];r['weight']=ONE\n assert[len(models[k])for k in FILES]==[440,722,384]\n return models,ledger\ndef solve(A,b):\n # Full rank on every declared actual-source training arm with positive ridge.\n n=len(b);R=[row[:]+[b[i]]for i,row in enumerate(A)]\n for j in range(n):\n  k=next((k for k in range(j,n)if R[k][j]),None)\n  if k is None:raise ValueError('actual-source-positive-ridge-normal-matrix-singular')\n  R[j],R[k]=R[k],R[j];d=R[j][j]\n  for t in range(j,n+1):R[j][t]/=d\n  for k in range(n):\n   if k==j:continue\n   d=R[k][j]\n   for t in range(j,n+1):R[k][t]-=d*R[j][t]\n return[row[-1]for row in R]\ndef fit(training,response):\n if not training:raise ValueError('empty-declared-training-arm')\n p=len(training[0]['x']);n=p+1;mass=Q(len(training));mins=[min(r['x'][j]for r in training)for j in range(p)];ranges=[max(r['x'][j]for r in training)-mins[j]or ONE for j in range(p)]\n def design(x):return[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]\n Z=[design(r['x'])for r in training];G=[[sum(z[j]*z[k]for z in Z)/mass+(LAM if j==k and j>0 else ZERO)for k in range(n)]for j in range(n)];h=[sum(z[j]*r[response]for z,r in zip(Z,training))/mass for j in range(n)];beta=solve(G,h)\n predict=lambda x:sum(v*b for v,b in zip(design(x),beta));mse=sum((r[response]-predict(r['x']))**2 for r in training)/mass;pen=LAM*sum(b*b for b in beta[1:])\n return dict(minima=mins,ranges=ranges,beta=beta,G=G,h=h,predict=predict,n=len(training),MSE=mse,penalty=pen,objective=mse+pen,training=training)\ndef variance(values,groups,den):\n gg=defaultdict(Q)\n for s,g in zip(values,groups):gg[g]+=s\n return sum(s*s for s in values)/(den*den),sum(s*s for s in gg.values())/(den*den)\ndef study(models):\n tables={name:[]for name in['model-frame','fold-training-membership','fold-fit-metrics','fold-coefficients','fold-crossproducts','heldout-predictions','residual-scores','propensity-ledger','aipw-pseudo-outcomes','source-estimates','source-chart-points']}\n for kind,rr in models.items():\n  pred={r['id']:{**r}for r in rr}\n  for r in rr:tables['model-frame'].append(dict(kind=kind,**r))\n  for k in range(K):\n   train=[r for r in rr if r['fold']!=k];test=[r for r in rr if r['fold']==k]\n   for name in['ell','m','mu0','mu1']:\n    tt=[r for r in train if name not in['mu0','mu1']or r['d']==int(name[-1])];f=fit(tt,'d'if name=='m'else'y')\n    tables['fold-fit-metrics'].append(dict(kind=kind,fold=k,target=name,nTrain=f['n'],nTest=len(test),rank=len(f['beta']),lambdaValue=LAM,MSE=f['MSE'],penalty=f['penalty'],objective=f['objective'],minima=f['minima'],ranges=f['ranges']))\n    for r in tt:tables['fold-training-membership'].append(dict(kind=kind,fold=k,target=name,id=r['id'],group=r['group'],sourceRows=r['sourceRows']))\n    for j,b in enumerate(f['beta']):tables['fold-coefficients'].append(dict(kind=kind,fold=k,target=name,index=j,beta=b,minimum=None if j==0 else f['minima'][j-1],range=None if j==0 else f['ranges'][j-1],RHS=f['h'][j]))\n    for j,row in enumerate(f['G']):\n     for l,v in enumerate(row):tables['fold-crossproducts'].append(dict(kind=kind,fold=k,target=name,row=j,column=l,value=v))\n    for r in test:pred[r['id']][name]=f['predict'](r['x'])\n  pp=[pred[r['id']]for r in rr];mass=Q(len(rr));num=den=ZERO\n  for r in pp:r['U']=r['y']-r['ell'];r['V']=r['d']-r['m'];r['VU']=r['V']*r['U'];r['V2']=r['V']**2;num+=r['VU'];den+=r['V2']\n  if not den:raise ValueError('actual-source-zero-residual-variation')\n  theta=num/den\n  for r in pp:\n   r['psi']=r['V']*(r['U']-theta*r['V']);r['grid']=Q(round(r['m']*GRID),GRID);r['used']=max(CLIP,min(ONE-CLIP,r['grid']));r['clipped']=r['grid']!=r['used'];r['pseudo']=r['mu1']-r['mu0']+((r['y']-r['mu1'])/r['used']if r['d']else-(r['y']-r['mu0'])/(ONE-r['used']))\n  tau=sum(r['pseudo']for r in pp)/mass;plrV=variance([r['psi']for r in pp],[r['group']for r in pp],den);aipwV=variance([r['pseudo']-tau for r in pp],[r['group']for r in pp],mass)\n  assert sum(r['psi']for r in pp)==0\n  unit={'country':'log teen-employment points','person':'recorded real earnings','company':'FTE employees'}[kind]\n  metrics={'rows':mass,'groups':Q(len({r['group']for r in pp})),'treated':sum(r['d']for r in pp),'comparison':mass-sum(r['d']for r in pp),'PLRtheta':theta,'PLRnumerator':num,'PLRdenominator':den,'PLRnormalization':den/mass,'PLRmeanScore':sum(r['psi']for r in pp)/mass,'PLRrowHC0':plrV[0],'PLRgroupHC0':plrV[1],'AIPWtheta':tau,'AIPWnumerator':sum(r['pseudo']for r in pp),'AIPWrowHC0':aipwV[0],'AIPWgroupHC0':aipwV[1],'rawPropensityMin':min(r['m']for r in pp),'rawPropensityMax':max(r['m']for r in pp),'grid':Q(GRID),'clip':CLIP,'clippedRows':Q(sum(r['clipped']for r in pp)),'lambda':LAM}\n  for name,v in metrics.items():\n   metricunit='rows'if name in['rows','treated','comparison','clippedRows']else'groups'if name=='groups'else unit if name in['PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator']else'('+unit+') squared'if name.endswith('HC0')else'dimensionless'\n   tables['source-estimates'].append(dict(kind=kind,metric=name,value=v,unit=metricunit))\n  for i,r in enumerate(pp):\n   basic=dict(kind=kind,index=i,id=r['id'],group=r['group'],fold=r['fold']);tables['heldout-predictions'].append({**basic,**{j:r[j]for j in['y','d','ell','m','mu0','mu1']}});tables['residual-scores'].append({**basic,**{j:r[j]for j in['U','V','VU','V2','psi']}});tables['propensity-ledger'].append({**basic,'raw':r['m'],'grid':r['grid'],'used':r['used'],'gridDelta':r['grid']-r['m'],'clipped':r['clipped']});tables['aipw-pseudo-outcomes'].append({**basic,'y':r['y'],'d':r['d'],'mu0':r['mu0'],'mu1':r['mu1'],'used':r['used'],'pseudo':r['pseudo'],'centeredScore':r['pseudo']-tau})\n   for chart,series,x,y in [('outcomes','observed',Q(i),r['y']),('outcomes','ell',Q(i),r['ell']),('residuals','U-on-V',r['V'],r['U']),('propensities','raw',Q(i),r['m']),('propensities','grid',Q(i),r['grid']),('propensities','used',Q(i),r['used']),('scores','PLR',Q(i),r['psi']),('scores','AIPW-centered',Q(i),r['pseudo']-tau)]:tables['source-chart-points'].append(dict(kind=kind,chart=chart,series=series,index=i,id=r['id'],x=x,y=y,unit=unit if chart!='propensities'else'probability prediction'))\n return tables\nHEAD={\n 'model-frame':['kind','id','group','fold','nativeID','sourceRows','y','d','x','weight'],\n 'full-selection-ledger':['kind','id','nativeID','sourceRows','eligible','reason','nativeTreatment'],\n 'fold-training-membership':['kind','fold','target','id','group','sourceRows'],\n 'fold-fit-metrics':['kind','fold','target','nTrain','nTest','rank','lambdaValue','MSE','penalty','objective','minima','ranges'],\n 'fold-coefficients':['kind','fold','target','index','beta','minimum','range','RHS'],\n 'fold-crossproducts':['kind','fold','target','row','column','value'],\n 'heldout-predictions':['kind','index','id','group','fold','y','d','ell','m','mu0','mu1'],\n 'residual-scores':['kind','index','id','group','fold','U','V','VU','V2','psi'],\n 'propensity-ledger':['kind','index','id','group','fold','raw','grid','used','gridDelta','clipped'],\n 'aipw-pseudo-outcomes':['kind','index','id','group','fold','y','d','mu0','mu1','used','pseudo','centeredScore'],\n 'source-estimates':['kind','metric','value','unit'],\n 'source-chart-points':['kind','chart','series','index','id','x','y','unit']}\ndef main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path,required=True);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);models,ledger=reconstruct(a.source_dir);tables=study(models);tables['full-selection-ledger']=ledger\n files=[]\n for name,rr in tables.items():\n  dest=a.out/('computed-'+name+'.csv');write_csv(dest,rr,HEAD[name]);files.append(dict(file=dest.name,rows=len(rr),columns=len(HEAD[name]),sha256=hashlib.sha256(dest.read_bytes()).hexdigest()))\n report=dict(chapter='METR-21',arithmetic='Exact Python Fraction finite storage arithmetic;not infinite measurement accuracy',models={k:len(v)for k,v in models.items()},parameters=dict(K=K,lambdaValue=str(LAM),scale='outer-training/arm-only range',propensityGrid=GRID,clip=str(CLIP)),files=files,claim='Finite declared post-level adjusted score experiments;no automatic causal or confidence certification')\n (a.out/'source-reproduction-summary.json').write_text(json.dumps(report,indent=2)+'\\n',encoding='utf8');print(json.dumps(report))\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC = json.loads('{\"operation\": \"crossfit\", \"key\": \"group-leak-reject\", \"title\": \"A group spanning folds is genuinely rejected\", \"input\": {\"rows\": [{\"id\": \"a\", \"group\": \"same-person\", \"fold\": 0, \"x\": [], \"d\": 0, \"y\": 1}, {\"id\": \"b\", \"group\": \"same-person\", \"fold\": 0, \"x\": [], \"d\": 1, \"y\": 4}, {\"id\": \"c\", \"group\": \"same-person\", \"fold\": 1, \"x\": [], \"d\": 0, \"y\": 2}, {\"id\": \"d\", \"group\": \"same-person\", \"fold\": 1, \"x\": [], \"d\": 1, \"y\": 5}], \"K\": 2, \"lambdaValue\": \"1/100\"}, \"xLabel\": \"Constructed row order\", \"yLabel\": \"Outcome units\"}')\n\n# Fixed worked examples use unit weights;this is not a general API port.\nimport html as _html\ndef fq(v):return v if isinstance(v,Q)else Q(str(v))\ndef mini_fit(rows,lam=Q(1,100),scale='range',response='y'):\n if not rows:return None\n p=len(rows[0]['x']);X=[[fq(x)for x in r['x']]for r in rows];Y=[fq(r[response])for r in rows];mass=Q(len(rows));mins=[min(x[j]for x in X)if scale=='range'else ZERO for j in range(p)];ranges=[(max(x[j]for x in X)-mins[j]or ONE)if scale=='range'else ONE for j in range(p)];Z=[[ONE]+[(x[j]-mins[j])/ranges[j]for j in range(p)]for x in X];G=[[sum(z[j]*z[k]for z in Z)/mass+(lam if j==k and j>0 else ZERO)for k in range(p+1)]for j in range(p+1)];h=[sum(z[j]*y for z,y in zip(Z,Y))/mass for j in range(p+1)];beta=solve(G,h)\n def predict(x):return sum(a*b for a,b in zip([ONE]+[(fq(x[j])-mins[j])/ranges[j]for j in range(p)],beta))\n mse=sum((y-predict(x))**2 for x,y in zip(X,Y))/mass;pen=lam*sum(v*v for v in beta[1:]);return dict(beta=beta,minima=mins,ranges=ranges,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\ndef cross_fixed(a):\n rows=a['rows'];K=a.get('K',2);mapping={}\n for i,r in enumerate(rows):\n  g=r.get('group',r.get('id',i));f=r['fold']\n  if g in mapping and mapping[g]!=f:raise ValueError('same-group-across-folds')\n  mapping[g]=f\n result=[];fits=[]\n for k in range(K):\n  training=[r for r in rows if r['fold']!=k];test=[r for r in rows if r['fold']==k];models={}\n  for name in['ell','m','mu0','mu1']:\n   tt=[r for r in training if name not in['mu0','mu1']or fq(r['d'])==int(name[-1])];models[name]=mini_fit(tt,fq(a.get('lambdaValue','1/100')),'range','d'if name=='m'else'y');fits.append(dict(fold=k,target=name,trainingIDs=[r.get('id',i)for i,r in enumerate(tt)],defined=models[name]is not None))\n  for r in test:result.append({**r,**{name:None if f is None else f['predict'](r['x'])for name,f in models.items()}})\n index={r['id']:i for i,r in enumerate(rows)};result.sort(key=lambda r:index[r['id']]);return result,fits\ndef ortho_fixed(rows):\n U=[fq(r['y'])-fq(r['ell'])for r in rows];V=[fq(r['d'])-fq(r['m'])for r in rows];num=sum(u*v for u,v in zip(U,V));den=sum(v*v for v in V)\n if not den:return dict(defined=False,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=None,rows=rows)\n theta=num/den;psi=[v*(u-theta*v)for u,v in zip(U,V)];groups=[r.get('group',r.get('id',i))for i,r in enumerate(rows)];vr,vg=variance(psi,groups,den);return dict(defined=True,theta=theta,numerator=num,denominator=den,rowHC0=vr,groupHC0=vg,meanScore=sum(psi)/len(rows),rows=[{**r,'U':u,'V':v,'psi':s}for r,u,v,s in zip(rows,U,V,psi)])\ndef aipw_fixed(a):\n out=[];c=None if a.get('clip')is None else fq(a['clip']);invalid=0\n for r in a['rows']:\n  y,d,e,m0,m1=[fq(r[k])for k in['y','d','e','mu0','mu1']];used=max(c,min(1-c,e))if c is not None else e;valid=0<used<1;invalid+=not valid;v=None if not valid else m1-m0+((y-m1)/used if d else-(y-m0)/(1-used));out.append({**r,'used':used,'clipped':used!=e,'pseudo':v})\n if invalid:return dict(defined=False,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=None,rows=out)\n tau=sum(r['pseudo']for r in out)/len(out);vr,vg=variance([r['pseudo']-tau for r in out],[r.get('group',r.get('id',i))for i,r in enumerate(out)],Q(len(out)));return dict(defined=True,theta=tau,rowHC0=vr,groupHC0=vg,clippedRows=sum(r['clipped']for r in out),rows=out)\ndef perturb_fixed(a):\n theta=fq(a['theta']);t=fq(a.get('t',1));n=Q(len(a['rows']));values=[]\n for r in a['rows']:\n  y,d,ell,m,aa,b=[fq(r[k])for k in['y','d','ell','m','a','b']];U=y-ell;V=d-m;values.append(dict(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b))\n M0=sum(r['base']for r in values)/n;M1=sum(r['linear']for r in values)/n;M2=sum(r['quadratic']for r in values)/n;return dict(defined=True,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\ndef fixed_study(spec,source):\n op,a=spec['operation'],spec['input'];points=[]\n def point(x,y,series):points.append(dict(x=fq(x),y=fq(y),series=series))\n if op=='nuisance':\n  f=mini_fit(a['rows'],fq(a.get('lambdaValue','1/100')),a.get('scale','range'));pred=[None if f is None else f['predict'](x)for x in a.get('queries',[])];full=dict(defined=f is not None,predictions=pred,fit=None if f is None else{k:v for k,v in f.items()if k!='predict'});summary=dict(defined=int(f is not None),nTrain=len(a['rows']),intercept=None if f is None else f['beta'][0],slope=None if f is None or len(f['beta'])<2 else f['beta'][1],MSE=None if f is None else f['MSE'],objective=None if f is None else f['objective'])\n  if f is not None:\n   for r in a['rows']:point(r['x'][0]if r['x']else 0,r['y'],'Training observed')\n   for x,y in zip(a.get('queries',[]),pred):point(x[0]if x else 0,y,'Query prediction')\n elif op=='crossfit':\n  rr,fits=cross_fixed(a);missing=sum(r[k]is None for r in rr for k in['mu0','mu1']);summary=dict(rows=len(rr),missingArmPredictions=missing,meanEll=sum(r['ell']for r in rr)/len(rr),meanM=sum(r['m']for r in rr)/len(rr));full=dict(defined=True,rows=rr,folds=fits)\n  for i,r in enumerate(rr):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n elif op=='orthogonal':\n  full=ortho_fixed(a['rows']);summary={k:full.get(k)for k in['defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for r in full['rows']:point(r['V'],r['U'],'U against V')\n elif op=='aipw':\n  full=aipw_fixed(a);summary={k:full.get(k)for k in['defined','theta','rowHC0','groupHC0','clippedRows','invalidRows']};summary['defined']=int(full['defined'])\n  if full['defined']:\n   for i,r in enumerate(full['rows']):point(i,r['pseudo'],'AIPW pseudo-outcome')\n elif op=='perturb':\n  full=perturb_fixed(a);summary={k:full[k]for k in['M0','M1','M2','t','direct']}\n  for i in range(21):t=Q(i-10,10);point(t,full['M0']+t*full['M1']+t*t*full['M2'],'Mean perturbed score')\n elif op=='realdata':\n  if source is None:raise ValueError('factual-source-directory-required')\n  models,ledger=reconstruct(source);kind=a['kind'];tables=study({kind:models[kind]});tables['full-selection-ledger']=[r for r in ledger if r['kind']==kind];mm={r['metric']:r['value']for r in tables['source-estimates']};summary={k:mm[k]for k in['rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax']};full=dict(defined=True,kind=kind,tables=tables)\n  for i,r in enumerate(tables['heldout-predictions']):point(i,r['y'],'Observed');point(i,r['ell'],'Out-of-fold ell')\n else:raise ValueError('unknown-fixed-operation')\n return summary,points,full\ndef fixed_svg(title,points,defined,reason,path):\n esc=lambda x:_html.escape(str(x),quote=True);parts=['<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"1000\" height=\"690\" viewBox=\"0 0 1000 690\"><rect width=\"1000\" height=\"690\" fill=\"white\"/><g font-family=\"Arial,sans-serif\" font-size=\"15\" fill=\"#203b46\"><text x=\"100\" y=\"38\" font-size=\"19\">'+esc(title)+'</text>']\n if not points:\n  parts.append('<text x=\"100\" y=\"170\" font-size=\"20\">Undefined: '+esc(reason or'No identified prediction')+'</text><text x=\"100\" y=\"215\">No fabricated zero points are plotted.</text>')\n else:\n  xs=[float(r['x'])for r in points];ys=[float(r['y'])for r in points];lo,hi=min(xs),max(xs);bot,top=min(ys),max(ys);dx=hi-lo or 1;dy=top-bot or 1;lo-=.04*dx;hi+=.04*dx;bot-=.08*dy;top+=.08*dy;X=lambda x:100+(x-lo)/(hi-lo)*830;Y=lambda y:500-(y-bot)/(top-bot)*400;series=list(dict.fromkeys(r['series']for r in points));colors={s:['#25647b','#aa4f3d','#64824c'][i%3]for i,s in enumerate(series)}\n  for i in range(5):\n   x=min(xs)+(max(xs)-min(xs))*i/4;y=bot+(top-bot)*i/4;parts.append('<path d=\"M'+str(X(x))+' 100V500M100 '+str(Y(y))+'H930\" stroke=\"#e0e7eb\"/><text x=\"'+str(X(x))+'\" y=\"527\" text-anchor=\"middle\">'+esc(format(x,'.5g'))+'</text><text x=\"90\" y=\"'+str(Y(y)+5)+'\" text-anchor=\"end\">'+esc(format(y,'.5g'))+'</text>')\n  for r in points:parts.append('<circle data-x=\"'+esc(r['x'])+'\" data-y=\"'+esc(r['y'])+'\" data-series=\"'+esc(r['series'])+'\" cx=\"'+str(X(float(r['x'])))+'\" cy=\"'+str(Y(float(r['y'])))+'\" r=\"'+('2'if len(points)>100 else'4')+'\" fill=\"'+colors[r['series']]+'\" fill-opacity=\".65\"/>')\n  parts.append('<path d=\"M100 100V500H930\" fill=\"none\" stroke=\"#405965\"/><text x=\"515\" y=\"559\" text-anchor=\"middle\">'+esc(FIXED_SPEC['xLabel'])+'</text><text x=\"25\" y=\"300\" transform=\"rotate(-90 25 300)\" text-anchor=\"middle\">'+esc(FIXED_SPEC['yLabel'])+'</text>')\n  for i,s in enumerate(series):parts.append('<circle cx=\"'+str(100+350*i)+'\" cy=\"585\" r=\"4\" fill=\"'+colors[s]+'\"/><text x=\"'+str(114+350*i)+'\" y=\"590\">'+esc(s)+'</text>')\n parts.append('<text x=\"100\" y=\"652\" font-size=\"13\">Finite worked calculation;inspect code,summary and exact values. No automatic causal guarantee.</text></g></svg>');path.write_text('\\n'.join(parts)+'\\n',encoding='utf8')\ndef fixed_main():\n p=argparse.ArgumentParser();p.add_argument('--source-dir',type=Path);p.add_argument('--out',type=Path,required=True);a=p.parse_args();a.out.mkdir(parents=True,exist_ok=True);summary,points,full=fixed_study(FIXED_SPEC,a.source_dir)\n write_csv(a.out/'plot-points.csv',points,['x','y','series']);write_csv(a.out/'summary.csv',[dict(metric=k,value='undefined'if v is None else format(float(v),'.9g'))for k,v in summary.items()],['metric','value']);(a.out/'full-values.json').write_text(json.dumps(full,ensure_ascii=False,indent=2,default=str)+'\\n',encoding='utf8');fixed_svg(FIXED_SPEC['title'],points,full.get('defined',True),full.get('reason'),a.out/'plot.svg');print(json.dumps({'profile':FIXED_SPEC['key'],'status':'normal','defined':full.get('defined',True),'summary':{k:'undefined'if v is None else format(float(v),'.9g')for k,v in summary.items()},'plotRows':len(points)}))\nif __name__=='__main__':fixed_main()\n",
      "arithmetic": "Python standard-library Fraction exact finite values; displays/SVG coordinates approximate",
      "summary": {
        "status": "rejected",
        "reason": "same-group-across-folds"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "status": "rejected",
        "reason": "same-group-across-folds"
      },
      "plot": null,
      "points": [],
      "publicDiagnostic": "A single group is placed in different folds and genuinely rejected. There is no fabricated numeric result or SVG."
    },
    {
      "api": "crossfit",
      "variant": "group-leak-reject",
      "profile": "group-leak-reject",
      "language": "R",
      "file": "metr21-programs/crossfit-group-leak-reject-R.R",
      "codeSHA256": "c51728e6ca64133f09cc03721cbc1b7008a37e285f953f1b5315638fe3be26c8",
      "returnCode": 1,
      "expectedRejection": true,
      "title": {
        "ko": "동일 그룹의 fold 누출 거절",
        "en": "A group spanning folds is genuinely rejected"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"crossfit\",\"key\"=\"group-leak-reject\",\"title\"=\"A group spanning folds is genuinely rejected\",\"input\"=list(\"rows\"=list(list(\"id\"=\"a\",\"group\"=\"same-person\",\"fold\"=0,\"x\"=list(),\"d\"=0,\"y\"=1),list(\"id\"=\"b\",\"group\"=\"same-person\",\"fold\"=0,\"x\"=list(),\"d\"=1,\"y\"=4),list(\"id\"=\"c\",\"group\"=\"same-person\",\"fold\"=1,\"x\"=list(),\"d\"=0,\"y\"=2),list(\"id\"=\"d\",\"group\"=\"same-person\",\"fold\"=1,\"x\"=list(),\"d\"=1,\"y\"=5)),\"K\"=2,\"lambdaValue\"=\"1/100\"),\"xLabel\"=\"Constructed row order\",\"yLabel\"=\"Outcome units\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab=spec$yLabel,axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend('bottomleft',inset=c(0,-.25),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xpd=TRUE,cex=.8);mtext('Finite calculation;inspect code and full values. No automatic causal guarantee.',side=1,line=4.8,cex=.65)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "status": "rejected",
        "reason": "same-group-across-folds"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "status": "rejected",
        "reason": "same-group-across-folds"
      },
      "plot": null,
      "points": [],
      "publicDiagnostic": "A single group is placed in different folds and genuinely rejected. There is no fabricated numeric result or SVG."
    },
    {
      "api": "realdata",
      "variant": "actual-company",
      "profile": "actual-company",
      "language": "R",
      "file": "metr21-programs/realdata-actual-company-R.R",
      "codeSHA256": "3341b67d7b54513e210f3e67767ebaeff8562a760a9a546b4d7c1c17b9cb82f6",
      "returnCode": 0,
      "expectedRejection": false,
      "title": {
        "ko": "점포 384개 완전쌍 전체",
        "en": "All 384 records: NJPA post FTE"
      },
      "code": "# METR21 standalone actual-source reproduction. Base R only;explicit numerical approximation.\n# Read3 factual CSVs;no engine,derived answers,model JSON or Python execution.\noptions(stringsAsFactors=FALSE,digits=17)\nU32 <- 4294967296\nwxor <- function(a,b) as.double(bitwXor(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwXor(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nwand <- function(a,b) as.double(bitwAnd(as.integer(a%%65536),as.integer(b%%65536)))+65536*as.double(bitwAnd(as.integer(floor(a/65536)),as.integer(floor(b/65536))))\nrotr <- function(a,n) floor(a/2^n)+(a%%2^n)*2^(32-n)\nhx <- function(s) strtoi(substr(s,1,4),16L)*65536+strtoi(substr(s,5,8),16L)\nSHA_K <- vapply(strsplit('428a2f98 71374491 b5c0fbcf e9b5dba5 3956c25b 59f111f1 923f82a4 ab1c5ed5 d807aa98 12835b01 243185be 550c7dc3 72be5d74 80deb1fe 9bdc06a7 c19bf174 e49b69c1 efbe4786 0fc19dc6 240ca1cc 2de92c6f 4a7484aa 5cb0a9dc 76f988da 983e5152 a831c66d b00327c8 bf597fc7 c6e00bf3 d5a79147 06ca6351 14292967 27b70a85 2e1b2138 4d2c6dfc 53380d13 650a7354 766a0abb 81c2c92e 92722c85 a2bfe8a1 a81a664b c24b8b70 c76c51a3 d192e819 d6990624 f40e3585 106aa070 19a4c116 1e376c08 2748774c 34b0bcb5 391c0cb3 4ed8aa4a 5b9cca4f 682e6ff3 748f82ee 78a5636f 84c87814 8cc70208 90befffa a4506ceb bef9a3f7 c67178f2',' ',fixed=TRUE)[[1]],hx,numeric(1))\nsha256 <- function(text){\n msg<-as.integer(charToRaw(enc2utf8(text)));bits<-length(msg)*8;msg<-c(msg,128L);while(length(msg)%%64!=56)msg<-c(msg,0L);msg<-c(msg,vapply(7:0,function(j)floor(bits/256^j)%%256,numeric(1)))\n H<-vapply(strsplit('6a09e667 bb67ae85 3c6ef372 a54ff53a 510e527f 9b05688c 1f83d9ab 5be0cd19',' ',fixed=TRUE)[[1]],hx,numeric(1))\n for(block in seq(1,length(msg),by=64)){\n  w<-numeric(64)\n  for(j in 0:15){b<-msg[block+4*j+0:3];w[j+1]<-sum(b*256^(3:0))}\n  for(j in 17:64){a<-w[j-15];b<-w[j-2];s0<-wxor(wxor(rotr(a,7),rotr(a,18)),floor(a/8));s1<-wxor(wxor(rotr(b,17),rotr(b,19)),floor(b/1024));w[j]<-(w[j-16]+s0+w[j-7]+s1)%%U32}\n  v<-H\n  for(j in 1:64){a<-v[1];b<-v[2];c<-v[3];d<-v[4];e<-v[5];f<-v[6];g<-v[7];h<-v[8];S1<-wxor(wxor(rotr(e,6),rotr(e,11)),rotr(e,25));ch<-wxor(wand(e,f),wand(U32-1-e,g));t1<-(h+S1+ch+SHA_K[j]+w[j])%%U32;S0<-wxor(wxor(rotr(a,2),rotr(a,13)),rotr(a,22));maj<-wxor(wxor(wand(a,b),wand(a,c)),wand(b,c));t2<-(S0+maj)%%U32;v<-c((t1+t2)%%U32,a,b,c,(d+t1)%%U32,e,f,g)}\n  H<-(H+v)%%U32\n }\n paste(vapply(H,function(x)sprintf('%04x%04x',as.integer(floor(x/65536)),as.integer(x%%65536)),character(1)),collapse='')\n}\nstopifnot(sha256('abc')=='ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad')\nnum<-function(x){z<-rep(NA_real_,length(x));ok<-x!='.';z[ok]<-as.numeric(x[ok]);z}\nesc<-function(x)paste0('\"',gsub('\"','\\\\\"',gsub('\\\\','\\\\\\\\',as.character(x),fixed=TRUE),fixed=TRUE),'\"')\njarray<-function(x,quoted=FALSE)paste0('[',paste(if(quoted)esc(x)else sprintf('%.17g',x),collapse=','),']')\nreadraw<-function(p)read.csv(p,colClasses='character',check.names=FALSE,na.strings=NULL)\ngroupindex<-function(d,key)split(seq_len(nrow(d)),factor(d[[key]],levels=unique(d[[key]])),drop=TRUE)\nK<-5;lambda<-0.01;clip<-0.05;grid<-1000\nreconstruct<-function(source){\n raw<-list(country=readraw(file.path(source,'actual2500-county-mpdta-all6-fields.csv')),person=readraw(file.path(source,'actual38408-NSW-all15-fields.csv')),company=readraw(file.path(source,'actual410-NJPA-all46-fields.csv')))\n stopifnot(identical(vapply(raw,nrow,integer(1)),c(country=2500L,person=38408L,company=410L)))\n models<-list();ledgers<-list();rr<-list();ll<-list()\n for(ii in groupindex(raw$country,'countyreal')){g<-raw$country[ii,,drop=FALSE];a<-g[g$year=='2003',,drop=FALSE];b<-g[g$year=='2007',,drop=FALSE];cohort<-as.integer(b$first.treat);ok<-cohort%in%c(0L,2007L);id<-paste0('county:',as.integer(b$countyreal));ll[[length(ll)+1]]<-data.frame(kind='country',id=id,nativeID=b$countyreal,sourceRows=jarray(as.numeric(g$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else'earlier-cohort-outside-declared-target',nativeTreatment=as.character(cohort));if(ok)rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$lemp),d=as.numeric(cohort==2007),x=c(num(a$lemp),num(a$lpop)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=b$countyreal)}\n models$country<-rr;ledgers$country<-do.call(rbind,ll);rr<-list();ll<-list()\n for(ii in groupindex(raw$person,'id')){g<-raw$person[ii,,drop=FALSE];a<-g[g$year=='1975',,drop=FALSE];b<-g[g$year=='1978',,drop=FALSE];ok<-a$experimental=='1';id<-paste0('nsw-id:',as.integer(a$id));stopifnot((a$treated!='.')==ok);ll[[length(ll)+1]]<-data.frame(kind='person',id=id,nativeID=a$id,sourceRows=jarray(as.numeric(c(a$sourceRow,b$sourceRow))),eligible=if(ok)'True'else'False',reason=if(ok)''else'outside-full-experimental-frame',nativeTreatment=a$treated);if(ok){stopifnot(a$treated==b$treated,a$re74==b$re74,a$black==b$black);rr[[length(rr)+1]]<-list(id=id,group=id,y=num(b$re),d=num(a$treated),x=c(num(a$re74),num(a$black)),sourceRows=c(as.integer(a$sourceRow),as.integer(b$sourceRow)),nativeID=a$id)}}\n models$person<-rr;ledgers$person<-do.call(rbind,ll);rr<-list();ll<-list()\n for(i in seq_len(nrow(raw$company))){r<-raw$company[i,,drop=FALSE];fte<-function(suffix){v<-num(unlist(r[paste0(c('EMPFT','NMGRS','EMPPT'),suffix)],use.names=FALSE));if(anyNA(v))NA_real_ else v[1]+v[2]+v[3]/2};pre<-fte('');post<-fte('2');ok<-!is.na(pre)&&!is.na(post);id<-paste0('njpa-row:',r$sourceRow);ll[[length(ll)+1]]<-data.frame(kind='company',id=id,nativeID=r$SHEET,sourceRows=jarray(as.numeric(r$sourceRow)),eligible=if(ok)'True'else'False',reason=if(ok)''else if(is.na(pre))'baseline-FTE-missing'else'post-FTE-missing',nativeTreatment=r$STATE);if(ok)rr[[length(rr)+1]]<-list(id=id,group=paste0('sheet:',r$SHEET),y=post,d=num(r$STATE),x=c(pre,as.numeric(as.integer(r$CHAIN)==2:4),num(r$CO_OWNED)),sourceRows=as.integer(r$sourceRow),nativeID=r$SHEET)}\n models$company<-rr;ledgers$company<-do.call(rbind,ll)\n for(kind in names(models)){rr<-models[[kind]];gg<-unique(vapply(rr,`[[`,character(1),'group'));hash<-vapply(gg,function(g)sha256(paste0('METR21|',kind,'|',g)),character(1));gg<-gg[order(hash,gg,method='radix')];fold<-setNames((seq_along(gg)-1)%%K,gg);for(i in seq_along(rr)){rr[[i]]$fold<-unname(fold[rr[[i]]$group]);rr[[i]]$weight<-1};models[[kind]]<-rr}\n stopifnot(identical(vapply(models,length,integer(1)),c(country=440L,person=722L,company=384L)))\n list(models=models,ledger=do.call(rbind,ledgers))\n}\nfit<-function(training,response){\n stopifnot(length(training)>0);X<-do.call(rbind,lapply(training,`[[`,'x'));Y<-vapply(training,`[[`,numeric(1),response);mn<-apply(X,2,min);rg<-apply(X,2,max)-mn;rg[rg==0]<-1;Z<-cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'));G<-crossprod(Z)/nrow(Z);diag(G)[-1]<-diag(G)[-1]+lambda;h<-as.vector(crossprod(Z,Y)/nrow(Z));beta<-as.vector(solve(G,h));mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lambda*sum(beta[-1]^2)\n list(minima=mn,ranges=rg,beta=beta,G=G,h=h,n=length(training),MSE=mse,penalty=pen,objective=mse+pen,predict=function(x)sum(c(1,(x-mn)/rg)*beta))\n}\nvariance<-function(scores,groups,den)c(sum(scores^2)/den^2,sum(tapply(scores,groups,sum)^2)/den^2)\nstudy<-function(models){\n tables<-new.env();add<-function(name,d){if(!exists(name,tables,inherits=FALSE))tables[[name]]<-list();z<-tables[[name]];z[[length(z)+1]]<-d;tables[[name]]<-z}\n for(kind in names(models)){\n  rr<-models[[kind]];N<-length(rr);ids<-vapply(rr,`[[`,character(1),'id');groups<-vapply(rr,`[[`,character(1),'group');fold<-vapply(rr,`[[`,numeric(1),'fold');Y<-vapply(rr,`[[`,numeric(1),'y');D<-vapply(rr,`[[`,numeric(1),'d');P<-matrix(NA_real_,N,4,dimnames=list(NULL,c('ell','m','mu0','mu1')))\n  add('model-frame',data.frame(kind=kind,id=ids,group=groups,fold=fold,nativeID=vapply(rr,`[[`,character(1),'nativeID'),sourceRows=vapply(rr,function(r)jarray(r$sourceRows),character(1)),y=Y,d=D,x=vapply(rr,function(r)jarray(r$x,TRUE),character(1)),weight=1))\n  for(k in 0:(K-1))for(target in colnames(P)){\n   ti<-which(fold!=k);test<-which(fold==k);if(target%in%c('mu0','mu1'))ti<-ti[D[ti]==as.numeric(substr(target,3,3))];tt<-rr[ti];f<-fit(tt,if(target=='m')'d'else'y');P[test,target]<-vapply(rr[test],function(r)f$predict(r$x),numeric(1))\n   add('fold-fit-metrics',data.frame(kind=kind,fold=k,target=target,nTrain=f$n,nTest=length(test),rank=length(f$beta),lambdaValue=lambda,MSE=f$MSE,penalty=f$penalty,objective=f$objective,minima=jarray(f$minima,TRUE),ranges=jarray(f$ranges,TRUE)))\n   add('fold-training-membership',data.frame(kind=kind,fold=k,target=target,id=ids[ti],group=groups[ti],sourceRows=vapply(tt,function(r)jarray(r$sourceRows),character(1))))\n   add('fold-coefficients',data.frame(kind=kind,fold=k,target=target,index=seq_along(f$beta)-1,beta=f$beta,minimum=c(NA,f$minima),range=c(NA,f$ranges),RHS=f$h))\n   for(j in seq_len(nrow(f$G)))add('fold-crossproducts',data.frame(kind=kind,fold=k,target=target,row=j-1,column=0:(ncol(f$G)-1),value=f$G[j,]))\n  }\n  U<-Y-P[,'ell'];V<-D-P[,'m'];VU<-V*U;V2<-V^2;den<-sum(V2);stopifnot(den>0);num<-sum(VU);theta<-num/den;psi<-V*(U-theta*V);gridvalue<-round(P[,'m']*grid)/grid;used<-pmax(clip,pmin(1-clip,gridvalue));clipped<-gridvalue!=used;pseudo<-P[,'mu1']-P[,'mu0']+ifelse(D==1,(Y-P[,'mu1'])/used,-(Y-P[,'mu0'])/(1-used));tau<-mean(pseudo);vp<-variance(psi,groups,den);va<-variance(pseudo-tau,groups,N)\n  unit<-switch(kind,country='log teen-employment points',person='recorded real earnings',company='FTE employees')\n  metrics<-c(rows=N,groups=length(unique(groups)),treated=sum(D),comparison=N-sum(D),PLRtheta=theta,PLRnumerator=num,PLRdenominator=den,PLRnormalization=den/N,PLRmeanScore=mean(psi),PLRrowHC0=vp[1],PLRgroupHC0=vp[2],AIPWtheta=tau,AIPWnumerator=sum(pseudo),AIPWrowHC0=va[1],AIPWgroupHC0=va[2],rawPropensityMin=min(P[,'m']),rawPropensityMax=max(P[,'m']),grid=grid,clip=clip,clippedRows=sum(clipped),lambda=lambda)\n  metricunit<-vapply(names(metrics),function(n)if(n%in%c('rows','treated','comparison','clippedRows'))'rows'else if(n=='groups')'groups'else if(n%in%c('PLRtheta','PLRnumerator','PLRmeanScore','AIPWtheta','AIPWnumerator'))unit else if(grepl('HC0$',n))paste0('(',unit,') squared')else'dimensionless',character(1));add('source-estimates',data.frame(kind=kind,metric=names(metrics),value=unname(metrics),unit=unname(metricunit)))\n  basic<-data.frame(kind=kind,index=seq_len(N)-1,id=ids,group=groups,fold=fold);add('heldout-predictions',cbind(basic,y=Y,d=D,as.data.frame(P)));add('residual-scores',cbind(basic,U=U,V=V,VU=VU,V2=V2,psi=psi));add('propensity-ledger',cbind(basic,raw=P[,'m'],grid=gridvalue,used=used,gridDelta=gridvalue-P[,'m'],clipped=ifelse(clipped,'True','False')));add('aipw-pseudo-outcomes',cbind(basic,y=Y,d=D,mu0=P[,'mu0'],mu1=P[,'mu1'],used=used,pseudo=pseudo,centeredScore=pseudo-tau))\n  vals<-list(list('outcomes','observed',seq_len(N)-1,Y),list('outcomes','ell',seq_len(N)-1,P[,'ell']),list('residuals','U-on-V',V,U),list('propensities','raw',seq_len(N)-1,P[,'m']),list('propensities','grid',seq_len(N)-1,gridvalue),list('propensities','used',seq_len(N)-1,used),list('scores','PLR',seq_len(N)-1,psi),list('scores','AIPW-centered',seq_len(N)-1,pseudo-tau))\n  # Match Python's row-major graph order instead of a series-major permutation.\n  charts<-do.call(rbind,lapply(seq_along(vals),function(j){v<-vals[[j]];data.frame(kind=kind,chart=v[[1]],series=v[[2]],index=seq_len(N)-1,id=ids,x=v[[3]],y=v[[4]],unit=if(v[[1]]=='propensities')'probability prediction'else unit,seriesOrder=j)}));charts<-charts[order(charts$index,charts$seriesOrder),];charts$seriesOrder<-NULL;add('source-chart-points',charts)\n }\n setNames(lapply(ls(tables),function(n)do.call(rbind,tables[[n]])),ls(tables))\n}\nmain<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript metr21-reproduce.R SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);a<-reconstruct(args[1]);tables<-study(a$models);tables[['full-selection-ledger']]<-a$ledger\n for(name in names(tables))write.csv(tables[[name]],file.path(args[2],paste0('computed-',name,'.csv')),row.names=FALSE,na='',quote=TRUE)\n writeLines(c('METR21 base R numerical approximation;not an exact Fraction oracle.','Full source frames:440counties,722experimental people,384complete stores.','K5;lambda0.01;training/arm-only range;AIPW nearest0.001 grid thenclip0.05.','Raw m is retained for PLR;grid andclipping are explicit finite-score changes.','No automatic causal or confidence certification.'),file.path(args[2],'source-reproduction-summary.txt'));cat('PASS baseR full source outputs:',length(tables),'CSV\\n')\n}\n\n\n\n# Independent standalone fixed configuration;no expected answers embedded.\nFIXED_SPEC <- list(\"operation\"=\"realdata\",\"key\"=\"actual-company\",\"title\"=\"All 384 records: NJPA post FTE\",\"input\"=list(\"kind\"=\"company\"),\"xLabel\"=\"Declared source order, not time\",\"yLabel\"=\"FTE employees\")\n\n# Fixed examples use declared unit weights;not a general sixAPI library.\nnq<-function(v){if(length(v)!=1||is.null(v))stop('fixed numeric scalar required');s<-as.character(v);z<-strsplit(s,'/',fixed=TRUE)[[1]];if(length(z)==2)as.numeric(z[1])/as.numeric(z[2])else as.numeric(s)}\nmini_fit<-function(rows,lam=0.01,scale='range',response='y'){\n if(length(rows)==0)return(NULL)\n n<-length(rows);p<-length(rows[[1]]$x);X<-if(p)do.call(rbind,lapply(rows,function(r)vapply(r$x,nq,numeric(1))))else matrix(numeric(0),nrow=n,ncol=0);Y<-vapply(rows,function(r)nq(r[[response]]),numeric(1));mn<-if(p&&scale=='range')apply(X,2,min)else rep(0,p);rg<-if(p&&scale=='range')apply(X,2,max)-mn else rep(1,p);rg[rg==0]<-1;Z<-if(p)cbind(1,sweep(sweep(X,2,mn,'-'),2,rg,'/'))else matrix(1,nrow=n,ncol=1);G<-crossprod(Z)/n;if(p)diag(G)[-1]<-diag(G)[-1]+lam;h<-as.vector(crossprod(Z,Y)/n);beta<-as.vector(solve(G,h));predict<-function(x)sum(c(1,if(p)(vapply(x,nq,numeric(1))-mn)/rg else numeric(0))*beta);mse<-mean((Y-as.vector(Z%*%beta))^2);pen<-lam*sum(beta[-1]^2);list(beta=beta,minima=mn,ranges=rg,MSE=mse,penalty=pen,objective=mse+pen,predict=predict)\n}\ncross_fixed<-function(a){\n rr<-a$rows;K<-if(is.null(a$K))2 else a$K;keys<-vapply(rr,function(r)as.character(r$group),character(1));fold<-vapply(rr,function(r)as.numeric(r$fold),numeric(1));for(g in unique(keys))if(length(unique(fold[keys==g]))!=1)stop('same-group-across-folds')\n result<-vector('list',length(rr));fits<-list()\n for(k in 0:(K-1)){\n  train<-rr[fold!=k];test<-which(fold==k);models<-list()\n  for(target in c('ell','m','mu0','mu1')){tt<-train;if(target%in%c('mu0','mu1'))tt<-Filter(function(r)nq(r$d)==as.numeric(substr(target,3,3)),tt);f<-mini_fit(tt,nq(a$lambdaValue),'range',if(target=='m')'d'else'y');models[target]<-list(f);fits[[length(fits)+1]]<-list(fold=k,target=target,trainingIDs=lapply(tt,`[[`,'id'),defined=!is.null(f))}\n  for(i in test){r<-rr[[i]];for(target in names(models))r[target]<-list(if(is.null(models[[target]]))NULL else models[[target]]$predict(r$x));result[[i]]<-r}\n }\n list(rows=result,folds=fits)\n}\northo_fixed<-function(rows){\n U<-vapply(rows,function(r)nq(r$y)-nq(r$ell),numeric(1));V<-vapply(rows,function(r)nq(r$d)-nq(r$m),numeric(1));num<-sum(U*V);den<-sum(V^2)\n if(den==0)return(list(defined=FALSE,reason='zero-residual-treatment-variation',numerator=num,denominator=den,theta=NULL,rows=rows))\n theta<-num/den;psi<-V*(U-theta*V);groups<-vapply(seq_along(rows),function(i)if(!is.null(rows[[i]]$group))as.character(rows[[i]]$group)else if(!is.null(rows[[i]]$id))as.character(rows[[i]]$id)else as.character(i-1),character(1));v<-variance(psi,groups,den)\n for(i in seq_along(rows)){rows[[i]]$U<-U[i];rows[[i]]$V<-V[i];rows[[i]]$psi<-psi[i]}\n list(defined=TRUE,theta=theta,numerator=num,denominator=den,rowHC0=v[1],groupHC0=v[2],meanScore=mean(psi),rows=rows)\n}\naipw_fixed<-function(a){\n rows<-a$rows;c<-if(is.null(a$clip))NULL else nq(a$clip);out<-list();invalid<-0\n for(r in rows){y<-nq(r$y);d<-nq(r$d);e<-nq(r$e);m0<-nq(r$mu0);m1<-nq(r$mu1);used<-if(is.null(c))e else max(c,min(1-c,e));valid<-used>0&&used<1;invalid<-invalid+!valid;r$used<-used;r$clipped<-used!=e;r['pseudo']<-list(if(!valid)NULL else m1-m0+if(d==1)(y-m1)/used else-(y-m0)/(1-used));out[[length(out)+1]]<-r}\n if(invalid)return(list(defined=FALSE,reason='at-least-one-positive-weight-propensity-invalid',invalidRows=invalid,theta=NULL,rows=out))\n pseudo<-vapply(out,`[[`,numeric(1),'pseudo');tau<-mean(pseudo);groups<-vapply(seq_along(out),function(i)if(!is.null(out[[i]]$group))as.character(out[[i]]$group)else if(!is.null(out[[i]]$id))as.character(out[[i]]$id)else as.character(i-1),character(1));v<-variance(pseudo-tau,groups,length(out));list(defined=TRUE,theta=tau,rowHC0=v[1],groupHC0=v[2],clippedRows=sum(vapply(out,`[[`,logical(1),'clipped')),rows=out)\n}\nperturb_fixed<-function(a){\n theta<-nq(a$theta);t<-nq(a$t);values<-lapply(a$rows,function(r){y<-nq(r$y);d<-nq(r$d);ell<-nq(r$ell);m<-nq(r$m);aa<-nq(r$a);b<-nq(r$b);U<-y-ell;V<-d-m;list(base=V*(U-theta*V),linear=-b*U-V*aa+2*theta*V*b,quadratic=aa*b-theta*b*b)})\n means<-function(n)mean(vapply(values,`[[`,numeric(1),n));M0<-means('base');M1<-means('linear');M2<-means('quadratic');list(defined=TRUE,M0=M0,M1=M1,M2=M2,t=t,direct=M0+t*M1+t*t*M2,rows=values)\n}\nfixed_study<-function(spec,source){\n op<-spec$operation;a<-spec$input;points<-data.frame(x=numeric(0),y=numeric(0),series=character(0));point<-function(x,y,series){points[nrow(points)+1,]<<-list(nq(x),nq(y),series)};take<-function(full,names){setNames(vapply(names,function(k)if(is.null(full[[k]]))NA_real_ else as.numeric(full[[k]]),numeric(1)),names)}\n if(op=='nuisance'){\n  f<-mini_fit(a$rows,nq(a$lambdaValue),a$scale);pred<-lapply(a$queries,function(x)if(is.null(f))NULL else f$predict(x));ff<-f;if(!is.null(ff))ff$predict<-NULL;full<-list(defined=!is.null(f),predictions=pred,fit=ff);summary<-c(defined=as.numeric(!is.null(f)),nTrain=length(a$rows),intercept=if(is.null(f))NA_real_ else f$beta[1],slope=if(is.null(f)||length(f$beta)<2)NA_real_ else f$beta[2],MSE=if(is.null(f))NA_real_ else f$MSE,objective=if(is.null(f))NA_real_ else f$objective)\n  if(!is.null(f)){for(r in a$rows)point(if(length(r$x))r$x[[1]]else 0,r$y,'Training observed');for(i in seq_along(pred))point(if(length(a$queries[[i]]))a$queries[[i]][[1]]else 0,pred[[i]],'Query prediction')}\n }else if(op=='crossfit'){\n  z<-cross_fixed(a);rr<-z$rows;missing<-sum(vapply(rr,function(r)as.numeric(is.null(r$mu0))+as.numeric(is.null(r$mu1)),numeric(1)));summary<-c(rows=length(rr),missingArmPredictions=missing,meanEll=mean(vapply(rr,`[[`,numeric(1),'ell')),meanM=mean(vapply(rr,`[[`,numeric(1),'m')));full<-list(defined=TRUE,rows=rr,folds=z$folds);for(i in seq_along(rr)){point(i-1,rr[[i]]$y,'Observed');point(i-1,rr[[i]]$ell,'Out-of-fold ell')}\n }else if(op=='orthogonal'){\n  full<-ortho_fixed(a$rows);summary<-take(full,c('defined','theta','numerator','denominator','rowHC0','groupHC0','meanScore'));if(full$defined)for(r in full$rows)point(r$V,r$U,'U against V')\n }else if(op=='aipw'){\n  full<-aipw_fixed(a);summary<-take(full,c('defined','theta','rowHC0','groupHC0','clippedRows','invalidRows'));if(full$defined)for(i in seq_along(full$rows))point(i-1,full$rows[[i]]$pseudo,'AIPW pseudo-outcome')\n }else if(op=='perturb'){\n  full<-perturb_fixed(a);summary<-take(full,c('M0','M1','M2','t','direct'));for(i in 0:20){t<-(i-10)/10;point(t,full$M0+t*full$M1+t*t*full$M2,'Mean perturbed score')}\n }else if(op=='realdata'){\n  if(is.null(source)||!nzchar(source))stop('factual-source-directory-required');all<-reconstruct(source);kind<-a$kind;tables<-study(setNames(list(all$models[[kind]]),kind));tables[['full-selection-ledger']]<-all$ledger[all$ledger$kind==kind,,drop=FALSE];m<-tables[['source-estimates']];mm<-setNames(m$value,m$metric);summary<-mm[c('rows','groups','PLRtheta','AIPWtheta','clippedRows','rawPropensityMin','rawPropensityMax')];full<-list(defined=TRUE,kind=kind,tables=tables);rr<-tables[['heldout-predictions']];for(i in seq_len(nrow(rr))){point(i-1,rr$y[i],'Observed');point(i-1,rr$ell[i],'Out-of-fold ell')}\n }else stop('unknown-fixed-operation')\n list(summary=summary,points=points,full=full)\n}\nwrite_full<-function(full,file){\n con<-file(file,open='wt',encoding='UTF-8');on.exit(close(con));writeLines('path,type,value',con)\n quoted<-function(x)paste0('\"',gsub('\"','\"\"',as.character(x),fixed=TRUE),'\"')\n leaf<-function(path,type,v)writeLines(paste(quoted(path),quoted(type),quoted(v),sep=','),con)\n walk<-function(x,path){\n  if(is.null(x)){leaf(path,'undefined','undefined');return()}\n  if(is.data.frame(x)){for(i in seq_len(nrow(x)))for(n in names(x))walk(x[[n]][i],paste0(path,'[',i-1,'].',n));return()}\n  if(is.list(x)){if(!length(x)){leaf(path,'empty','empty');return()};nm<-names(x);for(i in seq_along(x))walk(x[[i]],if(!is.null(nm)&&nzchar(nm[i]))paste0(path,'.',nm[i])else paste0(path,'[',i-1,']'));return()}\n  if(!length(x)){leaf(path,'empty','empty');return()}\n  if(length(x)>1){for(i in seq_along(x))walk(x[i],paste0(path,'[',i-1,']'));return()}\n  if(is.na(x))leaf(path,'undefined','undefined')else if(is.numeric(x))leaf(path,'number',sprintf('%.17g',x))else if(is.logical(x))leaf(path,'boolean',if(x)'true'else'false')else leaf(path,'string',x)\n }\n walk(full,'root')\n}\nfixed_svg<-function(spec,points,full,file){\n svg(file,width=10,height=6.9,pointsize=14,family='Arial');on.exit(dev.off());par(mar=c(6,6,4,2))\n if(nrow(points)==0){plot.new();text(0.02,0.85,spec$title,adj=0,cex=1.05);text(0.02,0.65,paste0('Undefined: ',if(is.null(full$reason))'No identified prediction'else full$reason),adj=0,cex=.95);text(0.02,0.5,'No fabricated zero points are plotted.',adj=0,cex=.9);return()}\n par(mar=c(8,8,4,2));xr<-range(points$x);yr<-range(points$y);dx<-if(diff(xr)==0)1 else diff(xr);dy<-if(diff(yr)==0)1 else diff(yr);xr<-xr+c(-.04,.04)*dx;yr<-yr+c(-.08,.08)*dy;plot(NA,xlim=xr,ylim=yr,xlab=spec$xLabel,ylab='',axes=FALSE,main=spec$title,cex.main=1);xt<-seq(min(points$x),max(points$x),length.out=5);yt<-seq(yr[1],yr[2],length.out=5);abline(v=xt,h=yt,col='#e0e7eb');axis(1,at=xt,labels=sprintf('%.5g',xt),cex.axis=.8);axis(2,at=yt,labels=sprintf('%.5g',yt),las=1,cex.axis=.8);mtext(spec$yLabel,side=2,line=6,cex=.9);box(bty='l',col='#405965');series<-unique(points$series);colors<-setNames(c('#25647b','#aa4f3d','#64824c')[seq_along(series)],series);for(s in series){z<-points[points$series==s,,drop=FALSE];points(z$x,z$y,pch=16,col=adjustcolor(colors[s],alpha.f=.65),cex=if(nrow(points)>100).35 else .8)};legend(x=grconvertX(.18,from='ndc',to='user'),y=grconvertY(.095,from='ndc',to='user'),legend=series,col=colors,pch=16,ncol=min(2,length(series)),bty='n',xjust=0,yjust=.5,xpd=NA,cex=.8);text(grconvertX(.18,from='ndc',to='user'),grconvertY(.025,from='ndc',to='user'),'Finite calculation; inspect code and full values. No automatic causal guarantee.',adj=c(0,.5),cex=.65,xpd=NA)\n}\nfixed_main<-function(){\n args<-commandArgs(trailingOnly=TRUE);if(length(args)!=2)stop('Usage:Rscript FIXED.R FACTUAL_SOURCE_DIRECTORY OUTPUT_DIRECTORY');dir.create(args[2],recursive=TRUE,showWarnings=FALSE);r<-fixed_study(FIXED_SPEC,args[1]);s<-ifelse(is.na(r$summary),'undefined',sprintf('%.9g',r$summary));write.csv(data.frame(metric=names(s),value=unname(s)),file.path(args[2],'summary.csv'),row.names=FALSE);write.csv(r$points,file.path(args[2],'plot-points.csv'),row.names=FALSE);write_full(r$full,file.path(args[2],'full-values.csv'));fixed_svg(FIXED_SPEC,r$points,r$full,file.path(args[2],'plot.svg'));cat('PASS fixed profile:',FIXED_SPEC$key,';plot rows:',nrow(r$points),'\\n')\n}\nif(sys.nframe()==0L)fixed_main()\n",
      "arithmetic": "Base R explicitly approximate finite arithmetic, not exact rational values",
      "summary": {
        "rows": "384",
        "groups": "383",
        "PLRtheta": "1.15262893",
        "AIPWtheta": "0.912249575",
        "clippedRows": "0",
        "rawPropensityMin": "0.631501042",
        "rawPropensityMax": "0.889101706"
      },
      "fullResultEmbedded": false,
      "plotEmbedded": false,
      "full": {
        "notice": "The linked JSON (Python) or flattened CSV (R) preserves the complete bounded standalone result. This short notice is not the full result."
      },
      "plot": null,
      "points": [
        {
          "x": "0",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "0",
          "y": "28.7919634945803",
          "series": "Out-of-fold ell"
        },
        {
          "x": "1",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "1",
          "y": "14.778941691502",
          "series": "Out-of-fold ell"
        },
        {
          "x": "2",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "2",
          "y": "11.9686172760259",
          "series": "Out-of-fold ell"
        },
        {
          "x": "3",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "3",
          "y": "25.9198669195335",
          "series": "Out-of-fold ell"
        },
        {
          "x": "4",
          "y": "35.5",
          "series": "Observed"
        },
        {
          "x": "4",
          "y": "22.9211274357828",
          "series": "Out-of-fold ell"
        },
        {
          "x": "5",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "5",
          "y": "37.7286243936119",
          "series": "Out-of-fold ell"
        },
        {
          "x": "6",
          "y": "36.5",
          "series": "Observed"
        },
        {
          "x": "6",
          "y": "24.2570871312955",
          "series": "Out-of-fold ell"
        },
        {
          "x": "7",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "7",
          "y": "12.7133390176119",
          "series": "Out-of-fold ell"
        },
        {
          "x": "8",
          "y": "8.5",
          "series": "Observed"
        },
        {
          "x": "8",
          "y": "12.3772201959152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "9",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "9",
          "y": "19.2096967951616",
          "series": "Out-of-fold ell"
        },
        {
          "x": "10",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "10",
          "y": "33.1534198488273",
          "series": "Out-of-fold ell"
        },
        {
          "x": "11",
          "y": "30.5",
          "series": "Observed"
        },
        {
          "x": "11",
          "y": "23.9446987130307",
          "series": "Out-of-fold ell"
        },
        {
          "x": "12",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "12",
          "y": "25.2172991349676",
          "series": "Out-of-fold ell"
        },
        {
          "x": "13",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "13",
          "y": "20.9851955844852",
          "series": "Out-of-fold ell"
        },
        {
          "x": "14",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "14",
          "y": "14.4261990232596",
          "series": "Out-of-fold ell"
        },
        {
          "x": "15",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "15",
          "y": "12.1710741811905",
          "series": "Out-of-fold ell"
        },
        {
          "x": "16",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "16",
          "y": "18.9032095964555",
          "series": "Out-of-fold ell"
        },
        {
          "x": "17",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "17",
          "y": "23.1154220750934",
          "series": "Out-of-fold ell"
        },
        {
          "x": "18",
          "y": "14.5",
          "series": "Observed"
        },
        {
          "x": "18",
          "y": "20.1842986008166",
          "series": "Out-of-fold ell"
        },
        {
          "x": "19",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "19",
          "y": "20.0543010529098",
          "series": "Out-of-fold ell"
        },
        {
          "x": "20",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "20",
          "y": "24.1993777396241",
          "series": "Out-of-fold ell"
        },
        {
          "x": "21",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "21",
          "y": "20.7899229522266",
          "series": "Out-of-fold ell"
        },
        {
          "x": "22",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "22",
          "y": "19.5821029417911",
          "series": "Out-of-fold ell"
        },
        {
          "x": "23",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "23",
          "y": "21.6229233961218",
          "series": "Out-of-fold ell"
        },
        {
          "x": "24",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "24",
          "y": "18.8219383438771",
          "series": "Out-of-fold ell"
        },
        {
          "x": "25",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "25",
          "y": "19.1352698968395",
          "series": "Out-of-fold ell"
        },
        {
          "x": "26",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "26",
          "y": "25.3106232338978",
          "series": "Out-of-fold ell"
        },
        {
          "x": "27",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "27",
          "y": "23.0717001154302",
          "series": "Out-of-fold ell"
        },
        {
          "x": "28",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "28",
          "y": "25.1303084764663",
          "series": "Out-of-fold ell"
        },
        {
          "x": "29",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "29",
          "y": "23.2591198796718",
          "series": "Out-of-fold ell"
        },
        {
          "x": "30",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "30",
          "y": "23.8768000001129",
          "series": "Out-of-fold ell"
        },
        {
          "x": "31",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "31",
          "y": "22.8131944812405",
          "series": "Out-of-fold ell"
        },
        {
          "x": "32",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "32",
          "y": "22.2372930619468",
          "series": "Out-of-fold ell"
        },
        {
          "x": "33",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "33",
          "y": "14.2525720258043",
          "series": "Out-of-fold ell"
        },
        {
          "x": "34",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "34",
          "y": "13.797559405383",
          "series": "Out-of-fold ell"
        },
        {
          "x": "35",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "35",
          "y": "26.2059657503714",
          "series": "Out-of-fold ell"
        },
        {
          "x": "36",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "36",
          "y": "21.8455361453354",
          "series": "Out-of-fold ell"
        },
        {
          "x": "37",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "37",
          "y": "19.7651211100821",
          "series": "Out-of-fold ell"
        },
        {
          "x": "38",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "38",
          "y": "22.6713169760741",
          "series": "Out-of-fold ell"
        },
        {
          "x": "39",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "39",
          "y": "13.7814047962039",
          "series": "Out-of-fold ell"
        },
        {
          "x": "40",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "40",
          "y": "27.6004087080427",
          "series": "Out-of-fold ell"
        },
        {
          "x": "41",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "41",
          "y": "31.7316388607841",
          "series": "Out-of-fold ell"
        },
        {
          "x": "42",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "42",
          "y": "25.8558671383868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "43",
          "y": "37.5",
          "series": "Observed"
        },
        {
          "x": "43",
          "y": "29.4224216526963",
          "series": "Out-of-fold ell"
        },
        {
          "x": "44",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "44",
          "y": "24.0410962436415",
          "series": "Out-of-fold ell"
        },
        {
          "x": "45",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "45",
          "y": "12.5163671408482",
          "series": "Out-of-fold ell"
        },
        {
          "x": "46",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "46",
          "y": "21.254564593254",
          "series": "Out-of-fold ell"
        },
        {
          "x": "47",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "47",
          "y": "27.4639003590516",
          "series": "Out-of-fold ell"
        },
        {
          "x": "48",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "48",
          "y": "22.3745336341566",
          "series": "Out-of-fold ell"
        },
        {
          "x": "49",
          "y": "31.5",
          "series": "Observed"
        },
        {
          "x": "49",
          "y": "22.6713169760741",
          "series": "Out-of-fold ell"
        },
        {
          "x": "50",
          "y": "24.5",
          "series": "Observed"
        },
        {
          "x": "50",
          "y": "23.5887113838095",
          "series": "Out-of-fold ell"
        },
        {
          "x": "51",
          "y": "27.5",
          "series": "Observed"
        },
        {
          "x": "51",
          "y": "21.3447460787206",
          "series": "Out-of-fold ell"
        },
        {
          "x": "52",
          "y": "34.5",
          "series": "Observed"
        },
        {
          "x": "52",
          "y": "21.4405037581076",
          "series": "Out-of-fold ell"
        },
        {
          "x": "53",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "53",
          "y": "13.1351407107298",
          "series": "Out-of-fold ell"
        },
        {
          "x": "54",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "54",
          "y": "19.586171856889",
          "series": "Out-of-fold ell"
        },
        {
          "x": "55",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "55",
          "y": "22.0333899618761",
          "series": "Out-of-fold ell"
        },
        {
          "x": "56",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "56",
          "y": "28.3451304496287",
          "series": "Out-of-fold ell"
        },
        {
          "x": "57",
          "y": "23.5",
          "series": "Observed"
        },
        {
          "x": "57",
          "y": "28.7479397636023",
          "series": "Out-of-fold ell"
        },
        {
          "x": "58",
          "y": "35.5",
          "series": "Observed"
        },
        {
          "x": "58",
          "y": "23.0340823657859",
          "series": "Out-of-fold ell"
        },
        {
          "x": "59",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "59",
          "y": "26.4322733598959",
          "series": "Out-of-fold ell"
        },
        {
          "x": "60",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "60",
          "y": "23.8768000001129",
          "series": "Out-of-fold ell"
        },
        {
          "x": "61",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "61",
          "y": "24.8808166635604",
          "series": "Out-of-fold ell"
        },
        {
          "x": "62",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "62",
          "y": "28.9530886228769",
          "series": "Out-of-fold ell"
        },
        {
          "x": "63",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "63",
          "y": "12.265765367343",
          "series": "Out-of-fold ell"
        },
        {
          "x": "64",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "64",
          "y": "20.6675779229102",
          "series": "Out-of-fold ell"
        },
        {
          "x": "65",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "65",
          "y": "17.9206709713206",
          "series": "Out-of-fold ell"
        },
        {
          "x": "66",
          "y": "26.75",
          "series": "Observed"
        },
        {
          "x": "66",
          "y": "23.9190946874065",
          "series": "Out-of-fold ell"
        },
        {
          "x": "67",
          "y": "43.5",
          "series": "Observed"
        },
        {
          "x": "67",
          "y": "23.4893905394083",
          "series": "Out-of-fold ell"
        },
        {
          "x": "68",
          "y": "41.25",
          "series": "Observed"
        },
        {
          "x": "68",
          "y": "23.0096280667659",
          "series": "Out-of-fold ell"
        },
        {
          "x": "69",
          "y": "14.25",
          "series": "Observed"
        },
        {
          "x": "69",
          "y": "20.8382693343506",
          "series": "Out-of-fold ell"
        },
        {
          "x": "70",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "70",
          "y": "18.3664902856092",
          "series": "Out-of-fold ell"
        },
        {
          "x": "71",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "71",
          "y": "20.5428320164572",
          "series": "Out-of-fold ell"
        },
        {
          "x": "72",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "72",
          "y": "20.4375985575625",
          "series": "Out-of-fold ell"
        },
        {
          "x": "73",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "73",
          "y": "22.2611526280481",
          "series": "Out-of-fold ell"
        },
        {
          "x": "74",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "74",
          "y": "22.6926012355691",
          "series": "Out-of-fold ell"
        },
        {
          "x": "75",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "75",
          "y": "22.1364067215951",
          "series": "Out-of-fold ell"
        },
        {
          "x": "76",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "76",
          "y": "22.735131938366",
          "series": "Out-of-fold ell"
        },
        {
          "x": "77",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "77",
          "y": "22.0397828938928",
          "series": "Out-of-fold ell"
        },
        {
          "x": "78",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "78",
          "y": "19.870739465403",
          "series": "Out-of-fold ell"
        },
        {
          "x": "79",
          "y": "34.5",
          "series": "Observed"
        },
        {
          "x": "79",
          "y": "24.1840447098043",
          "series": "Out-of-fold ell"
        },
        {
          "x": "80",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "80",
          "y": "13.2209617237762",
          "series": "Out-of-fold ell"
        },
        {
          "x": "81",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "81",
          "y": "28.9608512364871",
          "series": "Out-of-fold ell"
        },
        {
          "x": "82",
          "y": "38",
          "series": "Observed"
        },
        {
          "x": "82",
          "y": "23.5887113838095",
          "series": "Out-of-fold ell"
        },
        {
          "x": "83",
          "y": "36",
          "series": "Observed"
        },
        {
          "x": "83",
          "y": "23.3542792365076",
          "series": "Out-of-fold ell"
        },
        {
          "x": "84",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "84",
          "y": "19.2565056739062",
          "series": "Out-of-fold ell"
        },
        {
          "x": "85",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "85",
          "y": "23.9611350526599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "86",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "86",
          "y": "21.071546424963",
          "series": "Out-of-fold ell"
        },
        {
          "x": "87",
          "y": "53",
          "series": "Observed"
        },
        {
          "x": "87",
          "y": "21.3053924552069",
          "series": "Out-of-fold ell"
        },
        {
          "x": "88",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "88",
          "y": "21.6681578449188",
          "series": "Out-of-fold ell"
        },
        {
          "x": "89",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "89",
          "y": "21.5855028048213",
          "series": "Out-of-fold ell"
        },
        {
          "x": "90",
          "y": "45",
          "series": "Observed"
        },
        {
          "x": "90",
          "y": "23.68805309932",
          "series": "Out-of-fold ell"
        },
        {
          "x": "91",
          "y": "8",
          "series": "Observed"
        },
        {
          "x": "91",
          "y": "16.6266687283436",
          "series": "Out-of-fold ell"
        },
        {
          "x": "92",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "92",
          "y": "15.3605793684288",
          "series": "Out-of-fold ell"
        },
        {
          "x": "93",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "93",
          "y": "28.8880768846977",
          "series": "Out-of-fold ell"
        },
        {
          "x": "94",
          "y": "7.5",
          "series": "Observed"
        },
        {
          "x": "94",
          "y": "13.3091164108806",
          "series": "Out-of-fold ell"
        },
        {
          "x": "95",
          "y": "7.5",
          "series": "Observed"
        },
        {
          "x": "95",
          "y": "13.3419556785596",
          "series": "Out-of-fold ell"
        },
        {
          "x": "96",
          "y": "18.5",
          "series": "Observed"
        },
        {
          "x": "96",
          "y": "14.4802261126155",
          "series": "Out-of-fold ell"
        },
        {
          "x": "97",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "97",
          "y": "22.5387665197047",
          "series": "Out-of-fold ell"
        },
        {
          "x": "98",
          "y": "33.5",
          "series": "Observed"
        },
        {
          "x": "98",
          "y": "22.4859884627288",
          "series": "Out-of-fold ell"
        },
        {
          "x": "99",
          "y": "37",
          "series": "Observed"
        },
        {
          "x": "99",
          "y": "24.784192835858",
          "series": "Out-of-fold ell"
        },
        {
          "x": "100",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "100",
          "y": "20.2691341173226",
          "series": "Out-of-fold ell"
        },
        {
          "x": "101",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "101",
          "y": "24.8340308007804",
          "series": "Out-of-fold ell"
        },
        {
          "x": "102",
          "y": "33",
          "series": "Observed"
        },
        {
          "x": "102",
          "y": "21.387125876402",
          "series": "Out-of-fold ell"
        },
        {
          "x": "103",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "103",
          "y": "22.4649471487579",
          "series": "Out-of-fold ell"
        },
        {
          "x": "104",
          "y": "24.5",
          "series": "Observed"
        },
        {
          "x": "104",
          "y": "21.0700311009913",
          "series": "Out-of-fold ell"
        },
        {
          "x": "105",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "105",
          "y": "15.7483378197133",
          "series": "Out-of-fold ell"
        },
        {
          "x": "106",
          "y": "23.5",
          "series": "Observed"
        },
        {
          "x": "106",
          "y": "22.9318077770174",
          "series": "Out-of-fold ell"
        },
        {
          "x": "107",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "107",
          "y": "12.8571766666818",
          "series": "Out-of-fold ell"
        },
        {
          "x": "108",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "108",
          "y": "24.2852092100462",
          "series": "Out-of-fold ell"
        },
        {
          "x": "109",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "109",
          "y": "23.6324333434728",
          "series": "Out-of-fold ell"
        },
        {
          "x": "110",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "110",
          "y": "24.7150850341722",
          "series": "Out-of-fold ell"
        },
        {
          "x": "111",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "111",
          "y": "22.425436029956",
          "series": "Out-of-fold ell"
        },
        {
          "x": "112",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "112",
          "y": "22.0740337683686",
          "series": "Out-of-fold ell"
        },
        {
          "x": "113",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "113",
          "y": "23.7278556517957",
          "series": "Out-of-fold ell"
        },
        {
          "x": "114",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "114",
          "y": "21.6205836526443",
          "series": "Out-of-fold ell"
        },
        {
          "x": "115",
          "y": "23.75",
          "series": "Observed"
        },
        {
          "x": "115",
          "y": "30.5792956743866",
          "series": "Out-of-fold ell"
        },
        {
          "x": "116",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "116",
          "y": "14.8994767139233",
          "series": "Out-of-fold ell"
        },
        {
          "x": "117",
          "y": "36",
          "series": "Observed"
        },
        {
          "x": "117",
          "y": "21.0659234211618",
          "series": "Out-of-fold ell"
        },
        {
          "x": "118",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "118",
          "y": "20.9520963777562",
          "series": "Out-of-fold ell"
        },
        {
          "x": "119",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "119",
          "y": "20.724442290945",
          "series": "Out-of-fold ell"
        },
        {
          "x": "120",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "120",
          "y": "23.3542792365076",
          "series": "Out-of-fold ell"
        },
        {
          "x": "121",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "121",
          "y": "24.8263235333759",
          "series": "Out-of-fold ell"
        },
        {
          "x": "122",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "122",
          "y": "23.4324344717694",
          "series": "Out-of-fold ell"
        },
        {
          "x": "123",
          "y": "16.75",
          "series": "Observed"
        },
        {
          "x": "123",
          "y": "19.8841016477226",
          "series": "Out-of-fold ell"
        },
        {
          "x": "124",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "124",
          "y": "21.7101351427744",
          "series": "Out-of-fold ell"
        },
        {
          "x": "125",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "125",
          "y": "22.297397903518",
          "series": "Out-of-fold ell"
        },
        {
          "x": "126",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "126",
          "y": "26.5245961098198",
          "series": "Out-of-fold ell"
        },
        {
          "x": "127",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "127",
          "y": "21.1747643383556",
          "series": "Out-of-fold ell"
        },
        {
          "x": "128",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "128",
          "y": "22.9361382570682",
          "series": "Out-of-fold ell"
        },
        {
          "x": "129",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "129",
          "y": "23.0009831590569",
          "series": "Out-of-fold ell"
        },
        {
          "x": "130",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "130",
          "y": "21.012832609371",
          "series": "Out-of-fold ell"
        },
        {
          "x": "131",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "131",
          "y": "24.5184091955208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "132",
          "y": "23.25",
          "series": "Observed"
        },
        {
          "x": "132",
          "y": "23.4324344717694",
          "series": "Out-of-fold ell"
        },
        {
          "x": "133",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "133",
          "y": "11.9215823682845",
          "series": "Out-of-fold ell"
        },
        {
          "x": "134",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "134",
          "y": "13.1601720625635",
          "series": "Out-of-fold ell"
        },
        {
          "x": "135",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "135",
          "y": "12.1710741811905",
          "series": "Out-of-fold ell"
        },
        {
          "x": "136",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "136",
          "y": "13.2688588244925",
          "series": "Out-of-fold ell"
        },
        {
          "x": "137",
          "y": "14.5",
          "series": "Observed"
        },
        {
          "x": "137",
          "y": "22.0949765289034",
          "series": "Out-of-fold ell"
        },
        {
          "x": "138",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "138",
          "y": "12.1175616243431",
          "series": "Out-of-fold ell"
        },
        {
          "x": "139",
          "y": "6.5",
          "series": "Observed"
        },
        {
          "x": "139",
          "y": "15.8494498697213",
          "series": "Out-of-fold ell"
        },
        {
          "x": "140",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "140",
          "y": "13.719945349588",
          "series": "Out-of-fold ell"
        },
        {
          "x": "141",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "141",
          "y": "14.3548335482439",
          "series": "Out-of-fold ell"
        },
        {
          "x": "142",
          "y": "46.5",
          "series": "Observed"
        },
        {
          "x": "142",
          "y": "26.9000941617467",
          "series": "Out-of-fold ell"
        },
        {
          "x": "143",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "143",
          "y": "25.8466592441968",
          "series": "Out-of-fold ell"
        },
        {
          "x": "144",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "144",
          "y": "21.7255886622152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "145",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "145",
          "y": "22.8848821603129",
          "series": "Out-of-fold ell"
        },
        {
          "x": "146",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "146",
          "y": "20.2414199125893",
          "series": "Out-of-fold ell"
        },
        {
          "x": "147",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "147",
          "y": "23.0432626055896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "148",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "148",
          "y": "23.0432626055896",
          "series": "Out-of-fold ell"
        },
        {
          "x": "149",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "149",
          "y": "21.8503419865228",
          "series": "Out-of-fold ell"
        },
        {
          "x": "150",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "150",
          "y": "25.2689980060424",
          "series": "Out-of-fold ell"
        },
        {
          "x": "151",
          "y": "29.5",
          "series": "Observed"
        },
        {
          "x": "151",
          "y": "23.0311614386562",
          "series": "Out-of-fold ell"
        },
        {
          "x": "152",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "152",
          "y": "26.9492846282752",
          "series": "Out-of-fold ell"
        },
        {
          "x": "153",
          "y": "31.5",
          "series": "Observed"
        },
        {
          "x": "153",
          "y": "21.5253392746136",
          "series": "Out-of-fold ell"
        },
        {
          "x": "154",
          "y": "27.5",
          "series": "Observed"
        },
        {
          "x": "154",
          "y": "24.3642282863786",
          "series": "Out-of-fold ell"
        },
        {
          "x": "155",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "155",
          "y": "25.7709225712163",
          "series": "Out-of-fold ell"
        },
        {
          "x": "156",
          "y": "14.5",
          "series": "Observed"
        },
        {
          "x": "156",
          "y": "19.4848192614401",
          "series": "Out-of-fold ell"
        },
        {
          "x": "157",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "157",
          "y": "27.1535756630911",
          "series": "Out-of-fold ell"
        },
        {
          "x": "158",
          "y": "44",
          "series": "Observed"
        },
        {
          "x": "158",
          "y": "25.8797584509258",
          "series": "Out-of-fold ell"
        },
        {
          "x": "159",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "159",
          "y": "22.9580415955104",
          "series": "Out-of-fold ell"
        },
        {
          "x": "160",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "160",
          "y": "14.8994767139233",
          "series": "Out-of-fold ell"
        },
        {
          "x": "161",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "161",
          "y": "20.4011129161019",
          "series": "Out-of-fold ell"
        },
        {
          "x": "162",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "162",
          "y": "21.4363960782781",
          "series": "Out-of-fold ell"
        },
        {
          "x": "163",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "163",
          "y": "27.3757347926197",
          "series": "Out-of-fold ell"
        },
        {
          "x": "164",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "164",
          "y": "25.3662434832848",
          "series": "Out-of-fold ell"
        },
        {
          "x": "165",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "165",
          "y": "25.6567564573269",
          "series": "Out-of-fold ell"
        },
        {
          "x": "166",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "166",
          "y": "24.1283172955182",
          "series": "Out-of-fold ell"
        },
        {
          "x": "167",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "167",
          "y": "14.5940531560211",
          "series": "Out-of-fold ell"
        },
        {
          "x": "168",
          "y": "18",
          "series": "Observed"
        },
        {
          "x": "168",
          "y": "20.1298528066134",
          "series": "Out-of-fold ell"
        },
        {
          "x": "169",
          "y": "18.5",
          "series": "Observed"
        },
        {
          "x": "169",
          "y": "20.7899229522266",
          "series": "Out-of-fold ell"
        },
        {
          "x": "170",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "170",
          "y": "19.1085847451536",
          "series": "Out-of-fold ell"
        },
        {
          "x": "171",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "171",
          "y": "23.3739277092831",
          "series": "Out-of-fold ell"
        },
        {
          "x": "172",
          "y": "33",
          "series": "Observed"
        },
        {
          "x": "172",
          "y": "23.2617364525971",
          "series": "Out-of-fold ell"
        },
        {
          "x": "173",
          "y": "7.5",
          "series": "Observed"
        },
        {
          "x": "173",
          "y": "14.3436748818529",
          "series": "Out-of-fold ell"
        },
        {
          "x": "174",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "174",
          "y": "19.2736822535718",
          "series": "Out-of-fold ell"
        },
        {
          "x": "175",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "175",
          "y": "22.2611526280481",
          "series": "Out-of-fold ell"
        },
        {
          "x": "176",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "176",
          "y": "25.0055625700133",
          "series": "Out-of-fold ell"
        },
        {
          "x": "177",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "177",
          "y": "13.2925342949114",
          "series": "Out-of-fold ell"
        },
        {
          "x": "178",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "178",
          "y": "11.9205897475794",
          "series": "Out-of-fold ell"
        },
        {
          "x": "179",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "179",
          "y": "21.2469354189923",
          "series": "Out-of-fold ell"
        },
        {
          "x": "180",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "180",
          "y": "18.8692149416067",
          "series": "Out-of-fold ell"
        },
        {
          "x": "181",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "181",
          "y": "26.24420026188",
          "series": "Out-of-fold ell"
        },
        {
          "x": "182",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "182",
          "y": "25.9152620915166",
          "series": "Out-of-fold ell"
        },
        {
          "x": "183",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "183",
          "y": "26.0035298216371",
          "series": "Out-of-fold ell"
        },
        {
          "x": "184",
          "y": "35",
          "series": "Observed"
        },
        {
          "x": "184",
          "y": "25.1303084764663",
          "series": "Out-of-fold ell"
        },
        {
          "x": "185",
          "y": "17.75",
          "series": "Observed"
        },
        {
          "x": "185",
          "y": "22.9424472983354",
          "series": "Out-of-fold ell"
        },
        {
          "x": "186",
          "y": "24.5",
          "series": "Observed"
        },
        {
          "x": "186",
          "y": "27.8747184184315",
          "series": "Out-of-fold ell"
        },
        {
          "x": "187",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "187",
          "y": "22.510644440954",
          "series": "Out-of-fold ell"
        },
        {
          "x": "188",
          "y": "30",
          "series": "Observed"
        },
        {
          "x": "188",
          "y": "30.536969938418",
          "series": "Out-of-fold ell"
        },
        {
          "x": "189",
          "y": "39",
          "series": "Observed"
        },
        {
          "x": "189",
          "y": "22.5787741921635",
          "series": "Out-of-fold ell"
        },
        {
          "x": "190",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "190",
          "y": "12.9059207768056",
          "series": "Out-of-fold ell"
        },
        {
          "x": "191",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "191",
          "y": "14.7143152829546",
          "series": "Out-of-fold ell"
        },
        {
          "x": "192",
          "y": "38.5",
          "series": "Observed"
        },
        {
          "x": "192",
          "y": "21.9878626029308",
          "series": "Out-of-fold ell"
        },
        {
          "x": "193",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "193",
          "y": "20.7607306002996",
          "series": "Out-of-fold ell"
        },
        {
          "x": "194",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "194",
          "y": "23.8768000001129",
          "series": "Out-of-fold ell"
        },
        {
          "x": "195",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "195",
          "y": "23.9611350526599",
          "series": "Out-of-fold ell"
        },
        {
          "x": "196",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "196",
          "y": "23.7278556517957",
          "series": "Out-of-fold ell"
        },
        {
          "x": "197",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "197",
          "y": "22.6636097086696",
          "series": "Out-of-fold ell"
        },
        {
          "x": "198",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "198",
          "y": "22.0949765289034",
          "series": "Out-of-fold ell"
        },
        {
          "x": "199",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "199",
          "y": "22.0944744916416",
          "series": "Out-of-fold ell"
        },
        {
          "x": "200",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "200",
          "y": "17.2993716248513",
          "series": "Out-of-fold ell"
        },
        {
          "x": "201",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "201",
          "y": "13.228128635154",
          "series": "Out-of-fold ell"
        },
        {
          "x": "202",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "202",
          "y": "13.3457076302291",
          "series": "Out-of-fold ell"
        },
        {
          "x": "203",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "203",
          "y": "14.5777432053882",
          "series": "Out-of-fold ell"
        },
        {
          "x": "204",
          "y": "59",
          "series": "Observed"
        },
        {
          "x": "204",
          "y": "38.795923874709",
          "series": "Out-of-fold ell"
        },
        {
          "x": "205",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "205",
          "y": "19.3670903793432",
          "series": "Out-of-fold ell"
        },
        {
          "x": "206",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "206",
          "y": "21.0473770015761",
          "series": "Out-of-fold ell"
        },
        {
          "x": "207",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "207",
          "y": "30.3701966644929",
          "series": "Out-of-fold ell"
        },
        {
          "x": "208",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "208",
          "y": "23.3755634960027",
          "series": "Out-of-fold ell"
        },
        {
          "x": "209",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "209",
          "y": "23.5086116925777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "210",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "210",
          "y": "20.9617732725564",
          "series": "Out-of-fold ell"
        },
        {
          "x": "211",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "211",
          "y": "24.6313248506544",
          "series": "Out-of-fold ell"
        },
        {
          "x": "212",
          "y": "30.25",
          "series": "Observed"
        },
        {
          "x": "212",
          "y": "22.1273808950927",
          "series": "Out-of-fold ell"
        },
        {
          "x": "213",
          "y": "44",
          "series": "Observed"
        },
        {
          "x": "213",
          "y": "23.4299669551613",
          "series": "Out-of-fold ell"
        },
        {
          "x": "214",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "214",
          "y": "27.5276895669694",
          "series": "Out-of-fold ell"
        },
        {
          "x": "215",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "215",
          "y": "22.6977633006335",
          "series": "Out-of-fold ell"
        },
        {
          "x": "216",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "216",
          "y": "23.1320782585269",
          "series": "Out-of-fold ell"
        },
        {
          "x": "217",
          "y": "28.5",
          "series": "Observed"
        },
        {
          "x": "217",
          "y": "24.0257443484301",
          "series": "Out-of-fold ell"
        },
        {
          "x": "218",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "218",
          "y": "22.5407958431921",
          "series": "Out-of-fold ell"
        },
        {
          "x": "219",
          "y": "41",
          "series": "Observed"
        },
        {
          "x": "219",
          "y": "24.1746886967473",
          "series": "Out-of-fold ell"
        },
        {
          "x": "220",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "220",
          "y": "21.5543308015132",
          "series": "Out-of-fold ell"
        },
        {
          "x": "221",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "221",
          "y": "16.1360962709978",
          "series": "Out-of-fold ell"
        },
        {
          "x": "222",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "222",
          "y": "20.0940401284779",
          "series": "Out-of-fold ell"
        },
        {
          "x": "223",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "223",
          "y": "22.8246834284961",
          "series": "Out-of-fold ell"
        },
        {
          "x": "224",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "224",
          "y": "19.3389496122564",
          "series": "Out-of-fold ell"
        },
        {
          "x": "225",
          "y": "22.75",
          "series": "Observed"
        },
        {
          "x": "225",
          "y": "20.576685851565",
          "series": "Out-of-fold ell"
        },
        {
          "x": "226",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "226",
          "y": "22.4318479420289",
          "series": "Out-of-fold ell"
        },
        {
          "x": "227",
          "y": "27.5",
          "series": "Observed"
        },
        {
          "x": "227",
          "y": "23.7215231654626",
          "series": "Out-of-fold ell"
        },
        {
          "x": "228",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "228",
          "y": "23.0418967730603",
          "series": "Out-of-fold ell"
        },
        {
          "x": "229",
          "y": "60.5",
          "series": "Observed"
        },
        {
          "x": "229",
          "y": "26.1048537003634",
          "series": "Out-of-fold ell"
        },
        {
          "x": "230",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "230",
          "y": "24.1057226521889",
          "series": "Out-of-fold ell"
        },
        {
          "x": "231",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "231",
          "y": "22.5122222812217",
          "series": "Out-of-fold ell"
        },
        {
          "x": "232",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "232",
          "y": "23.2366786669408",
          "series": "Out-of-fold ell"
        },
        {
          "x": "233",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "233",
          "y": "23.0096280667659",
          "series": "Out-of-fold ell"
        },
        {
          "x": "234",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "234",
          "y": "13.3517400910943",
          "series": "Out-of-fold ell"
        },
        {
          "x": "235",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "235",
          "y": "14.5777432053882",
          "series": "Out-of-fold ell"
        },
        {
          "x": "236",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "236",
          "y": "21.1484890515841",
          "series": "Out-of-fold ell"
        },
        {
          "x": "237",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "237",
          "y": "23.5819333233188",
          "series": "Out-of-fold ell"
        },
        {
          "x": "238",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "238",
          "y": "22.2372930619468",
          "series": "Out-of-fold ell"
        },
        {
          "x": "239",
          "y": "21.25",
          "series": "Observed"
        },
        {
          "x": "239",
          "y": "22.9866151574807",
          "series": "Out-of-fold ell"
        },
        {
          "x": "240",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "240",
          "y": "23.1809512526547",
          "series": "Out-of-fold ell"
        },
        {
          "x": "241",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "241",
          "y": "27.4514643597255",
          "series": "Out-of-fold ell"
        },
        {
          "x": "242",
          "y": "33",
          "series": "Observed"
        },
        {
          "x": "242",
          "y": "24.6313248506544",
          "series": "Out-of-fold ell"
        },
        {
          "x": "243",
          "y": "37.75",
          "series": "Observed"
        },
        {
          "x": "243",
          "y": "24.6276609734643",
          "series": "Out-of-fold ell"
        },
        {
          "x": "244",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "244",
          "y": "16.6249667722903",
          "series": "Out-of-fold ell"
        },
        {
          "x": "245",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "245",
          "y": "13.5589775790686",
          "series": "Out-of-fold ell"
        },
        {
          "x": "246",
          "y": "12.75",
          "series": "Observed"
        },
        {
          "x": "246",
          "y": "14.7143152829546",
          "series": "Out-of-fold ell"
        },
        {
          "x": "247",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "247",
          "y": "14.3036993206545",
          "series": "Out-of-fold ell"
        },
        {
          "x": "248",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "248",
          "y": "15.6441984555093",
          "series": "Out-of-fold ell"
        },
        {
          "x": "249",
          "y": "8",
          "series": "Observed"
        },
        {
          "x": "249",
          "y": "13.5746497482387",
          "series": "Out-of-fold ell"
        },
        {
          "x": "250",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "250",
          "y": "21.6936410870503",
          "series": "Out-of-fold ell"
        },
        {
          "x": "251",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "251",
          "y": "19.3410101807884",
          "series": "Out-of-fold ell"
        },
        {
          "x": "252",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "252",
          "y": "23.5819333233188",
          "series": "Out-of-fold ell"
        },
        {
          "x": "253",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "253",
          "y": "20.8141660341462",
          "series": "Out-of-fold ell"
        },
        {
          "x": "254",
          "y": "23.5",
          "series": "Observed"
        },
        {
          "x": "254",
          "y": "21.0777383683957",
          "series": "Out-of-fold ell"
        },
        {
          "x": "255",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "255",
          "y": "12.9632001857998",
          "series": "Out-of-fold ell"
        },
        {
          "x": "256",
          "y": "29",
          "series": "Observed"
        },
        {
          "x": "256",
          "y": "25.4244502773034",
          "series": "Out-of-fold ell"
        },
        {
          "x": "257",
          "y": "30",
          "series": "Observed"
        },
        {
          "x": "257",
          "y": "23.200952932525",
          "series": "Out-of-fold ell"
        },
        {
          "x": "258",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "258",
          "y": "28.7588240676029",
          "series": "Out-of-fold ell"
        },
        {
          "x": "259",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "259",
          "y": "22.635390347407",
          "series": "Out-of-fold ell"
        },
        {
          "x": "260",
          "y": "21.75",
          "series": "Observed"
        },
        {
          "x": "260",
          "y": "22.877820889788",
          "series": "Out-of-fold ell"
        },
        {
          "x": "261",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "261",
          "y": "15.332438601342",
          "series": "Out-of-fold ell"
        },
        {
          "x": "262",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "262",
          "y": "22.155954457063",
          "series": "Out-of-fold ell"
        },
        {
          "x": "263",
          "y": "28.5",
          "series": "Observed"
        },
        {
          "x": "263",
          "y": "21.2204907732802",
          "series": "Out-of-fold ell"
        },
        {
          "x": "264",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "264",
          "y": "19.8024797744587",
          "series": "Out-of-fold ell"
        },
        {
          "x": "265",
          "y": "23.5",
          "series": "Observed"
        },
        {
          "x": "265",
          "y": "23.6333575990307",
          "series": "Out-of-fold ell"
        },
        {
          "x": "266",
          "y": "30.5",
          "series": "Observed"
        },
        {
          "x": "266",
          "y": "24.4626817812347",
          "series": "Out-of-fold ell"
        },
        {
          "x": "267",
          "y": "24.75",
          "series": "Observed"
        },
        {
          "x": "267",
          "y": "22.6558008970589",
          "series": "Out-of-fold ell"
        },
        {
          "x": "268",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "268",
          "y": "23.3838657861248",
          "series": "Out-of-fold ell"
        },
        {
          "x": "269",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "269",
          "y": "22.0096389751356",
          "series": "Out-of-fold ell"
        },
        {
          "x": "270",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "270",
          "y": "13.9387983803856",
          "series": "Out-of-fold ell"
        },
        {
          "x": "271",
          "y": "9",
          "series": "Observed"
        },
        {
          "x": "271",
          "y": "12.7115846816317",
          "series": "Out-of-fold ell"
        },
        {
          "x": "272",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "272",
          "y": "12.5453119005493",
          "series": "Out-of-fold ell"
        },
        {
          "x": "273",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "273",
          "y": "12.7115846816317",
          "series": "Out-of-fold ell"
        },
        {
          "x": "274",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "274",
          "y": "14.2433787196717",
          "series": "Out-of-fold ell"
        },
        {
          "x": "275",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "275",
          "y": "15.8775906368081",
          "series": "Out-of-fold ell"
        },
        {
          "x": "276",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "276",
          "y": "18.5394925035707",
          "series": "Out-of-fold ell"
        },
        {
          "x": "277",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "277",
          "y": "17.943715110302",
          "series": "Out-of-fold ell"
        },
        {
          "x": "278",
          "y": "28.5",
          "series": "Observed"
        },
        {
          "x": "278",
          "y": "19.8671821932304",
          "series": "Out-of-fold ell"
        },
        {
          "x": "279",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "279",
          "y": "21.3714401770071",
          "series": "Out-of-fold ell"
        },
        {
          "x": "280",
          "y": "23.5",
          "series": "Observed"
        },
        {
          "x": "280",
          "y": "21.5899600637209",
          "series": "Out-of-fold ell"
        },
        {
          "x": "281",
          "y": "30.5",
          "series": "Observed"
        },
        {
          "x": "281",
          "y": "24.8812395547579",
          "series": "Out-of-fold ell"
        },
        {
          "x": "282",
          "y": "26.5",
          "series": "Observed"
        },
        {
          "x": "282",
          "y": "21.4405037581076",
          "series": "Out-of-fold ell"
        },
        {
          "x": "283",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "283",
          "y": "23.8768000001129",
          "series": "Out-of-fold ell"
        },
        {
          "x": "284",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "284",
          "y": "23.7170446262195",
          "series": "Out-of-fold ell"
        },
        {
          "x": "285",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "285",
          "y": "23.7581035054837",
          "series": "Out-of-fold ell"
        },
        {
          "x": "286",
          "y": "37.5",
          "series": "Observed"
        },
        {
          "x": "286",
          "y": "13.2937873392671",
          "series": "Out-of-fold ell"
        },
        {
          "x": "287",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "287",
          "y": "15.9152011482543",
          "series": "Out-of-fold ell"
        },
        {
          "x": "288",
          "y": "21",
          "series": "Observed"
        },
        {
          "x": "288",
          "y": "20.0383127141918",
          "series": "Out-of-fold ell"
        },
        {
          "x": "289",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "289",
          "y": "22.3180208986233",
          "series": "Out-of-fold ell"
        },
        {
          "x": "290",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "290",
          "y": "22.4436628892629",
          "series": "Out-of-fold ell"
        },
        {
          "x": "291",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "291",
          "y": "22.3565220046132",
          "series": "Out-of-fold ell"
        },
        {
          "x": "292",
          "y": "19",
          "series": "Observed"
        },
        {
          "x": "292",
          "y": "21.5206663102922",
          "series": "Out-of-fold ell"
        },
        {
          "x": "293",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "293",
          "y": "11.4855815673378",
          "series": "Out-of-fold ell"
        },
        {
          "x": "294",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "294",
          "y": "18.6926855267822",
          "series": "Out-of-fold ell"
        },
        {
          "x": "295",
          "y": "32",
          "series": "Observed"
        },
        {
          "x": "295",
          "y": "22.0894678203066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "296",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "296",
          "y": "23.0311614386562",
          "series": "Out-of-fold ell"
        },
        {
          "x": "297",
          "y": "14.25",
          "series": "Observed"
        },
        {
          "x": "297",
          "y": "23.0694964240825",
          "series": "Out-of-fold ell"
        },
        {
          "x": "298",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "298",
          "y": "20.9518546812113",
          "series": "Out-of-fold ell"
        },
        {
          "x": "299",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "299",
          "y": "20.4160603674572",
          "series": "Out-of-fold ell"
        },
        {
          "x": "300",
          "y": "47.5",
          "series": "Observed"
        },
        {
          "x": "300",
          "y": "22.5363008652581",
          "series": "Out-of-fold ell"
        },
        {
          "x": "301",
          "y": "15.5",
          "series": "Observed"
        },
        {
          "x": "301",
          "y": "13.5228991620143",
          "series": "Out-of-fold ell"
        },
        {
          "x": "302",
          "y": "10.5",
          "series": "Observed"
        },
        {
          "x": "302",
          "y": "14.2984160645833",
          "series": "Out-of-fold ell"
        },
        {
          "x": "303",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "303",
          "y": "12.4154503209775",
          "series": "Out-of-fold ell"
        },
        {
          "x": "304",
          "y": "11",
          "series": "Observed"
        },
        {
          "x": "304",
          "y": "13.1601720625635",
          "series": "Out-of-fold ell"
        },
        {
          "x": "305",
          "y": "8.5",
          "series": "Observed"
        },
        {
          "x": "305",
          "y": "13.0058878936349",
          "series": "Out-of-fold ell"
        },
        {
          "x": "306",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "306",
          "y": "18.3049270754977",
          "series": "Out-of-fold ell"
        },
        {
          "x": "307",
          "y": "15",
          "series": "Observed"
        },
        {
          "x": "307",
          "y": "19.5821029417911",
          "series": "Out-of-fold ell"
        },
        {
          "x": "308",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "308",
          "y": "19.6999989002946",
          "series": "Out-of-fold ell"
        },
        {
          "x": "309",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "309",
          "y": "16.9011046720816",
          "series": "Out-of-fold ell"
        },
        {
          "x": "310",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "310",
          "y": "18.9032095964555",
          "series": "Out-of-fold ell"
        },
        {
          "x": "311",
          "y": "12.5",
          "series": "Observed"
        },
        {
          "x": "311",
          "y": "18.2454854093418",
          "series": "Out-of-fold ell"
        },
        {
          "x": "312",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "312",
          "y": "17.7649391623995",
          "series": "Out-of-fold ell"
        },
        {
          "x": "313",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "313",
          "y": "21.7013976382056",
          "series": "Out-of-fold ell"
        },
        {
          "x": "314",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "314",
          "y": "20.8500842815845",
          "series": "Out-of-fold ell"
        },
        {
          "x": "315",
          "y": "23.5",
          "series": "Observed"
        },
        {
          "x": "315",
          "y": "21.6468735854237",
          "series": "Out-of-fold ell"
        },
        {
          "x": "316",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "316",
          "y": "22.2092323370861",
          "series": "Out-of-fold ell"
        },
        {
          "x": "317",
          "y": "32.5",
          "series": "Observed"
        },
        {
          "x": "317",
          "y": "22.5609899081349",
          "series": "Out-of-fold ell"
        },
        {
          "x": "318",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "318",
          "y": "21.1724632448337",
          "series": "Out-of-fold ell"
        },
        {
          "x": "319",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "319",
          "y": "18.5634327096874",
          "series": "Out-of-fold ell"
        },
        {
          "x": "320",
          "y": "43.5",
          "series": "Observed"
        },
        {
          "x": "320",
          "y": "21.7658625570604",
          "series": "Out-of-fold ell"
        },
        {
          "x": "321",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "321",
          "y": "21.0777383683957",
          "series": "Out-of-fold ell"
        },
        {
          "x": "322",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "322",
          "y": "20.8889476570655",
          "series": "Out-of-fold ell"
        },
        {
          "x": "323",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "323",
          "y": "22.5546888470509",
          "series": "Out-of-fold ell"
        },
        {
          "x": "324",
          "y": "22",
          "series": "Observed"
        },
        {
          "x": "324",
          "y": "23.9897086146303",
          "series": "Out-of-fold ell"
        },
        {
          "x": "325",
          "y": "7",
          "series": "Observed"
        },
        {
          "x": "325",
          "y": "18.5148034606939",
          "series": "Out-of-fold ell"
        },
        {
          "x": "326",
          "y": "14",
          "series": "Observed"
        },
        {
          "x": "326",
          "y": "13.7079219273857",
          "series": "Out-of-fold ell"
        },
        {
          "x": "327",
          "y": "27",
          "series": "Observed"
        },
        {
          "x": "327",
          "y": "12.9714699108702",
          "series": "Out-of-fold ell"
        },
        {
          "x": "328",
          "y": "18.5",
          "series": "Observed"
        },
        {
          "x": "328",
          "y": "19.9852136977306",
          "series": "Out-of-fold ell"
        },
        {
          "x": "329",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "329",
          "y": "18.8692149416067",
          "series": "Out-of-fold ell"
        },
        {
          "x": "330",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "330",
          "y": "22.5679496955078",
          "series": "Out-of-fold ell"
        },
        {
          "x": "331",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "331",
          "y": "27.8747184184315",
          "series": "Out-of-fold ell"
        },
        {
          "x": "332",
          "y": "30.5",
          "series": "Observed"
        },
        {
          "x": "332",
          "y": "23.822526371772",
          "series": "Out-of-fold ell"
        },
        {
          "x": "333",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "333",
          "y": "23.8190762509124",
          "series": "Out-of-fold ell"
        },
        {
          "x": "334",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "334",
          "y": "24.7413188526651",
          "series": "Out-of-fold ell"
        },
        {
          "x": "335",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "335",
          "y": "11.6720905553786",
          "series": "Out-of-fold ell"
        },
        {
          "x": "336",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "336",
          "y": "13.5432791521731",
          "series": "Out-of-fold ell"
        },
        {
          "x": "337",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "337",
          "y": "12.4329476102012",
          "series": "Out-of-fold ell"
        },
        {
          "x": "338",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "338",
          "y": "17.8088747367565",
          "series": "Out-of-fold ell"
        },
        {
          "x": "339",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "339",
          "y": "19.1187067545126",
          "series": "Out-of-fold ell"
        },
        {
          "x": "340",
          "y": "24",
          "series": "Observed"
        },
        {
          "x": "340",
          "y": "19.2024014999005",
          "series": "Out-of-fold ell"
        },
        {
          "x": "341",
          "y": "13.5",
          "series": "Observed"
        },
        {
          "x": "341",
          "y": "21.3513509428563",
          "series": "Out-of-fold ell"
        },
        {
          "x": "342",
          "y": "17",
          "series": "Observed"
        },
        {
          "x": "342",
          "y": "20.8423770141801",
          "series": "Out-of-fold ell"
        },
        {
          "x": "343",
          "y": "28",
          "series": "Observed"
        },
        {
          "x": "343",
          "y": "21.9405234719894",
          "series": "Out-of-fold ell"
        },
        {
          "x": "344",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "344",
          "y": "21.89581193173",
          "series": "Out-of-fold ell"
        },
        {
          "x": "345",
          "y": "19.5",
          "series": "Observed"
        },
        {
          "x": "345",
          "y": "14.7179126012118",
          "series": "Out-of-fold ell"
        },
        {
          "x": "346",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "346",
          "y": "15.1973654105577",
          "series": "Out-of-fold ell"
        },
        {
          "x": "347",
          "y": "14.5",
          "series": "Observed"
        },
        {
          "x": "347",
          "y": "18.9793319280587",
          "series": "Out-of-fold ell"
        },
        {
          "x": "348",
          "y": "14.5",
          "series": "Observed"
        },
        {
          "x": "348",
          "y": "20.509842851668",
          "series": "Out-of-fold ell"
        },
        {
          "x": "349",
          "y": "0",
          "series": "Observed"
        },
        {
          "x": "349",
          "y": "20.8689734146095",
          "series": "Out-of-fold ell"
        },
        {
          "x": "350",
          "y": "31.5",
          "series": "Observed"
        },
        {
          "x": "350",
          "y": "25.6696817390364",
          "series": "Out-of-fold ell"
        },
        {
          "x": "351",
          "y": "11.5",
          "series": "Observed"
        },
        {
          "x": "351",
          "y": "21.5206663102922",
          "series": "Out-of-fold ell"
        },
        {
          "x": "352",
          "y": "20",
          "series": "Observed"
        },
        {
          "x": "352",
          "y": "22.0894678203066",
          "series": "Out-of-fold ell"
        },
        {
          "x": "353",
          "y": "34",
          "series": "Observed"
        },
        {
          "x": "353",
          "y": "26.0787767955312",
          "series": "Out-of-fold ell"
        },
        {
          "x": "354",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "354",
          "y": "22.8341895618925",
          "series": "Out-of-fold ell"
        },
        {
          "x": "355",
          "y": "10",
          "series": "Observed"
        },
        {
          "x": "355",
          "y": "19.7063582472315",
          "series": "Out-of-fold ell"
        },
        {
          "x": "356",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "356",
          "y": "24.8812395547579",
          "series": "Out-of-fold ell"
        },
        {
          "x": "357",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "357",
          "y": "20.4510799888174",
          "series": "Out-of-fold ell"
        },
        {
          "x": "358",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "358",
          "y": "16.2653490880926",
          "series": "Out-of-fold ell"
        },
        {
          "x": "359",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "359",
          "y": "13.0459491673482",
          "series": "Out-of-fold ell"
        },
        {
          "x": "360",
          "y": "26",
          "series": "Observed"
        },
        {
          "x": "360",
          "y": "23.9837971061782",
          "series": "Out-of-fold ell"
        },
        {
          "x": "361",
          "y": "16.5",
          "series": "Observed"
        },
        {
          "x": "361",
          "y": "20.2691341173226",
          "series": "Out-of-fold ell"
        },
        {
          "x": "362",
          "y": "35.5",
          "series": "Observed"
        },
        {
          "x": "362",
          "y": "21.5362475028686",
          "series": "Out-of-fold ell"
        },
        {
          "x": "363",
          "y": "31",
          "series": "Observed"
        },
        {
          "x": "363",
          "y": "19.4331585934739",
          "series": "Out-of-fold ell"
        },
        {
          "x": "364",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "364",
          "y": "21.3694351215974",
          "series": "Out-of-fold ell"
        },
        {
          "x": "365",
          "y": "22.5",
          "series": "Observed"
        },
        {
          "x": "365",
          "y": "18.7893536717586",
          "series": "Out-of-fold ell"
        },
        {
          "x": "366",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "366",
          "y": "20.1144665148254",
          "series": "Out-of-fold ell"
        },
        {
          "x": "367",
          "y": "12",
          "series": "Observed"
        },
        {
          "x": "367",
          "y": "19.7267080635409",
          "series": "Out-of-fold ell"
        },
        {
          "x": "368",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "368",
          "y": "23.5086116925777",
          "series": "Out-of-fold ell"
        },
        {
          "x": "369",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "369",
          "y": "23.6333575990307",
          "series": "Out-of-fold ell"
        },
        {
          "x": "370",
          "y": "8.5",
          "series": "Observed"
        },
        {
          "x": "370",
          "y": "13.4100332307514",
          "series": "Out-of-fold ell"
        },
        {
          "x": "371",
          "y": "13",
          "series": "Observed"
        },
        {
          "x": "371",
          "y": "24.5184091955208",
          "series": "Out-of-fold ell"
        },
        {
          "x": "372",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "372",
          "y": "24.1323412248426",
          "series": "Out-of-fold ell"
        },
        {
          "x": "373",
          "y": "23",
          "series": "Observed"
        },
        {
          "x": "373",
          "y": "25.8558671383868",
          "series": "Out-of-fold ell"
        },
        {
          "x": "374",
          "y": "25.5",
          "series": "Observed"
        },
        {
          "x": "374",
          "y": "22.583470056445",
          "series": "Out-of-fold ell"
        },
        {
          "x": "375",
          "y": "21.5",
          "series": "Observed"
        },
        {
          "x": "375",
          "y": "28.7479397636023",
          "series": "Out-of-fold ell"
        },
        {
          "x": "376",
          "y": "9.5",
          "series": "Observed"
        },
        {
          "x": "376",
          "y": "13.0459491673482",
          "series": "Out-of-fold ell"
        },
        {
          "x": "377",
          "y": "36.5",
          "series": "Observed"
        },
        {
          "x": "377",
          "y": "19.2668903435684",
          "series": "Out-of-fold ell"
        },
        {
          "x": "378",
          "y": "16",
          "series": "Observed"
        },
        {
          "x": "378",
          "y": "12.5451663747204",
          "series": "Out-of-fold ell"
        },
        {
          "x": "379",
          "y": "23.75",
          "series": "Observed"
        },
        {
          "x": "379",
          "y": "12.3772201959152",
          "series": "Out-of-fold ell"
        },
        {
          "x": "380",
          "y": "17.5",
          "series": "Observed"
        },
        {
          "x": "380",
          "y": "13.4582727534669",
          "series": "Out-of-fold ell"
        },
        {
          "x": "381",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "381",
          "y": "21.0659234211618",
          "series": "Out-of-fold ell"
        },
        {
          "x": "382",
          "y": "20.5",
          "series": "Observed"
        },
        {
          "x": "382",
          "y": "20.167122021151",
          "series": "Out-of-fold ell"
        },
        {
          "x": "383",
          "y": "25",
          "series": "Observed"
        },
        {
          "x": "383",
          "y": "22.8483018202918",
          "series": "Out-of-fold ell"
        }
      ],
      "summaryFile": "metr21-programs/realdata-actual-company-R-summary.csv",
      "summarySHA256": "48c5513a73b9f24927d6b58a84b3b9d776d30e9863ff8c67c5958001b58b7495",
      "pointsFile": "metr21-programs/realdata-actual-company-R-points.csv",
      "pointsSHA256": "cc804c7ea91335ab42265965e0b2fec326096cd092957510ccc8c18f53b89a76",
      "fullResultFile": "metr21-programs/realdata-actual-company-R-full.csv",
      "fullResultSHA256": "d86061c09fb0f87429c89539c165163f36962ffc6ea1dd8a717915f2e31b8322",
      "plotFile": "metr21-programs/realdata-actual-company-R.svg",
      "plotSHA256": "68e371b77254d96ab9f0191d1377501d034f3c01ad23bf76ea210ac7f4cbec10"
    }
  ],
  "byAPI": {
    "nuisance": [
      0,
      1,
      2,
      4
    ],
    "crossfit": [
      3,
      5,
      6,
      8,
      27,
      28
    ],
    "orthogonal": [
      7,
      9,
      10,
      12
    ],
    "aipw": [
      11,
      13,
      14,
      16,
      25,
      26
    ],
    "perturb": [
      15,
      17,
      18,
      19
    ],
    "realdata": [
      20,
      21,
      22,
      23,
      24,
      29
    ]
  }
}
