lag_length: Retrieve number of lags

Description Usage Arguments Details Value Examples

View source: R/aux_funs.R

Description

Given a matrix of slope parameters, retrieve the number of lags.

Usage

1

Arguments

A

A (K x Kp) matrix, providing the coeffcients for lag 1 to p with the first row containing the coefficents of the first equation. Parameter p is the maximum lag length and K the number of variables.

Details

At the moment, this function is just an intentionally named wrapper of ncol(A) / nrow(A).

Value

An integer scalar. The lag length p.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
p <- 3
K <- 4
A <- matrix(0, K, K * p)
lag_length(A) == p

## Not run: 

A <- matrix(0, 4, 7)
lag_length(A)
lag_length(A[1, ])

## End(Not run)

nielsaka/zeitreihe documentation built on March 17, 2020, 8:38 p.m.