The goal of fdatest is to implement various statistical methods for domain selection in functional data analysis, that is selecting a subset of the domain where the difference between two populations is significant. The package is based on the paper by Abramowicz et al. (2022) and Pini & Vantini (2017).
You can install the package from CRAN with:
install.packages("fdatest")
Alternatively, You can install the development version of fdatest from GitHub with:
# install.packages("pak")
pak::pak("permaverse/fdatest")
The package provides several methods for domain selection, including:
You can use these methods to test for significant differences between
two populations of functional data. Here is an example using the TWT2
method on the NASA temperatures data set:
library(fdatest)
# Performing the TWT for two populations on the NASA temperatures data set
withr::with_seed(1234, {
out <- TWT2(NASAtemp$paris, NASAtemp$milan)
})
#> Warning: `TWT2()` was deprecated in fdatest 0.2.0.
#> ℹ Use twt2() instead. Be mindful that the argument `statistic` has been
#> replaced by `aggregation_strategy` and `standardize`.
#> This warning is displayed once per session.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
#> generated.
# Plotting the results of the TWT
plot(
out,
xrange = c(0, 12),
main = "TWT results for testing mean differences"
)