# Comparing effects of price limit and circuit breaker
in stock exchanges by an agent-based model ††thanks: Note that the opinions
contained herein are solely those of the authors and do not necessarily
reflect those of SPARX Asset Management Co., Ltd.

Takanobu Mizuta  SPARX Asset Management Co. Ltd.
Tokyo, Japan
https://orcid.org/0000-0003-4329-0645  Isao Yagi  Faculty of Informatics
Kogakuin University
Tokyo, Japan
https://orcid.org/0000-0003-0119-1366

###### Abstract

The prevention of rapidly and steeply falling market prices is vital to avoid
financial crisis. To this end, some stock exchanges implement a price limit or
a circuit breaker, and there has been intensive investigation into which
regulation best prevents rapid and large variations in price. In this study,
we examine this question using an artificial market model that is an agent-
based model for a financial market. Our findings show that the price limit and
the circuit breaker basically have the same effect when the parameters, limit
price range and limit time range, are the same. However, the price limit is
less effective when limit the time range is smaller than the cancel time
range. With the price limit, many sell orders are accumulated around the lower
limit price, and when the lower limit price is changed before the accumulated
sell orders are cancelled, it leads to the accumulation of sell orders of
various prices. These accumulated sell orders essentially act as a wall
against buy orders, thereby preventing price from rising. Caution should be
taken in the sense that these results pertain to a limited situation.
Specifically, our finding that the circuit breaker is better than the price
limit should be adapted only in cases where the reason for falling prices is
erroneous orders and when individual stocks are regulated.

###### Index Terms:

Price limit, Circuit breaker, Financial crisis, Agent-based model, ABM, Multi-
agent simulation, Artificial market model

##  I Introduction

The prevention of rapidly and steeply falling market prices is vital to avoid
financial crisis. To this end, some stock exchanges implement a price limit,
which refuses orders that are priced significantly away from the current
market price, or implement a circuit breaker, which halts placing orders for a
while when the market prices are largely varied. Stock exchanges in Japan,
South Korea, China, and other Asian countries tend to implement the price
limit, while those in the USA and Europe lean more toward the circuit breaker.
While there has been intensive investigation into which regulation best
prevents rapid and large variations in price[1], this question remains
unanswered.

Empirical studies cannot be conducted to isolate the direct effect of
implementing a trading regulation due to the many diverse factors affecting
price formation in actual markets. In contrast, an artificial market model,
which is an agent-based model for a financial market111The basic concept for
constructing and validating the artificial market model utilized in the
current work are explained in Appendix V-B and V-C, or the article[2, 3], can
isolate the pure contributions of a trading regulation. Many previous
artificial market studies have contributed to explaining the nature of
financial market phenomena such as bubbles and crashes. Recent artificial
market studies have also contributed to discussions about appropriate
financial regulations and rules [4, 2, 3]. The JPX222The Japan Exchange Group
(JPX) is a Japanese financial services corporation operating the Tokyo Stock
Exchange. Working Paper series includes various studies that have contributed
to such discussions333https://www.jpx.co.jp/english/corporate/research-
study/working-paper/index.html.

There have been many investigations using artificial market models for both
the price limit[5, 6, 7] and the circuit breaker[8, 9]. Mizuta et al.[6]
investigated the price limit and showed that the following conditions prevent
large price variations:

$Pr/tr<S_{fall},$ (1) $Pr>Vol_{tr},$ (2) $tr<tm,$ (3) $Pr<P_{DD},$ (4)

where $Pr$ and $tr$ are parameters of the price limit (respectively a limit
price range and a limit time range), $S_{fall}$ is the falling speed of market
prices, $Vol_{tr}$ is the standard deviation of every $tr$ return
(volatility), $t_{m}$ is the erroneous orders period, and $P_{DD}$ is the
falling depth of market prices. Their findings showed that the $Pr$ and $tr$
parameters should be satisfied and that stock exchanges should implement
several price limits for every time scale of price variety.

However, no previous research has compared the effectiveness of the price
limit versus the circuit breaker using the $Pr$ and $tr$ parameters, mostly
because the model needs to be improved before the price limit and circuit
breaker can be compared under an equal condition. For example, when a circuit
breaker is active, time simply passes without orders being placed, but Mizuta
et al.’s model[6] cannot treat such time passing without placing orders
because the time passes only when an order is placed.

Therefore, in this study, we expanded on Mizuta et al.’s artificial market
model[6] by adding stop loss behavior of the agents and a circuit breaker and
then used it to investigate whether the price limit or the circuit breaker is
more effective to prevent falling market prices. Each agent estimates a fair
price and then re-estimates it when market prices fall significantly below
that price. The agents need a long time for the re-estimation, so they place
stop-loss orders during the re-estimation, which enables the model to let time
pass without placing orders.

Figure 1: Illustrations for (left) erroneous orders period and falling depth
and (right) stop-loss orders.  Figure 2: Illustrations for (left) price limit
and (right) circuit breaker.

##  II Model

Chiarella and Iori[10] built a model that, while very simple, could replicate
long-term statistical characteristics observed in actual financial markets,
e.g. fat-tail and volatility clustering. Mizuta et al.[6] later expanded this
model so that it can treat large fluctuation of prices such as turmoil by
erroneous orders. Only fundamental and technical analysis strategies that
exist generally for any market at any time444Many questionnaire-based
empirical studies have found these strategies to be the majority of investment
strategies, as comprehensively reviewed by Menkhoff and Taylor[11]. The
empirical study using market data by Yamamoto[12] showed that investors are
switching fundamental and technical analysis strategies. are implemented in
the agent model.

The simplicity of the model is very important for this study because
unnecessary replication of macro phenomena leads to models that are overfitted
and too complex. Such models hamper the understanding and discovery of the
mechanisms affecting price formation because of the increase in related
factors. Gilbert said ”the aim of abstract models is to demonstrate some basic
social process that may lie behind many area of social life”[13]. Axelrod
mentioned that to understand mechanism abstract models should be as simple as
possible because needless complex model preventing to understand the
mechanism, and called the principle as KISS (keep it simple stupid)[14].
Because our model is abstract model to understand and discover the mechanisms
mechanism, our model should obey KISS principle. The detail of basic concept
for constructing our artificial market model and an explanation of its
validation are explained in Appendix V-B and V-C, or the article[2, 3].

In the current study, we extend Mizuta et al.’s artificial market model[6] by
adding stop loss behavior of agents and a circuit breaker.

This model contains one stock, and the stock exchange utilizes a continuous
double auction to determine the market price[15]. In the auction mechanism,
multiple buyers and sellers compete to buy and sell stocks in the market, and
transactions can occur at any time an offer to buy and an offer to sell match.
The minimum unit of a price change is $\delta P$. The buy-order and sell-order
prices are respectively rounded down and up to the nearest fraction.

###  II-A Agents

We introduce agents for modeling a general investor so as to replicate the
nature of price formation in actual financial markets. The number of agents is
$n$ and they can short sell freely. The holding positions are not limited, so
agents can take an infinite number of shares for both long and short
positions. Time $t$ increases by one when an agent places an order or when a
circuit breaker in operation skips placing an order by an agent.

Agents always order only one share at a time. First, agent $1$ places an order
to buy or sell a stock, and then agent $2$ places an order to buy or sell.
After that, agents $3,4,,,n$ each place orders to buy or sell. After the final
agent $n$ places an order, going back to the first agent, agent $1$ places an
order to buy or sell, and at agents $2,3,,,,n$ each place orders to buy or
sell, and this cycle is repeated.

An agent determines the order price and buys or sells using a combination of
fundamental and technical analysis strategies to form an expectation of the
stock return. The expected return of agent $j$ at $t$ is calculated as

$r^{t}_{e,j}=(w_{1,j}\ln{\frac{P_{f}}{P^{t-1}}}+w_{2,j}\ln{\frac{P^{t-1}}{P^{t-\tau_{j}-1}}}+w_{3,j}\epsilon^{t}_{j})/\Sigma_{i}^{3}w_{i,j},$
(5)

where $w_{i,j}$ is the weight of term $i$ for agent $j$ and is independently
determined by random variables uniformly distributed on the interval
$(0,w_{i,max})$ at the start of the simulation for each agent. $\ln$ is the
natural logarithm. $P_{f}$ is a fundamental value and is constant. $P^{t}$ is
a mid-price (the average of the highest buy-order price and the lowest sell-
order price) at $t$, and $\epsilon^{t}_{j}$ is determined by random variables
from a normal distribution with average $0$ and variance $\sigma_{\epsilon}$
at $t$. $\tau_{j}$ is independently determined by random variables uniformly
distributed on the interval $(1,\tau_{max})$ at the start of the simulation
for each agent555When $t<\tau_{j}$, the second term of Eq. (5) is zero..

The first term in Eq. (5) represents a fundamental strategy: the agent expects
a positive return when the market price is lower than the fundamental value,
and vice versa. The second term represents a technical analysis strategy using
a historical return: the agent expects a positive return when the historical
market return is positive, and vice versa. The third term represents noise.

After the expected return has been determined, the expected price is

$P^{t}_{e,j}=P^{t-1}\exp{(r^{t}_{e,j})}.$ (6)

Order prices are scattered around the expected price $P^{t}_{e,j}$ to
replicate many waiting limit orders. An order price $P^{t}_{o,j}$ is

$P^{t}_{o,j}=P^{t}_{e,j}+P_{d}(2\rho^{t}_{j}-1),$ (7)

where $\rho^{t}_{j}$ is determined by random variables uniformly distributed
on the interval $(0,1)$ at $t$ and $P_{d}$ is constant. This means that
$P^{t}_{o,j}$ is determined by random variables uniformly distributed on the
interval $(P^{t}_{e,j}-P_{d},P^{t}_{e,j}+P_{d})$.

Whether the agent buys or sells is determined by the magnitude relationship
between $P^{t}_{e,j}$ and $P^{t}_{o,j}$. Here666When $t<t_{c}$, to generate
enough waiting orders, the agent places an order to buy one share when
$P_{f}>P^{t}_{o,j}$, or to sell one share when $P_{f}<P^{t}_{o,j}$. ,

  * when $P^{t}_{e,j}>P^{t}_{o,j}$, the agent places a buy order, and

  * when $P^{t}_{e,j}<P^{t}_{o,j}$, the agent places a sell order.

The remaining orders are canceled $t_{c}$ after the order time except when a
circuit breaker is in operation.

###  II-B Erroneous orders

We utilized the same model of erroneous orders as Mizuta et. al.[6]. Erroneous
orders start at time $t_{ms}$ and finish at time $t_{me}$ (see also Fig. 1
(left)). Within that period, with a constant probability $p_{m}$, each order
of the agents is changed to one share sell at the highest buy-order price
listed in the order book. The changed sell order is immediately executed
matching the highest buy order. Increasing such erroneous sell orders is what
makes market prices fall.

###  II-C Stop-loss orders

The agent $j$ starts to place stop-loss orders when $P^{t}$ becomes under
$P_{f}\exp{\epsilon^{t=0}_{j}}-P_{l,j}$, where $P_{l,j}$ is independently
determined by random variables uniformly distributed on the interval
$(P_{lmin},P_{lmax})$ at the start of the simulation for each agent $j$.
$t_{ls,j}$ is the start time of placing stop-loss orders for each agent. As
shown on Fig. 1 (right), within the stop-loss period with a constant
probability $p_{l}(t_{ls,j}+t_{l,j}-t)/t_{l,j}$, each order of an agent is
changed to one share sell at the highest buy-order price, where $t_{l,j}$ is
independently determined by random variables uniformly distributed on the
interval $(t_{lmin},t_{lmax})$ at the start of the simulation for each agent
$j$ and $p_{l}$ is constant.

Each agent estimates $P_{f}\exp{\epsilon^{t=0}_{j}}$ as a fair price and has
to re-estimates a fair price when market prices fall significantly below that
price. The agent needs a long time for the re-estimation and places stop-loss
orders during this process. In this study, because erroneous orders cause
prices to fall significantly, the fair price is not changed. The agent learns
this fact after the re-estimation. Therefore, the probability of a stop-loss
order decreases as time progresses in this model, and the agent stops a stop-
loss order after the re-estimation.

###  II-D Price limit and circuit breaker

We utilized the same model of a price limit as Mizuta et al.[6]. In the case
of adopting a price limit, as shown Fig. 2 (left), any order prices of sell
under $P^{t-tr}-Pr$ (of buy above $P^{t-tr}+Pr$) are changed to $P^{t-tr}-Pr$
($P^{t-tr}+Pr$), where $tr,Pr$ are constant parameters to determine the nature
of the price limit. We simulated the model to investigate the nature of price
formations when these parameters were changed. As Mizuta et al. [6]
demonstrated, the price limit prevents large price variations because agents
cannot place orders far from $P^{t-tr}$ when the price limit is in place.

In the case of adopting a circuit breaker, as shown Fig. 2 (right), when
$P_{t}$ reaches under $P^{t-tr}-Pr$ or above $P^{t-tr}+Pr$, the circuit
breaker starts, and after starting, placing or cancelling orders are stopped
during $tr_{2}$. Actually, the circuit breaker limits orders (unlike the price
limit) and just waits for time to pass; however, the erroneous order period
and stop-loss order period continue while the circuit breaker is activated.
This leads to a decrease in the erroneous orders and stop-loss orders and,
like the price limit, prevents large price variations. We also introduced a
price limit version two in which any order prices of sell under $P^{t-tr}-Pr$
or buy above $P^{t-tr}+Pr$ are canceled. In an actual financial market,
investors will place orders exactly at the $P^{t-tr}\pm Pr$ with such a price
limit because they know orders will be canceled outside the $P^{t-tr}\pm Pr$.
Therefore, in real financial markets version two does not cause any changes
and the result is exactly the same as the normal version. The reason we
introduce version two is that we want to investigate the effect of multiple
orders existing at $P^{t-tr}\pm Pr$, so we use agents that do not care whether
their orders are cancelled even though this is unrealistic in actual financial
markets.

Figure 3: Example of time evolution of market prices in cases with the price limit and the circuit breaker on $tr=10000andPr=100$, and with no regulation. Figure 4: Example of time evolution of market prices in cases with the price limit version two, the price limit, and the circuit breaker on $tr=2000andPr=20$. TABLE I: Averages of falling depth in cases with the price limit. |  | $tr$
---|---|---
|  | 1000 | 2000 | 5000 | 10000 | 20000
| 10 | 298 | 157 | 73 | 45 | 33
| 20 | 577 | 302 | 134 | 79 | 52
| 50 | 1227 | 721 | 313 | 167 | 110
$Pr$ | 100 | 2000 | 1296 | 612 | 315 | 209
| 200 | 2194 | 2111 | 1140 | 615 | 408
| 500 | 2054 | 2054 | 2053 | 1419 | 906
| 1000 | 2054 | 2054 | 2054 | 2054 | 1433
TABLE II: Averages of falling depth in cases with the circuit breaker. |  | $tr$
---|---|---
|  | 1000 | 2000 | 5000 | 10000 | 20000
| 10 | 152 | 103 | 57 | 34 | 22
| 20 | 297 | 207 | 107 | 58 | 43
| 50 | 702 | 487 | 266 | 163 | 105
$Pr$ | 100 | 1222 | 869 | 520 | 315 | 208
| 200 | 1954 | 1522 | 821 | 614 | 407
| 500 | 2054 | 2054 | 2038 | 1061 | 503
| 1000 | 2054 | 2054 | 2054 | 2054 | 1006
TABLE III: Differences between averages of falling depth with the price limit and with the circuit breaker. |  | $tr$
---|---|---
|  | 1000 | 2000 | 5000 | 10000 | 20000
| 10 | 146 | 54 | 16 | 12 | 11
| 20 | 280 | 95 | 27 | 21 | 9
| 50 | 525 | 234 | 47 | 4 | 5
$Pr$ | 100 | 778 | 427 | 92 | 0 | 1
| 200 | 240 | 589 | 319 | 1 | 1
| 500 | 0 | 0 | 15 | 359 | 403
| 1000 | 0 | 0 | 0 | 0 | 427
TABLE IV: Differences between averages of falling depth with the price limit version two and with the circuit breaker. |  | $tr$
---|---|---
|  | 1000 | 2000 | 5000 | 10000 | 20000
| 10 | -8 | -17 | -13 | -5 | -1
| 20 | 56 | 3 | -4 | 2 | -3
| 50 | 212 | 83 | 16 | -14 | -6
$Pr$ | 100 | 418 | 247 | 38 | -17 | -10
| 200 | 69 | 413 | 231 | -23 | -10
| 500 | 0 | 0 | 15 | 318 | 392
| 1000 | 0 | 0 | 0 | 0 | 417
Figure 5: An illustration of multiple sell orders accumulated around the lower limit price. TABLE V: The order books at $t=t_{me}=60000$ in the example from Fig. 4. | Price limit
---
sell shares | price | buy shares
272 | 9780-9800 |
290 | 9760-9780 |
279 | 9740-9760 |
278 | 9720-9740 |
136 | 9700-9720 |
| 9680-9700 | 49
| 9660-9680 | 69
| 9640-9660 | 83
| 9620-9640 | 80
| 9600-9620 | 67
| Circuit breaker
---
sell shares | price | buy shares
6 | 9860-9880 |
9 | 9840-9860 |
8 | 9820-9840 |
1 | 9800-9820 |
1 | 9780-9800 |
| 9760-9780 | 17
| 9740-9660 | 44
| 9720-9740 | 44
| 9700-9720 | 64
| 9680-9700 | 54
| Price limit version two
---
sell shares | price | buy shares
82 | 9880-9900 |
85 | 9860-9880 |
55 | 9840-9860 |
25 | 9820-9840 |
3 | 9800-9820 |
| 9700-9800 | 4
| 9720-9780 | 74
| 9740-9760 | 72
| 9720-9740 | 86
| 9700-9720 | 88

##  III Simulation results

In this study, we determined and validated the parameters of model to
replicate the fat-tail and volatility clustering that are stably observed as
stylized facts for any asset and in any period same as Mizuta et al. [6]. We
did not dare to replicate other stylized facts that are unstably observed
because, as we mentioned, the simplicity of the model is very important for
this study because unnecessary replication of macro phenomena leads to models
that are overfitted and too complex. More details, see the Appendix V-B and
V-C.

Then, we set $\delta P=0.01andP_{f}=10000$, and for the agents,
$n=1000,w_{1,max}=1,w_{2,max}=10,w_{3,max}=1,\tau_{max}=10000,\sigma_{\epsilon}=0.03,P_{d}=1000,t_{c}=10000$,
and $P_{f}=10000$. For the erroneous orders, we set
$t_{ms}=30000,t_{me}=60000,andp_{m}=0.15$, and for stop-loss orders,
$P_{lmin}=1000,P_{lmax}=3000,t_{lmin}=10000,t_{lmax}=100000,andp_{l}=0.35$.
The simulations ran to $t=t_{e}=150000$.

The price limit and the circuit breaker have the same parameters ($tr$ and
$Pr$, respectively). We simulated $35(=5\times 7)$ cases for
$tr=1000,2000,5000,10000,and20000$, and for $Pr=10,20,50,100,200,500,and1000$,
where the other parameters were fixed and used the same random number table.
We then simulated these runs 100 times, changing the random number table each
time, and counted the averages of falling depth ($P_{f}-$lowest $P^{t}$; see
also Fig. 1 (left)).

We used the above ranges of $tr$ and $Pr$ so as to satisfy the conditions
shown by Eqs. (1)–(4) in Section I. Specifically, we set $Pr$ to satisfy the
conditions in Eqs. (2) and (4) and $tr$ to satisfy the condition in Eq. (3).
The results are shown in Tables I–IV, where the gray shading indicates Eq. (1)
is not satisfied.

Figure 3 shows an example of the time evolution of market prices (mid prices)
in the cases with the price limit and the circuit breaker on
$tr=10000,Pr=100$, and without either. Note that while the example is just one
out of 100 simulation runs, the market prices of all cases showed a very
similar shape. In the case without the regulations, market prices fell sharply
and the falling continued by around $t=72000$ after $t=t_{me}=60000$ when the
erroneous orders were stopped, which means that an overshoot occurred. This
result is consistent with that reported by Mizuta et al. [6]. In the cases
with the price limit and the circuit breaker, market prices did not
significantly fall and they started to increase after $t=t_{me}=60000$ when
the erroneous orders were stopped. This means that an overshoot did not occur.

Tables I and II list the averages of falling depth ($P_{f}-$lowest $P^{t}$;
see also Fig. 1 (left)) for various $tr,Pr$ in the cases with the price limit
and the circuit breaker, where gray shading indicates Eq. (1) is not
satisfied. The falling speed is calculated around $0.052$ on the basis of Fig.
3. As we can see, market prices fell significantly when Eq. (1) was not
satisfied, but this could be prevented when Eq. (1) was satisfied. At $tr\geq
10000$, the price limit and the circuit breaker showed almost the same
effectiveness to prevent the falling, but at $tr<10000$, the circuit breaker
was more effective. To clarify this, Table III shows the differences in
falling depth averages between the price limit and the circuit breaker.

Next we examine the mechanism underlying these behaviors. In the price limit
case, sharply falling prices cause many sell orders to be accumulated around
the lower limit price, $p^{t-tr}-Pr$. The threshold, $tr=10000$, is exactly
the same as the cancel period, $t_{c}=10000$. Therefore, when $tr<tc$,
$p^{t-tr}-Pr$ is changed before the accumulated sell orders are cancelled,
which leads to the accumulation of more sell orders of various prices, as
shown in Fig. 5. This accumulation then acts like a wall against buy orders,
which prevents rising prices . Therefore, it is more difficult for the price
limit to prevent price falling when $tr<tc$ than when $tr>tc$.

Actually, in the case with the price limit version two, which does not
accumulate sell orders around the lower limit price, falling is prevented more
or less as effectively as the circuit breaker when $tr<tc$, as Table IV
indicates. Figure 4 shows an example of the time evolution of market prices
(mid prices) in the cases with the price limit version two, the price limit,
and the circuit breaker on $tr=2000,Pr=20$. As we can see, the time evolution
market prices with the price limit version two were almost the same as those
with the circuit breaker.

Table V shows the order book at $t=t_{me}=60000$ for the example in Fig. 4.
The numbers are aggregated orders for price ranges in increments of 20. In the
case with the price limit, many sell orders were accumulated and they
prevented the prices from rising.

To summarize, the price limit and the circuit breaker basically prevent
falling prices with the same level of effectiveness when the $Prandtr$
parameters are the same. However, the price limit is less effective when
$tr<tc$. In the case with the price limit, many sell orders are accumulated
around the lower limit price. When $tr<tc$, $p^{t-tr}-Pr$ is changed before
the accumulated sell orders are cancelled, which leads to the accumulation of
more sell orders of various prices. This accumulation acts like a wall against
buy orders, and the wall is what prevents the prices from rising.

##  IV Summary

In this study, we expanded on Mizuta et al.’s artificial market model[6] by
adding stop loss behavior of the agents and a circuit breaker and then used it
to investigate whether the price limit or the circuit breaker is more
effective to prevent falling market prices. Our findings showed that the price
limit and the circuit breaker are basically equally effective when the limit
price range ($Pr$) and limit time range ($tr$) parameters are the same.
However, the price limit is less effective when $tr$ is smaller than the
cancel time range ($tc$). In the case with the price limit, many sell orders
are accumulated around the lower limit price. When $tr<tc$, the lower limit
price is changed before the accumulated sell orders are cancelled, which leads
to the accumulation of more sell orders of various prices. This accumulation
then acts like a wall against buy orders, which prevents the prices from
rising.

Caution should be taken in the sense that these results pertain only to a
limited situation. Specifically, the fact that the circuit breaker is better
than the price limit should be adapted only in the case where the reason for
falling prices is erroneous orders and where individual stocks are regulated.
In cases where other reasons make the market prices fall (for example, large
variations in the fundamental price) or in cases where individual stocks are
not regulated (for example, stock indexes are regulated), the results might be
different. In fact, in real financial markets, market prices frequently fall
for reasons other than erroneous orders, and there are many cases where a
stock index is regulated by circuit breakers while individual stocks are not
regulated. Wang et. al. [16] indicated that if a stock index is regulated and
the index closes to the limit price of circuit breaker, some traders are in a
hurry to sell and their sell orders make the index fall, which means that
sometimes a circuit breaker induces a sharp fall rather than preventing it. In
the current work, we did not examine such behavior of traders, so this and the
other caveats mentioned above will be the focus of our future work.

##  V Appendix

###  V-A Brief history and contributions of Artificial market models

An artificial market model is an agent-based model for a financial market.
There are thorough great reviews on such model [17, 18, 19, 20, 21, 4, 2, 3,
22]. Numerous significant artificial market models [23, 24, 25, 26] have been
developed since their first appearance in the 1990s. Because of their
generality, they are often qualitative. In particular, artificial markets have
been used to investigate the mechanism by which stylized facts777A stylized
fact is a term used in economics to refer to empirical findings that are so
consistent (for example, across a wide range of instruments, markets and time
periods) that they are accepted as truth[27]. (fat-tails, volatility-
clustering, and so on) emerge [23, 26].

Here, let us briefly examine the nature of financial market phenomena such as
bubbles and crashes, as described in [24, 25]. It is said that micro-macro
feedback loops have played very important roles in bubbles and crashes, and
artificial market models can directly treat such loops. A number of projects
have built generic artificial market models, such as the U-mart project in
Japan in the 2000s. (Kita et al. provide a comprehensive review of the U-mart
project[28].) These projects have helped to explain the nature of financial
market phenomena and the mechanism by which stylized facts emerge.

Artificial market models, however, have rarely been used to investigate the
rules and regulations of financial markets. After the bankruptcy of Lehman
Brothers in 2008, some researchers argued that traditional economics had not
found ways to design markets that work well but suggested that an artificial
market model could do so. Indeed, in Nature, Farmer and Foley [29] explained
that “such (agent based) economic models should be able to provide an
alternative tool to give insight into how government policies could affect the
broad characteristics of economic performance, by quantitatively exploring how
the economy is likely to react under different scenarios.” Richard Bookstaber,
an expert on risk management who has worked for investment banks and hedge
funds, wrote a book [30] that “provides a nontechnical introduction to agent-
based modeling, an alternative to neoclassical economics that shows great
promise in predicting crises, averting them, and helping us recover from
them.” In 2010, Jean-Claude Trichet, then President of the European Central
Bank (ECB) [31], stated that “agent-based modelling dispenses with the
optimization assumption and allows for more complex interactions between
agents. Such approaches are worthy of our attention.”

Financial regulators and exchanges, who decide rules and regulations, are
especially interested in using artificial market models to design a market
that works well. Indeed, the Japan Exchange Group (JPX), which is the parent
company of the Tokyo Stock Exchange, has published 40 JPX working papers,
including 12 on using artificial market models, as of December
2022888https://www.jpx.co.jp/english/corporate/research-study/working-
paper/index.html.

Mizuta [4] reviewed other previous agent-based models for designing a
financial market that works well.

###  V-B Basic concept for constructing a model

An artificial market model, which is an agent-based model for financial
markets, can be used to investigate situations that have never occurred,
handle regulation changes that have never been made, and isolate the pure
contribution of these changes to price formation and liquidity[2, 3]. These
are the advantages of an artificial market simulation. However, the outputs of
this simulation would not be accurate or be credible forecasts of the actual
future. The simulation needs to reveal possible mechanisms that affect price
formation through many simulation runs, e.g., searching for parameters or
purely comparing the before and after states of changes. The possible
mechanisms revealed by these runs provide new intelligence and insight into
the effects of the changes in price formations in actual financial markets.
Other methods of study, e.g., empirical studies, would not reveal such
possible mechanisms.

Artificial markets should replicate the macro phenomena that exist generally
for any asset at any time. Price variation, which is a kind of macro
phenomenon, is not explicitly modeled in artificial markets. Only micro
processes, agents (general investors), and price determination mechanisms
(financial exchanges) are explicitly modeled. Macro phenomena emerge as the
outcome of interactions from micro processes. Therefore, the simulation
outputs should replicate existing macro phenomena to generally prove that
simulation models are probable in actual markets.

However, it is not the primary purpose for an artificial market to replicate
specific macro phenomena only for a specific asset or period. Unnecessary
replication of macro phenomena leads to models that are overfitted and too
complex. Such models would prevent us from understanding and discovering
mechanisms that affect price formation because the number of related factors
would increase. In addition, artificial market models that are too complex are
often criticized because they are very difficult to evaluate[19]. A model that
is too complex not only would prevent us from understanding mechanisms but
also could output arbitrary results by overfitting too many parameters. It is
more difficult for simpler models to obtain arbitrary results, and these
models are easier to evaluate.

Therefore, we constructed an artificial market model that is as simple as
possible and does not intentionally implement agents to cover all the
investors who would exist in actual financial markets.

Such simplicity is very important not only for artificial market models but
also generally for agent-based models. Gilbert argued that there are three
types for agent-based models, an abstract model, a middle-range model and a
facsimile model[13]. Gilbert said ”the aim of abstract models is to
demonstrate some basic social process that may lie behind many area of social
life.” Axelrod mentioned that to understand mechanism abstract models should
be as simple as possible because needless complex model preventing to
understand the mechanism, and called the principle as KISS (keep it simple
stupid)[14]. For example, Thomas Schelling, who received the Nobel Prize in
economics, used an agent-based model to discuss the mechanism of racial
segregation. The model was built very simply compared with an actual town to
focus on the mechanism[32]. While it was not able to predict the segregation
situation in the actual town, it was able to explain the mechanism of
segregation as a phenomenon. Of course, the model was not calibrated to
empirical data because of not leading to make it more complex to prevent
understanding. For such abstract models, we should be cautious complex
modeling by calibrations using empirical date, and this is a fundamental for
modeling[33]. Indeed, many artificial market models were validated by
replicating fat-tails and volatility-clustering that are very famous stylized
facts in financial markets[17, 19, 2, 3]. On the other hand, the aim of
facsimile models is to replicate some specific situation and ”predict” future
exactly. So, facsimile models are needed to be calibrated by empirical data at
least and should replicate existing social phenomena exactly.

As Michael Weisberg mentioned[33], “Modeling, (is) the indirect study of real-
world systems via the construction and analysis of models.” “Modeling is not
always aimed at purely veridical representation. Rather, they worked hard to
identify the features of these systems that were most salient to their
investigations.” Therefore, effective models are different depending on the
phenomena they focus on. Thus, our model is effective only for the purpose of
this study and not for others. The aim of our study is to understand how
important properties (behaviors, algorithms) affect macro phenomena and play a
role in the financial system rather than representing actual financial markets
precisely.

The aforementioned discussion holds not only for artificial markets but also
for agent-based models used in fields other than financial markets. For
example, Thomas Schelling, who received the Nobel Prize in economics, used an
agent-based model to discuss the mechanism of racial segregation. The model
was built very simply compared with an actual town to focus on the
mechanism[32]. While it was not able to predict the segregation situation in
the actual town, it was able to explain the mechanism of segregation as a
phenomenon.

Michael Weisberg studied what mathematical and simulation models are in the
first place and cited the example of a map[33]. Needless to say, a map models
geographical features on the way to a destination. With a simple map, we can
easily understand the way to the destination. However, while a satellite photo
replicates actual geographical features very well, we cannot easily find the
way to the destination.

The title page of Michael Weisberg’s book[33] cited a passage from a short
story by Jorge Borges[34], “In time, those Unconscionable Maps no longer
satisfied, and the Cartographers Guilds struck a Map of the Empire whose size
was that of the Empire, and which coincided point for point with it…In the
Deserts of the West, still today, there are Tattered Ruins of that Map,
inhabited by Animals and Beggars.” The story in which a map was enlarged to
the same size as the real Empire to become the most detailed of any map is an
analogy to that too detailed a model is not useful. This story give us one of
the most important lessons for when we build and use any model.

TABLE VI: Stylized facts without the erroneous orders kurtosis or returns | $4.32$
---|---
| lag |
| 1 | $0.130$
autocorrelation | 2 | $0.081$
coefficient for | 3 | $0.065$
square returns | 4 | $0.054$
| 5 | $0.045$

###  V-C Validation of the model

In many previous artificial market studies, the models were validated to
determine whether they could explain stylized facts, such as a fat-tail or
volatility clustering[17, 19, 2, 3]. A fat-tail means that the kurtosis of
price returns is positive. Volatility clustering means that square returns
have a positive autocorrelation, which slowly decays as its lag becomes
longer.

Many empirical studies, e.g., that of Sewell[27], have shown that both
stylized facts (fat-tail and volatility clustering) exist statistically in
almost all financial markets. Conversely, they also have shown that only the
fat-tail and volatility clustering are stably observed for any asset and in
any period because financial markets are generally unstable. This leads to the
conclusion that an artificial market should replicate macro phenomena that
exist generally for any asset at any time, fat-tails, and volatility
clustering. Other stylized facts should be replicate only when a purpose of
study relates them to prevent to make a model needless complex. In the case of
this study, our model should replicate only universally established stylized
facts about time evolution of market prices which are fat-tails and volatility
clustering to prevent to make a model needless complex because we focus
generally and universally impacts to market prices by the rules. We did not
dare to replicate other stylized facts that are unstably observed because, as
we mentioned, the simplicity of the model is very important for this study
because unnecessary replication of macro phenomena leads to models that are
overfitted and too complex. This is an example of how empirical studies can
help an artificial market model.

The kurtosis of price returns and the autocorrelation of square returns are
stably and significantly positive, but the magnitudes of these values are
unstable and very different depending on the asset and/or period. Very broad
magnitudes of about $1\sim 100$ and about $0\sim 0.2$, respectively, have been
observed[27].

For the aforementioned reasons, an artificial market model should replicate
these values as significantly positive and within a reasonable range. It is
not essential for the model to replicate specific values of stylized facts
because the values of these facts are unstable in actual financial markets.

Table VI lists the statistics showing the stylized facts, kurtosis of price
returns for $100$ tick times ($\ln(P^{t}/P^{t-100})$), and autocorrelation
coefficient for square returns for $100$ tick times without the erroneous
orders. Note that without the erroneous orders no stop loss is happened and no
regulation is triggered. This shows that this model replicated the statistical
characteristics, fat-tails, and volatility clustering observed in real
financial markets.

## References

  * [1] Y. H. Kim, J. YagÃ¼e, and J. J. Yang, “Relative performance of trading halts and price limits: Evidence from the spanish stock exchange,” _International Review of Economics & Finance_, vol. 17, no. 2, pp. 197–215, 2008, market Microstructure and Implications for Regulatory Policies. [Online]. Available: https://doi.org/10.1016/j.iref.2007.06.003
  * [2] T. Mizuta, “An agent-based model for designing a financial market that works well,” in _2020 IEEE Symposium Series on Computational Intelligence (SSCI)_ , 2020, pp. 400–406. [Online]. Available: https://doi.org/10.1109/SSCI47803.2020.9308376
  * [3] T. Mizuta, _Artificial Intelligence (AI) for Financial Markets: A Good AI for Designing Better Financial Markets and a Bad AI for Manipulating Markets_. Singapore: Springer Nature Singapore, 2022, pp. 305–329. [Online]. Available: https://doi.org/10.1007/978-981-19-0937-5_13
  * [4] ——, “A brief review of recent artificial market simulation (agent-based model) studies for financial market regulations and/or rules,” _SSRN Working Paper Series_ , 2016. [Online]. Available: https://doi.org/10.2139/ssrn.2710495
  * [5] C. Yeh and C. Yang, “Examining the effectiveness of price limits in an artificial stock market,” _Journal of Economic Dynamics and Control_ , vol. 34, no. 10, pp. 2089–2108, 2010.
  * [6] T. Mizuta, S. Kosugi, T. Kusumoto, W. Matsumoto, K. Izumi, I. Yagi, and S. Yoshimura, “Effects of price regulations and dark pools on financial market stability: An investigation by multiagent simulations,” _Intelligent Systems in Accounting, Finance and Management_ , vol. 23, no. 1-2, pp. 97–120, 2016. [Online]. Available: https://doi.org/10.1002/isaf.1374
  * [7] X. Zhang, J. Ping, T. Zhu, Y. Li, and X. Xiong, “Are price limits effective? an examination of an artificial stock market,” _PloS one_ , vol. 11, no. 8, p. e0160406, 2016.
  * [8] J. Muranaga and T. Shimizu, “Effect of trading halt system on market functioning: Simulation analysis of market behavior with artificial shutdown,” in _IMES Discussion Paper Series_. Institute for Monetary and Economic Studies, Bank of Japan, 1999\.
  * [9] S. Kobayashi and T. Hashimoto, “Benefits and limits of circuit breaker: Institutional design using artificial futures market,” _Evolutionary and Institutional Economics Review_ , vol. 7, no. 2, pp. 355–372, 2011.
  * [10] C. Chiarella and G. Iori, “A simulation analysis of the microstructure of double auction markets,” _Quantitative Finance_ , vol. 2, no. 5, pp. 346–353, 2002.
  * [11] L. Menkhoff and M. P. Taylor, “The obstinate passion of foreign exchange professionals: technical analysis,” _Journal of Economic Literature_ , pp. 936–972, 2007. [Online]. Available: https://doi.org/10.1257/jel.45.4.936
  * [12] R. Yamamoto, “Predictor choice, investor types, and the price impact of trades on the tokyo stock exchange,” _Computational Economics_ , 2021. [Online]. Available: https://doi.org/10.1007/s10614-020-10084-4
  * [13] N. Gilbert, _Agent-based models_. Sage Publications, 2008. [Online]. Available: https://doi.org/10.4135/9781412983259
  * [14] R. Axelrod, _The Complexity of Cooperation: Agent-Based Models of Competition and Collaboration_. Princeton University Press, 1997. [Online]. Available: http://www.jstor.org/stable/j.ctt7s951
  * [15] TSE, _Guide to TSE Trading Methodology_. Tokyo Stock Exchange, 2019. [Online]. Available: https://www.jpx.co.jp/learning/tour/books-brochures/detail/11.html
  * [16] X. Wang, M. H. Kim, and S. Suardi, “Herding and china’s market-wide circuit breaker,” _Journal of Banking and Finance_ , vol. 141, p. 106533, 2022. [Online]. Available: https://doi.org/10.1016/j.jbankfin.2022.106533
  * [17] B. LeBaron, “Chapter 24 agent-based computational finance,” ser. Handbook of Computational Economics, L. Tesfatsion and K. Judd, Eds. Elsevier, 2006, vol. 2, pp. 1187–1233.
  * [18] A. Chakraborti, I. M. Toke, M. Patriarca, and F. Abergel, “Econophysics review: Ii. agent-based models,” _Quantitative Finance_ , vol. 11, no. 7, pp. 1013–1041, 2011.
  * [19] S.-H. Chen, C.-L. Chang, and Y.-R. Du, “Agent-based economic models and econometrics,” _Knowledge Engineering Review_ , vol. 27, no. 2, pp. 187–219, 2012. [Online]. Available: https://doi.org/10.1017/S0269888912000136
  * [20] M. Cristelli, _Critical Review of Agent-Based Models_. Cham: Springer International Publishing, 2014, pp. 29–54.
  * [21] A. Todd, P. Beling, W. Scherer, and S. Y. Yang, “Agent-based financial markets: A review of the methodology and domain,” in _2016 IEEE Symposium Series on Computational Intelligence (SSCI)_ , 2016, pp. 1–5.
  * [22] J. E. T. Segovia, F. Di Sciorio, R. Mattera, and M. Spano, “A bibliometric analysis on agent-based models in finance: Identification of community clusters and future research trends,” _Complexity_ , 2022.
  * [23] H. Takayasu, H. Miura, T. Hirabayashi, and K. Hamada, “Statistical properties of deterministic threshold elements ― the case of market price,” _Physica A: Statistical Mechanics and its Applications_ , vol. 184, no. 1, pp. 127–134, 1992.
  * [24] K. Izumi and T. Okatsu, “An artificial market analysis of exchange rate dynamics,” _Evolutionary Programming V, Proceedings of the Fifth Annual Conference on Evolutionary Programming_ , pp. 27–36, 1996.
  * [25] W. Arthur, S. Durlauf, D. Lane, and S. E. Program, “Asset pricing under endogenous expectations in an artificial stock market,” _The economy as an evolving complex system II_ , pp. 15–44, 1997.
  * [26] T. Lux and M. Marchesi, “Scaling and criticality in a stochastic multi-agent model of a financial market,” _Nature_ , vol. 397, no. February, pp. 498–500, 1999.
  * [27] M. Sewell, “Characterization of financial time series,” _Research Note, University College London, Department of Computer Science_ , no. RN/11/01, 2011\. [Online]. Available: https://finance.martinsewell.com/stylized-facts/
  * [28] H. Kita, K. Taniguchi, and Y. Nakajima, _Realistic Simulation of Financial Markets_. Springer, 2016.
  * [29] J. D. Farmer and D. Foley, “The economy needs agent-based modelling,” _Nature_ , vol. 460, no. 7256, pp. 685–686, 2009.
  * [30] R. Bookstaber, _The End of Theory: Financial Crises, the Failure of Economics, and the Sweep of Human Interaction_. Princeton University Press, 2017.
  * [31] J.-C. Trichet, “Reflections on the nature of monetary policy non-standard measures and finance theory,” 2010. [Online]. Available: https://www.ecb.europa.eu/press/key/date/2010/html/sp101118.en.html
  * [32] T. C. Schelling, _Micromotives and Macrobehavior_. W. W. Norton & Company, 2006.
  * [33] M. Weisberg, _Simulation and Similarity: Using Models to Understand the World_. Oxford Studies in the Philosophy of Science, 2012.
  * [34] J. L. Borges, “Del rigor en la ciencia,” in _Historia universal de la infamia_. Emecé, 1954.


# Terraform — Automating Infrastructure As A Service

Michael Howard  Computer Science Department
Portland State University
Portland, USA
<EMAIL_ADDRESS>
###### Abstract

Developing a software service requires a strict software development life
cycle and process. This process demands controlling all application code
through source control management as well as a rigorous versioning and
branching strategy. However, the platform and infrastructure also benefit from
this rigor. Software services must be deployed to a target run time
environment and provisioning that environment through manual user actions is
tedious and error-prone. Provisioning manually also becomes prohibitive as the
number of resources grow and spread globally over multiple regions. The answer
is to apply the same rigor to provisioning the infrastructure as applied to
developing the application software. Terraform provides a platform allowing
infrastructure resources to be defined in code. This code not only allows the
automation of the infrastructure provisioning but also allows for a strict
development and review life cycle, same as the application software.

###### Index Terms:

cloud computing, terraform, infrastructure, provisioning

##  I Introduction

Terraform is an Infrastructure As Code (IaC) client tool developed by
HashiCorp. It allows the user to define both cloud and on-premise compute
resources in human-readable configuration files. These files are created using
the HashiCorp Configuration Language (HCL). The syntax is declarative with
each block of code defining a resource to be provisioned. Declarative
definitions (versus imperative) allow the user to define the desired state,
rather than an exhaustive list of all the interim steps required to achieve
that state.

Section II discusses typical Terraform workflows and how the tool is used.
Section III digs more into the structure of the HCL code. Various platforms
that can run the Terraform code are discussed in Section IV while the provider
plugins are expanded upon in Section V. Section VI details the Cloud
Development Kit interfacing Terraform to multiple high-level programming
languages. The alternatives to Terraform are examined in Section VII. Other
related topics of research are discussed in VIII which leads to a summary
discussion in Section IX.

##  II Basic Workflows

Figure 1 introduces the basic workflow for Terraform. The development and
implementation of IaC is broken into write, plan and apply stages.

Figure 1: High-level workflow for Terraform covering write, plan and apply
stages.

###  II-A Write

The _write_ stage focuses on developing the code required to drive the plan.
The infrastructure resources are defined here for the providers and services
required. Multiple providers may be included. The code is contained in
configuration files with a .tf extension. There is an additional option to
store the configuration in JavaScript Object Notation (JSON) format which then
requires the .tf.json extension. The correct extension must be used in order
for the Terraform tool to detect the configuration file while generating the
plan.

For example, a user wishes to create a mini-cluster of virtual machines in
Amazon Web Service (AWS). Three virtual machines, a Virtual Private Cloud
(VPC) network, security group and a load balancer service are required for
this cluster. The Terraform configuration code declares each of these
resources separately with corresponding parameters. Section III goes into more
detail of the configuration language.

###  II-B Plan

Once the configuration code has been written, the next stage is to run the
Terraform tool to generate a _plan_. The tool is run either through the local
Command Line Interface (CLI) or via other high-level language that can
interface to the Terraform framework via the Cloud Development Kit (CDK).
Section VI digs into further detail of the CDK. Running the Terraform plan
will scan local directories for configuration files ending in .tf or .tf.json
and process these into a list of actions to be sent to the provider(s). This
list is called the execution plan and encompasses all create, update and
destroy actions needed to make the target infrastructure match what is
declared in the configuration code.

The plan generation additionally has a dependency on the existing
infrastructure that is represented in the _state_. The state details all
infrastructure resources that are currently present. The state file exists
either locally in the file system or remotely. For example, the configuration
contains an Elastic Compute (EC2) virtual machine named “VirtualMachine1”.
Upon running Terraform to generate the plan, the current state file is
checked. If the VirtualMachine1 EC2 is already existing, the plan does not
create it. It will either be an update action or no operation.

###  II-C Apply

The final stage in the Terraform workflow is to _apply_. Running the tool on a
plan executes each action against the corresponding provider. Figure 2 shows
Terraform interacting with its provider plugin which subsequently calls into
the Application Programming Interface (API) of the corresponding cloud
provider (e.g. AWS). Provider modules act as the abstraction between the
configuration code and unique API defined by each infrastructure provider. The
providers are further discussed in Section V. As part of apply, the state is
updated to represent the changes in the target infrastructure.

Figure 2: Terraform actions go through a provider module to translate into API
calls specific to that provider.

##  III Configuration Language

Terraform scans configuration files and generates a corresponding plan. The
configuration files are written in the HashiCorp Configuration Language (HCL).
This language is declarative. Declarative offers an advantage over imperative
in that the desired state of the infrastructure can be directly coded. An
imperative language requires defining all the interim steps to arrive at the
desired state.

The main purpose of HCL is to define resources. The code is written in blocks
with each block representing an infrastructure object. A Terraform
configuration is a complete document in HCL telling Terraform how to manage a
given collection of infrastructure resources. Figure 3 shows example code that
declares the required provider plugin as well as a VPC and corresponding
subnet. The purpose of the block is defined by the block type. A _variable_
block type is used as a parameter in other blocks. A _provider_ defines what
provider plugin is used to translate the resource block into API calls to the
infrastructure provider. The _resource_ block is used to define a concrete
resource in the provider’s infrastructure. Resource blocks are translated into
create, update or delete API calls to the provider’s target infrastructure
service.

Figure 3: An HCL example declaring the required provider, a VPC and subnet.

##  IV Framework Environment

Environments that can run Terraform are the CLI, Terraform Cloud, Terraform
Enterprise and CDK. The CLI is the most common. Pre-built binaries can be
downloaded or the Golang source code111https://github.com/hashicorp/terraform
can be cloned and built. The Terraform tool runs on a local set of
configuration files. These files can be organized into subdirectories which
Terraform will automatically traverse. The _state_ file is typically generated
in the same directory that the tool runs from. However, there is a _remote_
option which generates state files in a remote, central location such that
multiple Terraform clients may apply their plans and still synchronize their
view of the existing infrastructure.

_Terraform Cloud_ is a Terraform environment hosted by HashiCorp. As a hosted
service, users log in to generate and apply plans. The Terraform tool-chain
itself is maintained by HashiCorp while the state files are centrally stored
such that all users are running against the same current infrastructure state.
_Terraform Enterprise_ is a self-hosted version of Terraform Cloud. If offers
the same cloud-based feature set but is designed to be deployed within an
enterprise’s private cloud.

Another version of the CLI or local environment is the _Cloud Development Kit
(CDK)_. Rather than running the CLI tool directly, CDK permits five supported
high-level languages to generate and apply Terraform plans. Code in these
supported languages is able to call in to the Terraform framework, replacing
the Terraform CLI. Section VI provides further details on CDK.

##  V Providers

Terraform relies on plugins called _providers_ to interact and abstract the
various infrastructure providers. Each provider must be declared in the
configuration using the “provider” block type. Once a provider has been
declared, the corresponding plugin is included while generating the plan.
Declared resources utilize the provider’s underlying API to perform create,
update and delete actions needed to ensure the resource ends up in the desired
state.

Providers come from a publicly available registry of known
plugins222https://registry.terraform.io/browse/providers. The list is
extensive and covers all known cloud, Software as a Service (SaaS) and other
APIs. These provider plugins allow the resource and data source blocks to be
declared without needing details on the specific provider’s API. Each provider
maintains documentation on the Terraform blocks it supports along with the
corresponding parameters.

##  VI Cloud Development Kit

The Cloud Development Kit (CDK) for Terraform allows the use of other
programming language to define and provision infrastructure. CDK gives access
to the entire Terraform ecosystem without requiring development in HashiCorp
Configuration Language (HCL) and running it via the CLI tool. Additionally, a
user can more easily integrate with an existing tool-chain for testing and
dependency management. The following languages are currently supported:

  * •

Typescript

  * •

Python

  * •

Java

  * •

C#

  * •

Go

Figure 4 shows the various input pathways to Terraform. CDK may be invoked
from its five supported languages while configuration code in HCL or JSON
require the Terraform CLI. Kubernetes’ Custom Resource Definitions (CRDS) are
another possibility but will not be covered here.

Figure 4: CDK and other pathways to define configuration, input to Terraform
and provision infrastructure through multiple providers. Configuration input
may be through CDK, CRDS, HCL or JSON.

##  VII Alternatives

Terraform provides an abstraction of providers and their resources. It can
represent physical hardware, virtual machines, containers, network
configurations, email and Domain Name Service (DNS) providers. Given the
breadth of resources and providers, Terraform does overlap with other tools.
Some of these tools will be discussed here.

###  VII-A Chef and Puppet

Chef333https://www.chef.io/ and Puppet444https://puppet.com/ are configuration
management tools. They are designed to install and manage software on compute
resources that already exist. Terraform instead focuses on the bootstrapping
and initializing of those compute resources. It works well in conjunction with
configuration management.

###  VII-B CloudFormation and Heat

CloudFormation555https://aws.amazon.com/cloudformation/ and
Heat666https://docs.openstack.org/heat/latest/ are both tools that represent
infrastructure as code, just like Terraform. The configuration files allow the
infrastructure to be elastically created, modified and destroyed. The big
advantage which Terraform provides is it is provider-agnostic. CloudFormation
is an Amazon Web Service (AWS) tool and only works with provisioning other AWS
resources. Heat similarly operates only on an OpenStack API. Terraform not
only supports multiple providers but can also combine resources from each into
a single plan. Thus, it introduces _multi-cloud_ provisioning.

Another feature which Terraform has over CloudFormation and Heat is the
separation of the plan and execution. Terraform has the distinct stage to
generate a plan which also takes into account the existing state of the
infrastructure. The plan is then optionally reviewed and approved before the
apply stage executes each plan action. Terraform also has a graph feature
which displays the plan actions ordered by dependency.

###  VII-C Boto and Fog

Boto777http://boto.cloudhackers.com/en/latest/ and
Fog888https://github.com/fog/ are similar to provider plugins in Terraform.
They abstract the API to a particular infrastructure provider. Both still
require some high level programming language to declare the resources and call
in to their respective libraries. In contrast, Terraform abstracts this
functionality as an extensive set of plugins and providers the high-level
configuration language to allow declaring the resources in a provider-agnostic
manner.

##  VIII Related Work

The Organization for the Advancement of Structured Information Standards
(OASIS)999https://www.oasis-open.org/ was founded in 1993 as a non-profit
consortium that works on the development, convergence and adoption of open
standards for cybersecurity, cloud computing and related areas[2]. The two
standards that are relevant to this paper are Topology and Orchestration
Specification for Cloud Applications (TOSCA) and Cloud Application Management
for Platforms (CAMP).

###  VIII-A TOSCA

TOSCA is an open standard that describes a topology of cloud-based web
services, their components, relationships and the processes that manage them.
Version 1.0 was approved 16 January 2014 by OASIS. The standard enables
portability and automated management across cloud providers regardless of the
underlying infrastructure. This standard improves reliability and reduces cost
while facilitating the continuous delivery of applications across their entire
lifecycle.

Version 2.0 is the current and was approved 28 October 2020 [3]. The core
specification provides a language for describing service components and their
relationships using a service topology, and it provides for specifying the
lifecycle management procedures that allow for creation or modification of
services using orchestration processes. A TOSCA _Service Template_ , as shown
in Figure 5, combines topology and orchestration needed in different
environments to enable automated deployment of services and their management
throughout the complete service lifecycle.

Figure 5: Structural Elements of a TOSCA Service Template and its Relations.

The TOSCA language has the ability to automate lifecycle management for the
following:

  * •

Infrastructure as a Service deployments for multiple cloud providers (i.e.
OpenStack, AWS, Microsoft Azure).

  * •

Deploy containerized applications to existing orchestrators (i.e. Kubernetes).

  * •

Define the management of Virtual Network Functions.

  * •

Support on-demand creation of network services.

  * •

Define Functions as a Service applications that can run without any
corresponding deployment.

  * •

Deploy services to Internet of Things (IoT) and Edge devices while minimizing
latency.

  * •

Support open and interoperable process control architectures.

Implementations of the TOSCA standard can take the form of:

  * •

Source code: a Yet-Another-Markup-Language (YAML) document which defines the
Service Template.

  * •

Processor: a tool or engine to parse the Service Template document.

  * •

Orchestrator: a tool or engine that processes the Service Template in order to
deploy and manage an application.

  * •

Translator: a tool to translate the Service Template into another language
such as Helm Charts or Amazon CloudFormation templates.

  * •

Generator: a tool to generate a Service Template.

  * •

Archive: Cloud Service Archive (CSAR), a package containing the Service
Template and other artifacts needed for deployment.

Links to all known TOSCA implementations are listed in the oasis-open
repository in GitHub101010https://github.com/oasis-open/tosca-community-
contributions/wiki/Known-TOSCA-Implementations. Also, a full list of TOSCA
technical committee members may be viewed at the oasis-open membership
page111111https://www.oasis-
open.org/committees/membership.php?wg_abbrev=tosca.

###  VIII-B CAMP

The Cloud Application Management for Platforms (CAMP) is another standard to
come from the OASIS consortium. Its technical committee published version 1.0
in August 2012 and was a collaboration between CloudBees, Cloudsoft
Corporation, Huawei, Oracle, Rackspace, Red Hat, and Software AG [4]. The
technical committee was closed by OASIS on 23 April 2021 and is no longer
active. As CAMP is referenced frequently in cloud computing research, we will
include it here for completeness.

The CAMP technical committee’s goal advances an interoperable protocol that
packages and deploys cloud-hosted applications. The standard defines models,
mechanisms and protocols for the management of a Platform as a Service (PaaS)
environment. PaaS describes a service where the users manage the platform that
applications are hosted on. In contrast, the TOSCA standard focuses on
Infrastructure as a Service (IaaS). PaaS exists a level above IaaS and thus
CAMP and TOSCA are complementary standards rather than overlapping.

##  IX Conclusion and Discussion

In this paper, we discuss Terraform as an Infrastructure as Code (IaC) tool.
Its framework allows the user to declare infrastructure resources through
code, generate an execution plan from that code and finally apply the plan.
Applying works through provider plugin modules which translate the execution
actions into API calls specific to the provider. Not only is the
infrastructure created in a programmatic manner, it is agnostic of the
underlying provider (i.e. AWS, private cloud, VMWare, Microsoft Azure). This
abstraction avoids vendor lock-in and increases portability between vendors.

The Terraform configuration language is discussed as well as the possible
environments that can interpret and run the corresponding code. These
environments range from local execution to both cloud and private hosted
services. Provider modules allow interfacing to almost any third-party
infrastructure vendor or service while the Cloud Development Kit (CDK) enables
a user to integrate with the Terraform framework from five popular high-level
programming languages. Configuration management tools such as Chef, Ansible
and Puppet focus more on automating the software and configurations within an
infrastructure resource and thus, do not directly compete with Terraform.
Amazon’s CloudFormation and OpenStack’s Heat do compete. However, their
framework only supports their own infrastructure and cannot provision
resources from other providers.

As of this writing, Terraform focuses on the provisioning of infrastructure
and services. The building and deployment of software applications to that
infrastructure requires additional tool-chains and automation. A product that
overseas an entire operation from multi-cloud infrastructure provisioning,
application deployment and runtime orchestration does not exist at this time.
One promising possibility is Topology and Orchestration Specification for
Cloud Applications (TOSCA).

TOSCA is a standard developed by the Organization for the Advancement of
Structured Information Standards (OASIS) consortium. Part of the standard is a
specification language that allows users to create YAML-based Service
Templates. These templates declare nodes, workflows and relationships such
that a more complete picture may be specified for the _total_ operation of an
application and its required infrastructure. TOSCA implementations include
template code interpreters, orchestrators, translators and archive tools.
OpenStack Heat is an example of a TOSCA-compatible framework but is still
limited in its breadth and focuses mostly on the provisioning. Further
research in TOSCA is required, both to expand and mature the standard as well
as bring a new suite of framework tools into the mainstream that implement it.

## References

  * [1] HashiCorp, _Terraform Documentation_. Accessed: May 2, 2022. [Online]. Available: https://www.terraform.io/docs
  * [2] Wikipedia, _OASIS (organization)_. Accessed: May 6, 2022. [Online]. Available: https://en.wikipedia.org/wiki/OASIS_(organization)
  * [3] Oasis Open, _TOSCA Version 2.0_. Accessed: May 7, 2022. [Online]. Available: https://docs.oasis-open.org/tosca/TOSCA/v2.0/TOSCA-v2.0.html
  * [4] Oasis Open, _CAMP Charter_. Accessed: May 7, 2022. [Online]. Available: https://www.oasis-open.org/committees/camp/charter.php


∎

11institutetext: Gianni Pagnini1,2,∗ 22institutetext: 1BCAM – Basque Center
for Applied Mathematics, Alameda de Mazarredo 14, E-48009 Bilbao, Basque
Country – Spain
2Ikerbasque – Basque Foundation for Science, Plaza Euskadi 5, E-48009 Bilbao,
Basque Country – Spain
22email<EMAIL_ADDRESS>∗ corresponding author
ORCID ID: orcid.org/0000-0001-9917-4614 33institutetext: Claudio Runfola3
44institutetext: 3Independent Researcher
44email<EMAIL_ADDRESS>
# Mellin definition of the fractional Laplacian

Gianni Pagnini1,2 Claudio Runfola3

(Received: / Revised: / Accepted: ……)

###### Abstract

It is known that at least ten equivalent definitions of the fractional
Laplacian exist in an unbounded domain. Here we derive a further equivalent
definition that is based on the Mellin transform and it can be used when the
fractional Laplacian is applied to radial functions. The main finding is
tested in the case of the space-fractional diffusion equation. The one-
dimensional case is also considered, such that the Mellin transform of the
Riesz (namely the symmetric Riesz–Feller) fractional derivative is
established. This one-dimensional result corrects an existing formula in
literature. Further results for the Riesz fractional derivative are obtained
when it is applied to symmetric functions, in particular its relation with the
Caputo and the Riemann–Liouville fractional derivatives.

###### Keywords:

fractional calculus (primary) fractional Laplacian Mellin transform radial
functions Riesz fractional derivative symmetric Riesz–Feller fractional
derivative space-fractional diffusion equation Lévy stable densities Lévy
flights anomalous diffusion

###### MSC:

26A33 (primary) 47G30 35S05 44A15 35R11

††journal: Fract. Calc. Appl. Anal.

##  1 Introduction

The fractional Laplacian bucur_valdinoci-2016; lischke_etal-jcp-2020, or
fractional Laplace operator, is a relevant example of non-local pseudo-
differential operator within the theory of fractional calculus. In an
unbounded domain, there exist at least ten equivalent definitions of the
fractional Laplacian kwasnicki-fcaa-2017, while this equivalence does not hold
in bounded domains, see, e.g., servadei_etal-prse-2014; cusimano_etal-
siamjna-2018; duo_etal-dcdsb-2019. Here we show that a further equivalent
definition in unbounded domains can be provided on the basis of the Mellin
transform when the fractional Laplacian is applied to radial functions.
Actually, the Mellin transform has a remarkable role in fractional calculus,
see, e.g., gorenflo_etal-fcaa-2000; mainardi_etal-fcaa-2001; mainardi_etal-
fcaa-2003; luchko_etal-fcaa-2013; bardaro_etal-jfaa-2015, that is additionally
supported by the present results.

More in detail, this equivalence holds when the fractional Laplacian is an
operator on Lebesgue spaces $\pazocal{L}^{p}$ (with $p\in[1,\infty)$), on the
space of continuous functions vanishing at infinity and on the space of
bounded uniformly continuous functions kwasnicki-fcaa-2017. For the present
aims, and to lighten the text, we assume sufficiently well-behaving functions
in $\mathbb{R}^{n}$ with $n\in\\{1,2,\dots\\}$ such that the considered
formulae have sense. In particular, we consider radial functions in
$\mathbb{R}^{n}$ that are radial Schwartz–Bruhat functions, namely they and
all their derivatives vanish very quickly for large value of the argument such
that we can use a result previously derived by N. Ormerod ormerod-jmaa-1979.
We denote the fractional Laplacian in $\mathbb{R}^{n}$ by
$\mathscr{L}=-(-\Delta)^{\alpha/2}$ with $\alpha\in(0,2)$. The classical
Laplacian $\Delta$ is recovered when $\alpha=2$. The reader interested in the
technicalities concerning the fractional Laplacian is referred, for example,
to the book by C. Bucur and E. Valdinoci bucur_valdinoci-2016, and for the
technicalities concerning the Mellin transform is referred, for example, to
the book by O.I. Marichev marichev-1983 or to the book by R.B. Paris and D.
Kaminski paris_kaminski-2001.

Before to start, we want to remind also that the fractional Laplacian is a
peculiar nonlocal operator beside its role in fractional calculus. In
particular, it has been proved that all functions are locally $s$-harmonic up
to a small error dipierro_etal-jems-2017 in the sense of the fractional
Laplacian of order $\alpha/2=s$. Actually, this is a pure consequence of
nonlocality of the fractional Laplacian because the approximating functions
that are $s$-harmonic are defined in the whole $\mathbb{R}^{n}$ such that the
approximation is possible with a careful choice of the values outside the
reference interval krylov-jfa-2019. A similar property does not hold for any
nonlocal operator dipierro_etal-jems-2017. This result has been further
investigated in literature valdinoci-lnm-2018; dipierro_etal-jga-2019; krylov-
jfa-2019.

We begin by reminding the heat semi-group definition kwasnicki-fcaa-2017;
stinga-2019; lischke_etal-jcp-2020 (or Bochner’s definition bochner-1949)

$\mathscr{L}u=\frac{-1}{\Gamma\left(-\frac{\alpha}{2}\right)}\int_{0}^{\infty}(e^{t\Delta}u-u)\frac{dt}{t^{1+\alpha/2}}\,,\quad\alpha\in(0,2)\,,$
(1.1)

where $e^{t\Delta}$ is the propagator of the heat equation, which means that
$\rho(x,t)=e^{t\Delta}u(x):\mathbb{R}^{n}\times[0,\infty)\to\mathbb{R}$ solves

$\frac{\partial\rho}{\partial t}=\Delta\rho\,,\quad\rho(x,0)=u(x)\,.$ (1.2)

Then, by applying the Fourier transform to (1.1), we have another and
equivalent definition of the fractional Laplacian. In particular, the
fractional Laplacian emerges to be a Fourier multiplier with the celebreted
symbol

$\mathscr{F}(\mathscr{L}u)(\kappa)=-|\kappa|^{\alpha}\mathscr{F}u(\kappa)\,,\quad\kappa\in\mathbb{R}^{n}\,.$
(1.3)

Formula (1.3) can be obtained by noting from (1.2) that
$\mathscr{F}\rho(\kappa)=e^{-|\kappa|^{2}t}\mathscr{F}u(\kappa)$, where
$|\kappa|=\sqrt{\kappa\cdot\kappa}$ and
$|\kappa|^{\alpha}=(|\kappa|^{2})^{\alpha/2}$, and by remembering that it
holds $\displaystyle{\int_{0}^{\infty}(e^{-y}-1)\,y^{s-1}\,dy=\Gamma(s)}$ for
$s\in\mathbb{C}$ with $-1<\Re(s)<0$ (whittaker_watson-1952, Chapter XII) from
the analytical continuation of the Gamma function through the
Cauchy–Saalschütz representation, see also (temme-1996, Chapter 3) and
(paris_kaminski-2001, Table of Mellin transforms).

The fractional Laplacian is also related with the so-called Riesz potential
$I^{\alpha}$ that is defined as

$I^{\alpha}u(x)=\frac{1}{\gamma_{n}(\alpha)}\int_{\mathbb{R}^{n}}u(x+z)|z|^{-n+\alpha}\,dz\,,\quad\gamma_{n}(\alpha)=\frac{\Gamma\left(\frac{n-\alpha}{2}\right)}{2^{\alpha}\pi^{n/2}\Gamma\left(\frac{\alpha}{2}\right)}\,,$
(1.4)

with $\alpha\neq n+2m$, $m=0,1,2,\dots$, and converges when $0<\alpha<n$, that
is with $\alpha\in(0,2)$ when $n\geq 2$ and $\alpha\in(0,1)$ when $n=1$, see,
e.g., samko-fcaa-1998; rubin-fcaa-2012. In fact, another equivalent definition
of the fractional Laplacian follows from the left inverse of the Riesz
potential (1.4) samko-fcaa-1998; kwasnicki-fcaa-2017. Actually, integral (1.4)
was originally introduced by M. Riesz in the late 1940’s in a study on the
Cauchy problem for the wave equation with the aim of writing the solution in
closed form riesz-1949. As a matter of fact, the operator (1.4) defines a
family of convolution operators with fractional index.

In this paper we prove a further equivalent definition of the fractional
Laplacian on the basis of the Mellin transform.

When $n=1$, the left inversion of the Riesz potential (1.4) is called Riesz
fractional derivative and it is here denoted by $\mathscr{D}_{x}^{\alpha}$
cai_etal-fcaa-2019. Thus, in the one-dimensional case, the symbol of the
fractional Laplacian (1.3) and that of the Riesz fractional derivative are
identical because only the modulus of the Fourier variable is involved. The
Riesz fractional derivative can be written by highlighting its relation with
the second derivative, i.e., the one-dimensional Laplacian, through the
following equality involving their symbols
$-|\kappa|^{\alpha}=-\left(|\kappa|^{2}\right)^{\alpha/2}$ mainardi_etal-
fcaa-2001 and then, in analogy, the following notation can be formally adopted
$\displaystyle{\mathscr{F}^{-1}(\mathscr{F}\mathscr{D}_{x}^{\alpha})=\mathscr{D}_{x}^{\alpha}:=-\left(-d^{2}/dx^{2}\right)^{\alpha/2}}$
when $x\in\mathbb{R}$ feller-1952. Moreover, we report here that W. Feller
generalised the Riesz potential (1.4) when $n=1$ to any complex $\alpha$ with
$\Re(\alpha)>0$ and included a further parameter $\theta$ related with
operator asymmetry feller-1952. In particular, by following the approach due
to M. Riesz, W. Feller introduced a family of one-dimensional pseudo-
differential operators obtained by the inversion of linear combinations of
left and right hand-sided Riemann–Liouville–Weyl operators feller-1952;
gorenflo_etal-fcaa-1998. Furthermore, motivated by the research started by S.
Bochner bochner-1949 on the generalization of standard diffusion to
generalized diffusion equations for Lévy stable densities, W. Feller provided
such generalized operators, nowadays called Riesz–Feller fractional
derivative, for diffusion processes converging to Lévy stable densities on the
basis of the fact that each stable density defines a semi-group of
transformations feller-1952. Finally, the symbol of the Riesz–Feller
fractional derivative is
$-|\kappa|^{\alpha}e^{i(\operatorname{sgn}\kappa)\theta\pi/2}$ with
$\alpha\in(0,2)$ and $|\theta|\leq\min\\{\alpha,2-\alpha\\}$. Thus, the
symmetric Riesz–Feller fractional derivative is the Riesz fractional
derivative when $\theta=0$, that is when the Riesz–Feller derivative is a
symmetric operator, and it is consistent with the requirement of radial
functions in $\mathbb{R}^{n}$. Actually, the Riesz fractional derivative, or
more general two-sided fractional derivatives, are still topics for recent
research, see, e.g., bayin-jmp-2016; cai_etal-fcaa-2019; ortigueira-mmas-2021.
The Riesz fractional derivative can be written explicitly in a regularised
integral form valid for $\alpha\in(0,2)$ (mainardi_etal-fcaa-2001, see,
formula (2.6) and footnote $3$)

$\mathscr{D}_{x}^{\alpha}f(x)=\frac{\Gamma(1+\alpha)}{\pi}\sin\frac{\pi\alpha}{2}\int_{0}^{\infty}\frac{f(x+z)-2f(x)+f(x-z)}{z^{1+\alpha}}\,dz\,.$
(1.5)

By exploiting the one-dimensional case of the Mellin definition of the
fractional Laplacian here derived, we also establish the relations of the
Riesz fractional derivative applied to a symmetric function with the Caputo
and with the Riemann–Liouville fractional derivatives.

In the following, we first present and discuss the main results in Section 2
and later we provide the proofs in Section 3. In Section LABEL:sec:4, we apply
(and check) our findings for solving the space-fractional diffusion equation.
Conclusions and future developments are finally reported in Section
LABEL:sec:5.

##  2 Main results

###### Theorem 2.1

Let $f$ be a radial function in $\mathbb{R}^{n}$ and
$\mathscr{M}(\mathscr{L}f)(s)$ its Mellin transform with $s\in\mathbb{C}$. A
further definition of the fractional Laplacian
$\mathscr{L}=-(-\Delta)^{\alpha/2}$ with $\alpha\in(0,2)$ that is equivalent,
inter alia, to definitions (1.1) and (1.3) in the sense of Reference
kwasnicki-fcaa-2017 is

$\mathscr{M}(\mathscr{L}f)(s)=-2^{\alpha}\frac{\Gamma\left(\frac{s}{2}\right)\Gamma\left[\frac{n-(s-\alpha)}{2}\right]}{\Gamma\left(\frac{n-s}{2}\right)\Gamma\left[\frac{s-\alpha}{2}\right]}\mathscr{M}f(s-\alpha)\,,\quad
s\in\mathbb{C}\,,$ (2.1)

for $s\neq 0$ and $0<\Re(s)<n$.

From Theorem 2.1 with $n=1$, we have the following Corollary that holds for
the Riesz fractional derivative (1.5)

###### Corollary 1

When the Riesz frational derivative $\mathscr{D}_{x}^{\alpha}$ (1.5) of order
$\alpha\in(0,2)$ is applied to a symmetric function $f(x)=f(|x|)$, with
$x\in\mathbb{R}$, it holds

$\mathscr{M}(\mathscr{D}_{x}^{\alpha}f)(s)=-\frac{\Gamma(s)\cos\left(\frac{\pi}{2}s\right)}{\Gamma(s-\alpha)\cos\left[\frac{\pi}{2}(s-\alpha)\right]}\mathscr{M}f(s-\alpha)\,,\quad
s\in\mathbb{C}\,,$ (2.2)

for $s\neq 0$ and $0<\Re(s)<1$.

Formula (2.2) corrects a similar functional equation previously derived in an
attempt to derive a new generalization of an Hilfer-type fractional derivative
(khan_etal-rp-2021, formula (53)). There khan_etal-rp-2021, the expression of
the Mellin transform of the Riesz fractional derivative is retrieved by
handling this last as a pseudo-differential operator of the Riemann–Liouville
type (khan_etal-rp-2021, formula (42)). However, that formula does not work
when it is faced to the space-fractional diffusion equation. The success of
formula (2.1) for solving the space-fractional diffusion equation, and then
also of (2.2) for the one-dimensional case, is indeed here reported.

Moreover, the study of the one-dimensional case allows for deriving the
following functional relations that are of interest in the theory of
fractional calculus. Let $x\in\mathbb{R}$ and let $\mathbb{D}_{|x|}^{\alpha}$
and $\pazocal{D}_{|x|}^{\alpha}$ be the fractional derivatives of order
$\alpha>0$ with respect to $|x|\in\mathbb{R}^{+}$ in the Caputo and in the
Riemann–Liouville sense, respectively, then the following Theorems can be
proven by starting from results obtained from Corollary 1.

###### Theorem 2.2

Let $\phi:\mathbb{R}\to\mathbb{R}$ be a symmetric function such that
$\phi(x)=\phi(|x|)$ and let $\mathscr{D}_{x}^{\alpha}$ and
$\mathbb{D}_{|x|}^{\alpha}$ be the Riesz and the Caputo fractional derivatives
with respect to $x$ and $|x|$, respectively, of order $0\leq m-1<\alpha<m$
with $m\in\mathbb{N}$. Provided that

$i)\,\lim_{|x|\to 0}\phi^{(j)}(|x|)\,|x|^{s-\alpha+j}=0\,,\quad
ii)\,\lim_{|x|\to+\infty}\phi^{(j)}|x|^{s-\alpha+j}=0\,,$ (2.3)

with $j=0,\dots,m-1$ and proper $\Re(s)$, it holds

$\mathscr{D}_{x}^{\alpha}\phi(|x|)=\int_{0}^{\infty}\left\\{\mathbb{D}_{\xi}^{\alpha}\phi(\xi)\right\\}\mathscr{E}(|x|/\xi)\,\frac{d\xi}{\xi}\,,$
(2.4)

where, for $\xi\in\mathbb{R}^{+}$, kernel $\mathscr{E}(\xi)$ is defined as

$\mathscr{E}(\xi)=\frac{2}{\pi}\frac{\sin(\pi\alpha/2)}{1-\xi^{2}}-\cos\left(\frac{\pi\alpha}{2}\right)\,\xi\delta(\xi-1)\,.$

###### Corollary 2

When $\alpha=1$, it holds $\mathbb{D}_{\xi}^{1}=d/d\xi$ with
$\xi\in\mathbb{R}^{+}$. Thus, by using the Leibniz integral rule and the
symmetry of $\phi$ such that $d\phi/dx=\operatorname{sgn}(x)\,d\phi/d|x|$ with
$x\in\mathbb{R}$, from Theorem 2.2 we have

$\mathscr{D}_{x}^{1}\phi(|x|)=-\frac{1}{\pi}\frac{d}{dx}\int_{-\infty}^{+\infty}\frac{\phi(|y|)}{x-y}\,dy\,.$
(2.5)

Formula (2.5) was previosuly derived by W. Feller in the special case of the
symmetric Cauchy density by looking for space-fractional diffusion equations
solved by the stable densities introduced by P. Lévy feller-1952.

###### Remark 1

Formula (2.5) holds for symmetric functions only. This symmetry constraint is
implicit from the symmetric diffusion process studied in the original
derivation by W. Feller feller-1952, but it is indeed omitted when the
operator $\mathscr{D}_{x}^{1}$ is reported in overviews, see, e.g.,
mainardi_etal-fcaa-2001; bayin-jmp-2016. On the other side, formula (2.5) is
an important complement that is missing in recent studies on the Riesz
fractional derivative or on more general two-sided fractional derivatives
cai_etal-fcaa-2019; ortigueira-mmas-2021.

###### Corollary 3

When $\alpha=2$, by using the properties of the delta-function, from Theorem
2.2 it holds

$\mathscr{D}_{x}^{2}\phi(|x|)=\mathbb{D}_{|x|}^{2}\phi(|x|)\,.$ (2.6)

###### Theorem 2.3

Let $\phi:\mathbb{R}\to\mathbb{R}$ be a symmetric function such that
$\phi(x)=\phi(|x|)$ and let $\mathscr{D}_{x}^{\alpha}$ and
$\pazocal{D}_{|x|}^{\alpha}$ be the Riesz and the Riemann–Liouville fractional
derivatives with respect to $x$ and $|x|$, respectively, of order $0\leq
m-1<\alpha<m$ with $m\in\mathbb{N}$. Provided that conditions $i)$ and $ii)$
in (2.3) are met together with the further conditions $\phi^{(j)}(0^{+})=0$,
for any $j=0,\dots,m-1$, then it holds

$\mathscr{D}_{x}^{\alpha}\phi(|x|)=\int_{0}^{\infty}\left\\{\pazocal{D}_{\xi}^{\alpha}\phi(\xi)\right\\}\mathscr{E}(|x|/\xi)\,\frac{d\xi}{\xi}\,,$
(2.7)

where kernel $\mathscr{E}$ is defined as in Theorem 2.2.

###### Corollary 4

A further Theorem similar to Theorems 2.2 and 2.3 can be proved for the
Miller–Ross fractional derivative. Actually, a formula analogous to formuale
(2.4) and (2.7) with the same kernel $\mathscr{E}$ (LABEL:eq:E) can be derived
after providing the conditions required for the Mellin transform of the
Miller–Ross fractional derivative to be equal to that of both the Caputo and
the Riemann–Liouville fractional derivatives (podlubny-1999, Section 2.10.5).

##  3 Proofs and further results

###  3.1 Proof of Theorem 2.1

Before proving our Theorem 2.1 we need to remind a previous result relating
Fourier and Mellin transforms of radial functions in $\mathbb{R}^{n}$. This
result was originally proved by N. Ormerod (ormerod-jmaa-1979, Theorem 1).
Actually, N. Ormerod derived this as an intermediate step for providing an
alternative proof of an existing result linking Fourier transform of radial
function in $\mathbb{R}^{n}$ with appropriate Bessel transform that was
previously derivided by using different techniques
bochner_chadrasekharan-1949; stein_weiss-1972. However, it is this
intermediate step in terms of Mellin transform provided by N. Ormerod that is
useful for our proof.

Let the Fourier transform of a suitable function
$g:\mathbb{R}^{n}\to\mathbb{R}$ be defined as

$\mathscr{F}g(\kappa)=\int_{\mathbb{R}^{n}}e^{i\kappa\cdot
x}\,g(x)\,dx\,,\quad\kappa\in\mathbb{R}^{n}\,,$ (3.1)

then we have formula (1.3). Moreover, let the Mellin transform of another
suitable function $\varphi:\mathbb{R}_{0}^{+}\to\mathbb{R}$ be defined as

$\mathscr{M}\varphi(s)=\int_{0}^{\infty}\varphi(r)\,r^{s-1}\,dr\,,\quad
s\in\mathbb{C}\,.$ (3.2)

Then, let $f$ be a radial function in $\mathbb{R}^{n}$, i.e., $f(x)=f(r)$
where $r=|x|\in\mathbb{R}_{0}^{+}$, in our notation the Theorem by Ormerod
reads:

######  Theorem 3.1 (Ormerod ormerod-jmaa-1979)

Function $\mathscr{M}f(s)$ has an analytic continuation valid for all $s\neq
0$ and satisfies the functional equation

$\mathscr{M}f(s)=\pi^{n/2-s}\frac{\Gamma\left(\frac{s}{2}\right)}{\Gamma\left(\frac{n-s}{2}\right)}\mathscr{M}(\mathscr{F}^{\prime}f)(n-s)\,,$
(3.3)

where for a suitable function $g$ the operator $\mathscr{F}^{\prime}$ is
defined as $\mathscr{F}^{\prime}g(\kappa)=\mathscr{F}g(2\pi\kappa)$.

More specifically, Theorem 3.1 allows for the identity (ormerod-jmaa-1979,
equation (3))

$\int_{0}^{\infty}f(r)\,r^{s-1}\,dr=\pi^{n/2-s}\frac{\Gamma\left(\frac{s}{2}\right)}{\Gamma\left(\frac{n-s}{2}\right)}\int_{0}^{\infty}\\{\mathscr{F}^{\prime}f(r)\\}\,r^{n-s}\,dr\,,$
(3.4)

for $s\neq 0$ and $0<\Re(s)<n$. Now, we can prove Theorem 2.1.

###### Proof

By using formula (3.3) from Theorem 3.1, we can write the functional equation

$\mathscr{M}(\mathscr{L}f)(s)=\pi^{n/2-s}\frac{\Gamma\left(\frac{s}{2}\right)}{\Gamma\left(\frac{n-s}{2}\right)}\mathscr{M}\\{\mathscr{F}^{\prime}(\mathscr{L}f)\\}(n-s)\,.$
(3.5)

By adopting the operator $\mathscr{F}^{\prime}$, formula (1.3) for a radial
function $f$ reads
$\mathscr{F}^{\prime}(\mathscr{L}f)(\kappa)=-(2\pi|\kappa|)^{\alpha}\mathscr{F}^{\prime}f(|\kappa|)$.
Hence, the term $\mathscr{M}\\{\mathscr{F}^{\prime}(\mathscr{L}f)\\}(n-s)$ in
(3.5) results to be

$\displaystyle\mathscr{M}\\{\mathscr{F}^{\prime}(\mathscr{L}f)\\}(n-s)$
$\displaystyle=$
$\displaystyle-(2\pi)^{\alpha}\int_{0}^{\infty}|\kappa|^{\alpha}\mathscr{F}^{\prime}f(|\kappa|)|\kappa|^{n-s-1}\,d|\kappa|$
(3.6) $\displaystyle=$
$\displaystyle-(2\pi)^{\alpha}\mathscr{M}\\{\mathscr{F}^{\prime}f\\}(n-(s-\alpha))$
$\displaystyle=$
$\displaystyle-2^{\alpha}\pi^{-n/2+s}\frac{\Gamma\left[\frac{n-(s-\alpha)}{2}\right]}{\Gamma\left(\frac{s-\alpha}{2}\right)}\mathscr{M}f(s-\alpha)\,,$

where Theorem 3.1 has been used for calculating the term
$\mathscr{M}\\{\mathscr{F}^{\prime}f\\}(n-(s-\alpha))$ in the last step after
replacing $s$ with $s-\alpha$. Finally, by plugging the last line of (3.6)
into (3.5), and by reminding the conditions for the validity of (3.3) and
identity (3.4), we have formula (2.1). This completes the proof. $\Box$

###  3.2 Proof of Corollary 1

Before to proove Corollary 1, we remind the following properties of the Gamma
function

$\Gamma(2z)=\frac{2^{2z-1/2}}{\sqrt{2\pi}}\Gamma(z)\Gamma\left(z+\frac{1}{2}\right)\,,$
(3.7) $\Gamma(z)\Gamma(1-z)=\frac{\pi}{\sin\pi z}\,,$ (3.8)

and the trigonometric property

$\sin\left[\frac{\pi}{2}(1-\phi)\right]=\cos\left[\frac{\pi}{2}\phi\right]\,.$
(3.9)

By using formulae (3.7), (3.8) and (3.9) we can derive formula (2.2) from
formula (2.1) when $n=1$.