EQsampleDensity: Samples from a bunch of nodes on a grid.

Description Usage Arguments Value Author(s) References Examples

Description

EQsampleDensity is used to simulate the nodes from a grid, where the increment of the position of the nodes on each marginal space of the grid is the same.

Usage

1
EQsampleDensity(sx, boundaryVec, NoNote = 215, size = 100)

Arguments

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

Value

See actualPosition

Author(s)

Jordan Morris

References

no references

Examples

 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
##---- 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 = 215, size = 100) 
{
    n <- NoNote
    SXdim <- length(sx[1, ])
    space <- NULL
    for (i in 1:SXdim) {
        a <- boundaryVec[2 * i - 1]
        b <- boundaryVec[2 * i]
        d <- (b - a)/(n - 1)
        space <- c(space, d)
    }
    d <- min(space)
    XP <- NULL
    vectorL <- NULL
    for (i in 1:SXdim) {
        a <- boundaryVec[2 * i - 1]
        b <- boundaryVec[2 * i]
        xposition <- seq(from = a, to = b, by = d)
        L <- length(xposition)
        XP <- c(XP, xposition)
        vectorL <- c(vectorL, L)
    }
    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)
  }

MaskJointDensity documentation built on May 2, 2019, 8:28 a.m.