prob_step: Posterior probability of a step change

prob_stepR Documentation

Posterior probability of a step change

Description

Computes the posterior probability that a step change is increasing (positive) or decreasing (negative)

Usage

prob_step(x, positive = TRUE, Delta = NULL)

Arguments

x

A 'birp' object.

positive

Logical. If 'TRUE' (default), returns the posterior probability of an increasing (positive) step change, P(\Delta_m > 0 \mid y). If 'FALSE', returns the posterior probability of a decreasing (negative) step change, P(\Delta_m < 0 \mid y).

Delta

Integer. Index of the Delta parameter for which to return the posterior probability. If 'NULL' (default), posterior probabilities for all Delta parameters are returned.

Value

If 'Delta = NULL', a numeric vector containing posterior probabilities for all step change parameters. Otherwise, a single numeric value.

See Also

[birp()]

Examples

data <- simulate_birp()
est <- birp(data, change = "step")

# Posterior probabilities of positive step changes
prob_step(est)

# Posterior probability for a specific Delta
prob_step(est, Delta = 1)

# Posterior probabilities of negative step changes
prob_step(est, positive = FALSE)


birp documentation built on Nov. 3, 2026, 1:09 a.m.