powered by
gsave
gsave(x,x.new,y,ytype,ex,ey,comx,comy,r)
input predictor matrix from training set
input predictor matrix from testing set
response variables
type of response variables
tuning parameter for the Tychonoff reguralized inverse for GX
tuning parameter for the Tychonoff reguralized inverse for GY
tuning parameter for the Gaussian kernel in X
tuning parameter for the Gaussian kernel in Y
number of dimension
pred: sufficient predictors from GSAVE
obj.mat: objective matrix of GSAVE
eig.val: the first r eigenvalues from the eigendecomposition of the objective matrix
eig.vec: the first r eigenvectors from the eigendecomposition of the objective matrix
Li, B. (2018). Sufficient dimension reduction: Methods and applications with R. CRC Press.
# NOT RUN { n = 50; p = 5; sigma = 1; x = matrix(rnorm(n*p),n,p) ; err = rnorm(n) y = x[,1]/(0.5+(x[,1]+1)^2) + sigma*err; ex=0.01 ; ey=0.01 gsave_res <- gsave(x,x,y,"scalar",ex,ey,1,1,1) # }
Run the code above in your browser using DataLab