Last data update: 2014.03.03

R: Point Processes
PointProcessR Documentation

Point Processes

Description

Functions for estimating point processes.

Usage

extremalPP(data, threshold = NA, nextremes = NA, ...)
unmark(PP)
fit.POT(PP, markdens = "GPD", ...)
fit.sePP(PP, model = c("Hawkes", "ETAS"), mark.influence = TRUE,
         std.errs = FALSE, ...)
fit.seMPP(PP, markdens = "GPD", model = c("Hawkes", "ETAS"),
          mark.influence = TRUE, predictable = FALSE,
          std.errs = FALSE, ...)
stationary.sePP(sePP)
sePP.negloglik(theta, PP, case)
seMPP.negloglik(theta, PP, case, markdens)
volfunction(anytimes, times, marks, theta, model)
## S3 method for class 'MPP'
plot(x, ...)
## S3 method for class 'PP'
plot(x, ...)
## S3 method for class 'sePP'
plot(x, ...)

Arguments

anytimes

vector, times at which to calculate self-excitement function.

data

timeSeries object or vector.

case

numeric, indicating Hawkes or ETAS models and whether marks may have an influence on future points.

markdens

character, name of density of mark distribution, currently only "GPD".

mark.influence

logical, whether marks of marked point process may influence the self-excitement.

marks

vector, marks associated with point events.

model

character, name of self-exciting model.

nextremes

integer, count of upper extremes to be used.

PP

list, a point process object of class PP or MPP.

predictable

logical, whether previous events may influence the scaling of mark distribution.

sePP

list, a fitted self-exciting process created with fit.sePP() or a marked self-exciting process created with fit.seMPP().

std.errs

logical, whether standard errors should be computed.

theta

vector, parameters of self-excitement function.

threshold

numeric, threshold value.

times

vector, times of point events.

x

list, a (un/marked) point process object of class PP/MPP.

...

ellipsis, arguments passed to plot() or to fit.GPD() for fit.POT() or to nlminb() for functions fit.sePP() and fit.seMPP or to julian() for extremalPP.

Details

extremalPP(): returns a list describing a marked point process (see pages 298-301 of QRM).
fit.POT(): fits the POT (peaks-over-threshold) model to a point process of class PP or MPP. Note that if point process is of class PP, then function simply esitmates the rate of a homogeneous Poisson process (see pages 301–305 of QRM).
fit.seMPP(): fits a marked self-exciting process to a point process object of class MPP.
fit.sePP(): fits self-exciting process to a point process object of class PP (unmarked) or MPP (marked).
seMPP.negloglik(): evaluates negative log-likelihood of a marked self-exciting point process model; this objective function will be passed to the optimizing function.
sePP.negloglik(): evaluates negative log-likelihood of a self-exciting point process model (unmarked).
stationary.sePP(): checks a sufficient condition for stationarity of a self-exciting model and gives information about cluster size.
unmark(): strips marks from a marked point process.
volfunction(): calculates a self-excitement function for use in the negloglik methods used in fit.sePP() and fit.seMPP().

Value

The function extremalPP() returns a list describing class MPP (marked point process) consisting of times and magnitudes of threshold exceedances:

times

vector of julian day counts (since 1/1/1960) for each exceedance

marks

vector of exceedances values (differences between value and threshold at each mark)

startime

the julian count one day prior to the first date in the entire timeSeries

endtime

value of last julian count in entire timeSeries

threshold

value of threshold above which exceedances are calculated

The functions fit.POT(), fit.seMPP(), and fit.sePP() return a list containing the fitted model.

The plot-methods return invisibly the data for producing these.

See Also

GPD, nlminb

Examples

## Extremal PP
data(sp500)
l <- -returns(sp500) 
lw <- window(l, start = "1995-12-31", end = end(l)) 
mod1 <- extremalPP(lw, ne = 100) 
mod1$marks[1:5]
mod1$threshold
mod2a <- fit.sePP(mod1, mark.influence = FALSE, std.errs = TRUE)
mod2b <- fit.seMPP(mod1, mark.influence = FALSE, std.errs = TRUE)
stationary.sePP(mod2b)
mod2c <- fit.POT(mod1, method = "BFGS")
plot(mod1)
plot(unmark(mod1))
plot(mod2a)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(QRM)
Loading required package: gsl
Loading required package: Matrix
Loading required package: mvtnorm
Loading required package: numDeriv
Loading required package: timeSeries
Loading required package: timeDate

Attaching package: 'QRM'

The following object is masked from 'package:base':

    lbeta

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/QRM/PointProcess.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PointProcess
> ### Title: Point Processes
> ### Aliases: PointProcess extremalPP unmark fit.POT fit.sePP fit.seMPP
> ###   stationary.sePP plot.MPP plot.PP plot.sePP sePP.negloglik
> ###   seMPP.negloglik volfunction SEprocExciteFunc
> ### Keywords: models
> 
> ### ** Examples
> 
> ## Extremal PP
> data(sp500)
> l <- -returns(sp500) 
> lw <- window(l, start = "1995-12-31", end = end(l)) 
> mod1 <- extremalPP(lw, ne = 100) 
> mod1$marks[1:5]
[1] 0.011492882 0.002680738 0.005872111 0.001429676 0.002075903
> mod1$threshold
[1] 0.01981916
> mod2a <- fit.sePP(mod1, mark.influence = FALSE, std.errs = TRUE)
> mod2b <- fit.seMPP(mod1, mark.influence = FALSE, std.errs = TRUE)
> stationary.sePP(mod2b)
  stationary          eta cluster.size 
   1.0000000    0.6549983    2.8985365 
> mod2c <- fit.POT(mod1, method = "BFGS")
> plot(mod1)
> plot(unmark(mod1))
> plot(mod2a)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>