model and error term distribution dist. The error terms can also be sampled from residuals. The possibility of including a diurnal seasonal component in the simulated sample is included.
sim_ACD(N = 1000, model = "ACD", dist = "exponential", param = NULL, order = NULL, Nburn = 50, startX = c(1), startMu = c(1), errors = NULL, sampleErrors = TRUE, roundToSec = FALSE, rm0 = FALSE, diurnalFactor = FALSE, splineObj = NULL, open = NULL, close = NULL)"ACD", "LACD1", "LACD2", "AMACD","ABACD", "SNIACD" or "LSNIACD".
errors are left out). Must be one of "exponential", "weibull", "burr", "gengamma" or "genf".
order = c(1,1) for an ACD(1,1) model.
sampleErrors = TRUE the errors will be sampled from this vector (with replacement). If instead sampleErrors = FALSE the error terms will be matched by the errors vector non stochastic (must then be of the same length as N + Nburn)
errors above. Default is TRUE.
TRUE the simulated sample will be discretized with 1 second(unit) precision.
TRUE zero durations will be removed. Will the result in a smaller sample than N.
TRUE the simulated data will include a diurnal factor. The diurnal factor is from a fitted cubic spline given as argument to splineObj. If the argument splineObj is empty, a default fitted cubic spline from transData using aggregation over weekdays will be used.
diurnalAdj(). Currently only works with cubic splines fitted with weekday aggregation. Also see diurnalFactor above.
diurnalFactor = TRUE and a splineObj were provided. The time the exchange opens trading (as used in the fitted splineObj), for example open = "10:00:00".
diurnalFactor = TRUE and a splineObj were provided. The time the exchange close trading (as used in the fitted splineObj), for example close = "18:25:00".
x <- sim_ACD() #simulates 1000 observations from an ACD(1,1) with exp. errors as default
acdFit(x)
Run the code above in your browser using DataLab