# modeling example for price changes using HFT data

In Rue S. Tsay’s Time Series book, a decomposition method is described for analyzing price changes using HFT trade data. A change is modeled using the following variables,

A indicates price change occurred. (change : A=1, no change : A=0)
D indicates the change direction. (down : D=-1, up : D=1)
S indicates price change size in ticks.

Each component(A, D, S) is estimated in its own lagged values. For example, variable A is modeled as below:

Since Ai values are all 0 and 1, it is possible to estimate beta0 and beta1 using logistic regression. It is done like this in the book as an example:

glm(A ~ A_lag1, family=binomial)


Now, since we know beta0 and beta1, pi is calculated like this:

pi = inv.logit(beta0 + beta1*A_lag1)


The same method works for variable D. Just a basic transformation is needed for changing -1 values to 0.
Everything is clear to me at this point. But when it comes to S, I’m a bit confused. The description for S is in the book is below:

So, estimating theta0 and theta1 using logistic regression does not work for S because it is not a binary variable. In the book, estimated theta0 and theta1 values are shown but although I tried linear regression, etc., I could not find the same results for S in the book.

Actually I’m stuck at this point. What do you suggest? How should I proceed?