We first calculate moments’ predicted values. We abuse notation and use symbol “�” for predicted values. Consider the _ns_ draws for children eligible to attend grade _g_ in year _t_ . Predicted enrollment for ( _j_ , _g_ , _t_ ) is _N_<sup>ˆ</sup> _jgt_ =<sup>_M_</sup> _ns_<sup>_<u>gt</u>_∑</sup> _i_<sup>_ns_</sup> =1<sup>_P_</sup> _jgt_<sup>_i_</sup> � _ygt_ , _Dgt_ , _ξgt_ , _pgt_ , _Xigt_ ; _θ_<sup>_d_�</sup> , where _Pjgt_<sup>_i_(·) is given by (4) and we use</sup> _D_ to approximate _D_<sup>~~�~~</sup> in the r.h.s. of (4). Predicted enrollment share for ( _j_ , _g_ , _t_ ) is andto _D_<sup>~~�~~</sup> _S jtjgt_ = denotes∑ _g_ ∈ _κ jt_ <u>�</u> _N_ ˆ _nsjg_ its _t_ <u>�observed∑</u><sup>_ns_</sup> _i_ =1∑<sup>_D_</sup> _g_<sup>_i_</sup> ∈<sup>_P_</sup> _κjgt_<sup>_i_</sup> _jt_<sup>(</sup> _N_<sup><u>ˆ</u></sup><sup>_y_</sup> counterpart.<sup>_gt_</sup> _jgt_<sup>,</sup> _Dgt_ , _ξgt_ , _pgt_ , _Xigt_ Predicted; _θ_<sup>_d_</sup> ). Finally,schoollet characteristics _C_<sup>~~�~~</sup> _kt_ be the _C_<sup>�</sup> ×are 1 vectorequal of predicted average values for neighborhood _k_ in year _t_ , with the following _C_<sup>�</sup> = 3 elements: (i) percent of children enrolled in charter schools, (ii) average travel distance for children enrolled in public schools, and (iii) average travel distance for children enrolled in charter schools. Let _Ckt_ denote this vector’s observed counterpart.

Denote by _Xt_ the union of the _Xigt_ sets over all households. We assume that _E_ � _D jt_ | _Xt_ � = _D_<sup>~~�~~</sup> _jt_ and _E_ ~~�~~ _Ckt_ | _Xt_ � = _C_<sup>~~�~~</sup> _kt_ , and that _D jt_ and _Ckt_ are different from their expected values due to sampling (or measurement) error: _u_<sup>_D_</sup> _jt_<sup>=</sup> _D jt_ − _D_<sup>~~�~~</sup> _jt_ and _u_<sup>_C_</sup> _kt_<sup>=</sup> _Ckt_ − _C_<sup>~~�~~</sup> _kt_ . Following BLP and Nevo (2000, 2001), we assume that ∆ _ξ jgt_ is meanindependent of the corresponding instruments: _E_ (∆ _ξ jgt_ | _Z_<sup>_X_</sup> _jgt_<sup>) = 0.Inaddition,weas-</sup> sume _E_ ( _u_<sup>_D_</sup> _jt_<sup>|</sup><sup>_ZD_</sup> _jt_<sup>) = 0 and</sup><sup>_E_</sup> � _u_<sup>_C_</sup> _kt_<sup>|</sup><sup>_Z_</sup> _kt_<sup>_C_</sup> � = 0.

To estimate the BLP model, researchers typically rely on a nested-fixed point algorithm. This finds the baseline utilities _δ_ that equate predicted and observed market shares for each value of _θ_<sup>_d_</sup> . Since this algorithm is slow and potentially inaccurate, we follow Dube et al (2012) and formulate our estimation as a mathematical programming with equilibrium constraints (MPEC). Our MPEC problem, more complex than Dube et al’s given the inclusion of demographic and neighborhood moments, is as follows: where _λX_ , _λD_ and _λC_ are sample interactions of the shocks ∆ _ξ_ , _u_<sup>_D_</sup> and _u_<sup>_C_</sup> with the corresponding instruments (see details in Appendix E.1); _S_<sup>ˆ</sup> (·) is given by (14); and _VX_ , _VD_ and _VC_ are positive definite matrices. The MPEC algorithm simultaneously searches over values of ∆ _ξ_ (and hence _δ_ ) and _θ_<sup>_d_</sup> ; given values for these, it calculates moments’ predicted values. The constraints of the MPEC problem ensure that observed enrollment shares _S_ match predicted shares _S_<sup>ˆ</sup> .

Given the decomposition of the demand shock _ξ jgt_ ,we include school-, gradeand time-fixed effects in the utility function. Since the school fixed effects capture both the value of time-invariant school characteristics, _y jβ_ , and of school quality _ξ j_ in (2), 23