This conducts directional regression (DR) as in Li (2018) with modifications to improve speed and to allow for the option of standardizing and regularizing
dr(x, y, nslices, d, ytype, lambda = 0)
a 'n x p' matrix of predictors; n sample size, p dimension
a scalar response
specify the number of slices to conduct;
specify the reduced dimension
specify the response as 'continuous' or 'categorical'
a L2 or Tikonov regularizer for the sample covariance matrix; default is '0', i.e. no regularization
A list containing both the estimate and candidate matrix.
beta - A 'pxd' matrix that estimates a basis for the central subspace.
cand_mat - The candidate matrix for DR; this is used in other functions for order determination.
Standardizing is the default as it is necessary for recovering the properly scaled central subspace. However, in certain contexts, the standardization is not necessary, and so we leave this option open to the practitioner.
The L2-regularization option corresponds to the SIR regularization idea by Zhang et al.(2005). While they do not apply the idea to SAVE, we find that the context is analogous and that such a regularization works.