| PIE | R Documentation |
Main function for the Penalized Interaction Estimation (PIE) where the tuning parameter is chosen by BIC
PIE(X, Y, lambda = NULL, nlambda = 50, lambda.min.ratio = 0.1, err = 1e-04, maxIter = 1000, rho = 1)
X |
covariates data matrix of dimension n*p after centering. |
Y |
response variable with length n. |
lambda |
user supplied tuning parameter; Default is NULL and the program compute its own
sequence based on |
nlambda |
the length of the tuning parameter sequence which is available when lambda is NULL. Default is 50. |
lambda.min.ratio |
smallest value for lambda, as a fraction of lambda.max which is available when lambda is NULL. Default is 0.1. |
err |
the precision used to stop the convergence. Default is 1e-4. |
maxIter |
Maximum number of iterations. Default is 1000. |
rho |
step parameter for the ADMM. Default is 1. |
A sparse asymmetric p*p matrix for the interactions.
rm(list = ls())
library('PIE')
library('glmnet')
set.seed(99)
p=100
n=200;
Omega=matrix(0,nrow=p,ncol=p);
Omega[6,6]=1
Omega[1,6]=2;Omega[6,10]=2;Omega=(Omega+t(Omega))/2;
beta<-rep(0,p);beta[c(1,6,10)]=1;
X=matrix(rnorm(n*p),nrow =n);
Y=as.vector(diag(X%*%Omega%*%t(X))+X%*%beta+rnorm(n));
yOme<-PIE(X,Y)
hbeta<-as.vector(coef(cv.glmnet(X,Y,nfolds =5),s="lambda.min"))[-1];
rOme<-PIE(X,Y-X%*%hbeta)
yOme[1:10,1:10]
rOme[1:10,1:10]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.