Code in Python with the implementation of the dimensionality reduction method described in:
Dimensionality Reduction via Regression in Hyperspectral Imagery. V. Laparra, J. Malo & G. Camps-Valls IEEE Journal of selected topics in signal processing, (2015)
It also includes an example on how to extend the method to equalize second order terms.
https://arxiv.org/abs/1602.00214
https://www.uv.es/lapeva/papers/2015_JSTSP.pdf
Matlab Code: http://isp.uv.es/drr.html
R Code: https://github.com/gdkrmr/DRR