Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

quantileTPS

Sample Quantiles of Time-Persistent Statistics (TPS)


Description

Computes the sample quantiles of a time-persistent statistic corresponding to the given probabilities.

Usage

quantileTPS(times = NULL, numbers = NULL, probs = c(0, 0.25, 0.5, 0.75, 1))

Arguments

times

A numeric vector of non-decreasing time observations

numbers

A numeric vector containing the values of the time-persistent statistic between the time observation

probs

A numeric vector of probabilities with values in [0,1]

Details

The lengths of times and numbers either must be the same, or times may have one more entry than numbers (interval endpoints vs. interval counts). The sample quantiles are calculated by determining the length of time spent in each state, sorting these times, then calculating the quantiles associated with the values in the prob vector in the same fashion as one would calculate quantiles associated with a univariate discrete probability distribution.

Value

Computes the sample quantiles of the time-persistent statistic provided.

Author(s)

Barry Lawson (blawson@richmond.edu),
Larry Leemis (leemis@math.wm.edu),
Vadim Kudlay (vadim.kudlay@richmond.edu)

Examples

times  <- c(1,2,3,4,5)
 counts <- c(1,2,1,1,2)
 meanTPS(times, counts)
 sdTPS(times, counts)
 quantileTPS(times, counts)

 output <- ssq(seed = 54321, maxTime = 1000, saveNumInSystem = TRUE)
 utilization <- meanTPS(output$numInSystemT, output$numInSystemN)
 sdServerStatus <- sdTPS(output$numInSystemT, output$numInSystemN)
 quantileServerStatus <- quantileTPS(output$numInSystemT, output$numInSystemN)

 # compute and graphically display quantiles of number in system vs time
 output <- ssq(maxArrivals = 60, seed = 54321, saveAllStats = TRUE)
 quantileSys <- quantileTPS(output$numInSystemT, output$numInSystemN)
 plot(output$numInSystemT, output$numInSystemN, type = "s", bty = "l",
     las = 1, xlab = "time", ylab = "number in system")
 labels <- c("0%", "25%", "50%", "75%", "100%")
 mtext(text = labels, side = 4, at = quantileSys, las = 1, col = "red")
 abline(h = quantileSys, lty = "dashed", col = "red", lwd = 2)

simEd

Simulation Education

v2.0.0
GPL (>= 2)
Authors
Barry Lawson [aut, cre], Larry Leemis [aut], Vadim Kudlay [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.