{'fraction_non_alphanumeric': 0.031134173461823574, 'fraction_numerical': 0.006593578089032812, 'mean_word_length': 4.674562762895727, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Second-order Price Dynamics: Approach to Equilibrium with Perpetual Arbitrage

The notion that economies should normally be in equilibrium is by now well-established; equally well-established is that economies are almost never precisely in equilibrium. Using a very general formulation, we show that under dynamics that are second-order in time a price system can remain away from equilibrium with permanent and repeating opportunities for arbitrage, even when a damping term drives the system towards equilibrium. We also argue that second-order dynamic equations emerge naturally when there are heterogeneous economic actors, some behaving as active and knowledgeable arbitrageurs, and others using heuristics. The essential mechanism is that active arbitrageurs are able to repeatedly benefit from the suboptimal heuristics that govern most economic behavior.


Introduction
Dynamic macroeconomics proposes that economic actors set prices based on gaps -perceived or realbetween supply and demand. The aggregate gap between supply and demand is determined by the current vector of prices p, which has as many elements as there are commodities, through the aggregate demand function ξ(p), a vector-valued function of the same dimensionality as p. In the standard formulation, the prices in one time period are set depending on the excess demand that results from the prices in the previous period. In continuous time, this leads to a first-order dynamic equation, dp dt = κξ(p).
When excess demand for a product or commodity is positive, sellers or speculators raise the price, judging that they could gain extra income. When excess demand is negative, sellers or speculators lower the price, hoping to stimulate demand sufficiently to raise their total income. At equilibrium, excess demand is zero and prices stop changing. Importantly, at equilibrium there is no opportunity for arbitrage -selling one commodity or product at what is judged to be an elevated price, or buying an under-priced commodity or product, in order to gain a temporary advantage. Moreover, opportunities for arbitrage should rapidly disappear as active arbitrageurs take advantage of them [9]. The historical development of the dynamic theory of prices is generally thought to be unsatisfactory because, after some initially promising results, it could not guarantee stability [18,27,29]. Part of the argument has a solid and unavoidable foundation: the so-called SMD theorem elaborated in separate papers by Sonnenschein [30], Mantel [23], and Debreu [8]. These papers collectively showed that there are almost no constraints on the excess demand function, no matter how regular the behavior of individual economic actors. The other part of the instability argument flows from the first-order dynamics.
Macroeconomics today is dominated by the theory of General Equilibrium (e.g., [16]). General Equilibrium theory seeks to avoid the problems of dynamic macroeconomics by, essentially, not providing any dynamics at all. Instead, exogenous changes in supply and demand functions, combined with exogenous "shocks" push the economy away from a preexisting equilibrium. Then, following an unknown process, a new equilibrium is formed quickly enough that it can be treated as instantaneous from the point of view of the theory. This can be interpreted as a modest and sensible approach to deal with an unsatisfactory dynamic theory. However, despite the popularity and appeal of General Equilibrium theory, it inherits the shaky foundation of dynamic economics, because the SMD theorem appears to make any price adjustment mechanism -even an unspecified one -problematic [2]. Moreover, as Fisher [10] points out, it is difficult to analyze equilibria without a theory of disequilibrium.
In this paper, and building on a previous paper [21], we challenge the idea that price dynamics should be first-order in time. Following Samuelson's [28] formulation of Walras' tâtonnement adjustment process [32], economists have assumed an adjustment process that is first-order in time, as in Equation 1. (See, e.g., [11,33]). 1 In this paper we argue that it is difficult to maintain first-order price dynamics and that, from different starting points, it is easy to reach an equation that is second-order in time. We then show that solutions to the resulting dynamic equations have interesting properties that are quite different from those of a first-order dynamic equation. Near an equilibrium point, the dynamic equations are like those governing a collection of damped harmonic oscillators. While economic systems have, in the past, been modeled as coupled harmonic oscillators (see, e.g., [17]), it is unusual. This paper argues that models with second-order time dynamics arise so naturally that they are a much better starting point than first-order equations when studying how economic actors determine prices.
Before proceeding, we acknowledge that there are compelling arguments against looking for equilibria in economics at all -at least equilibria as Walras described them. In a lecture subsequently published in The Economic Journal, Kaldor [20] argued that theories of equilibrium prices described economies where creative process were strangely erased. He noted in particular that they could not account for the obvious fact of economies of scale in industrial production. In contemporary terms, the economy that Kaldor described can be seen as a complex adaptive system, in which creative forces alter demands for materials in a dynamic and reciprocal way and actors absorb fluctuations in the system by holding or releasing stocks, while any (non-unique and fleeting) stable structure emerges from internal dynamics. A quite distinct critique was offered by Keynes [22], who sought to explain economic depressions through a "general" economic theory, in contrast to the "special" theory that explained economic activity in normal times. His theory explains how the economy can remain in a stable state -an equilibrium -with a large gap between the supply and demand for labor and large unsold stocks of goods.
This paper does not fundamentally challenge theories of (Walrasian) price equilibria, as did Kaldor and Keynes. Instead, it offers a "special" theory, in the sense of Keynes, and over short enough times that the creative processes noted by Kaldor are unimportant when compared to price-setting behavior. The surprise is that this special, limited theory, which differs only modestly from prior theories of price-setting behavior, results in price dynamics that approach, but rarely reach, equilibrium and that offers, as a consequence of its dynamics, endless opportunities for arbitrage.

Routes to Second-order Price Dynamics
In this section we argue that second-order price dynamics emerge naturally when there are heterogeneous actors, some of whom act immediately using standard first-order price setting and others of whom act in a subsequent period. In two of our examples we assume that one group -the arbitrageurs -informs itself about the market and actively seeks opportunities to take advantage of positive or negative excess demand, while a second group -the majority of economic actors -uses heuristics to guide its actions. The third example considers arbitrageurs operating under uncertainty at different times.
The use of heuristics in economic reasoning, and in particular for setting prices, is well established. Keynes postulated that employers found it difficult to lower wages in nominal terms, a phenomenon he called a "sticky wage" [22]. Later work focused more on sticky prices than wages. These theories had little empirical backing until Blinder [3,4] carried out a survey of firms and directly asked managers about their pricing behavior. He and his colleagues found that prices are indeed sticky, with a median change of 1.3 times per year; they also found that firms set prices based on heuristics such as waiting for other firms to change their prices first and basing prices on costs. The importance of heuristics in economics, and more generally of the field of Behavioral Economics (see, e.g., [6]), was formally recognized when the 2002 Nobel Prize in Economics was awarded to Kahneman for his work with Tversky [31,19]. Even in financial markets, which are widely believed to efficiently and rapidly drive prices toward equilibrium, Bouchard et al. [5] found evidence that actual price setting is slow and noisy, characterized by the gradual absorption of imperfect information, while in an important sequence of papers Gabaix and his colleagues unified stylized facts about the distribution of returns, trading volume, price impact, and large investors using a model in which different-sized investors exhibit different trading behavior [13,14,12].
One heuristic, which was observed in an artificial experimental setting by Ostrom and her colleagues [25] and in the behavior of firms in the survey by Blinder, is that some actors, group a, set their prices immediately, while others, group b, wait and set their price in the next time period based on the change in average prices from the previous time period. Following [21], and setting κ = 1 in Equation 1 for convenience, we write If a fraction f a of sellers are of type a, and a fraction f b = 1 − f a are of type b, and we compute ∆p t = f a ∆p a,t + f b ∆p b,t , then after substituting we get Next, writing ∆p t−1 as where can be rearranged to give This equation, which has a difference of differences on the left-hand side, is second-order in time; if f b or ν goes to zero, then it returns to a first-order equation. Also, if f b ν < 1 then the second term on the right-hand side is a damping term, which dissipates economic activity and drives the system toward equilibrium. A second type of heuristic is the collection of trend-spotting methods used in technical trading. While in theory these techniques should not work (see, e.g., [9]), they are applied in practice, and are sufficiently successful to support a large and growing number of books on the topic (e.g., [7,26]). Since practitioners may still be deluded, more convincing is the evidence provided by Garzarelli et al. [15], who, in contrast to theoretical expectations, observed signals of technical trading in financial data. Technical traders expect prices of traded assets to go through recurring periods of accelerating, and then slowing, rises and falls. An accelerating rise in price, or a slowing fall, is driven by the activities of "bulls" who are optimistic about future price trends; a slowing rise in price, or an accelerating fall, is driven by the activities of "bears". The technical trader tries to anticipate where the bulls and bears are going, and follow along. Using the same notation as above, suppose that the bulls comprise group a and the bears group b. In this case we could write With these behaviors, both bulls and bears respond to perceived opportunities, as reflected in excess demand, but bulls are encouraged by a rising market, whereas bears are discouraged by it and ready to judge a rapidlygrowing market as overheated. Calculating the average change in price as before, these behaviors result in the following equation, This equation has the same structure as Equation 3, and like it can be rearranged to give a second-order equation similar to Equation 5.
A third possibility is that everyone is an arbitrageur, but different arbitraguers respond to price signals at different times (as in [1]). In the case that group a responds in the next time period, while group b delays a further time period before responding, the change in price in a given time period is Expanding ξ(p t−2 ) about the point p t−1 to first order in a Taylor series, this becomes where ∇ξ(p) is the vector derivative of ξ(p) with respect to price. As with the other examples, this can be expressed as a second order equation, possibly with damping, in which the coefficient on the damping term is a matrix that depends on the price vector.

Second-order Dynamics in Continuous Time
We consider dynamics in continuous time and in which prices can take on any real value. Before proceeding we note that both of these assumptions are problematic. It is well known that discrete-time dynamics can be different from continuous-time dynamics (see, e.g., [27]), and arguably discrete-time dynamics are more relevant for economic analysis. The discrete-time behavior of second-order price dynamics is discussed in [21]; here we focus on the solutions to the continuous-time dynamical theory, which have interesting properties that are worth exploring. The assumption that prices can take on any real value within a compact space appears to be generally accepted as a reasonable approximation to reality. However, Nadal [24] points out that prices cannot take on any real value and they in fact lie within a non-compact space. This is an interesting point deserving more attention, but in this paper we make the conventional assumption that prices can be represented as a real-valued vector. The continuous-time equation we shall consider is where, as explained in [21], the second term on the left-hand side of the equation ensures that the price vector stays on the hypersphere defined by |p| 2 ≡ n i=1 p 2 i = 1. 2 This price normalization is required because the overall magnitude of the price vector carries no information, and only relative prices are important. In this equation we take κ to be a scalar and γ to be a diagonal matrix with all positive elements -that is, damping may vary from one commodity to another, but while the price of one commodity may affect the price of another through the excess demand function, the rate of change of the price of that commodity only affects subsequent changes in its own price through damping. This assumption is not essential, but it simplifies some subsequent calculations.
The excess demand function for an n-commodity economy is a continuous function that takes a vector of prices, p, with n positive elements and produces a vector with n elements. Mathematically, this is expressed as ξ : (R + ) n → R n . More specifically, as noted above, because the magnitude of the price vector carries no information the price vector can be restricted to the positive portion of the hypersphere S + n defined by |p| 2 = 1. Finally, Walras' Law states that the excess demand function is orthogonal to the price vector, so that p · ξ(p) = 0 for all combinations of prices, so that, in monetary terms, the economy is always in overall equilibrium, even though individual commodities might be out of equilibrium. 3 Combining these observations we recover the definition of an excess demand function offered by Debreu [8]. In the terms defined here, the definition can be given as Definition 1 (Excess demand function). A continuous function ξ : S + n → R n such that p · ξ(p) = 0 for all p ∈ S + n .
The essence of the SMD theorem is that almost any such function is compatible with some combination of well-behaved individual demand functions. So, while individual demand functions may have nice properties such as marginally declining demand as prices rise, consistent preference rankings, and so on, the aggregate demand function can have almost any behavior at all as long as it is a continuous vector-valued function on the positive portion of the price hypersphere.
Fortunately, the properties of being a continuous vector-valued function on a compact space (pace Nadal) are all that is required for the Helmholtz-Hodge decomposition theorem to apply. According to this theorem, the excess demand function can be written as a sum of the gradient of a scalar potential and another, divergence-free, vector field. That is, where ∇ · A = 0. Substituting this equation into Equation 10, we have From this equation we can get an interesting result by dot-multiplying on the left by the rate of change of the price vector dp/dt. This gives dp dt · d 2 p dt + dp dt · p dp dt 2 = −κ dp dt · ∇φ(p) + dp dt · κA(p) − dp dt · γ · dp dt .
Taking the first three of these terms, we find that The second of these equations, Equation 14b, is zero because the price vector is constrained to remain on the surface |p| 2 = 1. The third, Equation 14c, is true as long as the potential is not changing in time. 4 Substituting Equations 14a and 14c into Equation 13 and rearranging gives d dt 1 2 dp dt 2 + κφ(p) = dp dt · κA(p) − dp dt · γ · dp dt . (15) This term in parentheses on the left-hand side of Equation 15 has a precise physical analogue: the total energy of a body in a conservative potential. If the divergence-free portion of the excess demand function, A(p) were equal to zero, then the equation would become d dt In this special case it is seen that, just as in the physical analogue, the damping term gradually dissipates the total energy. This will eventually bring the system to rest at a local minimum of the potential. That is, the system will approach equilibrium. However, it is easy to see that in general A(p) will not be zero. If it were, then the Jacobian of the excess demand function, ∂ i ξ j (p) would be equal to −∂ i ∂ j φ(p) and, since partial derivatives commute, the Jacobian would be symmetric. A symmetric Jacobian for the demand function would mean that the influence of the price of commodity i on demand for commodity j would be equal to the influence of the price of commodity j on commodity i, and there is no reason to expect such an outcome for most pairs of commodities. 5 We are therefore left with the full expression in Equation 15. This is more difficult to analyze than the case of a conservative potential, but also more interesting. To make some progress we suppose that there is a price trajectory p * (t) that travels in a loop that repeats at some point (possibly after wandering for quite a while), such that p * (T ) = p * (0) and dp * (T )/dt = dp * (0)/dt at some time T . In this case we can integrate across the time it takes to traverse the loop to find Because the loop repeats itself, the left-hand side vanishes: we have traveled around a loop in a conservative potential and ended up where we started, and the total energy is the same in the end as it was at the start. We therefore find κ p * dp · A(p) = p * dp · γ · dp dt .
The economically interesting aspect of this equation is that if the divergence-free portion of the excess demand function is not zero, then over a continuously repeating loop of price changes, the "energy" gained from those price changes can counteract the dissipative effect of the damping term. In human terms what this means is that the efforts of some economic actors to stop the spinning wheel of price changes (the damping term on the right) merely reopen opportunities for arbitrage that active arbitrageurs can take advantage of (the term on the left).

A Two-price System
To make the theory presented in this paper more concrete we consider a system with two commodities that are normal goods and partial complements. The excess demand function is given by wherep = (p 1 ,p 2 ) is the equilibrium price. The own-price coefficient α is assumed to be the same for both commodities to simplify later calculations. The parameters α and β are assumed to be positive, but δ can be either sign -indeed, by simply switching the labels on the commodities δ can pass from one sign to the other. The symmetric part of the excess demand function can be derived from a potential, However, the asymmetric term, proportional to δ, cannot be captured in the potential. We assume that prices are a small distance away from the equilibrium point and define the deviation vector q ≡ p −p. We also assume that the dissipative coefficient is the same for both commodities: γ 1 = γ 2 ≡ γ. With these assumptions, and to first order in q, the second-order dynamic equation, Equation 10, becomes These are the equations for a set of coupled harmonic oscillators, which can have quite complex behavior. Because the purpose of this section is to gain insight rather than to simulate an actual market, we consider two cases that have relatively simple behavior: δ = 0 and β = 0.

Conservative dynamics: δ = 0
Considering first the case in which δ = 0, which corresponds to motion in a conservative potential, Equations 21 become Defining the linear combinations of the price deviations y1 ≡ q 1 + q 2 and y 2 ≡ q 1 − q 2 we find, by taking the sum and differences of these equations, These equations are ordinary differential equations and can be solved using standard techniques. The most straightforward is to propose ansätze, Substituting these into Equations 23 gives a pair of quadratic equations, which are solved by If β < α then these solutions always decay; if not, then the equilibrium is not stable, and there is a growing mode. Also, if κ(α + β) > γ 2 , then ω 1 has an imaginary part, and the price vector spirals around the equilibrium even as it is decaying toward the equilibrium. The result from this calculation is consistent with the general result given in the previous section -if the excess demand function can be derived from a potential, then the price decays toward a stable equilibrium.

Dynamics with asymmetric price responses: β = 0
Next we consider the case in which β = 0. In this case Equations 21 become Rather than solving these equations fully, we manipulate them into a form in which we can recognize another physical analogue. To do this, we multiply the first equation by q 2 , the second by q 1 , and then subtract. The result is Next, we note that Therefore, Equation 28 becomes Defining the "angular momentum" L of the deviation of the price vector around the equilibrium point as and the magnitude of the price deviation |q| 2 ≡ q 2 1 + q 2 2 , we can rewrite Equation 30 as Note that if δ is set to zero in this equation then the angular momentum L simply decays, consistent with the case δ = 0 elaborated above and the general remarks in the previous section. However, if δ is not equal to zero then there is a solution with a nonzero but constant angular momentum, where This expresses the same phenomenon as in Equation 18, where prices keep circulating around an equilibrium because of recurring arbitrage opportunities opened up by the second-order time dynamics. The "angular momentum" of the price movements decreases as the damping γ increases, and increases with greater asymmetries δ between the price responses of different commodities.

Conclusion
In this paper we have shown that if there are heterogeneous economic actors, some behaving as active arbitrageurs and others using heuristics, then it is not difficult to generate price dynamics that are secondorder in time. More strongly, we conclude that it is difficult to maintain price dynamics that are first-order in time. In general, the variety of possible responses by sellers and speculators in setting prices could lead to multiple time lags of varying length, producing even more complex dynamics. When prices are governed by second-order dynamics with damping -where damping reflects heterogeneity of price responses, including the disinclination of some economic actors to continue changing prices -even the very loose constraints on the excess demand function placed by the SMD theorem leads to interesting results. The Helmholtz-Hodge theorem allows us to decompose the excess demand function in a revealing way, and we find a combination of convergent and non-convergent behavior. The non-convergent behavior emerges from that part of the excess demand function that cannot be expressed as the gradient of a scalar potential; in the two-price system used as an example in this paper, it appeared as an asymmetry in the Jacobian of the excess demand function. In contrast to first-order price dynamics, second-order dynamics with damping result in an endless spiral of price-setting, in which those economic actors who rely on heuristics -or even partial and fuzzy information -repeatedly create arbitrage opportunities for active and knowledgeable arbitrageurs.
This interesting result -of approaching but never quite reaching equilibrium -is inherent to the secondorder dynamics. It means that the system is stable overall, because prices stay near to equilibria, but are never at rest, because of recurring arbitrage opportunities. Rather than an equilibrium point there is a zone of price movements around the equilibrium. Because this behavior is inherent to the dynamics, arbitrage opportunities are not created by noise or shocks, but rather by normal economic activities. There are also, of course, noise and shocks in real markets that could disrupt the dynamics described in this paper.
For example, if damping is so large that prices move very slowly around an equilibrium point, then the characteristic recurrence time of shocks may be shorter than the characteristic periodicity of the internal dynamics. In this case the price movements from the internal dynamics would be unobservable, and the system would be dominated by noise. In cases where damping is very low, the internal dynamics could dominate over noise and shocks.
The theory presented in this paper could be further developed by more sophisticated derivations of the price dynamics resulting from heterogeneous actors. Alternatively, further development could address part of Kaldor's critique [20], by adding time-dependent excess demand functions. While simply adding time dependence to the potential would not capture the rich dynamics of a complex adaptive system, it would enable exploration of how markets respond in this theory to a changing economic environment.