Learn R Programming

irregulAR1 (version 1.0.0)

ar1_prec_chol_irregular: Upper Cholesky triangle of the precision matrix of a stationary Gaussian AR(1) process, observed at irregularly spaced time points.

Description

Creates the upper triangular Cholesky decomposition of the precision matrix of an AR(1) process with parameters rho and sigma, observed at the time points in the vector times. The process is assumed to be in stationarity and to have Gaussian errors.

Usage

ar1_prec_chol_irregular(times, rho, sigma)

Arguments

times

An vector of positive integers, preferably ordered.

rho

A real number strictly less than 1 in absolute value.

sigma

A positive real number.

Value

A sparse square matrix with length(times) rows.

Examples

Run this code
# NOT RUN {
library(Matrix)
times <- c(1, 4:5, 7)
rho <- 0.5
sigma <- 1
ar1_prec_chol_irregular(times, rho, sigma)
# }

Run the code above in your browser using DataLab