Package 'PieceExpIntensity'

Title: Bayesian Model to Find Changepoints Based on Rates and Count Data
Description: This function fits a reversible jump Bayesian piecewise exponential model that also includes the intensity of each event considered along with the rate of events.
Authors: Andrew G. Chapple
Maintainer: Andrew G. Chapple <[email protected]>
License: GPL-2
Version: 1.0.4
Built: 2025-03-06 03:32:16 UTC
Source: https://github.com/cran/PieceExpIntensity

Help Index


Runs the PieceExpIntensity sampler and returns posterior results.

Description

Returns a list of posterior samples along with summaries for the most visited number of split points.

Usage

PieceExpIntensity(X, Y, B, Poi)

Arguments

X

Vector containing observed event times.

Y

Vector containing poisson count intensities.

B

Number of iterations to run the MCMC with half burned in.

Poi

Prior mean number of split points.

Value

A list of all posterior quantities and a summary of the most commonly visited model.

References

Chapple (2017). Modeling ISIL terror attacks and their intensities via flexible Bayesian piecewise models. Currently Under Review.

Examples

B=1000
n=100
X=rexp(n,1)
Y=X
Y[X<.5]=rpois(sum(X<.5),20)
Y[X>.5]=rpois(sum(X>.5),3)
Poi=10
PieceExpIntensity(X,Y,B,Poi)

C++ Sampling Function for MCMC

Description

C++ Sampling Function used in the PieceExpIntensity function.

Usage

PieceExpIntensity2(Y, Rates, B, Poi)

Arguments

Y

Vector containing observed event times.

Rates

Vector containing poisson count intensities.

B

Number of iterations to run the MCMC with half burned in.

Poi

Prior mean number of split points,

Value

A list of all posterior quantities.

Examples

B=1000
n=100
Y=rexp(n,1)
Rates=Y
Rates[Y<.5]=rpois(sum(Y<.5),20)
Rates[Y>.5]=rpois(sum(Y>.5),3)
Poi=10
PieceExpIntensity2(Y,Rates,B,Poi)