Library: | times |
See also: | quantile |
Quantlet: | quantilelines | |
Description: | compute quantiles of trajectories. |
Usage: | y = quantilelines(data,step,perc) | |
Input: | ||
data | n x m x 2 array, data, where n is the length of trajectories and m the number of trajectories | |
step | scalar, time interval between points at which the quantiles are computed | |
perc | s x 1 vector, orders of quantiles | |
Output: | ||
y | p x q matrix, where first column contains time and the remaining quantiles |
library("xplore") library("times") library("plot") randomize(101) randomize2(101) y=simHPP(2,20,100) q=quantilelines(y,1,#(0.1,0.5,0.9)) d1 = createdisplay(1,1) adddata(d1, 1, 1,setmask(q[,1]~q[,2],"line","thin","black", "style",1)) adddata(d1, 1, 1,setmask(q[,1]~q[,3],"line","thin","black", "style",1)) adddata(d1, 1, 1,setmask(q[,1]~q[,4],"line","thin","black", "style",1)) adddata(d1, 1, 1,setmask(reduce(y[,1,]),"line","thin","red", "style",1))
Show three quantile lines (black) and a sample trajectory (red).