Description Usage Arguments Details Value Author(s) References Examples
Obtains samples from the marginal density functions of the unmasked variables.
1 | actualPosition(vectorL, prob, boundaryVec, size = 1)
|
vectorL |
Should be the dimension of the Joint Density Function |
prob |
The Joint Density Function |
boundaryVec |
Boundary of each element, min, max, min, max |
size |
The size of the sample |
Used by getSampleFromMarginalDistributionOfUnmaskedData
An n*k matrix where n is the sample size and k is the number of vectors. Each column represents the sample from the marginal density of the kth variable.
Jordan Morris
no references
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (vectorL, prob, boundaryVec, size = 1)
{
len <- length(vectorL)
n <- c()
for (i in 1:len) {
n[i] <- vectorL[i]
}
maxSize = 1
for (i in 1:len) {
maxSize <- maxSize * n[i]
}
w <- c(0:(maxSize - 1))
k <- sample(w, size = size, replace = TRUE, prob = prob)
barredPoints <- matrix(nrow = size, ncol = len)
for (i in 1:size) {
maxSize <- 1
for (l in 1:len) {
maxSize <- maxSize * n[l]
}
for (j in 1:(len - 1)) {
maxSize <- maxSize/n[len + 1 - j]
if (k[i] > maxSize) {
barredPoints[i, (len + 1 - j)] <- floor(k[i]/maxSize) +
1
k[i] <- k[i]%%maxSize + 1
}
else {
barredPoints[i, (len + 1 - j)] <- 1
}
}
barredPoints[i, 1] <- k[i] + 1
}
return(barredToActual(vectorL, boundaryVec, barredPoints))
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.