View source: R/opcg_wrap_cpp.R
opcg | R Documentation |
This implements the Outer Product of Canonical Gradients (OPCG) in a forth coming paper Quach and Li (2021).
opcg( x, y, d, bw, lambda = 0, ytype = "continuous", method = "newton", parallelize = F, r_mat = NULL, control_list = list() )
x |
a 'nxp' matrix of predictors; |
y |
a 'nxm' response |
d |
specified the reduced dimension |
bw |
the bandwidth parameter for the kernel; the default kernel is gaussian |
ytype |
specify the response as 'continuous', 'multinomial', or 'ordinal' |
method |
"newton" or "cg" methods; for carrying out the optimization using the standard newton-raphson (i.e. Fisher Scoring) or using Congugate Gradients |
parallelize |
Default is False; to run in parallel, you will need to have foreach and some parallel backend loaded; parallelization is strongly recommended and encouraged. |
control_list |
a list of control parameters for the Newton-Raphson or Conjugate Gradient methods
|
The kernel for the local linear regression is fixed at a gaussian kernel.
For large 'p', we strongly recommend using the Conjugate Gradients implement, by setting method="cg". For method="cg", the hybrid conjugate gradient of Dai and Yuan is implemented, but only the armijo rule is implemented through backtracking, like in Bertsekas' "Convex Optimization Algorithms". A weak Wolfe condition can also be enforced by adding setting c_wolfe > 0 in the control_list, but since c_wolfe is usually set to 0.1 (Wikipedia) and this drastically slows down the algorithm relative to newton for small to moderate p, we leave the default as not enforcing a Wolfe condition, since we assume that our link function gives us a close enough initial point that local convergence is satisfactory. Should the initial values be suspect, then maybe enforcing the Wolfe condition is a reasonable trade-off.
A 'pxd' matrix that estimates a basis for the central subspace based on the estimated local gradients
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.