Learn R Programming

pinbasic (version 1.2.2)

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,
  method = "HAC", lower = rep(0, 5), upper = c(1, 1, rep(Inf, 3)),
  n = 10000, seed = NULL, level = 0.95, ncores = 1)

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

method

character Switch between algorithms for generating initial values, valid choices are: 'Grid', 'HAC' and 'HAC_Ref'

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

interpreted as integer or NULL: defaults to NULL, for more details see set.seed

level

numeric: Confidence level, defaults to 0.95

ncores

integer: Number of cpu cores utilized in computation, defaults to 1

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). By default, only one core is utilized in computations (ncores = 1). Confidence intervals can also be calculated in parallel, however, this only pays off for large values of n.