Library: | metrics |
See also: | sir sssm |
Quantlet: | sir2 | |
Description: | Calculates the effective dimension-reduction (edr) directions by Sliced Inverse Regression II (Li, 1991) |
Usage: | {edr, eigen} = sir (x, y, h) | |
Input: | ||
x | n x p matrix, the explonatory variable | |
y | n vector, the dependent variable | |
h | scalar, number of slices (h>=2) width of slice (0 < h < 1) elements in a slice (-h) | |
Output: | ||
edr | p x p matrix containing estimates for the edr | |
eigen | p vector of the eigenvalues |
library("metrics") randomize(10178) x = normal(300, 3) b = #(1, 0 ,1) y = sin(x*b) + normal(300) b = sir2(x, y, -20) b.edr b.eigen
estimates of the edr, b.edr, and the eigenvalues, b.eigen