1
$\begingroup$

Try to reproduce Robert E. McCulloch and Ruey S. Tsay’s paper Nonlinearity in High-Frequency Financial Data and Hierarchical Models with local market data.

the paper uses GLM to model high-frequency data, $D_i, N_i, \Delta t_i$, and $F_{i-1}$.

$D_i$ indicates the up jump or down jump of price movement. $N_i$ is the number of trade happened during the $\Delta t_i$ period. $\Delta t_i$ it the duration of the period in seconds. $F_{i-1}$ is the information in the $t_{i-1}$ time period. The model of $D_i$ is: $$D_i \vert(N_i, \Delta t_i, F_{i-1})=sign(\mu_i+\sigma_i \epsilon) $$ where $\epsilon \thicksim N(0,1)$, $$\mu_i=\omega_0+\omega_1 D_{i-1}+\omega_2ln(\Delta t_i)$$ $$ln(\sigma_i)=\beta^* \vert \sum_{j=1}^4 D_{i-j} \vert$$

$D_i$ could be either -1 or 1 for price up-jump or down-jump. From the model definition, it is clear that: $$ P(D_i=-1 \vert N_i, \Delta t_i, F_{i-1})=\Phi({- \mu_i \over \sigma_i})$$ $$ P(D_i=1 \vert N_i, \Delta t_i, F_{i-1})=1-\Phi({- \mu_i \over \sigma_i})$$ $$ E(D_i\vert N_i, \Delta t_i, F_{i-1})=1-2\Phi({- \mu_i \over \sigma_i})$$

if we map -1,1 to 1,0

$$ E(D_i\vert N_i, \Delta t_i, F_{i-1})=\Phi({- \mu_i \over \sigma_i})$$

Here $D_i$ follows a 0-1 distribution, definitely a distribution of exponential family. Intuitively the link function $g^{-1}(X^T \beta)$ is the CDF of normal distribution, the probit link function.

Here $$X=[1, D_i, ln(\Delta t_i), \vert \sum_{j=1}^4 D_{i-j} \vert] $$ The perameters to estimate is: $$\beta=[\omega_0, \omega_1, \omega_2, \beta^*] $$

My questions are:

  1. The GLM need $X^t\beta$ in the link function to be a linear form, but ${- \mu_i \over \sigma_i}$ is not. Should I choose another link function or should I reform the $ {- \mu_i \over \sigma_i}$ (since the model proposed $ln(\sigma_i)$ form)?

  2. For the computational reason, I mapped $D_i$ from -1,1 to 1,0. Do I need to map regressors as well? I guess not. Cause if I do, i. the calculation of $ \vert \sum_{j=1}^4 D_{i-j} \vert$will be different. ii. I am just using a different tag for the same 'truth'.

I have spent days searching and scratching this problem. I presume it could be a quite common modeling procedure since people normally want to model expectation and variance. It will be very appreciated if you may kindly provide me some guide.

$\endgroup$
1
$\begingroup$

What you have seems to be a binomial regression model with probit link function, but in place of the usual linear predictor $\beta^T x$ you have some nonlinear predictor $f(\beta, x)$.

Binomial regression is usually fitted by irls algorithm, see Can you give a simple intuitive explanation of IRLS method to find the MLE of a GLM?. It should be possible to replace the linear least squares used there with nonlinear least squares, but I do not know of implementations. But looking closer at your model, you have a linear predictor for $\mu_i$, but then you also have a linear predictor (with a log link function) for $\sigma_i$. So you are doing simultaneous modelling of two parameters, so you need an extension of the usual glm framework. I would have a look at the gamlss package for R, see http://www.gamlss.com/. It could probably be used!

| cite | improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thanks for the hint, I will definitely try gamlss out. I finally just put $\mu_i +ln(\sigma_i) $ and get a usable result. since I know the distribution of my endog, and I know $\mu_i$ and $\sigma_i$ will influence the result, I can put them in a linear form to get a number to calculate CDF. moreover, $ln(\sigma_i) $is a rough approximation of $1\over \sigma_i$. $\endgroup$ – T.young Jun 29 '18 at 2:04
1
$\begingroup$

Heteroscedasticity in binary response or Bernoulli models is not separately identified and is equivalent to a non-linear mean function. Richard Williams has some articles that include comments on identification in discrete choic and heteroscedastic Binomial models, but I do not remember the references that I read.

Stata has hetprobit for this case https://www.stata.com/manuals13/rhetprobit.pdf

Statsmodels in Python does not have yet non-linear GLM nor heteroscedastic GLM. GLM now support var_weights, uses optionally gradient optimization and there is some preliminary code for nonlinear GLM. However, it will still take some time before official versions for nonlinear and heteroscedastic GLM will become available.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.