The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
MaximinInfer is a package that implements the sampling and aggregation method for the covariate shift maximin effect, which was proposed in <arXiv:2011.07568>. It constructs the confidence interval for any linear combination of the high-dimensional maximin effect.
You can install the released version of MaximinInfer from CRAN with:
install.packages("MaximinInfer")
And the development version from GitHub with:
# install.packages("devtools")
::install_github("zywang0701/MaximinInfer") devtools
This is a basic example which shows you how to solve a common problem:
library(MaximinInfer)
The data is heterogeneous and covariates shift between source and target data
## number of groups
=2
L## dimension
=100
p
## mean vector for source
= rep(0, p)
mean.source ## covariance matrix for source
<- function(rho,p){
A1gen =matrix(0,p,p)
A1for(i in 1:p){
for(j in 1:p){
<-rho^(abs(i-j))
A1[i,j]
}
}return(A1)
}= A1gen(0.6, p)
cov.source
## 1st group's source data
= 100
n1 = MASS::mvrnorm(n1, mu=mean.source, Sigma=cov.source)
X1 # true coef for 1st group
= rep(0, p)
b1 1:5] = seq(1,5)/20
b1[98:100] = c(0.5, -0.5, -0.5)
b1[= X1%*%b1 + rnorm(n1)
Y1
## 2nd group's source data
= 100
n2 = MASS::mvrnorm(n2, mu=mean.source, Sigma=cov.source)
X2 # true coef for 2nd group
= rep(0, p)
b2 6:10] = seq(1,5)/20
b2[98:100] = 0.5*c(0.5, -0.5, -0.5)
b2[= X2%*%b2 + rnorm(n2)
Y2
## Target Data, covariate shift
= 100
n0 = rep(0, p)
mean0 = cov.source
cov0 for(i in 1:p) cov0[i, i] = 1.5
for(i in 1:5) for(j in 1:5) if(i!=j) cov0[i, j] = 0.9
for(i in 99:100) for(j in 99:100) if(i!=j) cov0[i, j] = 0.9
= MASS::mvrnorm(n0, mu=mean0, Sigma=cov0) X0
Input the loading. Note that it allows for multiple loading simultaneously.
= matrix(0, nrow=100, ncol=2) # dimension p=100
loading.mat 96:100, 1] = 0.4
loading.mat[99:100, 2] = 0.8 loading.mat[
Call function Maximin()
. By setting the argument
verbose, you can choose whether or not to display the intermediate
bias-correction results.
<- Maximin(list(X1,X2), list(Y1,Y2), loading.mat, X0, cov.shift=TRUE, verbose=TRUE)
mm #> ======> Bias Correction for initial estimators....
#> Computing LF for loading (1/2)...
#> The projection direction is identified at mu = 0.026739at step =6
#> Computing LF for loading (2/2)...
#> The projection direction is identified at mu = 0.040108at step =5
#> Computing LF for loading (1/2)...
#> The projection direction is identified at mu = 0.026739at step =6
#> Computing LF for loading (2/2)...
#> The projection direction is identified at mu = 0.026739at step =6
#> ======> Bias Correction for matrix Gamma....
#> Computing LF for loading (1/1)...
#> The projection direction is identified at mu = 0.026739at step =6
#> Computing LF for loading (1/1)...
#> The projection direction is identified at mu = 0.026739at step =6
#> Computing LF for loading (1/1)...
#> The projection direction is identified at mu = 0.005282at step =10
#> Computing LF for loading (1/1)...
#> The projection direction is identified at mu = 0.007923at step =9
The following inference method is:
<- Infer(mm, gen.size=200) out
The weights for each group:
$weight
out#> [1] 0.5703927 0.4296073
The point estimator and its corresponding confidence interval for each loading:
$mminfer
out#> [[1]]
#> [[1]]$point
#> [1] -0.212938
#>
#> [[1]]$CI
#> lower upper
#> [1,] -0.4136389 0.01993818
#>
#>
#> [[2]]
#> [[2]]$point
#> [1] -0.6861211
#>
#> [[2]]$CI
#> lower upper
#> [1,] -1.20779 -0.1704235
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.