
Pre-transform tree-ring series using Baillie & Pilcher method
Source:R/trs_tbp_transform.R
trs_tbp_transform.Rd
Applies a 5-year centered moving average and computes the log index:
log(100 * value / MA5)
. Uses edge mirroring to maintain
constant window size and avoid NA values.
Examples
# Create sample data,
trs <- trs_pseudo_rwl(n_series = 5, series_length = 100, end_date = c(2020, 2025))
transformed <- trs_tbp_transform(trs)
head(transformed, 10)
#> trs_1 trs_2 trs_3 trs_4 trs_5
#> 1921 NA NA 4.611591 NA NA
#> 1922 4.649622 NA 4.603532 4.663278 NA
#> 1923 4.605170 NA 4.634158 4.635807 NA
#> 1924 4.584036 NA 4.562970 4.545451 4.605170
#> 1925 4.630737 4.717287 4.665490 4.628072 4.660406
#> 1926 4.625789 4.615533 4.688183 4.641102 4.605170
#> 1927 4.618445 4.554218 4.552420 4.570232 4.652087
#> 1928 4.631393 4.644121 4.570232 4.618593 4.676547
#> 1929 4.499810 4.529617 4.492746 4.489098 4.410301
#> 1930 4.462854 4.477657 4.551230 4.545106 4.465408