compute_pairwise_norm: Title Compute normalised mmpd

View source: R/compute_pairwise_norm.R

compute_pairwise_normR Documentation

Title Compute normalised mmpd

Description

Title Compute normalised mmpd

Usage

compute_pairwise_norm(
  .data,
  gran_x = NULL,
  gran_facet = NULL,
  response = NULL,
  quantile_prob = seq(0.01, 0.99, 0.01),
  dist_ordered = TRUE,
  lambda = 0.67,
  nperm = 100,
  seed = 9000
)

Arguments

.data

data for which mmpd needs to be calculated

gran_x

granularities mapped across x levels

gran_facet

granularities mapped across facets

response

univarite response variable

quantile_prob

probabilities

dist_ordered

if categories are ordered

lambda

tuning parameter

nperm

number of permutations for normalization

seed

seed considered

Value

weighted pairwise distances normalized using permutation approach

Examples

library(dplyr)
library(parallel)
sm <- smart_meter10 %>%
  dplyr::filter(customer_id %in% c("10017936"))
gran_x <- "week_month"
gran_facet <- "wknd_wday"
v <- compute_pairwise_norm(sm, gran_x, gran_facet,
  response = general_supply_kwh, nperm = 20, lambda = 0.9
)
# month of the year not working in this setup

Sayani07/gravitas documentation built on June 18, 2022, 2:40 a.m.