EHO: Likelihood factorization of Easley et. al. (2010) - EHO...

Description Usage Arguments Details Value Warning Author(s) References Examples

View source: R/EHO.R

Description

The function calculates the likelihood factorization of Easley et. al. (2010) and computes paramaters for estimation of PIN value.

Usage

1
EHO(data, fixed = c(FALSE, FALSE, FALSE, FALSE, FALSE))

Arguments

data

Data frame with 2 variables

fixed

Initial values for parameters in the following order: alpha, delta, mu, epsilon_b, epsilon_s

Details

In order to use EHO's return in optimization functions, please omit second argument. With this way, EHO will return a function instead of a value. Moreover, argument for data must be a data frame with 2 columns that contain numbers. Not any other type.

Value

LK_out

Returns an optim() object including parameter estimates for the likelihood factorization of Easley et. al. (2010)

Warning

This function does not handle NA values. Therefore the datasets should not contain any missing values.

Author(s)

Duygu Celik and Murat Tinic

References

Easley, D., Hvidkjaer, S., & O'Hara, M. Factoring information into returns. Journal of Financial and Quantitative Analysis, 45(2):293-309,2010.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
  # Sample Data
  #   Buy Sell 
  #1  350  382  
  #2  250  500  
  #3  500  463  
  #4  552  550  
  #5  163  200  
  #6  345  323  
  #7  847  456  
  #8  923  342  
  #9  123  578  
  #10 349  455 
  
  Buy<-c(350,250,500,552,163,345,847,923,123,349)
  Sell<-c(382,500,463,550,200,323,456,342,578,455)
  data=cbind(Buy,Sell)

  # Initial parameter values
  # par0 = (alpha, delta, mu, epsilon_b, epsilon_s)
  par0 = c(0.5,0.5,300,400,500)

  # Call EHO function
  EHO_out = EHO(data)
  model = optim(par0, EHO_out, gr = NULL, method = c("Nelder-Mead"), hessian = FALSE)

  ## Parameter Estimates
  model$par[1] # Estimate for alpha
  # [1] 0.9111102
  model$par[2] # Estimate for delta
  #[1] 0.0001231429
  model$par[3] # Estimate for mu
  # [1] 417.1497
  model$par[4] # Estimate for eb
  # [1] 336.075
  model$par[5] # Estimate for es
  # [1] 466.2539
  
  ## Estimate for PIN
  (model$par[1]*model$par[3])/((model$par[1]*model$par[3])+model$par[4]+model$par[5])
  # [1] 0.3214394
  ####

InfoTrad documentation built on Aug. 21, 2017, 9:02 a.m.