## NAME

r.regression.series - Makes each output cell value a function of the values assigned to the corresponding cells in the input raster map layers.

## KEYWORDS

raster, statistics, series, regression

## SYNOPSIS

r.regression.series
r.regression.series --help
r.regression.series [-n] xseries=name[,name,...] yseries=name[,name,...] output=name[,name,...] method=string[,string,...] [--overwrite] [--help] [--verbose] [--quiet] [--ui]

### Flags:

-n
Propagate NULLs
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--ui
Force launching GUI dialog

### Parameters:

xseries=name[,name,...] [required]
Name of input raster map(s)
yseries=name[,name,...] [required]
Name of input raster map(s)
output=name[,name,...] [required]
Name for output raster map
method=string[,string,...] [required]
Regression parameters
Options: slope, offset, corcoef, rsq, adjrsq, f, t

## DESCRIPTION

r.regression.series is a module to calculate linear regression parameters between two time series, e.g. NDVI and precipitation.

The module makes each output cell value a function of the values assigned to the corresponding cells in the two input raster map series. Following methods are available:

• offset: Linear regression offset
• slope: Linear regression slope
• corcoef: Correlation Coefficent R
• rsq: Coefficient of determination = R squared
• f: F statistic
• t: T statistic

## DESCRIPTION

The module assumes a simple linear regression of the form
```    y = a + b * x
```

offset is equivalent to a in the above equation, also referred to as constant or intercept.

slope is equivalent to b in the above equation.

corcoef is the correlation coefficient R with a theoretical range of -1,1.

rsq is the coefficient of determination, equivalent to the squared correlation coefficient R2.

adjrsq is the coefficient of determination adjusted for the number of samples, i.e. number of input maps per series.

f is the value of the F statistic.

t is the value of the T statistic.

## NOTES

The number of maps in xseries and yseries must be identical.

With -n flag, any cell for which any of the corresponding input cells are NULL is automatically set to NULL (NULL propagation). The aggregate function is not called, so all methods behave this way with respect to the -n flag.

Without -n flag, the complete list of inputs for each cell (including NULLs) is passed to the function. Individual functions can handle data as they choose. Mostly, they just compute the parameter over the non-NULL values, producing a NULL result only if all inputs are NULL.

Linear regression (slope, offset, coefficient of determination) requires an equal number of xseries and yseries maps. If the different time series have irregular time intervals, NULL raster maps can be inserted into time series to make time intervals equal (see example).

The maximum number of raster maps to be processed is limited by the operating system. For example, both the hard and soft limits are typically 1024. The soft limit can be changed with e.g. ulimit -n 1500 (UNIX-based operating systems) but not higher than the hard limit. If it is too low, you can as superuser add an entry in

```/etc/security/limits.conf
# <domain>      <type>  <item>         <value>
```
This would raise the hard limit to 1500 file. Be warned that more files open need more RAM.

## EXAMPLES

Using r.regression.series with wildcards:
```r.regression.series xseries="`g.list pattern='insitu_data.*' sep=,`" \
yseries="`g.list pattern='invivo_data.*' sep=,`" \
output=insitu_data.rsquared method=rsq
```

Note the g.list module also supports regular expressions for selecting map names.

Example for multiple parameters to be computed in one run (3 resulting parameters from 8 input maps, 4 maps per time series):

```r.regression.series x=xone,xtwo,xthree,xfour y=yone,ytwo,ythree,yfour \
```

r.series, r.regression.line, g.list, g.region

## AUTHOR

Markus Metz

Last changed: \$Date: 2014-10-29 00:11:08 +0100 (Wed, 29 Oct 2014) \$

## SOURCE CODE

Available at: r.regression.series source code (history)

© 2003-2018 GRASS Development Team, GRASS GIS 7.4.2svn Reference Manual