Description Usage Arguments Value Author(s) References Examples
Very similar to EQsampleDensity without the restriction of having the nodes equally spaced.
1 | sampleDensity(sx, boundaryVec, NoNote = 151, size = 100)
|
sx |
Matrix where each column corresponds to a vector |
boundaryVec |
Vector of boundaries of the columns of sx in the order from_1, to_1, from_2, to_2 etc |
NoNote |
Number of nodes |
size |
Size of the sample |
See actualPosition
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 | ##---- 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 (sx, boundaryVec, NoNote = 151, size = 100)
{
n <- NoNote
SXdim <- length(sx[1, ])
vectorL <- rep(n, SXdim)
XP <- NULL
for (i in 1:SXdim) {
a <- boundaryVec[2 * i - 1]
b <- boundaryVec[2 * i]
xposition <- seq(from = a, to = b, by = (b - a)/(n -
1))
XP <- c(XP, xposition)
}
NotePositions <- positions(XP, vectorL)
H <- Hpi(x = sx)
fhat <- kde(x = sx, H = H)
prob <- predict(fhat, x = NotePositions)
outSample <- actualPosition(vectorL, prob, boundaryVec, size)
return(outSample)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.