resIndSpatial: Runs function "resInd" on gridded time series and returns...

Description Usage Arguments Details Value Author(s) Examples

View source: R/resIndSpatial.R

Description

Computes several change detection metrics based on a BFAST type change detection framework for breakpoints ocurring during a given time period specified by the user (i.e. years of a known drought event). In addition, the overall number of breakpoints in the time series, the overall mean of the data and the inital value of the data at the beginning of the time series are extracted. Applicable to to gridded time-series data.

Usage

1
2
3
resIndSpatial(x, dates, type = "irregular", sc = 1, order = 3,
  formula = response ~ (trend + harmon), h = 0.15, plevel = 0.05, dr,
  drd, s = 3, NV = NA, mc.cores = 1)

Arguments

x

RasterBrick or rasterStack object

dates

See resInd

type

See resInd

sc

See resInd

order

See resInd

formula

See resInd

h

See resInd

plevel

See resInd

dr

See resInd

drd

See resInd

s

See resInd

NV

See resInd

mc.cores

Numeric. Number of cores used for the calcualtion. Default=1

Details

The function resInd was designed to explore several change detection metrics that can be extracted from a BFAST type change detection approach in relation to drought. The extracted metrics are at the experimental stage and should be used with caution. Not all metrics were found equally reliable: for an irregular time series the interecept of the linear trend line within segments (i.e. the height of the trend line after a breakpoint when plotted), was not stable. Therefore, the metrics relying directly on this information ('MagTrendA', 'MagTrendR') are equally not robust. The slope of the trend line within segments ('RecTrend','PreTrend') was found to be a robust model parameter, however, as well as the total number of breakpoints ('BPNumb'). The function "resIndSpatial" requires the function 'mc.calc' from the package "bfastSpatial" https://github.com/loicdtx/bfastSpatial, which you can install from github.

Value

Large Raster stack with 14 layers: 'BPNumb': Total number of breakpoints in time series 'Initial NDVI': Mean of data during the first "s" years of the time series. 'Intercept': Linear model intercept 'DBP': Drought Break Point yes/no (1/0). Yes, if a breakpoint occurs in time interval set with parameter "dr". 'BpTime': Timing of breakpoint. Format: Decimal year. If more than one breakpoints occurs during time interval, the first one is selected. 'Timelag': Number of days between drought reference day set with parameter "drd" and breakpoint 'RecTrend': Slope of linear trend in segment succeeding "drought breakpoint". 'PreTrend': Slope of linear trend in segment preceeding "drought breakpoint". 'PreNDVI': Mean of data of "s" years before drought breakpoint, based on observed data values. 'MagObsA': Absolute difference of mean observed data "s" years before and after the "drought breakpoint". 'MagObsR': Relative difference of mean observed data "s" years before and after the "drought breakpoint". 'MagTrendA': Absolute difference between last value of trend prediction before and first value of trend prediction after drought breakpoint. Based on corrected trend for irregular data. Still, with irregular data, the height of the trend line does not seem robust. 'MagTrendR': Relative difference between last value of trend prediction before and first value of trend prediction after drought breakpoint. Based on corrected trend for irregular data. Still, with irregular data, the height of the trend line does not seem robust. 'AmpDiffR': Relative difference in mean amplitudes (based on sine and cosine terms of harmonic model) in segment before and after drought breakpoint.

Author(s)

Jennifer von Keyserlingk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Load example raster data set (476 observations, 5x5 cells, including NA values) and date vector
data(stN) #raster brick
data(d) # date vector

#Plot first 9 layers of raster brick with NDVI scaling factor
sc <- 0.0001
library(raster)
plot(stN*sc, 1:9)

##With package "bfastSpatial" you can extract information on acquisition date
# from typical Landsat file names \url{https://github.com/loicdtx/bfastSpatial}
#gs <- getSceneinfo(names(stN))
#d <- gs$date

## Not run: 
#Run function "resIndSpatial". This requires the function 'mc.calc' from the
package "bfastSpatial", which you can install from github
# \url{https://github.com/loicdtx/bfastSpatial} .
y <- resIndSpatial(stN, d, dr=c(2004.753,2008.751), drd=2004.753)

#Should return a raster stack containing 14 layers

## End(Not run)

jennifervk/ChangeDetectionMetrics documentation built on Oct. 3, 2020, 12:07 p.m.