Learn R Programming

pinbasic (version 0.2.0)

pin_confint: PIN confidence intervals

Description

Computes confidence intervals for the probability of informed trading by simulation

Usage

pin_confint(param = NULL, numbuys = NULL, numsells = NULL, lower = rep(0, 5), upper = c(1, 1, rep(Inf, 3)), n = 10000, seed = NULL, level = 0.95, ncores = detectCores())

Arguments

param
numeric: (named) vector of model parameters (valid names: 'alpha', 'delta', 'epsilon_b', 'epsilon_s', 'mu'), length must equal 5
numbuys
numeric vector of daily buys
numsells
numeric vector of daily sells
lower
numeric lower bounds for optimization, must have length of 5
upper
numeric upper bounds for optimization, must have length of 5
n
integer: Number of simulation runs, defaults to 10000
seed
interpretted as integer: setting seed for RNG, defaults to NULL; for more detail see set.seed
level
numeric: Confidence level, defaults to 0.95
ncores
integer: Number of cpu cores utilized in computation, defaults to detectCores

Value

numeric: confidence interval

Details

If names are not set for param or one or more of the vector names do not match the valid choices, they are internally set to 'alpha', 'delta', 'epsilon_b', 'epsilon_s', 'mu' (in this order). The foreach, doParallel and parallel packages are utilized for computation of confidence intervals in parallel. By default, ncores is set to detectCores which attempts to utilize all available cores for computation. This task may be slow and time-consuming on older or single-core machines.