Description Usage Arguments Value Examples
View source: R/price_impact_function.R
This function computes the price impact as a percentage loss in value of the different bond exposures if a certain volume is sold to the market. It needs to know the state variables, the data on bond volatilities and average daily volumes as well as the base_year for which the stress test is taken as well as the value of a constant of order unity. Finally it takes as argument a method. Currently only one method is implemented, which we call "square-root". This method implements equation (9) in the paper. For future versions we keep space to include other impact functions which have been used in the literature, in particular the functions of Cont and Schaanning 2017.
1 2 3 4 5 6 7 8 9 10 | price_impact_function(
del,
mat,
lb,
data_idx,
data_adv,
base_year,
constant,
method = "squareroot"
)
|
del |
I times 1 vector of discount factors with each component in [0,1] |
mat |
A list containing the matrices which are the output of
|
lb |
A real number specifiying the leverage threshold lambd_bar. |
data_idx |
A dataframe with price index data. It must contain the variables Country (chr), Date, and Value (num) |
data_adv |
A dataframe with average daily volumes. It must contain the variables Country (chr), Year (num), Volume (num), Unit (chr) and Currency (chr) |
base_year |
The base year for the stress test exercise |
constant |
The constant kappa in the square root formula for price impact |
method |
In our paper we use the square root law of price impact because we can derive it from evidence and the market-microstructure literature. But others, for example Schannning and Cont use different impact functions. We leave space for allowing for different methods by which impact is computed. For now we only implement the square root law. |
A list with An I times 1 vector of discount factors delta measuring the price impact of a quantity sold.
1 2 3 4 5 6 7 8 9 | stress_data <- make_stress_data(eba_exposures_2016, eba_impairments_2016, 1, 2015)
matrices <- make_state_variables(stress_data)
delta <- rep(0, dim(matrices$S_0)[2])
price_impact_function(del = delta,
mat = matrices, lb = 33,
data_idx = sovereign_bond_indices,
data_adv = average_daily_volume_sovereign,
base_year = 2015,
constant = 1.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.