View source: R/select_harmonies.R
select_harmonies | R Documentation |
Select harmonies with significant patterns
select_harmonies( .data, harmony_tbl = NULL, response = NULL, quantile_prob = seq(0.01, 0.99, 0.01), dist_ordered = TRUE, lambda = 0.67, nperm = 200, use_perm = TRUE, nsamp = 200 )
.data |
a tsibble or data with already computed categories |
harmony_tbl |
A tibble containing one or more hamronies with facet_variable, x_variable, facet_levels and x_levels |
response |
the response variable |
quantile_prob |
numeric vector of probabilities with value #'in [0,1] whose sample quantiles are wanted. Default is set to #' "decile" plot |
dist_ordered |
if categories are ordered |
lambda |
value of tuning parameter for computing weighted pairwise distances |
nperm |
number of permutations for normalization |
use_perm |
should permutation approach for normalization be used |
nsamp |
number of permutation for computing the threshold |
## Not run: library(parallel) library(dplyr) library(tidyr) sm <- smart_meter10 %>% filter(customer_id %in% c("10017994")) harmonies <- sm %>% harmony( ugran = "year", filter_in = "wknd_wday", filter_out = c("hhour", "fortnight", "quarter", "semester") ) harmonies1 <- harmonies %>% mutate(facet_variable = NA) h <- harmonies1 %>% select(-facet_levels) %>% distinct() %>% dplyr::mutate(facet_levels = NA) all_harmony <- select_harmonies(sm, harmony_tbl = h, response = general_supply_kwh, nperm = 200, nsamp = 20 ) all_harmony2 <- select_harmonies(sm, harmony_tbl = harmonies, response = general_supply_kwh, nperm = 20, nsamp = 20 ) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.