rtsa.seas: Raster time series Seasonal Adjustment analysis using X-11...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/rtsa.seas.R

Description

This function conducts a Seasonal Adjustment analysis using X-11 and X-13ARIMA-SEATS methods from monthly raster time series using "seasonal" and "x13binary" packages.

Usage

1
2
3
rtsa.seas(rasterts, rastermask = NULL, method = "x11", gapfill = "none",
  cores = 1L, only.statistics = FALSE, keep.original = FALSE,
  verbose = FALSE)

Arguments

rasterts

Input raster time series as RasterStackTS or RasterBrickTS object.

rastermask

Either a RasterLayer or "compute". Raster layer to use as a mask. When "compute" is set raster mask is computed to remove all pixels with incomplete time series.

method

Character. Defines the method to be used for the Seasonal Adjustment analysis. Accepts argument 'x11' (default) or 'x13'.

gapfill

Character. Defines the algorithm to be used to interpolate pixels with incomplete temporal profiles. Accepts argument supported as method in function rtsa.gapfill.

cores

Integer. Defines the number of CPU to be used for multicore processing. Default to "1" core for singlecore processing.

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 STDstack-class object.

...

Additional arguments to be passed through to function seas.

Value

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
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
remainder Remainder component as RasterBrickTS object

Author(s)

Federico Filipponi

References

Shiskin, J., Young, A.H., Musgrave, J.C. (1967). The X-11 variant of the Census Method II seasonal adjustment program. Technical Paper No. 15, U.S. Department of Commerce, U. S. Census Bureau.

Dagum, E.B. (1978). Modelling, forecasting and seasonally adjusting economic time series with the X-11 ARIMA method. Journal of the Royal Statistical Society. Series D (The Statistician), 27(3/4), 203-216.

Comprehensive list of R examples from the X-13ARIMA-SEATS manual: manual

Official X-13ARIMA-SEATS manual: pdf

See Also

seas, stlplus, rtsa.seas, rtsa.gapfill, stl, decompose

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## 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
# subset input for faster processing
pacificSST_clip <- crop(pacificSST, extent(260, 290, -15, 15))
# create rts object
rasterts <- rts(pacificSST_clip, seq(as.Date('1982-01-15'), as.Date('2010-12-15'), 'months'))

## generate raster mask
raster_mask <- pacificSST_clip[[1]] # create raster mask
names(raster_mask) <- "mask"
values(raster_mask) <- 1 # set raster mask values
raster_mask[which(is.na(getValues(pacificSST_clip[[1]])))] <- 0 # set raster mask values

## compute Seasonal Adjustment analysis
# use 'x11' (X-11) method to compute only adjusted seasonal trend decomposition statistics
std_x11_stats <- rtsa.seas(rasterts, rastermask=raster_mask, method="x11", only.statistics=TRUE)
# use 'x11' (X-11) method
std_x11_result <- rtsa.seas(rasterts=rasterts, rastermask=raster_mask, method="x11")
# use 'x13' (X-13ARIMA-SEATS) method
std_x13_result <- rtsa.seas(rasterts=rasterts, rastermask=raster_mask, method="x13")
# use 'x11' (X-11) method with multiple cores support and returning the original raster values
std_x11_res <- rtsa.seas(rasterts=rasterts, rastermask=raster_mask, cores=2, keep.original=TRUE)

## End(Not run)

ffilipponi/rtsa documentation built on Oct. 18, 2019, 12:37 a.m.