Skip to contents

Builds a T x T penalty matrix I + lambda_t * D2' D2 where D2 is the second-difference operator. Promotes smoothness in time while keeping the metric positive definite.

Usage

make_temporal_penalty(Tlen, lambda_t = 0.3)

Arguments

Tlen

Integer number of time points.

lambda_t

Nonnegative weight on the roughness penalty (default 0.3).

Value

Symmetric positive definite Matrix of size Tlen x Tlen.

Examples

# \donttest{
H <- make_temporal_penalty(30, lambda_t = 0.5)
# }