TemporalCube: Cube method for temporal samples selection

Description Usage Arguments Details Value Author(s) Examples

View source: R/TemporalCube.R

Description

Select one temporal sample for each unit using the Cube method. The function samplecube from the package sampling is used.

Usage

1
TemporalCube(S, P, R, tol = 1e-08)

Arguments

S

a matrix that contains variables on which the sample must be balanced. See Details.

P

a vector of probabilities of select samples.

R

a vector that specify to which unit each sample belongs.

tol

the tolerance parameter. Default value is 1e-8.

Details

Balancing constraints considered in S allow first to select exactly one temporal sample for each unit considered and then to verify constraint of fixed samples size.

Value

PP the balanced sample selected (a vector of 0s and 1s with the same size as P).

Author(s)

Esther Eustache esther.eustache@unine.ch

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 

## Temporal samples of three units ##
S <- matrix(c(0,1,1,
              1,1,0,
              1,0,1,
              0,0,1,
              0,1,0,
              1,0,1,), ncol=3, byrow = T)
R <- c(1,1,2,2,3,3)
P <- c(0.2,0.8,0.6,0.4,0.5,0.5)

## Find balanced sample ##
res  <- LandTemporalPivot(S, P, R, tol = 1e-6)
res

## End(Not run)

RJauslin/Sampling documentation built on Aug. 29, 2020, 7:27 a.m.