Type: | Package |
Title: | Compute the Adjusted Market Inefficiency Measure |
Version: | 1.0.0 |
Maintainer: | Vu Le Tran <gelotran@gmail.com> |
Description: | Fast tool to calculate the Adjusted Market Inefficiency Measure following Tran & Leirvik (2019) <doi:10.1016/j.frl.2019.03.004>. This tool provides rolling window estimates of the Adjusted Market Inefficiency Measure for multiple instruments simultaneously. |
License: | MIT + file LICENSE |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 3.10) |
RoxygenNote: | 7.1.1 |
Imports: | data.table |
URL: | https://github.com/gelotran/AMIM, https://gelotran.github.io/AMIM/ |
BugReports: | https://github.com/gelotran/AMIM/issues |
NeedsCompilation: | no |
Packaged: | 2023-07-07 10:03:49 UTC; Brutus |
Author: | Vu Le Tran |
Repository: | CRAN |
Date/Publication: | 2023-07-07 16:00:02 UTC |
AMIM roll
Description
This function computes the rolling window AMIM for a given data.table
Usage
AMIM.roll(
data.table,
identity.col,
Date.col,
rollWindow,
return.col,
min.obs,
max.lag
)
Arguments
data.table |
data.table with the data |
identity.col |
column name of the identity intrument for example the stock ticker |
Date.col |
column name of the date column with format "YYYY-mm-dd" (for example "2019-12-01") |
rollWindow |
number of days to compute the AMIM |
return.col |
column name of the return column |
min.obs |
minimum number of observations to compute the AMIM |
max.lag |
maximum number of lags to compute the MIM and then AMIM. The algorithm will select the number of lags that minimize the AIC but the maximum number of lags is limited by this parameter. In case the AIC is zero for the zero lag then the algorithm will estimate an AR(1) model. This is to avoid zero in the MIM and AMIM. |
Value
data.table with the MIM, AMIM and the number of lags used to compute the MIM, AMIM, confidence interval (CI), and the number of lags (N).
Examples
library(AMIM)
library(data.table)
data <- AMIM::exampledata # load the example data
AMIM <- AMIM.roll(
data.table = data, identity.col = "ticker", rollWindow = 60,
Date.col = "Date", return.col = "RET", min.obs = 30, max.lag = 10
)
AMIM[, .SD[(.N - 5):(.N), ], by = ticker] # Last 5 rows of each instrument
Confidence Interval Data to compute AMIM
Description
Confidence Interval Data to compute AMIM
Usage
CI
Format
## 'CI' A data datatable with the following columns:
- N
Number of lags
- a
Scale parameter equal to 1 as in Tran & Leivrik (2019)
- CI
Confidence interval accordingly each number lags and scale parameter
...
Source
Tran & Leivrik (2019)
Example Data to compute AMIM
Description
Example Data to compute AMIM
Usage
exampledata
Format
## 'exampledata' A data datatable with the following columns:
- Date
Date format YYYY-MM-DD
- ticker
Imaginary ticker
- RET
Imaginary return
...
Source
Vu Le Tran