Regression between 2 rasters

21 views
Skip to first unread message

Diego García Díaz

unread,
Apr 16, 2015, 9:03:49 AM4/16/15
to rsgislib...@googlegroups.com
Hi,

Can I perform a regression line between 2 rasters with rsgislib? I have seen the correlation and covariance, but I would need to get the regression equation in order to get the intercept, slope and r_value.

Thanks in advance

Pd. If not possible, does anybody knows how to do this with python or R?

Daniel Clewley

unread,
Apr 16, 2015, 4:45:41 PM4/16/15
to Diego García Díaz, RSGISLib Support
Hi,

In imagecalc there is a function to perform a linear regression for column of pixels http://rsgislib.org/rsgislib_imagecalc.html#rsgislib.imagecalc.imagePixelLinearFit (have just updated the docs for it).

If this doesn’t do what you need (or for any other tasks you might need to do) I would use the RIOS Python library (https://bitbucket.org/chchrsc/rios/wiki/applier/simpleexample). You create a function which works on a block of pixel values, represented as a NumPy array and the library applies this to the image (it reads a block of data at a time so will operate on massive images). As it uses NumPy arrays you can use any of the features in NumPy, SciPy etc.

RIOS is also available through conda:

conda install -c osgeo rios

Hope this helps,

Dan

--
You received this message because you are subscribed to the Google Groups "RSGISLib Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rsgislib-suppo...@googlegroups.com.
To post to this group, send email to rsgislib...@googlegroups.com.
Visit this group at http://groups.google.com/group/rsgislib-support.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages