fitPP.fun {NHPoisson} R Documentation

## Fit a non homogeneous Poisson Process

### Description

This function fits by maximum likelihood a NHPP where the intensity λ(t) is formulated as a function of covariates. It also calculates and plots approximate confidence intervals for λ(t).

### Usage

fitPP.fun(covariates = NULL, beta, posE = NULL, inddat = NULL, POTob = NULL,
namcovariates = NULL, n = NULL, tind = "TRUE", tim = NULL, modCI = "TRUE",
CIty = "Delta", clevel = 0.95, tit = '', modSim = "FALSE", dplot = TRUE,
xlegend = "topleft")


### Arguments

 covariates Matrix of the covariates to be included in the linear predictor of the PP intensity (each column is a covariate). beta Numeric vector of the initial values for the estimation of the β parameters. posE Optional (see Details section). Numeric vector of the position of the PP occurrence points. inddat Optional (see Details section). Index vector equal to 1 for the observations used in the estimation process By default, all the observations are considered. POTob Optional (see Details section). List with elements T and thres that defines the PP resulting from a POT approach; see POTevents.fun for more details. namcovariates Optional. Vector of the names of the variables in covariates. n Optional. Number of observations in the observation period; it is only neccessary if POTob, inddat and covariates are NULL. tind Logical flag. If it is TRUE, an independent term is fitted in the linear predictor. tim Optional. Time vector of the observation period. By default, a vector 1,...n is considered. modCI Logical flag. If it is TRUE, confidence intervals for λ(t) values are calculated. CIty Label indicating the method to calculate the approximate confidence intervals for λ(t). It can be 'delta' for the delta method or 'transf' for transformed asymptotic intervals; see CIdelta.fun and CItran.fun for details. clevel Confidence level of the confidence intervals. tit Character string. A title for the plot. modSim Logical flag. If it is FALSE, information on the estimation process is shown on the screen. For simulation process, the option TRUE should be prefered. dplot Logical flag. If it is TRUE, the fitted intensity is plotted. xlegend Label indicating the position where the legend on the graph will be located.

### Details

A Poisson process (PP) is usually specified by a vector containing the occurrence points of the process (t_i)_{i=1}^k, (argument posE). Since PP are often used in the framework of POT models, fitPP.fun also provides the possibility of using as input the series of the observed values in a POT model (x_i)_{i=1}^n and the threshold used to define the extreme events (argument POTob).

In the case of PP defined by a POT approach, the observations of the extreme events which are not defined as the occurrence point are not considered in the estimation. This is done through the argument inddat, see POTevents.fun. If the input is provided via argument POTob, index inddat is calculated automatically. See Coles (2001) for more details on the POT approach.

The estimation of the β covariance matrix is based on the asymptotic distribution of the MLE \hat β, and calculated as the inverse of the hessian. Confidence intervals for λ(t) can be calculated using two approaches, the delta method or a transformation of the confidence interval for the linear predictor ν(t)=\textbf{X(t)} β. The interval for ν(t) is also based on the asymptotic properties of the MLE \hat ν(t). See Casella (2002) for more details on ML theory and delta method.

### Value

A list with elements

 llik  Value of the loglikelihood function. npar  Number of estimated parameters. beta  Vector of the MLE \hat β. inddat  Input argument. VARbeta  Covariance matrix of the β parameters lambdafit  Vector of the fitted intensity \hat λ(t). LIlambda  Vector of lower extremes of the CI LUlambda  Vector of upper extremes of the CI. posE  Input argument. namcovariates  Input argument. tit  Input argument. tind  Input argument.

### Note

A homogeneous Poisson process (HPP) can be fitted as a particular case, using an intensity defined by only an independent term and no covariates.

### References

Coles, S. (2001). An introduction to statistical modelling of extreme values. Springer.

Casella, G. and Berger, R.L., (2002). Statistical inference. Brooks/Cole.

POTevents.fun, globalval.fun, VARbeta.fun, CItran.fun, CIdelta.fun

### Examples

#model fitted  using as input posE and inddat and  no confidence intervals

data(BarTxTn)
covB<-cbind(cos(2*pi*BarTxTn$dia/365), sin(2*pi*BarTxTn$dia/365),
BarTxTn$TTx,BarTxTn$Txm31,BarTxTn$Txm31**2) BarEv<-POTevents.fun(T=BarTxTn$Tx,thres=318,
date=cbind(BarTxTn$ano,BarTxTn$mes,BarTxTn$dia)) mod1B<-fitPP.fun(tind='TRUE',covariates=covB, posE=BarEv$Px, inddat=BarEv$inddat, tit='BAR Tx; cos, sin, TTx, Txm31, Txm31**2', beta=c(-100,1,10,0,0,0)) #model fitted using as input a list from POTevents.fun and with confidence intervals tiempoB<-BarTxTn$ano+rep(c(0:152)/153,55)

mod2B<-fitPP.fun(tind='TRUE',covariates=covB,
POTob=list(T=BarTxTn\$Tx, thres=318),
tim=tiempoB, tit='BAR Tx; cos, sin, TTx, Txm31, Txm31**2',
beta=c(-100,1,10,0,0,0),CIty='Transf',modCI=TRUE,
modSim=TRUE)


[Package NHPoisson version 1.0 Index]