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 |
Returns a list of posterior samples along with summaries for the most visited number of split points.
PieceExpIntensity(X, Y, B, Poi)
PieceExpIntensity(X, Y, B, Poi)
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. |
A list of all posterior quantities and a summary of the most commonly visited model.
Chapple (2017). Modeling ISIL terror attacks and their intensities via flexible Bayesian piecewise models. Currently Under Review.
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)
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 used in the PieceExpIntensity function.
PieceExpIntensity2(Y, Rates, B, Poi)
PieceExpIntensity2(Y, Rates, B, Poi)
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, |
A list of all posterior quantities.
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)
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)