ffphase: Fast flight phase of the cube method

View source: R/ffphase.R

ffphaseR Documentation

Fast flight phase of the cube method

Description

This function computes the flight phase of the cube method proposed by Chauvet and Tillé (2006).

Usage

ffphase(X, pik)

Arguments

X

A matrix of size (N x p) of auxiliary variables on which the sample must be balanced.

pik

A vector of inclusion probabilities.

Details

This function implements the method proposed by (Chauvet and Tillé 2006). It recursively transforms the vector of inclusion probabilities pik into a sample that respects the balancing equations. The algorithm stops when the null space of the sub-matrix B is empty. For more information see (Chauvet and Tillé 2006).

The function uses the function Null to find the null space of the sub-matrix B.

Value

Updated vector of pik that contains 0 and 1 for unit that are rejected or selected.

Author(s)

Raphaël Jauslin raphael.jauslin@unine.ch

References

Chauvet, G. and Tillé, Y. (2006). A fast algorithm of balanced sampling. Computational Statistics, 21/1:53-62

See Also

fastflightphase, flightphase.

Examples


N <- 100
n <- 10
p <- 4

pik <- rep(n/N,N)
X <- cbind(pik,matrix(rgamma(N*p,4,25),ncol= p))

pikstar <- ffphase(X,pik) 
t(X/pik)%*%pikstar
t(X/pik)%*%pik
pikstar



StratifiedSampling documentation built on Oct. 26, 2022, 5:09 p.m.