tridiag | R Documentation |
Make a tridiagonal matrix.
tridiag(main, upper, lower, as.covar = FALSE)
main |
vector for the main diagonal |
upper |
vector for the upper diagonal |
lower |
vector for the lower diagonal |
as.covar |
if TRUE, the matrix is interpreted as a variance-covariance matrix, with |
matrix
Jthorpe (https://stackoverflow.com/a/28974577/597069)
## Not run: main <- 3:6
upper <- 1:3
lower <- 2:4
tridiag(main, upper, lower)
main <- sample(x=1:2, size=4, replace=TRUE)
upper <- lower <- rep(-0.4, 3)
tridiag(main, upper, lower)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.