LeonardV / restriktor

An R package for (in)equality constrained estimation, model selection and hypothesis testing for the linear model
http://restriktor.org
4 stars 4 forks source link

bootstrap mixing weights are wrong? #2

Closed shabbychef closed 4 years ago

shabbychef commented 4 years ago

Maybe I have misunderstood the 'mixing weight' functions, con_weights_boot. Considering the simple 2D model with correlation rho:

library(restriktor)
wts <- function(rho) {
 con_weights_boot(VCOV=matrix(c(1,rho,rho,1),nrow=2,ncol=2),
   Amat=diag(2),meq=0L,R=9999L)
}
set.seed(1234)
wts(0)
wts(0.9995)
This is restriktor 0.1-80.911
restriktor is BETA software! Please report any bugs.
[1] 0.2474247 0.5031503 0.2494249
[1] 0.00590059 0.50085009 0.49324932

The first answer looks like what I would expect, namely choose(2,0:2) / 4, or c(0.25,0.5,0.25). However, for rho near 1, I expect the weights to go to c(0.5,0,0.5). That is not observed in this case.

shabbychef commented 4 years ago

For what it's worth, I was expecting something like the following, which agrees for the rho=0 case:

wtsim <- function(rho,nsim=9999) {
  require(mvtnorm,quietly=TRUE)
  R <- pmin(diag(2) + rho,1)
  X <- rmvnorm(nsim,sigma=R)
  w <- rowSums(X > 0)
  table(w) / length(w)
}
set.seed(1234)
wtsim(0)
wtsim(0.9995)
     0      1      2 
0.2474 0.5032 0.2494 
     0      1      2 
0.4953 0.0114 0.4932 
shabbychef commented 4 years ago

Hmmm, I think I am computing the wrong quantity. It seems I am projecting my multivariate normals on the positive cone without taking into account the covariance. (My weights do not seem to satisfy Proposition 3.6.1 (3) in Silvapulle & Sen, whereas the ones produced by restriktor do.)