Learn R Programming

nsdr (version 0.1.1)

gsir: gsir

Description

gsir

Usage

gsir(x,x.new,y,ytype,ex,ey,complex.x,complex.y,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 regularized inverse for GX

ey

tuning parameter for the Tychonoff regularized inverse for GY

complex.x

tuning parameter for the Gaussian kernel in X

complex.y

tuning parameter for the Gaussian kernel in Y

r

number of dimension

Value

suff.pred: sufficient predictors from GSIR

obj.mat: objective matrix of GSIR

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 = sin(0.5+(x[,1]+1)^2) + sigma*err; ex=0.01 ; ey=0.01
gsir_res <- gsir(x,x,y,"scalar",ex,ey,1,1,1)
# }

Run the code above in your browser using DataLab