Learn R Programming

irregulAR1 (version 1.0.0)

ar1_lpdf: Evaluate the log-density of a stationary Gaussian AR(1) process.

Description

Evaluate the log-density of a stationary Gaussian AR(1) process, observed at times times taking values x.

Usage

ar1_lpdf(x, times, rho, sigma, mu = 0)

Arguments

x

A vector of observed values.

times

A vector of the time points of observation.

rho

A real number strictly less than 1 in absolute value.

sigma

A positive real number.

mu

A vector of expected values.

Value

A scalar, the log density.

Examples

Run this code
# NOT RUN {
x <- rnorm(5) + 1:5
t <- c(1, 3, 5:6, 10)
rho <- 0.5
sigma <- 1
# zero mean
ar1_lpdf(x, t, rho, sigma)
# means equal times
mu <- t
ar1_lpdf(x + mu, t, rho, sigma, mu)
# }

Run the code above in your browser using DataLab