Learn R Programming

RegimeChange (version 0.1.1)

geometric_hazard: Geometric Hazard Prior

Description

Creates a geometric (constant hazard) prior for the changepoint process. This implies that the probability of a changepoint at each time step is constant and independent.

Usage

geometric_hazard(lambda = 0.01)

Value

An object of class "hazard_prior"

Arguments

lambda

Hazard rate (probability of changepoint at each step). Should be between 0 and 1. Smaller values expect fewer changepoints.

Details

Under a geometric hazard, the expected run length (time between changepoints) is 1/lambda. For example, lambda = 0.01 expects a changepoint every 100 observations on average.

Examples

Run this code
hazard <- geometric_hazard(lambda = 0.01)

hazard <- geometric_hazard(lambda = 0.1)

Run the code above in your browser using DataLab