Description Usage Arguments Value Author(s) References See Also Examples
This function conducts a Seasonal Trend Decomposition using Loess (STL) from raster time series using "stlplus" package especially designed to handle gappy time series.
1 2 3 4 |
rasterts |
Input raster time series as |
rastermask |
Either a |
gapfill |
Character. Defines the algorithm to be used to interpolate pixels with incomplete temporal profiles.
Accepts argument supported as method in function |
cores |
Integer. Defines the number of CPU to be used for multicore processing. Default to "1" core for singlecore processing. |
n.p |
Integer. Argument to be passed to function |
s.window |
Argument to be passed to function |
t.window |
Integer. Argument to be passed to function |
s.degree |
Integer. Argument to be passed to function |
t.degree |
Integer. Argument to be passed to function |
only.statistics |
Logical. If TRUE returns only the statistics from seasonal, trend and remainder components. |
keep.original |
Logical. If TRUE returns the original raster time series values in the 'rts' slot of |
... |
Additional arguments to be passed through to function |
Object of class STDstack-class
containing the following components:
std | Seasonal Trend Decomposition method used | |
mask | Final raster mask of computed pixels as RasterLayer object |
|
seasonal_amplitude | Amplitude of seasonal component (statistic) as RasterLayer object |
|
seasonal_amplitude_stdev | Standard deviation computed from the amplitude of seasonal component (statistic) as RasterLayer object (only returned when running function rtsa.seas ) |
|
trend_slope | Trend slope computed from trend component (yearly statistic) as RasterLayer object |
|
residual_stdev | Standard deviation computed from the remainder component (statistics) as RasterLayer object |
|
rts | Input raster time series as RasterBrickTS object (only returned if keep.original = TRUE ) |
|
seasonality | Seasonal component as RasterBrickTS object |
|
trend | Trend component as RasterBrickTS object |
|
seasonaladjtrend | Seasonal adjusted trend component as RasterBrickTS object (only returned when running function rtsa.seas ) |
|
remainder | Remainder component as RasterBrickTS object |
|
Federico Filipponi
Cleveland, R.B., Cleveland, W.S., Terpenning, I. (1990). STL: A seasonal-trend decomposition procedure based on loess. Journal of Official Statistics, 6(1), 3.
Hafen, R.P. (2010). Local regression models: Advancements, applications, and new methods. West Lafayette, Indiana: Purdue University, PhD dissertation, pp. 279.
stlplus
, rtsa.seas
, rtsa.gapfill
, seas
, stl
, decompose
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
## create raster time series using the 'pacificSST' data from 'remote' package
require(remote)
data(pacificSST)
pacificSST[which(getValues(pacificSST == 0))] <- NA # set NA values
# create rts object
rasterts <- rts(pacificSST, seq(as.Date('1982-01-15'), as.Date('2010-12-15'), 'months'))
## generate raster mask
raster_mask <- pacificSST[[1]] # create raster mask
names(raster_mask) <- "mask"
values(raster_mask) <- 1 # set raster mask values
raster_mask[which(is.na(getValues(pacificSST[[1]])))] <- 0 # set raster mask values
## compute Seasonal Trend Decomposition analysis
# compute 'STL'
std_result <- rtsa.stl(rasterts=rasterts, rastermask=raster_mask)
# compute STL' with multiple cores support and returning the original raster values
std_result <- rtsa.stl(rasterts=rasterts, rastermask=raster_mask, cores=2, keep.original=TRUE)
# compute STL' using additional arguments to define loess window
std_result <- rtsa.stl(rasterts=rasterts, rastermask=raster_mask, n.p=12, t.window=48)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.