Learn R Programming

nsdr (version 0.1.1)

gsave: gsave

Description

gsave

Usage

gsave(x,x.new,y,ytype,ex,ey,comx,comy,r)

Arguments

x

input predictor matrix from training set

x.new

input predictor matrix from testing set

y

response variables

ytype

type of response variables

ex

tuning parameter for the Tychonoff reguralized inverse for GX

ey

tuning parameter for the Tychonoff reguralized inverse for GY

comx

tuning parameter for the Gaussian kernel in X

comy

tuning parameter for the Gaussian kernel in Y

r

number of dimension

Value

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

References

Li, B. (2018). Sufficient dimension reduction: Methods and applications with R. CRC Press.

Examples

Run this code
# 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