initial_vals: Initial values for PIN optimization

View source: R/initialCAR.R

initial_valsR Documentation

Initial values for PIN optimization

Description

Generates set(s) of initial values which can be used in PIN optimization routines.

Usage

initial_vals(
  numbuys = NULL,
  numsells = NULL,
  method = "HAC",
  length = 5,
  num_clust = 5,
  details = FALSE
)

Arguments

numbuys

numeric: vector of daily buys

numsells

numeric: vector of daily sells

method

character Switch between algorithms for generating initial values, valid choices are: 'Grid', 'HAC' and 'HAC_Ref'

length

numeric length of equidistant sequence from 0.1 to 0.9 for parameters of grid search algorithm, defaults to 5, irrelevant for HAC and refined HAC method

num_clust

numeric only relevant for refined HAC method, total number of clusters trading data is grouped into equals num_clust + 1

details

logical only relevant for grid search, if TRUE and method = 'Grid' the number of infeasible sets of initial values are returned,

Value

Matrix with set(s) of initial values for PIN model optimization. If method = 'Grid' and details = TRUE a list with four elements is returned:

inits

Matrix of sets of initial values

neg_eps

Number of infeasible sets due to negative values for intensity of uninformed sells

irr_mu

Number of infeasible sets due to intensity of informed trading larger than any daily buys and sells data

rem

Total number of removed sets of initial values

References

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

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

Examples

# Loading simulated datasets

data("BSinfrequent")
data("BSfrequent")
data("BSheavy")

# Grid Search

grid <- initial_vals(numbuys = BSinfrequent[,"Buys"],
                     numsells = BSinfrequent[,"Sells"],
                     method = "Grid")

# Grid Search: Detailed Output

grid_detailed <- initial_vals(numbuys = BSinfrequent[,"Buys"],
                              numsells = BSinfrequent[,"Sells"],
                              method = "Grid", details = TRUE)

# HAC

hac <- initial_vals(numbuys = BSfrequent[,"Buys"],
                    numsells = BSfrequent[,"Sells"],
                    method = "HAC")

# Refined HAC

hac_ref <- initial_vals(numbuys = BSheavy[,"Buys"],
                        numsells = BSheavy[,"Sells"],
                        method = "HAC_Ref")


anre005/pinbasic documentation built on May 6, 2022, 4:40 a.m.