Generates an array or matrix that includes k fully separated block-clusters.
arsim(n, dim, k, noise = 0, shuffle = TRUE, v = 0.1, minc = 1,
exp.prop = NULL, min.prop = 1/dim/4, noise.type = "s",
dimnames=list(LETTERS,1:max(dim)))
The number of observations in the array.
The dimension of the array.
The number of clusters. 1 for no clusters.
The proportion of noise among the observations. There are two choices for noise.type
.
Whether or not to shuffle the original category orders randomly.
A variability parameter for the assignment of the observations to the block clusters. Small values lea
The minimum number of categories each cluster must have in each variable. E.g. minc = 2
means, that each block cluster covers at least 2 categories in each dimension.
Optional: expected proportions of the observations which fall into the block clusters.
Minimum proportion of observations in each cluster.
Either "s"
or "I"
. The noise type "s"
means that n*noise
observations are drawn at random from the block-diagonal matrix. Then for these observations the category labels are permuted at random. "I"
adds noise in form of a random sample from the independence matrix with the same marginal totals as the block matrix.
A list of 2: The first entry defines the variable labels (default: A,B,C,...) and the second entry defines the category labels (default 1:k).
A simulated data array.
Not a very sophisticated way of generating random arrays but it serves for tests and illustrations of the other functions.
# NOT RUN {
A <- arsim(1000, c(12,12), 3, shuffle = FALSE)
fluctile(A)
A <- arsim(1000, c(12,12), 3, shuffle = FALSE, dimnames = list(NULL,letters))
dimnames(A)
A <- arsim(4000, c(11,7,5), 3, shuffle = TRUE, dimnames = list(0:2,letters))
dimnames(A)
# }
# NOT RUN {
A2<- arsim(1000, c(12,12,12), 3, shuffle = FALSE)
fluctile3d(A2, shape ="oct")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab