simulate_ekop: Simulates trades data

Description Usage Arguments Details Value References See Also Examples

Description

Simulates trades data from the model by Easley, Kiefer, O'Hara and Paperman (1996). The simulation function is implemented in C++ and allows therefore usage in specific performance-sensitive scenarios, like simulating huge amounts of trade data or calling this function repeatedly in large simulations.

Usage

1
2
3
4
5
6
7
8
simulate_ekop(
  size = 1000,
  alpha = 0.2,
  epsilon = 0.2,
  delta = 0.5,
  mu = 0.02,
  T = 60 * 6.5
)

Arguments

size

An integer specifying the number of trading days that should be simulated.

alpha

A double specifying the probability of an information event.

epsilon

A double specifying the arrival rate of uninformed traders.

delta

A double specifying the probability of information being good or bad.

mu

A double specifying the arrival rate of informed traders.

T

A double defining the length of a trading day in minutes.

Details

The functions returns a data.frame with named columns MisBuy, MisSell, Buy, Sell, and Trades. Buy and Sell are the number of buy and sell trades per trading day and Trades defines the sum of these amounts. MisBuy and MisSell are only added to allow for a standardization of input data to the estimation functions of the bayespin package. The corresponding simulation function simulate_ekop_mis() simulates mis-specified trades data and returns in the fields MisBuy and MisSell the number of mis-specified buy and sell trades per trading day respectively.

Value

A data.frame containing the trades per day.

References

See Also

Examples

1
2
3
4
5
# Simulate trades data for 1000 trading dates with a trading day lasting 
# 6.5 hours.
trades_data <- simulate_ekop(size = 1000, alpha = .3, epsilon = .4,
                             delta = .5, mu = .04, T = 60*6.5)
head(trades_data)

simonsays1980/bayespin documentation built on Dec. 23, 2021, 2:25 a.m.