List with two items: the correlation or (weighted) covariance matrix, and the (weighted) means.
RasterStack or RasterBrick for which to compute a statistic
Character. The statistic to compute: either 'cov' (covariance), 'weighted.cov' (weighted covariance), or 'pearson' (correlation coefficient)
RasterLayer with the weights (should have the same extent, resolution and number of layers as x) to compute the weighted covariance
Logical. If TRUE, the statistic for a sample (denominator is n-1) is computed, rather than for the population (denominator is n)
Logical. Should missing values be removed?
Additional arguments (none implemetned)
Jonathan A. Greenberg & Robert Hijmans. Weighted covariance based on code by Mort Canty
For the weighted covariance:
Canty, M.J. and A.A. Nielsen, 2008. Automatic radiometric normalization of multitemporal satellite imagery with the iteratively re-weighted MAD transformation. Remote Sensing of Environment 112:1025-1036.
Nielsen, A.A., 2007. The regularized iteratively reweighted MAD method for change detection in multi- and hyperspectral data. IEEE Transactions on Image Processing 16(2):463-478.