--- title: "Simulated Example" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Simulated Example} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r} library(MAP) ``` simulate data to test the algorithm ```{r} set.seed(123) n = 400 ICD = c(rpois(n / 4, 10), rpois(n / 4, 1), rep(0, n / 2)) NLP = c(rpois(n / 4, 10), rpois(n / 4, 1), rep(0, n / 2)) mat = Matrix(data = cbind(ICD, NLP), sparse = TRUE) note = Matrix(rpois(n, 10) + 5, ncol = 1, sparse = TRUE) res = MAP(mat = mat, note = note) ``` ```{r} head(res$scores) ``` ```{r} res$cut.MAP ```