simulation-study

Simulation attempt for Andréhette Verster

Introduction and disclaimer The data simulated here pertains to a specific set of assumptions, and we should not try to extend the results beyond that without seriously considering and accounting for any systematic differences between that situation and any broader situation. The data analysed here is inherently random. If the study were to be repeated then the results will differ. While the computer software used is tried and tested, the analysis involves multiple human elements.

Variance Of Sample Kurtosis

Kurtosis First we define the sample kurtosis function, as well as a matrix version. Source: Wikipedia kurtosis1 <- function(x) { xstand <- x - mean(x) kurt <- (mean((xstand)^4))/((mean((xstand)^2))^2) return(kurt) } kurtosis <- function(X) { apply(X,2,kurtosis1) } Generate samples We select the range of sample sizes and generate a matrix of samples arranged in columns, for each size. samplesizes <- seq(minsize<-100,maxsize<-10000,stepsize<-50) nsizes <- length(samplesizes) nsample.persize <- 500 samples <- vector('list',nsizes) for (i in 1:nsizes) { samples[[i]] <- matrix(rnorm(samplesizes[i]*nsample.

Analysis Of Sample Kurtosis

Kurtosis Source: Wikipedia We define a function for the sample-size-standardised excess kurtosis. kurtosis <- function(x) { xstand <- x - mean(x) kurt <- (sum((xstand)^4))/((sum((xstand)^2))^2)-3/length(x) return(kurt) } Generate samples We select random sample sizes and generate a matrix of samples arranged in a list. We are generating samples from the Stable distribution using the stabledist package. The index parameter is chosen randomly between 1 and 2. The skewness parameter is set to zero.