#' Sampling for particle filtering
#' @author Ta-Chou Ng
#'
#' @param res a list containing the case_data data.tables generated by scenario_sim
#'
#' @return data.table of outbreak summary statistics
#' @export
#'
#' @importFrom data.table rbindlist as.data.table
#' @importFrom lhs improvedLHS
#'
pfilter_lhs <- function(fitted.paras = NULL, n=NULL){
sams <- lhs::improvedLHS(n, length(fitted.paras))
tmp <- purrr::map_dfc(1:length(fitted.paras), function(j){
fitted.paras[[j]][1] + sams[,j]*(fitted.paras[[j]][2]-fitted.paras[[j]][1])
}) %>% data.table::as.data.table()
colnames(tmp) <- names(fitted.paras)
tmp
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.