needs_trend: Determines if a trend is required for the specified VAR model

Description Usage Arguments Value Examples

View source: R/needs_trend.r

Description

This function uses the Phillips-Perron Unit Root Test to determine whether a trend is required for a VAR model based on the given matrix of endogenous variables and the given lag. All variables are assessed individually. This function returns TRUE if any of the endogenous variables requires a trend.

Usage

1
needs_trend(endo_matrix, lag)

Arguments

endo_matrix

The matrix of endogenous variables in the model.

lag

An integer specifying the lag length of the model.

Value

A boolean indicating whether a trend is required for the specified VAR model.

Examples

1
2
3
4
5
6
data_matrix <- matrix(nrow = 40, ncol = 3)
data_matrix[, ] <- runif(ncol(data_matrix) * nrow(data_matrix), 1, 10)
data_matrix[, 3] <- (1:40) + rnorm(40)
colnames(data_matrix) <- c('rumination', 'happiness', 'activity')
data_matrix
autovarCore:::needs_trend(data_matrix, 1)

autovarCore documentation built on May 19, 2017, 8:08 p.m.

Search within the autovarCore package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.