Pirates of Somalia: Crime and Deterrence on the High Seas∗

[PRELIMINARY AND INCOMPLETE PLEASE DO NOT CIRCULATE]] Piracy off the coast of Somalia took the world by surprise when, within a six-year span (2005-2011), as many as 1,099 ships were attacked, among which more than 200 were successfully hijacked. In 2012 however, attacks had plummeted with no new hijacking reported between 2013 and mid-2015. We quantitatively investigate the roles of two crime deterrence measures widely believed to be responsible for the collapse of Somali piracy: the deployment of international navies in pirate-infested waters and the provision of armed security guards onboard vessels. Using unique data on attacks, hijacks, and ransoms to calibrate a structural model of Somali piracy, we estimate the elasticity of crime with respect to deterrence and highlight the positive and negative spillovers generated by the private adoption of onboard armed security. We discuss counterfactual scenarios obtained by varying the intensity and composition of deterrence measures.


Introduction
Piracy off the coast of Somalia has stunned the international community by its dramatic rise over the years [2005][2006][2007][2008][2009][2010][2011]. As of June 2015, 1,099 reported attacks have been attributed to Somali pirates who have moved beyond the Gulf of Aden and launched attacks as far south as the Mozambique channel and as far east as the western shores of the Indian subcontinent. 216 vessels and their crews have been hijacked, which has allowed pirates to claim an estimated total of US$338m in ransoms. Equally astonishing was its collapse in 2012, which has been sustained as of June 2015; in the eyes of international public opinion, Somali piracy has largely faded into oblivion.
The deployment of naval assets in the Western Indian Ocean and the increased use of armed security guards onboard vessels sailing through pirate-infested waters have often been credited for the eradication of piracy. To investigate this claim and measure the crime elasticity with respect to these two forms of crime deterrence, we set up a structural model of Somali piracy, which we then calibrate using novel and rich data on incidents attributed to Somali pirates.
We find that, while the effect of navy patrols has been modest and largely homogeneous across vessels of all sizes, the provision of armed guards onboard vessels accounts for the bulk of the observed drop in piracy attacks starting in 2012. We find that if 10 percent of the largest vessels sailing off the coast of Somalia in 2011 were equipped with armed security, it would have resulted in a 30 percent drop in the number of attacks, and a 12 percent drop in the number of hijacks.
We further quantify the displacement effect, whereby larger vessels protecting themselves against an assault induce pirates to turn to smaller ships instead. We nevertheless find that for smaller vessels, the decrease in overall attacks due to the self-protection of larger ships dominates the negative effects of crime displacement, which has in part been mitigated by the presence of patrolling navies. We then draw implications for a theory of optimal policing (Eeckhout, Persico and Todd 2010) in the presence of these spillovers.
The Somali piracy business model that we look at is exclusively a kidnapping-for-ransom model, whereby the sole purpose of hijacking a vessel is to "sell" her back in her entirety to the shipping company as opposed to cargo and vessel theft, which is prevalent elsewhere in the world.
In our model, therefore, pirate teams form and comprise an assault and a "hold-out" crew. Assault teams set off to attack vessels sailing through the Gulf of Aden and beyond. The probability that an attack is successful depends on the assault team's intrinsic ability and the vessel's characteristics, but also on the level of deterrence. Deterrence interventions consist of the deployment of naval assets to police stretches of the Indian Ocean and the provision of armed guards onboard vessels. We assume that the former is a public good in that it benefits all ships sailing through pirate-infested waters, while the latter only protects the vessel armed guards are onboard. When an attack is successful, vessel and crew are brought back to Somali shores and the hold-out crew takes over to protect and maintain the ship and feed the crew while negotiation with the shipping company over a ransom for their liberation takes place. The amount that can be extracted ultimately depends on the ship's value and the hold-out crew's inherent willingness/ability to carry protracted negotiations. Under some regularity assumptions, the equilibrium of the model is characterized by supermodularity whereby more able pirates attack larger vessels and positive assortative matching by which high ability assault teams pair with high ability hold out teams.
Finally, we close our model by stipulating the piracy business entry condition. We assume that the number of pirate teams operating in any single period is a function of the expected payoffs of doing so. Our model thus delivers a number of time-varying equilibrium outcomes that are functions of structural parameters of the model: the number of pirate attacks and their distribution across vessel types, the success rates by vessel types, and for the hijacked vessels, the ransom extracted and the duration of captivity.
These structural parameters are calibrated using the method of simulated moments. We use a unique data set that contains, for each incident attributed to Somali pirates over the 2006-2012 period, its date, the characteristics of the vessel that was attacked, whether the attack was successful in that it resulted in the hijacking of ship and crew, and if so, the duration of captivity and amount of ransom paid. The calibrated model then allows constructing a counterfactual to measure the elasticity of crime with respect to deterrence. It is also used to understand and quantify the mechanisms behind the effects that the different types of interventions have on the evolution of Somali piracy. On the one hand, navy patrols reduce the success rates of piracy attacks across all types of ships, therefore discouraging pirates from entering the business in the first place. On the other hand, we find that targeted onboard security accounts for the bulk of the reduction in the number of attacks. When the deployment of armed guards is concentrated among larger and hence more valuable vessels, this intervention reduces the success rate of hijacking larger ships, hence creating a positive pecuniary externality: by lowering the expected payoffs of a pirate expedition, private onboard armed security deter entry and hence benefits all vessels. This positive spillover is similar to the one identified by Ayres and Levitt (1998). 1 However, as commonly highlighted in the crime-deterrence literature, protection induces a displacement of crime towards more vulnerable targets, the smaller ships in our context. We thus emphasize the role of the naval assets deployed on the Indian Ocean to ensure that the pecuniary externality exceeds the effect of displacement for every category of ships. We then simulate various scenarios that look at the elasticity of crime with respect to both level and composition of deterrence activities. In particular, our policy simulations vary the composition of deterrence interventions to determine the marginal rate of substitution between navy patrols and onboard security guards. Using cost estimates, we discuss the optimal allocation of limited funds between these two crime deterrence instruments.
Our paper contributes to the modern literature on the economics of crime pioneered by Becker (1968) and Ehrlich (1973). 2 Our primary objective is to provide estimates of the crime-policing elasticity, where policing here is achieved by a mix of naval patrols and onboard armed security guards. We thus complement the contributions of Levitt (1997), Corman and Mocan (2000), Di Tella andSchargrodsky (2004), or Draca, Machin andWitt (2011). A noteworthy difference is that the identification of the impact of deterrence on crime in these and most other studies relies on arguably exogenous spatial heterogeneity in the level of policing. Such quasi-experimental settings generate a "natural" counterfactual, which allows identifying crime-policing elasticities. In our setting however, there is no such natural counterfactual, since all pirates are subject to the same crime deterrence environment. We instead propose a structural model of the piracy business that we then calibrate. By putting structure on agents' behavior, our model allows not only constructing a counterfactual to measure the elasticity of crime with respect to deterrence, but also gauging the extent of crime displacement (Cornish andClark 1987, van Ours andVollaard 2015), which in most natural experiment settings is a potential source of concern for identification. 3 We indeed assess the effect of equipping large vessels with onboard armed security on the likelihood that smaller boats become targets of pirate attacks instead. Similarly, we can also quantify the positive externalities generated by the deployment of armed guards onboard vessels, which echoes other analyses of the spillovers from private protection (Ayres and Levitt 1998, Gonzalez-Navarro 2013, Vollaard and van Ours 2011, van Ours and Vollaard 2015. Finally, one central policy discussion in the paper pertains to the optimal allocation of police resources, which is also addressed in say Fu and Wolpin (2014). More specifically, we focus on the relative effectiveness of un-targeted -the deployment of naval assets off the coast of Somalia -versus targeted -the hir-2 For a recent review, see Draca and Machin (2015). 3 Banerjee, Duflo, Keniston and Singh (2012) also specify agents' preferences so to address crime displacement in the presence of increased law enforcement ing of onboard armed security guards -deterrence interventions. We thus follow Lazear (2004), Eeckhout et al. (2010), and Banerjee et al. (2012), in that we examine the optimal composition of deterrence interventions. The novelty brought about by the context of our study is the presence of both positive and negative spillovers generated by targeted interventions, which has implication for how optimal deterrence is characterized.
The rest of the paper is organized as follows. Section 1 provides background information on Somali piracy and presents some stylized facts. In section 2, we lay out a model of Somali piracy and crime deterrence, which we calibrate in section 3. We conduct our policy simulations in section 4. Section 5 concludes. Out of these 1,099 attacks, 216 were successful, resulting in the hijacking of ships and crews (these instances are depicted by a red dot in Figure 1). Figure 3 plots Somali attacks and the success rate, i.e. the fraction of attacks that were successful in a given year. The success rate spiked in the early years of piracy to drop equally sharply in 2009, at the same time international navies started to get deployed to police the Indian Ocean, and again in 2011 as armed security guards were increasingly placed on board of vessels sailing through pirate-infested waters.

Piracy off the Coast of Somalia
Somali pirates' modus operandi At the origin of a pirate attack is the initiative of an instigator who would assemble a team consisting of an assault crew and a "hold-out" team in charge of logistics once a vessel is brought to shore for ransom negotiations. An assault is conducted out of two to three skiffs with between 10 to 20 persons on board. Pirates would be armed with weapons, be equipped with navigation equipment, and dispose of a ladder to board vessels (World Bank 2013). When a vessel is successfully hijacked, she is brought back to Somali waters and anchored off the coast. Figure 5 shows the locations where hijacked vessels have been held while negotiation for their release was taking place. An entirely different team -the hold-out team -of pirates then takes over from the assault team. In addition to a negotiator and translator, the hold-out team further comprises a posse dedicated to securing access to the beach to deliver protection, food and water, and energy to the boat and its crew being held hostage. The negotiation team's connections with local power brokers and the stability of the local political landscape are therefore understood to play a critical role on the pirates' ability to sustain protracted negotiations with the shipping companies' representatives (World Bank 2013).
Once an agreement is reached, the ransom is paid and the vessel released. We estimate that Somali pirates extracted around US$338 million in ransoms over the 2005-2015 period (see section 3 for a description of data sources). The amount of ransoms extracted steadily increased over time. In 2012, the data is however censored as some vessels are still being held hostage in 2015 and these are likely to command large ransom payments. To achieve such results, pirates have been able to hold out for long periods of time. The longest reported case is the crew of the MV Albedo, hijacked in 2010 and released only in June 2014 after 1288 days of captivity; the vessel itself had sunk in 2013 and 5 crew-members died or were reported missing then. Figure 6 plots the evolution of ransom payments and durations of captivity over time. Indeed, as illustrated in The shipping industry too adopted its own counter-piracy measures. MSCHOA (2011) issued "best management practices for protection against Somalia-based piracy". These include instructions to protect ships against boarding, procedures to follow in case of an attack, and reporting protocols. On the question of onboard armed guards, however, no recommendation was pro- State "exclusive jurisdiction on the high seas." However, countries where armed security companies are registered, operate, or transit might also exercise jurisdiction. The surge in piracy off the coast of Somalia has however prompted the international community and individual States to reconsider their legal stances on private armed guards on board of vessels. The U.K. allowed armed security on board towards the end of 2011; France did so only in late 2013.

A Model of Crime and Deterrence on the High Seas
To model the distinct roles of the navies on the one hand and of the armed guards deployed on merchant vessels on the other hand, we follow Lazear (2004) and Eeckhout et al. (2010) and consider a policing model in which law enforcement can apply uniformly or be targeted at one group of vessels only. Uniform law enforcement is ensured by navies from the military coalitions operating in the Indian Ocean; in each time period t, ν t indicates the number of assets deployed off the coast of Somalia. Policing can alternatively be targeted in that onboard security personnel can be dispatched on selected vessels. Vessels fall into three categories η ∈ {1, 2, 3}, which are observable to pirates. Fishing vessels and passenger boats fall under category η = 1, η = 2 corresponds to small cargo and bulk container carriers, and η = 3 corresponds to tankers and large cargo carriers. When vessels have onboard security personnel, the probability of being hijacked is zero. As in an earlier analysis of the impact of Lojack (Ayres and Levitt 1998), presence of security personnel is only observed by pirates once an attack is actually launched. We denote µ t η the fraction of vessels of type η that have onboard security details in period t, and µ t denotes the vector µ t 1 , µ t 2 , µ t 3 . At the beginning of each period t ≥ 1, the level of deterrence and its composition ν t , µ t are publicly known and a new generation of N t pirate teams form and enter the business. As described in the previous section, a kingpin assembles a pirate team, which consists of an assault crew and a negotiation team. Assault crews have heterogeneous ability denoted x ∈ R + , while negotiation teams differ by their discount rates δ ∈ [0, 1]. A team i ∈ 1, ..., N t is thus characterized by (x i , δ i ) .

Assault ability, learning, and hijacking rates
In each period t, the probability of an assault team of ability x to successfully hijack a vessel of type η is a function of the level of deterrence ν t and whether or not the vessel has armed security guards onboard. While the presence of armed security is not observed until an attack is actually launched, it always results in a failed attempt. The probability of a successful hijack therefore takes the form π t η x|ν t , µ t η = 1 − µ t η · Π x, η, ν t . To capture how pirate ability, vessel size, and the presence of international navies interact, we note that larger vessels are intrinsically more difficult to hijack due to, among other things, a higher freeboard, but assume that the ability of assault teams mitigates these obstacles. Furthermore, we consider international navies as being public goods. 4 We thus specify the interactions between pirate ability x, vessel size η, and navy patrolling intensity ν t as follows: (1) The relationship between pirate ability and hijacking probabilities is assumed to be given by While φ η is a scaling parameter, exponent φ captures the extent to which pirate ability x affects success probabilities. In the CES composite, parameter σ captures the elasticity of substitution between navies and vessel/pirate characteristics, while λ is the relative weight of these two components in determining the success probability. An added parameter γ allows the success rates to exhibit increasing, decreasing, or constant returns to scale.

Learning
We further extend the model to account for two important features that we observe from the data.
First, whether one looks in the aggregate or boat-type by boat-type, pirates have been increasingly successful at hijacking vessels over the period 2006-2008 (see Figure 3 and the breakdown by boat types in Figure 4). The increased ability could be driven by learning-by-doing or by better selection among an increasingly large pool of candidates for piracy. We thus assume that, at any period of time t, the ability of pirates entering the business is random draw from a time-varying with associated PDF denoted g t (x) = g x|b t , θ t . Parameters b t and θ t are the period-t lower bound and tail index of the ability distribution, respectively. We furthermore allow ability to increase over time; the distribution of ability shifts over time, with both parameters varying according to While parametersb andθ are the baseline values, the rates of growth of the lower bound and tail index of the ability distribution are thus given by α 0 and α 1 , respectively.
Moreover, Figure 4 indicates that the share of attacks on the largest ships (η = 3) was very high even when the success rates were extremely low. At the beginning of the phenomenon, almost 70 percent of pirate attacks were on type-3 boats when success rates were at a mere 3 percent. Meanwhile, smaller vessels were relatively overlooked despite being easier targets. This discrepancy however shrinks over time. To account for this apparent mismatch between actual and perceived success probabilities, we further assume that learning also entails learning about the vector of probabilities π t η (x) η∈{1,2,3} . More specifically, pirate priors about the probability of success in an attack are given bỹ withΦ t η (x) =φ t η ·x φ and a learning processφ t η = (1 − ζ)·φ t−1 η +ζ ·φ η , where ζ < 1 is the parameter that governs the speed of learning. The speed of convergence towards the true probabilities thus depends on the speed of learning (1 − ζ) and the initial bias in pirate priors.

Ransom negotiation: holdout and payment
Once hijacked, pirates then attempt to "sell back" cargo and crew to the shipping company. Ransom negotiation is modeled as a split-the-pie bargaining game under one-sided asymmetric information. As suggested by the data, longer hold out time is associated with higher ransoms paid making it consistent with a setting where pirate preferences are private information. Earlier, we discussed how critical it is for pirates to be able to maintain hijacked vessels anchored off the coast of Somalia during protracted negotiations given the fragility and volatility of the local political landscape. Shipping companies have a discount factor δ 0 known to everyone, while the discount rate δ of the negotiating team is private information. In each time period t, the support of the distribution of δ is nonetheless common knowledge and is assumed to be dense and bounded below by someδ t ≥ 0.
Assuming that the negotiation process follows the structure in Admati and Perry (1987) and Cramton (1992), the value of the ransom is the complete-information Rubinstein (1982) outcome In a separating equilibrium, pirate of type δ who announces a typeδ is offered a ransom p δ , V η after delay T t δ . The holdout time function T t δ that supports such separating equilibrium satisfies the incentive-compatibility constraint given by (Cramton 1992): Taking the first-order conditions yields Define E t (η) the support of the prior probability distribution of types of pirates who hijacked a vessel of category η in period t and E t (δ|η) = E t (η) ∩ (0, δ). The hold-out time function T t (δ) is then given by Lebesgue integral where dT t dδ is defined by first-order condition (5). Note that our approach here is similar to Ambrus and Chaney (2010) in that both structurally estimate a bargaining gameà la Cramton (1992) where delay strategically signals one's patience.
In the context of ransom negotiations by the Barbary Corsairs of 16 th -18 th century Europe however, asymmetric information is found to be on the "buyer's" side as longer delays are associated with lower ransoms paid. While the focus of Ambrus and Chaney (2010) is to evaluate the efficiency of these bargaining institutions, our main objective here is to relate Somali pirates' ability to extract ransoms with their success at capturing vessels in the first place and the growth of that industry.

Vessel choice, pirate team formation, and entry
Assuming risk-neutrality, a pirate team i's expected payoff from attacking a vessel of type η is equal to where ρ (.) and T t (.) are defined by (4) and (6), respectively. Given that utility u t η Proposition 1: Vessel choice Under supermodularity conditions (3), there exist three cutoffs Proposition 1 shows that ability predicts the type of vessels pirates will choose to attack. Supermodularity assumptions (3) imply that higher ability pirates opt for larger vessels, while lowest ability ones go for smaller crafts. In the rest of the theoretical section, to be consistent with the fact that we consistently observe attacks on mid-size ships, we assume thatx t 12 ≤x t 23 so that (8) applies. The treatment of case (9) is qualitatively similar nonetheless.
We now look at how pirate teams form. Kingpins choose teams with varying ability levels.
The expected payoff function u t (x, δ) is supermodular, implying that the association of assault crews and negotiating teams that maximize total payoffs is characterized by positive assortative matching: aggregate payoff is maximized when higher ability assault crews are matched with more patient negotiation teams. Proposition 2 formalizes the intuition; the proof follows Kremer (1993) and is omitted.

Proposition 2: Positive assortative matching Aggregate expected payoff is maximized if and only
if for any two pirate teams i and j characterized by abilities (x i , δ i ) and (x j , δ j ), respectively, we The actual matching between assault and negotiation teams is not formally modeled here. Instead, we assume that the distribution H t (.) of hold-out team discount rates δ is a monotonic transformation of G t (.). We define the lower bound of the discount rate distribution. In equation (10),δ and β are the location and shape parameters that define the correspondence between the distributions of assault and holdout team abilities. The distribution of hold-out team types is then given by Matching between assault and hold-out teams is then assumed to be imperfect, whereby with some probability ξ perfect matching occurs, i.e. an assault team of ability x is matched with a hold-out team of patience δ (x) such that and with probability (1 − ξ), matching is random, i.e. an assault team of ability x is matched with a hold-out team, the patience of which is drawn from distribution H t (.|δ, β).
As a consequence, imperfect matching implies that in equilibrium, the support of the prior probability distribution of pirate patience is simply E t (δ|η) = δ t , δ , and we can rewrite (6) as Finally, the number of pirates that enter in each period positively depends on the expected payoffs of doing so. For a given level of enforcement ν t , µ t , the pirates expected payoffs are given by We next specify the entry condition as where r and α 2 are respectively the location and shape parameters that determine the mapping between expected payoffs and entry. Equations (1), (2), (4), (8), (13), and (15), are, for each period, expressions of the number and composition of pirate attacks, their success rates, and the length of captivity and ransom extracted for hijacked vessels, as functions of structural parameters of the model. We can then use actual data to calibrate the proposed model.

Data Description
The data set we use in this paper comes from two main sources. The first source is the data on pirate attacks provided by the International Maritime Bureau's Piracy Reporting Center, thereafter referred to as the IMB data. The Piracy Reporting Center collects information on all self-reported pirate attacks around the world. Our data are between 2000 and 2012, and include the date, time, location (longitude and latitude) of the attack, the basic characteristics of the vessel being attacked, such as type, tonnage, flag nation, management nation, crew nationality, existence of onboard security, etc. The IMB data broadly classify the outcome of the attack into"attempted", "boarded", "detained", "fired upon", "hijacked", "missing", and "suspicious" categories. We define those attacks that ended in hijacks as "successful" attacks.
The second source is the data on ransoms. These data come from the joint data set compiled or sunk), the amount of ransoms paid, and the length of the negotiation. We merge the two data sets to get a complete picture of each successful hijack. The date and the location of the attack, along with the basic characteristics of the vessel uniquely identify the vessel in both data sets, and thus allow us to link the attack information from IMB to the ransom data in UNODC-WB. All the statistics reported in Section 1, as well as the calibration described in this section are based on this data set.
We classify an attack as carried out by Somali pirates if it took place along the coast of Somalia, Egypt, Eritrea, Iran, Iraq, Kenya, Oman, Saudi Arabia, Seychelles, Tanzania, UAE, Yemen, or anywhere in the Red Sea, Arabian Sea, Gulf of Aden, or Gulf of Oman. In the model we classify the vessels into three categories. In the data, the counterpart definition of type 1 (η = 1) vessels are dhows, fishing vessels, passenger vessels, and yachts. The type 2 (η = 2) vessels are general and refrigerated cargo ships. The type 3 (η = 3) vessels are various types of tankers and carriers.
Detailed information on the attacks across types of vessels and time is reported in Table 1.

Calibration
Method We jointly calibrate the model parameters with the method of simulated moments following the ideas outlined in McFadden (1989). There are 27 structural parameters in the model, which we collectively denote as the Θ vector. Our calibration strategy consists of finding the vector Θ that minimizes the weighted distance between a set of simulated moments and their counterparts in the data. Specifically, Θ is defined as: where n = 1, 2, · · · 76 indexes the moments to be matched, and s = 1, 2, · · · , S indexes the number of simulations, S being the total number of such simulations. m n is the n-th moment in the data, andm n (Θ; s) is the nth moment in the sth simulation of the model conditional on parameter vector Θ. W is the weighting matrix, which is the inverse of the variance matrix of the data moments. 5 We compute this variance matrix by bootstrapping with 1000 repetitions.
We calibrate the model parameters using data from 2006 to 2012. 6 The four panels in Table   3 list the 76 moments to be matched. The selected moments summarize the evolution over time of our main variables of interest for the pre-onboard security period that are: number of attacks, success rate, ransom amounts, and duration of captivity. In addition, we include several moments that span the 2011-2012 years in order to calibrate the share of type-2 and -3 ships that hire onboard security starting on 2011. These moments summarize the evolution in the number of attacks and their success rates in 2011 and 2012. Given that in our model onboard security has no impact 5 Altonji and Segal (1996) show that using the optimal weighting matrix introduces significant small sample bias. We follow Blundell, Pistaferri and Preston (2008), and use a Diagonally Weighted Minimum Distance approach for our weighting matrix. Under this approach, W is set to the diagonal elements of the optimal weighting matrix, while the terms outside the main diagonal are set to zero. 6 We drop 2005 from our sample given the political events that took place in Somalia in 2005 and affected pirate operations (see Section 1 for a discussion of the context). on the ransom and length of captivity of ships once these are hijacked, our calibration exercise excludes these moments for the 2011 and 2012 years. Instead, we evaluate if our calibrated model can replicate these data patterns for the post-onboard security period.
The first 27 moments listed in panel (a)  to 2010, as well as per year. In addition, we target the average ransom payments separately for each type of vessel in 2008. We, therefore, isolate changes over time of ransoms and exclusively compare how the average ransom payment varies by type of vessel. Intuitively, this information can allow to pin down V η , the parameters governing the value of each vessel type. Lastly, panel (d) shows the 12 moments that summarize the negotiation length over time: the average and standard deviations of negotiation length overall, as well as separately for each year.
To calibrate the model, for each period we first solve the vessel choice problem of the pirates, and the number of potential entrants, conditional on the deterrence level announced at the beginning of the period. To do this, we first discretize the ability set of pirates in each year into 50 equally spaced points between b t andx t ; recall that b t is the theoretical lower bound of the ability distribution in year t. The Pareto distribution being unbounded from above, we truncate the upper tail by setting G t (x t |b t , θ t ) = 0.99, which makesx t the top 1 percent of the ability distribution in year t. We compute the expected payoff for attacking different types of ships on the grid points, and find the cut-off ability for vessel choices and the expected payoff of potential entrants through spline interpolation and numerical integration based on the trapezoid method. The expected payoff of potential entrants pins down the number of entrants, N t , in each year.
We then proceed to simulate the model conditional on the number of entrants. In each year, we randomly draw N t pirates from the distribution G(·). For each pirate, we first compute their success rate based on their vessel choice, and then we simulate the outcome of the attack. The successful pirates enter the negotiation stage, secure ransoms, and the unsuccessful pirates exit the game immediately. At the end of the year all the pirates exit, and we start the simulation of the next year following the steps outlined above. At the end of the 7-year simulation, we compute the moments from the simulated data. The entire simulation is repeated S = 100 times for every input of Θ in the algorithm that minimizes equation (16), and the simulated moments are computed as the average across the 100 simulations.

Model Fit
The calibrated 27 parameters for the benchmark model are reported in Table 2. We list the 76 targeted moments, alongside with their data counterparts in Table 3, and plot in Figure   8 Figure 8 shows that overall the model closely tracks the data in the total number of attacks. Our model is also able to capture the compositions of the vessels attacked.
Over the years, between 55 and 85 percent of the attacks concentrate on type-3 ships in the data.  Table 3 and Figure 8 compare the simulated success rates against the data. Our model is able to capture the fact that larger ships are inherently more difficult to hijack: in the data, the average success rate over time of attacking type 3 vessels is 11 percent, compared to 29 percent for type 2 vessels and 67 percent for type 1 vessels. In our model, these averages correspond to 11 percent for type 3 ships, 24 percent for type 2 ships and 64 percent for type 1 ships, respectively. Before navy patrols start securing the area, the success rate of attacks increases as pirates accumulate more experience. For example, the success rate of attacking type-2 vessels in the data increased from 14 percent in 2006 to 43 percent in 2008. In our model, the success rate increases at a slower pace, from 24 percent to 27 percent. Once navy patrols were introduced, the success rate in the data for type-2 vessels drops to 36 percent in 2010. In our model, the success rate drops similarly to 20 percent. Table 3 and Figure 8 compare the moments on ransom payments and duration of captivity. Since the data variances of these moments are substantially large, the weights assigned to these moments in the calibration are smaller. Therefore, our model predictions on ransoms and duration of captivity are less aligned to their data counterparts. Nevertheless, the model captures the overall average and standard deviation of the two variables well, and is also able to replicate the time trends. As seen in Figure 8, the predicted average ransoms and duration of captivity lie always within the 95 percent confidence interval of the average ransoms and duration of the data. In the case of ransom payments, the data reveal that the average ransom payments steadily increase until 2011, and then drop to almost zero in 2012. Our model is able to trace the inverse-U shaped time trend of ransom payments, though the drop in 2012 is larger in the data. Our model is also able to capture the time trend of average negotiation length over the 7-year span.

Panels (c) and (d) in
At these parameter values, the learning process of pirates mainly occurs through two channels.
The first is through the drop over time of θ t , which leads to fatter tails in the ability distribution over time, i.e. to more "super star" pirates. The second is through the evolution of priors about the probabilities of success. The role of each of these channels in explaining the evolution of piracy over time is discussed in more detail in Section C of the Appendix.
We validate the out-of-sample fit of our model by comparing the model predictions on the yearly average ransoms and durations of captivity of successful hijacks after 2010. We excluded these moments from the calibration because in our model, these moments are not directly influenced by the shares of ships hiring onboard security. Figure 8 shows that our model predictions of average ransoms and delay patterns in the post-onboard security period lie within the 95 percent confidence interval of these data moments. In the data, the average ransoms were 2.94 million dollars in 2011, and zero by 2012, compared to 1.91 and 0.87 million dollars in our model. For these years, the average length of captivity in the data was 0.46 and 0.09 years, compared to 0.44 and 0.18 years in our model. This lends credibility to the model mechanism that links attacks, vessel selection, and ransom payments.

Crime and Deterrence off the Coast of Somalia
In our benchmark model we allow for two forms of deterrence: navy patrols, which provide security to all vessels, and onboard security, which only protects the vessels that hire them. However, the provision of onboard security on some observable categories of vessels might lead to a displacement of crime towards unprotected categories. Conversely, the decreased expected payoffs from piracy due to private protection reduces the incentives to commit crime in the first place; shipping companies hiring private armed guards onboard vessels hence generate a positive pecuniary externality on all vessels regardless of their protection status. In this section we carry out several counterfactual analysis to understand the effects of the two forms of security. We first calibrate the marginal effects of different policies separately, and then move to understand the optimal policy combinations to curb the piracy problem, conditional on the costs of these policies.
Onboard security Onboard security was only introduced widely starting from 2011, several years after the piracy problem went rampant. We discussed earlier the absence of a legal framework that would allow a rapid and systematic deployment of armed guards onboard vessels.
We investigate the policy of increased onboard security among, say, largest vessels. Such intervention affects the number N t 3 ν t , µ t of attacks on such boat category.
Not only fewer attacks end up being undertaken, but conditional on an attack taking place, large vessels are also less likely to be targeted. Similarly, smaller crafts (η = 1) also benefit from the overall decrease in crime. An increase in µ t 3 leads to a decrease in total attacks, which induces a proportional decrease in the number of attacks on type η = 1 vessels: if the number of attacks on fishing vessels is denoted N t On the other hand, since the provision of onboard armed guards to largest vessels displaces crime towards category η = 2 ships, the number of attacks of such ships is given by N t While the extensive-margin effect is positive as increased onboard security decreases the overall profitability of the piracy business, the intensive-margin effect on the other hand captures the displacement of crime onto smaller crafts . The net effect on type η = 2 vessels is thus an empirical question that we address next.
In our benchmark calibration we captured the impact of onboard security by allowing µ t η to be positive for type-2 and type-3 vessels in 2011 and 2012. To understand the role of onboard security, we first simulate a counterfactual world without onboard security by setting µ t η = 0 for all types of vessels throughout the entire simulation, while keeping all the other parameters as in the benchmark model. Figures 9 and 10 summarize the results of the simulations. The first-order impact of onboard security, unsurprisingly, is on the success rate of attacks. Without any private teams to protect the largest vessels, the success rate in the counterfactual world increases to 28 percent in 2012 -a 7 percentage point increase -as compared to the 21 percent success rate in our benchmark model. Higher success rate on large vessels impacts all the other key variables significantly. As tankers and container ships now constitute a larger proportion of the hijacked ships, average ransom in 2012 surges to US$2.63 million, more than doubling the average ransom in the benchmark simulation (US$1.05 million). Higher success rate and average ransom send a strong signal to the potential pirates -they observe the rising expected return, and join the piracy business en masse in the following periods. Consequently, the booming piracy business in the absence of onboard security threatens all the vessels in the area regardless of size. This positive externality generated by the private provision of armed guards onboard vessels is similar to the one identified by Ayres and Levitt (1998).
The total number of attacks in 2012, instead of dropping to 71 in the benchmark, skyrockets to 297 in the counterfactual. The impact of the piracy problem is felt across vessels of all sizes: the attacks on type-3 ships increased from 49 to 247, and the attacks on type-2 ships increased more than 4 folds, from 6 to 31. Even type-1 vessels -the fishing boats and dhows that do not directly benefit from onboard security -were affected through the negative spillovers: the number of attacks increases from 15 in the benchmark to 19 in the counterfactual.
To measure the elasticity of crime with respect to the prevalence of onboard security, we simu- The marginal effects of armed guards decrease as µ 3 approximates 1: for example, the number of attacks and hijacks stays almost the same as µ 3 increases from 0.8 to 0.9. This is mainly due to the displacement effect of targeted protection. Pirates start to switch their targets from type-3 ships to the smaller type-2 vessels. Figure 13 plots the number of attacks by different types of vessels as µ 3 increases to highlight the displacement effects. For smaller values of µ 3 , the positive externality offsets the displacement effects, and all types of vessels see fewer attacks. However, when more than 70 percent of the type-3 vessels start to hire armed guards, pirates start to shift to the less-valuable and less protected targets, the type-2 vessels. As a result of these, the effects on total number of attacks are greatly dampened for high values of µ 3 .
Private provision of security affects the piracy business by generating positive externalities that are similar in nature to the ones generated by Lojack on auto-thefts, as documented by Ayres and Levitt (1998) and Gonzalez-Navarro (2013). The self-protection of the large vessels only lead to a small benefit for the protected vessels. Given the vast traffic volumes through the affected area, the unconditional probability of being attacked by pirates is at most 1.04 percent -the ratio between the observed 185 attacks in 2011, and the traffic through the Suez Canal (17799 trips) in the same year. This probability is closer to the upper bound, as the Suez Canal traffic is strictly a subset of all the vessels traveling through the troubled waters. Combined with the average ransom of US$6.2 million for type-3 vessels and the success rate of 13 percent in the same year, the private monetary benefit of hiring a security team is only around US$8,400. This is well below the private costs of doing so, which is estimated by the (Oceans Beyond Piracy 2013) and (Oceans Beyond Piracy 2015) to be between US$19,950 and US$50,000 per trip. Admittedly however, the reason for hiring onboard security personnel goes beyond the avoidance of ransom payments only, but also includes the depreciation of the cargo and the vessel herself and most importantly the human cost imposed on the crew and their families. Since we are not able to put a dollar value to these other factors, we restrict ourselves to looking at ransoms only. Private protection generates sizable positive externalities by lowering the number of attacks on all types of vessels. As estimated in the previous section, one security team on average lowers the number of attacks by 1/75 when µ 3 = 0.52 and the displacement effects are negligible. This implies that the social benefit of the private security is around US$6.2m×0.13/75 ≈ US$10,746, i.e. more than 28 percent higher than the private benefit. The social benefits of private protection is not internalized by ship-owners; this potentially leads to under-provision of vessel protection, which could explain the late systematic adoption of self-protection and calls for a subsidy scheme.

Navy patrols
We study the effects of navy patrols in a similar manner. In the data and our benchmark simulation, navies start to patrol the affected regions at around 2009, and the intensity increased steadily from 48 patrols in 2009 to 61 patrols in 2012. In the first exercise we completely shut the public provision of security down by setting the naval patrols to 0 for all the years, while keeping all the other parameters, including onboard security, at the same level as in the benchmark model. These results are summarized in Figure 11.
The first order impacts of withdrawing navies are the unchecked success rates of the attacks. In 2009 the success rate increases to 25 percent, and in 2010 to 30 percent. By 2011, onboard security lowers the success rate in the counterfactual world to 20 percent. However, in the absence of navy patrols, by 2012 the success rate rises again to 28 percent because pirates switch to attack smaller unprotected ships, where the odds of success are higher. Thus, the success rate in 2012 is significantly higher in the counterfactual world relative to the data (21 percent) and benchmark model (21 percent). On the other hand, the navy patrols cannot effectively lower the average ransom payments. The graph clearly shows that the difference between the counterfactual and the benchmark in average ransom payments is negligible. This is expected, as the ransoms are mainly extorted from type-2 and type-3 vessels who depend on onboard security instead of navy patrols as deterrence measures. The number of attacks continued to increase after 2009 in the counterfactual scenario. Between 2009 and 2011, the total number of attacks only increased slowly from 158 to 185 in the data, while in the counterfactual world without navy patrols, they increased from 220 to 425 over the same period. The surge in number of attacks only stopped when onboard security was introduced in 2011 in the counterfactual simulations: by the end of 2012, the number of attacks dropped to 131 in the counterfactual scenario. Though the number of attacks at the end of the simulation is still higher than in the data, onboard security seems to be able to effectively reverse the trend of attacks.
In order the put a rough estimate on the elasticity of crime with respect to naval patrols, we run another set of counterfactual analysis in which we increase the number of patrols in 2009 gradually from 48 in the benchmark to 96. We then report the number of attacks, along with the marginal impacts of more frequent patrols on the attacks and hijacks in Figure 14. Unsurprisingly, more frequent patrols lower the number of attacks -though the marginal effects seems to be smaller.
A 10 percent increase in the number of patrols will reduce the number of attacks and hijacks by around 4.5 to 5 percent. Even with the navy patrols doubling to 96, the number of attacks only decreases by 38.17 percent to 126 in the next year.
Towards an optimal allocation of anti-piracy resources The above two counterfactual analyses show that navy patrols and onboard security work differently in curbing the pirate attacks. We thus attempt to estimate the optimal combination of navy patrols and security teams to tackle the piracy problem.
We look at the program of allocating limited resources between the deployment of naval assets in the Indian Ocean and equipping a number of vessels with onboard armed guards so to minimize the number N t of pirate attacks subject to budget constraint ν t + q · µ t ≤ I, where q = {q 1 , q 2 , q 3 } is the vector of prices and I is the total law enforcement budget. 7 Optimal policing, when characterized by an interior solution, is determined by the following trade-off: , for every η ∈ {1, 2, 3}. Given the expression for N t ν t , µ t and U t x | ν t , µ t given in (14) and (15), respectively, we have can then apply the envelope theorem and express the first-order conditions for vessels of type η as: The left-hand side of (17) captures the benefits of increasing the deployment of naval assets.
The right-hand side of (17) on the other hand captures a positive externality generated by increased onboard security: by lowering the expected payoffs of pirates, increased prevalence of onboard security reduces overall crime. Furthermore, an interior solution implies that the righthand sides of (17) are all equal for η ∈ {1, 2, 3}. Otherwise, from a crime-reduction standpoint, it is always optimal to dedicate resources for onboard security personnel to the one vessel type that generates highest revenues for the pirates, provided (i) the costs of doing so are similar across vessel types and (ii) the distribution of vessel types targeted by pirates mirrors the actual distribution of vessels sailing off the coast of Somalia. We will document in subsequent sections that, it is indeed the largest vessels that would provide the highest returns in terms of crime reduction per dollar invested in onboard security.
We can now draw the "iso-crime" curves of the two policies: the combinations of patrols and armed guards that will lead to a given number of attacks in the following year. These iso-crime curves for different years are presented in Figure 15. The iso-crime curves trace out the effectiveness of policy measures. In order to estimate the optimal policy combinations, we further need estimates on the relative price of these two policy measures.
To compute the relative price q 3 of onboard security provision, we look at cost estimates available in the literature. While analysis such as Besley, Fetzer and Mueller (2015) or World Bank almost surely an upper bound, as it assumes that the warship will be patrolling year-around. In the following years they have provided much more detailed breakdown of the costs of patrols. In their 2012 reports they estimated the total costs of operation to be around US$960 million for 63 patrols, and for the next year, US$912 million for 61 patrols. We take the difference of these two years, and estimate the cost per patrol to be around US$23.7 million. This cost estimate is closer to the lower bound of the true costs, as the difference-estimator takes away any fixed costs of main-taining navy bases in the region. In the end we use the average of the two estimates, US$26.97 million per patrol for all the years. We then proceed to compute the cost-minimizing combination of policy measures for every level of attack-reduction in each year, and plot the optimal policy rules as the black solid lines in Figure 15. The iso-crime curves are concave to the origin indicating that the positive externality generated by the individual provision of onboard armed security always exceeds the displacement effects when looking at aggregate crime numbers. The optimal policy rule thus adopts corner solutions until the presence of onboard armed security reaches decreasing returns (i.e. when 80 percent of large vessels are equipped with armed security guards), that makes the case for the use of navy patrols.
We can also construct iso-crime curves for type-2 ships only. As Figure 16 shows, at relatively high levels of self-protection, these iso-crime curves bend and become convex to the origin, illustrating the pattern documented earlier in Figure 13: the displacement effect due to protection of type-3 ships dominates the positive externality hereby generated, resulting in a higher number of attacks on type-2 vessels. The role of the navy then becomes instrumental in keeping the number of attacks on type-2 ships low. These findings highlight the distributional implications of various policy instruments, that might matter when determining what the optimal level and composition of policing should be.

Conclusion
We have provided quantitative evidence on the relative contribution of navy patrols and onboard security guards to the collapse of Somali piracy in 2012. Yet attention is increasingly being directed to finding onshore rather than offshore solutions to the piracy problem (World Bank 2013), as the ability of private and public agents to commit to a long-term deployment of security assets Rubinstein, Ariel, "Perfect Equilibrium in a Bargaining Model," Econometrica, January 1982, 50 (1), 97-109.
van Ours, Jan C. and Ben Vollaard, "The Engine Immobiliser: A Non-starter for Car Thieves," The Economic Journal, 2015, pp. n/a-n/a.

A Figures and Tables
Year of attack  Tanker  2  1  2  1  3  3  5  4  21  Livestock Carrier  0  0  0  0  0  0  1  0  1  Product Tanker  4  1  2  2  9  16  12  1  47  Tanker  3  1  3  15  32  26  29  0  109  Vehicle Carrier  2  0  1  1  2  3  5  1  15  Total  34  23  37  88  158  163  185 49 737      Note: The 4 panels list the 76 moments matched in the calibration using the Method of Simulated Moments. The "data" column lists the moments in the data, and the "model" column lists the corresponding simulated moments at the optimized Θ. Section 3 discusses the selection of moments and calibration method in detail.   Note: The figures plot the combination of navy patrols and percentage of type-3 vessels with onboard security in year t that achieves a certain number of attacks on all vessels in year t + 1. The black line in each graph indicates the optimal combination of navy patrols and private teams that minimizes the total costs for each level of attacks. All the other parameters are set to their benchmark value. : Navy patrols vs. armed onboard security: iso-crime curves for type-2 ships Note: The figures plot the combination of navy patrols and percentage of type-3 vessels with onboard security in year t that achieves a certain number of attacks on type-2 vessels in year t + 1. The black line in each graph indicates the optimal combination of navy patrols and private teams that minimizes the total costs for each level of attacks. All the other parameters are set to their benchmark value. In this simulation we double the costs of armed guards in each year.

B Proof of Proposition 1:
All functions are conditional on ν t and µ t ; we thus omit the reference in our notations for the sake of simplicity. Pirate team i chooses a type η vessel over type η if and only if u t η (x i , δ i ) ≥ u t η (x i , δ i ) orπ t η (x i ) V η ≥π t η (x i ) V η . We first establish the following result: Lemma 1: Suppose that conditions (3) hold. If for η > η,π t η (x) V η ≥π t η (x) V η then ∀x ≥ x, π t η (x ) V η ≥π t η (x ) V η .

C The role of learning in explaining the rise of Somali piracy
In the benchmark model, pirates are allowed to learn from the experience of the previous generation of pirates. The learning process in the model is introduced by allowing φ(t), θ(t), and b(t) to be functions of time. To better understand the role of each learning component, we shutdown each channel of learning separately, and compare the results to the benchmark simulations. In each of these exercises, we set φ(t), θ(t), and b(t) to be constant while keeping all the other parameters the same as in the benchmark model.
The results of shutting down the learning in φ(t) are summarized in Figure 17. In this exercise we set the speed of learning parameter ζ equal to 1. With ζ = 1, pirates perfectly observe the true probabilities of success of attacking the three types of vessels, and thus target less frequently larger vessels in the earlier years. The first order effect of concentrating on smaller vessels is the soaring success rate: in this counter-factual case the average success rate starts as high as 83 percent in 2006, compared to 15 percent in the benchmark model. The side-effect of attacking smaller vessels can also be observed in the lowered ransom payments and negotiation length. Lastly, a constant φ also lowers the expected returns of the future pirates, which reduces the overall number of attacks. Figure 18 presents the results of shutting down the evolution of θ(t) over time. In this exercise, we force the value of θ(t) to be fixed throughout the years to its baseline valueθ. In our benchmark simulation θ(t) drops as time goes by, leading to fatter tails in the ability distribution, which in turn leads to more frequent appearances of "super star" pirates with high values of x. These highly talented pirates tend to attack larger ships with high success rates, and are able to extract large ransoms out of negotiations. In the end, the emergence of "super star" pirates leads to higher expected returns for the potential pirates in the next period, and thus the worsening of the piracy problem. Removing the learning process through θ(t) essentially eliminates the possibility of a fatter tail, and thus reduces the frequency of "super star" pirates in the simulations. Similar to the previous case, without many super stars, the pirates in the counter-factual world are more likely to attack smaller type-1 ships as compared to the benchmark case, and thus enjoy a higher overall success rate. However, without super star pirates to hijack large vessels and collect large ransoms, the average ransoms in the counter-factual world are 0.35 million USD, which are substantially lower to the 1.96 million USD average ransoms of the benchmark model. The lower average ransoms in turn lead to fewer attacks. The number of attacks drops by around 81 percent to only 25 attacks per year in the counter-factual case.
The results of shutting down learning through b(t) are reported in Figure 19. Similar to the case of θ(t), at every period, we set b(t) to its baseline valueb. b(t) is the location parameter in the ability distribution, which is also the lowest possible level of ability in each period. Shutting down this channel means that the pirates at the bottom of the ability distribution are not able to learn and improve over time. The figure clearly shows that doing so does not affect the benchmark results.
The counter-factual simulation closely tracks the benchmark results in all four variables depicted in Figure 19. This is consistent with our calibration results -in the benchmark calibration b(t) indeed barely moves with time. This suggests unlike the highly-talented pirates who constantly improve over time, the pirates at the low tail of the ability distribution rarely learn from their past mistakes. Note: The figures plot the number of attacks, average conditional ransoms, success rates and relative delay in the: counterfactual analysis where we shut down the learning channel through b (blue-dash line), benchmark model (reddash line), data (black line). We set b(t) =b, all other parameters are kept the same as in the benchmark model.