RM_trid {RMAT}R Documentation

Generate a tridiagonal matrix with normal entries

Description

Generate a tridiagonal matrix with normal entries

Usage

RM_trid(N, symm = FALSE)

Arguments

N

number of dimensions of the square matrix

symm

indicates whether the matrix should be symmetric; equal to its transpose.

Value

A random tridiagonal matrix with N(0,2) diagonal and N(0,1) band.

Examples

# Generate a 3x3 standard normal tridiagonal matrix
P <- RM_trid(N = 3)

# Symmetric tridiagonal matrix
P <- RM_trid(N = 9, symm = TRUE)


[Package RMAT version 0.2.0 Index]