Description Usage Arguments Details Value References See Also Examples
View source: R/globalval.fun.r
This function performs a thorough validation analysis for a fitted NHPP. It calculates the (generalized) uniform and the raw (or scaled) residuals, performs residual plots for the uniform residuals, and time residual and lurking variable plots for the raw or scaled residuals. It also plots the fitted and empirical estimations of the NHPP intensity. Optionally, it also performs a residual QQplot.
1 2 3 4 5 6  globalval.fun(mlePP, lint = NULL, nint = NULL, Xvar = NULL,
namXvar = NULL, Xvart = NULL, namXvart = NULL, h = NULL, typeRes = NULL,
typeResLV="Pearson",typeI = "Disjoint", nsim = 100, clevel = 0.95,
resqqplot = FALSE, nintLP = 100, tit = "", flow = 0.5, addlow = FALSE,
histWgraph=TRUE,plotDisp=c(2,2), indgraph = FALSE, scax = NULL, scay = NULL,
legcex = 0.5, cores = 1, xlegend = "topleft", fixed.seed=NULL)

mlePP 
An object of class 
lint 
Length of the intervals used to calculate the residuals. 
nint 
Number of intervals used to calculate the residuals. Intervals of equal length are considered. Only used if typeI="Disjoint". In that case, only one of the arguments lint or nint must be specified. 
Xvar 
Optional. Matrix of the lurking variables (each column is a variable). 
namXvar 
Optional. Vector of names of the variables in Xvar. 
Xvart 
Optional. Matrix of the variables for the residual plots (each column is a variable). A time plot is performed in all the cases. 
namXvart 
Optional. Vector of names of the variables in Xvart. 
h 
Optional. Weight function to calculate the scaled residuals. By default, Pearson residuals with h(t)=1/√{\hat λ(t)} are calculated. This function is used to calculate both the scaled residuals and the residuals for the lurking variables (except if typeResLV="Raw"). 
typeRes 
Optional. Label indicating the type of scaled residuals. By default, Pearson residuals are calculated and label is "Pearson". 
typeResLV 
Label indicating the type of residuals ("Raw" or any type of scaled residuals such as "Pearson") to calculate the residuals for the lurking variable plots. 
typeI 
Label indicating the type ("Overlapping" or "Disjoint") of intervals used to calculate the residuals. 
clevel 
Confidence level of the residual envelopes. 
resqqplot 
Logical flag. It is is TRUE, a residual qqplot is carried out. 
nsim 
Number of simulations for the residual qqplot. 
nintLP 
Number of levels considered in the lurking variables. It is used as argument
nint in the call of the function 
tit 
Character string. A title for the plot. 
flow 
Argument f for the lowess smoother of the raw (or scaled) residual
plots, see 
addlow 
Logical flag. If it is TRUE, a lowess is added in the residual plots. 
histWgraph 
Logical flag. If it is TRUE, a new graphical device is opened
with the option 
plotDisp 
A vector of the form 
indgraph 
Logical flag. If it is TRUE, the validation plots (except the residual versus variables plots) in

scax 
Optional. Vector of two values indicating the range of values for the xaxis in the fitted and empirical rate plot. An adequate range is selected by default. 
scay 
Optional. Vector of two values indicating the range of values for the xaxis in the fitted and empirical rate plot. An adequate range is selected by default. 
legcex 
cex argument for the legend in the residual time plots
(see 
cores 
Optional. Number of cores of the computer to be used in the calculations. Default: one core is used. 
xlegend 
Argument xlegend used in the call of the function

fixed.seed 
An integer or NULL. It is the argument for 
If typeI="Overlapping", argument lint is compulsory. If typeI="Disjoint", only one of the arguments lint or nlint must be specified.
A list with the same elements that CalcRes.fun
or
CalcResD.fun
(depending on the value of the argument typeI).
Cebrian, A.C., Abaurrea, J. and Asin, J. (2015). NHPoisson: An R Package for Fitting and Validating Nonhomogeneous Poisson Processes. Journal of Statistical Software, 64(6), 124.
graphres.fun
, graphrate.fun
, resQQplot.fun
,
graphResCov.fun
, graphresU.fun
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24  data(BarTxTn)
covB<cbind(cos(2*pi*BarTxTn$dia/365), sin(2*pi*BarTxTn$dia/365),
BarTxTn$TTx,BarTxTn$Txm31,BarTxTn$Txm31**2)
modB<fitPP.fun(tind=TRUE,covariates=covB,
POTob=list(T=BarTxTn$Tx, thres=318),
tit="BAR Tx; cos, sin, TTx, Txm31, Txm31**2",
start=list(b0=100,b1=1,b2=10,b3=0,b4=0,b5=0),CIty="Transf",modCI=TRUE,
modSim=TRUE,dplot=FALSE)
#Since only one graphical device is opened and the argument histWgraph is TRUE
#by default, the different plots can be scrolled up and down with the "Page Up"
#and "Page Down" keys.
aux<globalval.fun(mlePP=modB,lint=153, typeI="Disjoint",
typeRes="Raw",typeResLV="Raw", resqqplot=FALSE)
#If typeRes and typeResLV are not specified, Pearson residuals are calculated
#by default.
aux<globalval.fun(mlePP=modB,lint=153, typeI="Disjoint",
resqqplot=FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.