cpi_inflator {grattanInflators} | R Documentation |
CPI inflator
Description
CPI inflator
Usage
cpi_inflator(
from = NULL,
to = NULL,
series = c("seasonal", "original", "trimmed.mean", "monthly-original",
"monthly-seasonal", "monthly-excl-volatile"),
fy_month = 3L,
x = NULL,
check = 1L,
nThread = getOption("grattanInflators.nThread", 1L)
)
cpi_seasonal(..., FORECAST = FALSE, LEVEL = "mean")
cpi_original(..., FORECAST = FALSE, LEVEL = "mean")
cpi_trimmed_mean(..., FORECAST = FALSE, LEVEL = "mean")
cpi_monthly_original(..., FORECAST = FALSE, LEVEL = "mean")
cpi_monthly_seasonal(..., FORECAST = FALSE, LEVEL = "mean")
cpi_monthly_excl_volatile(..., FORECAST = FALSE, LEVEL = "mean")
Arguments
from , to |
Times for which the inflator is desired. If |
series |
Which CPI series to use. |
fy_month |
An integer 1-12, the month to be used for
years and financial years in |
x |
(Advanced) A vector that will be inflated in-place. If |
check |
|
nThread |
Number of threads to use. |
... |
Set of date-rate pairs for custom CPI series in the future. |
FORECAST |
Whether the series should be extended via an ETS forecast. |
LEVEL |
If 'FORECAST = TRUE' what prediction interval should be used. ('LEVEL = 20' means the lower end of an 80% prediction interval.) If 'LEVEL = "mean"' (the default), the central estimate is used. |
Value
If 'x' is 'NULL', the default, a numeric vector matching the lengths of 'from' and 'to' equal to the inflators by which nominal prices dated 'from' must be multiplied so that they are in 'to' real terms.
If 'x' is numeric, it is taken to be prices dated 'from' and the value returned is 'x' in 'to' real terms.
Examples
cpi_inflator(1995, 2019) # Inflation from 1995 to 2019
cpi_inflator("2015-16", "2016-17")
cpi_inflator("2015-01-01", "2016-01-01")
if (Sys.Date() < as.Date("2029-01-01")) {
cpi_inflator("2030-01-01", "2031-01-01",
series = cpi_original(2030, 0.1))
cpi_inflator("2030-01-01", "2031-01-01",
series = cpi_original(0.1))
cpi_inflator("2030-01-01", "2032-01-01",
series = cpi_original(2030, 0.1, 2031, 0.1, 2032, 0))
}