# NOT RUN {
set.seed(81)
rspam <- spam_random(50^2, density = .0001, spd = TRUE)
SPD <- eigen.spam(rspam, nev = 20, control = list(mode = "SM"),
only.values = TRUE)
tail(SPD$values, 20)
isSymmetric(rspam)
# hence the matrix is symmetric positiv definit
rspam2 <- spam_random(50^2, density = .0001, spd = FALSE, sym = TRUE,
distribution = rpois, lambda = 2)
SNPDF <- eigen.spam(rspam2, nev = 20, control = list(mode = "SM"),
only.values = TRUE)
tail(SNPDF$values, 20)
isSymmetric(rspam2)
# hence the matrix is symmetric but not positiv definit
# }
Run the code above in your browser using DataCamp Workspace