| DepqueueNHK {IndTestPP} | R Documentation |
Estimating cross K-function and envelopes for the marginal processes of a queue
Description
This function estimates the cross K-function between
two (homogenous or nonhomogeneous) point processes in time, N_x and N_y.
It is evaluated in a grid of distances r and plotted. An envelope built by simulation under the hypothesis
that the processes are the marginal processes (the input and the output) of a queue is also plotted.
It calls the auxiliary functions NHKaux, NHKaux2, NHKaux3 and DepqueueKenv, not intended for users.
Usage
DepqueueNHK(posx, posy, lambda, T=NULL, nserv='infty', ddist='exp',argd=1,r=NULL,
typeEst=1, nsim=1000, conf=0.95,tit=NULL, cores=1,fixed.seed=NULL,...)
Arguments
posx |
Numeric vector. Occurrence times of the points in the first point processes |
posy |
Numeric vector. Occurrence times of the points in the second point processes |
lambda |
Numeric vector. Intensity values of the input process |
T |
Optional. Positive integer. Length of the period where the point are going to be generated. Only used in homogeneous processes (if lambda is a constant). |
nserv |
Optional. Number of servers in the queue system; only two values are possible: 1 or "infty" if the number of servers is infinity. |
ddist |
Character string. Identification of the probability distribution of the serving time. It must be one of the names of the probability distributions available in the stats package,
see |
.
argd |
Optional. Numeric value or vector containing the arguments to be used in the probability distribution in |
r |
Optional. Numeric vector. Grid values where the K-function must be evaluated. If it is NULL, a default vector is used; see Details. |
typeEst |
Optional. Two possible values: 1 or 2. They determine which one of the two available estimators
of the function |
nsim |
Optional. Numeric value. Number of simulations to obtain the envelope. |
conf |
Optional. Numeric value in (0,1). Confidence level of the envelope for the K-function. |
tit |
Optional. Title to be used in the plot of the K-function. |
cores |
Optional. Number of cores of the computer to be used in the calculations. |
fixed.seed |
An integer or NULL. If it is an integer, that is the value used to set the seed in random generation processes. It it is NULL, a random seed is used. |
... |
Further arguments to be passed to the function |
Details
This function estimates the cross K function between two (homogenous or nonhomogeneous) point processes
in time, N_x and N_y. Two different estimators are available, see NHK for details.
An envelope for the cross K function is built under the hypothesis that the processes are the input and the
output processes of a queue. The envelope is based on simulations, where processes generated by
DepNHPPqueue are used. The distribution of the serving time is specified
in arguments ddist and argd. The queue can have one or infinity servers.
If argument r is NULL, the following r-grid is used to evaluate the function
r1<-max(20, floor(T/20))
r<-seq(1,r1,by=2)
if (length(r)>200) r<-seq(1,r1,length.out=200)
where T is the length of the observed period.
Value
A list with elements:
r |
Vector of values |
NHKr |
Estimated values of |
KenvL |
Lower bounds of the envelope of |
KenvU |
Upper bounds of the envelope of |
T |
Length of the observed period of the processes. |
See Also
Examples
#Observed process: independent Poisson processes
set.seed(123)
T<-1000
lambda1<-runif(T,0,0.05)
dendist<- dexp(c(1:T), 1)
lambda2<-convolve(lambda1,rev(dendist),type='o')[1:T]
posx<-simNHPc(lambda = lambda1, fixed.seed = 134)$posNH
posy<-simNHPc(lambda = lambda2, fixed.seed = 135)$posNH
DepqueueNHK(posx=posx, posy=posy, lambda=lambda1, ddist='exp',argd=1,
r=seq(1,40, by=5), fixed.seed=123,nsim=500)
#Observed process: input and output processes of a queue
#aux<-DepNHPPqueue(lambda=lambda1, d=2, fixed.seed=123, argd=1, dplot=FALSE)$posNH
#DepqueueNHK(posx=aux[[1]], posy=aux[[2]], lambda=lambda1, ddist='exp',argd=1,
# r=seq(1,40, by=5), fixed.seed=123)