Description Usage Arguments Details Value References See Also Examples
Calling estimate_compml()
estimates the probability of informed trading
(PIN) from the model of Jackson (2007) using maximum likelihood (ML). As
described in the paper by Jackson (2007) and similar to the Bayesian
estimation used in Grammig et al. (2015) this model needs only the number
of trades per day provided in the parameter data
.
1 2 3 4 5 6 7 8 9 10 11 |
data |
A |
startpar |
A vector containing start parameters for maximum likelihood
estimation. These must be starting values for the logit of alpha, epsilon,
and mu. If no starting values are provided the function chooses the values
|
T |
A double specifying the minutes of a trading day. |
methodLik |
A character specifying, if undefined function values in
optimization should be approximated by large defined values ( |
fnscale |
A negatve double specifying a scaling factor for the likelihood function. This can in some cases help when the algorithm does not reach convergence or suffer from number overflow. |
trace |
An integer specifying which level of tracing should be used.
see |
grad_free |
A logical indicating if gradient-free optimization should
be used when gradient descent did not converge. If |
return_opt |
A logical indicating, if in addition to the PIN estimates
also the results from the optimization procedure should be returned. If
|
opt_out |
(Deprecated) A logical indicating if only the output of the
optimization procedure should be returned. Some older applications still
rely on this output. In the next version this feature will be removed.
Note that the default value is |
Optimization is performed gradient-based by using the
optim
function. The algorithm used is the L-BFGS-B
that allows for parameter restrictions. This is necessary because we use for
the probability alpha
the logistic transformation exp()/(1+exp())
to
produce valid probabilities in optimization.
In case that the gradient-based algorithm does not converge in between 100
steps, a gradient-free optimization is applied. For gradient-free
optimization nmkb
, a bounded Nelder-Mead
algorithm
is used. Derivative-free optimization is only performed after gradient-based
optimization did not converge and the argument grad_free
is TRUE
.
The argument fnscale
can be used to scale the likelihood function in case
of very large values (e.g. very large volumes) that might lead to number
overflow during computation. Note, fnscale
must always be negative as the
likelihood function should be maximized.
A list
with all components as returned by
optim
or nmkb
.
Jackson, D., 2007. Infering trader behavior from transaction data: A trade count model. Journal of Computational and Graphical Statistics 12, 55-79.
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
estimate_pin()
for estimating the PIN with a Bayesian approach that
needs only the total number of trades
estimate_mlekop()
for estimating the PIN with the original EKOP model
that needs the numbers of buyer- and seller-initiated trades per day
compute_comp_lik()
for the implementation of the likelihood function of
the paper of Jackson (2007).
1 2 3 4 5 6 | # Simulate data from the EKOP model.
trades_data <- simulate_ekop()
# Estimate the EKOP model by maximum likelihood.
pin_estml <- estimate_compml(trades_data$Trades, methodLik="approx",
opt_out=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.