Skip to contents

Fits the point-state special case with a symmetric transition matrix `A(q) = matrix(c(1-q, q, q, 1-q), 2, 2, byrow = TRUE)`. The scalar `q` is selected by likelihood maximization over the requested interval.

Usage

fit_binary_markov(
  y,
  se,
  state_means = c(0, 1),
  sequence_id = rep(1L, length(y)),
  q_interval = c(0, 0.5),
  grid_size = 501L,
  init_prob = c(0.5, 0.5)
)

Arguments

y

Numeric vector of noisy observations.

se

Numeric vector of known, strictly positive standard errors.

state_means

Two finite point-state means.

sequence_id

Vector identifying independent contiguous sequences.

q_interval

Increasing length-two search interval contained in `[0,1]`.

grid_size

Number of initial likelihood evaluations over `q_interval`.

init_prob

Nonnegative length-two initial state distribution.

Value

A list containing the estimated flip probability `q`, transition matrix, log likelihood, smoothed state probabilities, and boundary probabilities.