pin_gwj | R Documentation |
Estimates the Probability of Informed Trading (PIN
) using the
initial set from the algorithm in Gan et al.(2015).
pin_gwj(data, factorization = "E", verbose = TRUE)
data |
A dataframe with 2 variables: the first corresponds to buyer-initiated trades (buys), and the second corresponds to seller-initiated trades (sells). |
factorization |
A character string from
|
verbose |
A binary variable that determines whether detailed
information about the steps of the estimation of the PIN model is displayed.
No output is produced when |
The argument 'data' should be a numeric dataframe, and contain
at least two variables. Only the first two variables will be considered:
The first variable is assumed to correspond to the total number of
buyer-initiated trades, while the second variable is assumed to
correspond to the total number of seller-initiated trades. Each row or
observation correspond to a trading day. NA
values will be ignored.
The factorization variable takes one of four values:
"EHO"
refers to the factorization in
\insertCiteEasley2010;textualPINstimation
"LK"
refers to the factorization in
\insertCiteWilliamLin2011;textualPINstimation
"E"
refers to the factorization in
\insertCiteErsan2016;textualPINstimation
"NONE"
refers to the original likelihood function - with no
factorization
The function pin_gwj()
implements the algorithm detailed in
\insertCiteGan2015;textualPINstimation. You can use the function
initials_pin_gwj()
in order to get the initial parameter set.
Returns an object of class estimate.pin
# There is a preloaded quarterly dataset called 'dailytrades' with 60
# observations. Each observation corresponds to a day and contains the
# total number of buyer-initiated trades ('B') and seller-initiated
# trades ('S') on that day. To know more, type ?dailytrades
xdata <- dailytrades
# Estimate the PIN model using the factorization of Ersan (2016), and initial
# parameter sets generated using the algorithm of Gan et al. (2015).
# The argument xtraclusters is omitted so will take its default value 4.
estimate <- pin_gwj(xdata, verbose = FALSE)
# Display the estimated PIN value
show(estimate@pin)
# Display the estimated parameters
show(estimate@parameters)
# Store the initial parameter sets used for MLE in a dataframe variable,
# and display its first five rows
initialsets <- estimate@initialsets
show(head(initialsets, 5))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.