The PIN likelihood function is derived from the original PIN model as developed by Easley and Ohara (1992) and Easley et al. (1996) . The maximization of the likelihood function as is leads to computational problems, in particular, to floating point errors. To remedy to this issue, several log-transformations or factorizations of the different PIN likelihood functions have been suggested. The main factorizations in the literature are:

• fact_pin_eho(): factorization of Easley et al. (2010)

• fact_pin_lk(): factorization of Lin and Ke (2011)

• fact_pin_e(): factorization of Ersan (2016)

The factorization of the likelihood function of the multilayer PIN model, as developed in Ersan (2016) .

• fact_mpin(): factorization of Ersan (2016)

The factorization of the likelihood function of the adjusted PIN model (Duarte and Young 2009) , is derived, and presented in Ersan and Ghachem (2022b) .

• fact_adjpin(): factorization in Ersan and Ghachem (2022b)

## Usage

fact_pin_eho(data, parameters = NULL)

fact_pin_lk(data, parameters = NULL)

fact_pin_e(data, parameters = NULL)

fact_mpin(data, parameters = NULL)

fact_adjpin(data, parameters = NULL)

## Arguments

data

parameters

In the case of the PIN likelihood factorization, it is an ordered numeric vector ($$\alpha$$, $$\delta$$, $$\mu$$, $$\epsilon$$b, $$\epsilon$$s). In the case of the MPIN likelihood factorization, it is an ordered numeric vector ($$\alpha$$, $$\delta$$, $$\mu$$, $$\epsilon$$b, $$\epsilon$$s), where $$\alpha$$, $$\delta$$, and $$\mu$$ are numeric vectors of size J, where J is the number of information layers in the data. In the case of the AdjPIN likelihood factorization, it is an ordered numeric vector ($$\alpha$$, $$\delta$$, $$\theta$$, $$\theta'$$, $$\epsilon$$b, $$\epsilon$$s, $$\mu$$b, $$\mu$$s, $$\Delta$$b, $$\Delta$$s). The default value is NULL.

## Value

If the argument parameters is omitted, returns a function object that can be used with the optimization functions optim(), and neldermead(). If the argument parameters is provided, returns a numeric value of the log-likelihood function evaluated at the dataset data and the parameters parameters, where parameters is a numeric vector following this order ($$\alpha$$, $$\delta$$, $$\mu$$, $$\epsilon$$b, $$\epsilon$$s) for the factorizations of the PIN likelihood function, ($$\alpha$$, $$\delta$$, $$\mu$$, $$\epsilon$$b, $$\epsilon$$s) for the factorization of the MPIN likelihood function, and ($$\alpha$$, $$\delta$$, $$\theta$$, $$\theta'$$, $$\epsilon$$b, $$\epsilon$$s ,$$\mu$$b, $$\mu$$s, $$\Delta$$b, $$\Delta$$s) for the factorization of the AdjPIN likelihood function.

## Details

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.

Our tests, in line with Lin and Ke (2011) , and Ersan and Alici (2016) , demonstrate very similar results for fact_pin_lk(), and fact_pin_e(), both having substantially better estimates than fact_pin_eho().

Duarte J, Young L (2009). “Why is PIN priced?” Journal of Financial Economics, 91(2), 119--138. ISSN 0304405X.

Easley D, Hvidkjaer S, Ohara M (2010). “Factoring information into returns.” Journal of Financial and Quantitative Analysis, 45(2), 293--309. ISSN 00221090.

Easley D, Kiefer NM, Ohara M, Paperman JB (1996). “Liquidity, information, and infrequently traded stocks.” Journal of Finance, 51(4), 1405--1436. ISSN 00221082.

Easley D, Ohara M (1992). “Time and the Process of Security Price Adjustment.” The Journal of Finance, 47(2), 577--605. ISSN 15406261.

Ersan O (2016). “Multilayer Probability of Informed Trading.” Available at SSRN 2874420.

Ersan O, Alici A (2016). “An unbiased computation methodology for estimating the probability of informed trading (PIN).” Journal of International Financial Markets, Institutions and Money, 43, 74--94. ISSN 10424431.

Ersan O, Ghachem M (2022b). “A methodological approach to the computational problems in the estimation of adjusted PIN model.” Available at SSRN 4117954.

Lin H, Ke W (2011). “A computing bias in estimating the probability of informed trading.” Journal of Financial Markets, 14(4), 625-640. ISSN 1386-4181.