Description Usage Arguments Examples
Sample cube SPOT
1 | samplecubeSPOT(X, pik, order = 1, comment = TRUE, method = 1)
|
X |
matrix of auxiliary variable |
pik |
vector of inclusion probabilities |
order |
order |
comment |
comment if true |
method |
method |
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 | ## Not run:
N=1000
p=7
set.seed(1)
x=rnorm(N*p,10,3)
# random inclusion probabilities
pik= runif(N)
X=array(x,c(N,p))
X=cbind(cbind(X,rep(1,times=N)),pik)
pikfin = sampling::samplecube(X,pik,1,TRUE)
pikfin2 = samplecubeSPOT(X,pik,1,TRUE)
rm(list = ls())
set.seed(1)
eps <- 1e-13
library(Matrix)
N <- 200
Pik <- matrix(c(sampling::inclusionprobabilities(runif(N),70),
sampling::inclusionprobabilities(runif(N),50),
sampling::inclusionprobabilities(runif(N),30)),ncol = 3)
X <- PM(Pik)$PM
pik <- PM(Pik)$P
dim(X)
order = 2
method = 1
comment = TRUE
EPS = 1e-11
system.time(s <- samplecubeSPOT(X,pik,order = 2,method = 2,arma = FALSE))
system.time(s <- sampling::samplecube(X,pik,order = 2,comment = TRUE,method = 2))
system.time(s <- BalancedSampling::cube(pik,X))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.