lpm3: Local Pivotal Method

Description Usage Arguments Value Author(s) References Examples

Description

The local pivotal method provides a way to perform balanced sampling. This implementation replace linear searches in lpm2, with k-d trees. K-d trees are binary trees used to effectively search high dimensional spaces, and reduce the average computational complexity of lpm2 from O(N^2) to O(N log(N)).

Usage

1
2
3
4
5
  lpm3(
     prob,
     x, 
     m=40
     ) 

Arguments

prob

An array of length N such that the sum of prob is equal to the sample size, where the N is the number of rows of x.

x

A matrix of N rows and p columns, each row is assumed to be a sampling unit.

m

Max leaf size used as a terminal condition for building the k-d tree.

Value

Returns a vector of selected indexes from the matrix x. The results are identical to the lpm2 package when no ties in distance occur.

Author(s)

Jonathan Lisic

References

Lisic, J., Jonathan (2015) Parcel Level Agricultural Land Cover Prediction. (Unpublished doctoral dissertation). George Mason University, Fairfax, Virginia.

Examples

1
2
3
4
5
6
7
8
9
N <- 1000
n <- 100
x <- cbind( runif(N), runif(N)) 

set.seed(100)
Cprog <- proc.time()
sampled3 <- lpm3( rep(n/N,N), x)
print("lpm3 running time")
print(proc.time() - Cprog) 

jlisic/lpm3 documentation built on May 19, 2019, 12:46 p.m.