View source: R/quarterly_pin.R
qpin | R Documentation |
Estimation of model parameters and probability of informed trading for quarterly data.
qpin( numbuys = NULL, numsells = NULL, dates = NULL, nlminb_control = list(), confint = FALSE, ci_control = list(), posterior = TRUE )
numbuys |
numeric: vector of daily buys |
numsells |
numeric: vector of daily sells |
dates |
see Details |
nlminb_control |
list: Control list for |
confint |
logical: Compute confidence intervals for PIN?
Defaults to |
ci_control |
list: see |
posterior |
logical: Should posterior probabilities for conditions of trading days be computed? |
Wrapper around pin_est
function and therefore inherits its settings for optimization.
Data is split into quarters with the quarter
function from lubridate package.
According to the help page of this function dates
argument must be
a date-time object of class POSIXct, POSIXlt, Date, chron, yearmon, yearqtr, zoo, zooreg,
timeDate, xts, its, ti, jul, timeSeries, fts or anything else that can be converted with as.POSIXlt.
nlminb
function in the stats package is used for maximization.
Vectors for numbuys
and numsells
need to have same length.
Calculation of confidence interval for the probability of informed trading is disabled by default.
For more details see pin_est_core
or pin_confint
.
A list of lists with class 'qpin'. The length of the outer list equals the number of available quarters in the data. Naming scheme for the outer list is 'Year.QuarterNumber', where QuarterNumber equals an integer from 1 to 4. The inner list is structured as follows:
Matrix containing the parameter estimates as well as their estimated standard errors, t-values and p-values.
Value of likelihood function returned by nlminb
Value(s) of the estimated probability of informed trading
Convergence code for nlminb optimization
Convergence message returned by the nlminb optimizer
Number of iterations until convergence of nlminb optimizer
Vector of initial values
If confint = TRUE
; confidence interval for the probability of informed trading
Easley, David et al. (2002)
Is Information Risk a Determinant of Asset Returns?
The Journal of Finance, Volume 57, Number 5, pp. 2185 - 2221
doi: 10.1111/1540-6261.00493
Easley, David et al. (1996)
Liquidity, Information, and Infrequently Traded Stocks
The Journal of Finance, Volume 51, Number 4, pp. 1405 - 1436
doi: 10.1111/j.1540-6261.1996.tb04074.x
Easley, David et al. (2010)
Factoring Information into Returns
Journal of Financial and Quantitative Analysis, Volume 45, Issue 2, pp. 293 - 309
doi: 10.1017/S0022109010000074
Ersan, Oguz and Alici, Asli (2016)
An unbiased computation methodology for estimating the probability of informed trading (PIN)
Journal of International Financial Markets, Institutions and Money, Volume 43, pp. 74 - 94
doi: 10.1016/j.intfin.2016.04.001
Gan, Quan et al. (2015)
A faster estimation method for the probability of informed trading
using hierarchical agglomerative clustering
Quantitative Finance, Volume 15, Issue 11, pp. 1805 - 1821
doi: 10.1080/14697688.2015.1023336
Grolemund, Garett and Wickham, Hadley (2011)
Dates and Times Made Easy with lubridate
Journal of Statistical Software, Volume 40, Issue 3, pp. 1 - 25
doi: 10.18637/jss.v040.i03
Lin, Hsiou-Wei William and Ke, Wen-Chyan (2011)
A computing bias in estimating the probability of informed trading
Journal of Financial Markets, Volume 14, Issue 4, pp. 625 - 640
doi: 10.1016/j.finmar.2011.03.001
Yan, Yuxing and Zhang, Shaojun (2012)
An improved estimation method and empirical properties of the probability of informed trading
Journal of Banking & Finance, Volume 36, Issue 2, pp. 454 - 467
doi: 10.1016/j.jbankfin.2011.08.003
nlminb
,
initial_vals
pin_est
pin_est_core
pin_confint
quarter
year
# Loading one year of simulated daily buys and sells data('BSfrequent2015') # Quarterly estimates for model parameters and the probability of informed trading # Rownames of 'BSfrequent2015' equal the business days in 2015. qpin2015 <- qpin(numbuys = BSfrequent2015[,"Buys"], numsells = BSfrequent2015[,"Sells"], dates = as.Date(rownames(BSfrequent2015), format = "%Y-%m-%d"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.