# Packages library(MASS) library(e1071) # 100,000 samples; up to 1000 timepoints; 99% quantile n <- 100000 p <- 1000 cut <- 0.99 # Create one large matrix and use subsets of it :) set.seed(0) X <- t(mvrnorm(n, mu=rep(0, p), Sigma=diag(p))) # Compute kurtosis kurt <- function(X){ apply(X, 2, kurtosis, type=1) } kurt_99_quant <- vector(mode='numeric', length=p) # No valid cutoff for less than 5 timepoints kurt_99_quant[1:4] <- NA for(ii in seq(5, p)){ kurt_99_quant[ii] <- as.numeric(quantile(kurt(X[seq(ii),]), cut)) } usethis::use_data(kurt_99_quant, internal=TRUE, overwrite=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.