Class NNPP
- All Implemented Interfaces:
Serializable,Copyable
The target rate function lambda(t) on [0, S] is either an
exponential-polynomial-trigonometric function with multiple periodicities
(EPTMP),
lambda(t) = exp(sum_i alpha_i t^i + sum_k gamma_k sin(omega_k t + phi_k)),
or a piecewise-linear interpolation of knots. A piecewise-constant majorizer
lamTilde >= lambda on Q equal subintervals is built
deterministically (golden-section search for EPTMP, exact for piecewise
linear). Arrivals are generated by inverting the majorizing mean-value
function muTilde at the epochs of a unit-rate equilibrium renewal
process with Weibull gaps of squared coefficient of variation C
(the dispersion ratio), and each candidate at time t is accepted
with probability lambda(t)/lamTilde(t).
With C = 1 the renewal gaps are Exp(1) and the method is the
Lewis-Shedler thinning of a nonhomogeneous Poisson process. With
C != 1 it is SCIATA (Liu, Kuhl, Liu and Wilson), designed for
C in (0, 2].
Cyclic (default): lambda(t) = lambda(t mod S) and the renewal
process continues across cycles. Non-cyclic: zero intensity past S.
Like NHPP this is not a renewal process: getSCV(),
getSkewness(), evalCDF(double) and evalLST(double) return NaN;
getMean() is S / mu(S).
The process representation (getProcess()) has seven entries:
{majBreakpoints (1x(Q+1)), majRates (1xQ), cyclic (0/1), dispersion,
kind (1 eptmp, 2 pwlinear), params (row), horizon}, where params is
[m+1, p, alpha_0..alpha_m, gamma_1..gamma_p, omega_1..omega_p, phi_1..phi_p]
for EPTMP and [n, times_0..times_{n-1}, rates_0..rates_{n-1}] for
piecewise linear.
Solver support. Only LDES, and only as an arrival process.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classPer-path sampling state: last renewal epoch in muTilde space, whether the next gap is the equilibrium one, and the last accepted arrival time. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionstatic NNPPeptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon) EPTMP Poisson (C = 1), cyclic, default Q.static NNPPeptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon, double dispersion) EPTMP with dispersion, cyclic, default Q.static NNPPeptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon, double dispersion, boolean cyclic) EPTMP with dispersion, cyclic flag and default Q.static NNPPeptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon, double dispersion, boolean cyclic, int Q) EPTMP rate function on[0, horizon].doubleevalCDF(double t) Evaluates the cumulative distribution function (CDF) at the given point.doubleevalLST(double s) Evaluate the Laplace-Stieltjes Transform at sstatic NNPPfromProcess(MatrixCell cell) Rebuilds an NNPP from its seven-entry process cell (sn.proc layout).doublemu(S) / muTilde(S): long-run fraction of candidates accepted.double[]getAlpha()doubledouble[]getGamma()doublegetKind()"eptmp" or "pwlinear".intdouble[][]Majorizer {breakpoints (Q+1), rates (Q)}.doublegetMajorizerAt(double t) The majorizing intensity at time t; zero past a non-cyclic horizon.doublegetMean()Gets the mean (expected value) of this distribution.doublegetMeanValue(double t) The target mean-value function mu(t) = integral_0^t lambda(u) du.doublemuTilde(S).doublegetMeanValueMajorizer(double t) The majorizing mean-value function muTilde(t).doublegetMeanValueMajorizerInverse(double u) Public inverse of muTilde (absolute time)."thinning" when C == 1, otherwise "sciata".double[]getOmega()double[]The params row of the process cell.double[]getPhi()Gets the process representation with actual distribution parameters.intgetQ()doublegetRate()Gets the rate of this distribution (inverse of mean).doublegetRateAt(double t) The target intensity lambda(t); zero past a non-cyclic horizon.double[]getRates()doublegetSCV()Returns NaN: an NNPP is not a renewal process (seeNHPP.getSCV()).doubleGets the skewness of this distribution.doubledouble[]getTimes()doubledoublebooleanisCyclic()Creates a fresh sampling stream starting at time 0.static NNPPpiecewiseLinear(double[] times, double[] rates) Piecewise linear Poisson (C = 1), cyclic, default Q.static NNPPpiecewiseLinear(double[] times, double[] rates, double dispersion) Piecewise linear with dispersion, cyclic, default Q.static NNPPpiecewiseLinear(double[] times, double[] rates, double dispersion, boolean cyclic) Piecewise linear with dispersion, cyclic flag and default Q.static NNPPpiecewiseLinear(double[] times, double[] rates, double dispersion, boolean cyclic, int Q) Piecewise-linear rate function through the knots(times[j], rates[j]).voidRestarts thesample(int, java.util.Random)path at time 0.double[]sample(int n) Generates random samples from this distribution using default random generator.double[]Drawsnsuccessive interarrival times along one sample path starting at time 0.double[]sampleArrivalTimes(int n, Random random) nsuccessive absolute arrival times of a fresh path from 0 (+Inf once exhausted).toString()static double[]weibullParams(double C) Weibull {shape, scale} with mean 1 and SCV C.Methods inherited from class jline.lang.processes.Distribution
evalLST, evalProbInterval, getFeatureName, getName, getNumParams, getNumParams, getParam, getParam, getParams, getSupport, getVar, hasParam, isContinuous, isDisabled, isDiscrete, isImmediate, isMarkovian, mean, name, numParams, param, rate, scv, setNumParams, setParam, skewness, support, var, withDefect, withMassAtOrigin
-
Field Details
-
KIND_EPTMP
public static final int KIND_EPTMP- See Also:
-
KIND_PWLINEAR
public static final int KIND_PWLINEAR- See Also:
-
DEFAULT_Q
public static final int DEFAULT_Q- See Also:
-
-
Method Details
-
eptmp
public static NNPP eptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon, double dispersion, boolean cyclic, int Q) EPTMP rate function on[0, horizon].- Parameters:
alpha- polynomial coefficients alpha_0..alpha_m (length >= 1)gamma- sine amplitudes (length p >= 0)omega- sine angular frequencies (length p)phi- sine phases (length p)horizon- Sdispersion- C > 0 (1 = Lewis-Shedler thinning)cyclic- whether lambda repeats with period SQ- number of majorizer subintervals
-
eptmp
public static NNPP eptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon, double dispersion, boolean cyclic) EPTMP with dispersion, cyclic flag and default Q. -
eptmp
public static NNPP eptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon, double dispersion) EPTMP with dispersion, cyclic, default Q. -
eptmp
public static NNPP eptmp(double[] alpha, double[] gamma, double[] omega, double[] phi, double horizon) EPTMP Poisson (C = 1), cyclic, default Q. -
piecewiseLinear
public static NNPP piecewiseLinear(double[] times, double[] rates, double dispersion, boolean cyclic, int Q) Piecewise-linear rate function through the knots(times[j], rates[j]).- Parameters:
times- knot times, times[0] = 0, strictly increasing; horizon = times[n-1]rates- non-negative knot ratesdispersion- C > 0cyclic- whether lambda repeats with period SQ- number of majorizer subintervals
-
piecewiseLinear
public static NNPP piecewiseLinear(double[] times, double[] rates, double dispersion, boolean cyclic) Piecewise linear with dispersion, cyclic flag and default Q. -
piecewiseLinear
Piecewise linear with dispersion, cyclic, default Q. -
piecewiseLinear
Piecewise linear Poisson (C = 1), cyclic, default Q. -
fromProcess
Rebuilds an NNPP from its seven-entry process cell (sn.proc layout). The majorizer is recomputed from the parameters; it is deterministic, so it equals the one carried by the cell. -
getRateAt
public double getRateAt(double t) The target intensity lambda(t); zero past a non-cyclic horizon. -
getMajorizerAt
public double getMajorizerAt(double t) The majorizing intensity at time t; zero past a non-cyclic horizon. -
getMeanValue
public double getMeanValue(double t) The target mean-value function mu(t) = integral_0^t lambda(u) du. -
getMeanValueMajorizer
public double getMeanValueMajorizer(double t) The majorizing mean-value function muTilde(t). -
getMeanValueMajorizer
public double getMeanValueMajorizer()muTilde(S). -
getMeanValueMajorizerInverse
public double getMeanValueMajorizerInverse(double u) Public inverse of muTilde (absolute time). -
weibullParams
public static double[] weibullParams(double C) Weibull {shape, scale} with mean 1 and SCV C. C = 1 gives {1, 1}. -
newStream
Creates a fresh sampling stream starting at time 0. -
resetSampleClock
public void resetSampleClock()Restarts thesample(int, java.util.Random)path at time 0. -
sample
Drawsnsuccessive interarrival times along one sample path starting at time 0. As forNHPP.sample(int, java.util.Random), the path continues across calls;resetSampleClock()restarts it. Once a non-cyclic process is exhausted the remaining samples are 0.- Specified by:
samplein classDistribution- Parameters:
n- the number of samples to generaterandom- the random number generator to use- Returns:
- array of random samples
-
sample
public double[] sample(int n) Description copied from class:DistributionGenerates random samples from this distribution using default random generator.- Overrides:
samplein classDistribution- Parameters:
n- the number of samples to generate- Returns:
- array of random samples
-
sampleArrivalTimes
nsuccessive absolute arrival times of a fresh path from 0 (+Inf once exhausted). -
getTimeAverageRate
public double getTimeAverageRate() -
getMean
public double getMean()Description copied from class:DistributionGets the mean (expected value) of this distribution.- Specified by:
getMeanin classDistribution- Returns:
- the mean value
-
getRate
public double getRate()Description copied from class:DistributionGets the rate of this distribution (inverse of mean).- Overrides:
getRatein classDistribution- Returns:
- the rate value (1/mean)
-
getSCV
public double getSCV()Returns NaN: an NNPP is not a renewal process (seeNHPP.getSCV()).- Specified by:
getSCVin classDistribution- Returns:
- the squared coefficient of variation
-
getSkewness
public double getSkewness()Description copied from class:DistributionGets the skewness of this distribution. Skewness measures the asymmetry of the probability distribution.- Specified by:
getSkewnessin classDistribution- Returns:
- the skewness value
-
evalCDF
public double evalCDF(double t) Description copied from class:DistributionEvaluates the cumulative distribution function (CDF) at the given point.- Specified by:
evalCDFin classDistribution- Parameters:
t- the point at which to evaluate the CDF- Returns:
- the CDF value at point t
-
evalLST
public double evalLST(double s) Description copied from class:DistributionEvaluate the Laplace-Stieltjes Transform at s- Specified by:
evalLSTin classContinuousDistribution- Parameters:
s- the Laplace domain variable- Returns:
- the LST value at s
-
getProcess
Description copied from class:ContinuousDistributionGets the process representation with actual distribution parameters. Returns a MatrixCell containing the distribution parameters.- Specified by:
getProcessin classContinuousDistribution- Returns:
- MatrixCell with distribution-specific parameters
-
getMajorizer
public double[][] getMajorizer()Majorizer {breakpoints (Q+1), rates (Q)}. -
getAcceptanceRate
public double getAcceptanceRate()mu(S) / muTilde(S): long-run fraction of candidates accepted. -
getDispersion
public double getDispersion() -
isCyclic
public boolean isCyclic() -
getHorizon
public double getHorizon() -
getQ
public int getQ() -
getWeibullShape
public double getWeibullShape() -
getWeibullScale
public double getWeibullScale() -
getMethod
"thinning" when C == 1, otherwise "sciata". -
getKind
"eptmp" or "pwlinear". -
getKindCode
public int getKindCode() -
getAlpha
public double[] getAlpha() -
getGamma
public double[] getGamma() -
getOmega
public double[] getOmega() -
getPhi
public double[] getPhi() -
getTimes
public double[] getTimes() -
getRates
public double[] getRates() -
getParamRow
public double[] getParamRow()The params row of the process cell. -
toString
-