Description Usage Arguments Details Value References See Also Examples
Calling estimate_pin()
on trades data estimates the probability of
informed trading from the compressed EKOP model presented in Grammig,
Theissen and Zehnder (2015).
1 | estimate_pin(pin_data, return_mcmc = FALSE, with_stephens = FALSE)
|
pin_data |
A |
return_mcmc |
A logical indicating, if MCMC parameter samples should be returned in addition to the final PIN estimates. |
with_stephens |
A logical indicating, if in addition to |
Internally this function uses the finmix
package for estimation of the
finite mixture parameters. The finmix
package performs MCMC sampling for
the parameters of the compressed EKOP model and computes three parameter
estimates namely
Maximum a posterior (MAP) the mode of the joint posterior of parameters and indicators,
Bayesian maximum likelihood (BML) the mode of the joint posterior of parameters and indicators in case of a flat prior distribution,
Identified ergodic average (IEAVG) is the ergodic average over the MCMC parameter traces after relabeling the parameters.
The MCMC sampling uses a socalled random permutation algorithm to force the labels of the two distributions in the mixture to switch randomly between iterations. Label switching occurs naturally in estimation of finite mixture distributions and is documented in the literature. Random permutation tries not to eliminate label switching, but to bring it into a more controlled setting. As a result each MCMC parameter trace contains parameter values of the other trace. For this reason re-labeling is performed after sampling.
The finmix
package offers three different re-labeling algorithms:
kmeans
re-labels parameters by applying K-means clustering to the
merged component parameters,
Stephens1997a
applies the algorithm suggested by Stephens (1997a) that
tries to make the posterior marginal distributions of parameters uni-modal,
Stephens1997b
uses the algorithm presented in Stephens (1997b) that
tries to re-label parameter values by minimizing the Kullback-Leibler
distance between a parameter clustering via assignment probabilities and
the classification probabilities defined by Poisson distributions.
To offer the user more flexibility the function can also return the MCMC
samples for further inspection. Setting return_mcmc
to TRUE
(default)
returns also the MCMC traces.
A data.frame()
with PIN estimates, if return_mcmc
is FALSE
.
Otherwise, a list
containing the data.frame
of PIN estimates together
with a finmix::mcmcoutput
(see mcmcoutput-class
)
object containing the MCMC traces of the component paramaters.
Easley, D., Kiefer, N., O’Hara, M., Paperman, J., 1996. Liquidity, information, and infrequently traded stocks. Journal of Finance 51, 1405–1436.
Grammig, J., Theissen, E., Zehnder, L.S., 2015. Bayesian Estimation of the Probability of Informed Trading. Conference on Financial Econometrics & Empirical Asset Pricing 2016, Lancaster University
Stephens, M., 1997a. Discussion 'On Bayesian analysis of mixtures with an unknown number of components' (by S. Richardson and P.J. Green), J. R. Statist. Soc., B, 59, 768-769.
Stephens, M., 1997b. Bayesian methods for mixtures of normal distributions. DPhil. Thesis. University of Oxford, Oxford.
mixturemcmc
for performing MCMC sampling
mcmcestimate
for estimating parameters from MCMC samples
compute_bayespin()
for computing the Bayesian PIN from Bayesian
estimates of the component parameters of the compressed EKOP model
1 2 3 4 | # Simulate trades data
trades_data <- simulate_ekop()
# Estimate the Bayesian PIN.
estimate_pin(trades_data$Trades)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.