where _distjk_ is the distance in kilometers along the shortest path on the actual road network, ( _distjk >_ 50 _km_ ) takes on 1 if the inequality holds and on zero otherwise, and _ξ_ 0<sup>_T_is calibrated</sup> so that we match the share of the total government budget allocated to roads.

**Calibration of Transport Costs.** Observed transport costs between two neighboring regions _i_ and _j_ are a function of the road quality investment _Iij_ (derived from the DNIT geospatial roads database) and the geographical-barriers parameter _δ_<sup>_T_The road quality along a given</sup> _ij_<sup>.</sup> discretized segment is computed as the average speed at which products can travel (see Appendix E for details). To calibrate _δ_<sup>_T_inturn,weusethedistanceinkilometerstakinginto</sup> _ij_<sup>,</sup> account that one can reach a location through the observed road network or, if there are no roads connecting _i_ and _j_ , by land. More specifically, we compute the geographical barriers between any two locations as the shortest path through the road network or by land weighted by the ruggedness index. We assume, following Allen and Arkolakis (2014), an exponential form for the normalized distance.

**Calibration of Electricity Investment Costs.** To assign values to the marginal cost of investing in quality of electricity, _ξi_<sup>_G_,we assume that</sup><sup>_ξ_</sup> _i_<sup>_G_can be expressed as</sup><sup>_ξ_</sup> _i_<sup>_G_=</sup><sup>_ξ_ ̄</sup><sup>_G_/</sup><sup>_δ_</sup> _i_<sup>_G_,</sup> where _ξ_<sup> ̄</sup><sup>_G_</sup> is calibrated to match the share of investment in electricity (71.88%),<sup>15</sup> and following Lipscomb et al. (2013), _δi_<sup>_G_is given by</sup>

_δ_<sup>_G_Φ (</sup><sup>_β_1 log(Max Flow) +</sup><sup>_β_2Average Slope in River +</sup><sup>_β_3Max. Slope in River +</sup><sup>_β_4Forest Cover)</sup> _i_<sup>=</sup> where Φ( _·_ ) denotes the CDF of the standard normal distribution, and the coefficients are taken from Table 1 in their paper. Their estimates provide the geographic potential for hydroelectric energy production. We assume that locations with smaller potential have a higher cost per unit of electricity investment because they are more dependent on the external electricity supply.

**Calibration of Available Grid Supply of Electricity.** To calibrate _Ei_ , we use the IBGE continuous cartographic database (Bases Cartográficas Contínuas), which provides data on the location and load of the main sources of energy generation. We use the load from thermal and hydroelectric stations to compute a distance-weighted average of the total available load for each region. We subtract the average electric power transmission losses.<sup>16</sup> Finally, we normalize this index to be in the range [1, 100].

**Calibration of Local Quality of Electricity.** The observed quality of electricity _Gi_ is calculated based on two collective indicators of continuity provided by ANEEL: the Equivalent

> 15This number comes from the World Bank PPI database: `ppi.worldbank.org` . Other sources (Paiva, 2010; BNDES, 2014) suggest very similar values.

> 16World Bank Data estimates that average electric power losses as a percentage of output from transmission and distribution are 14.6%. The series identifier is EG.ELC.LOSS.ZS.

21