Skip to contents

Follows the five steps of Section 2.3 of BCB's Technical Note 57 (Dec/2025): items are sorted by price change, 20\ each tail, boundary items are kept with their partial weight, and the core is the weighted mean of the remaining items with normalised weights.

Usage

core_ma(data, change, weight, date, trim = 0.2)

Arguments

data

Dataframe object with inflation items data.

change

A string with the column name of the percentage change of the inflation items.

weight

A string with the column name of the weight of the inflation items.

date

A string with the name of the date column.

trim

Share of the cumulative weight trimmed from each tail (BCB uses 0.2).

Value

Calculated core inflation tibble.

Author

Fernando da Silva <fernando@fortietwo.com>

Examples

if (FALSE) { # \dontrun{
library(magrittr)
library(dplyr)

ipca_ma <- get_ipca(period = "all") %>%
group_desc() %>%
dplyr::filter(group == "Item") %>%
core_ma(., "pct_change", "weight", "date")
} # }