compute_norm_pairwise_max: Title Compute normalised maximum pairwise distances

View source: R/compute_norm_pairwise_max.R

compute_norm_pairwise_maxR Documentation

Title Compute normalised maximum pairwise distances

Description

Title Compute normalised maximum pairwise distances

Usage

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

Arguments

.data

data for which mmpd needs to be calculated

gran_x

granularities mapped across x levels

gran_facet

granularities mapped across facetss

response

univarite response variable

quantile_prob

probabilities

dist_ordered

if categories are ordered

nperm

number of permutations required for normalisation

lambda

value of the tuning parameter for computing weighted pairwise distances

Value

the weighted pairwise distance normalised using permutation

Examples

library(dplyr)
library(parallel)
sm <- smart_meter10 %>%
  filter(customer_id %in% c("10017936"))
gran_x <- "week_month"
gran_facet <- "week_fortnight"
v <- compute_norm_pairwise_max(sm, gran_x, gran_facet,
  response = general_supply_kwh, nperm = 10
)
# month of the year not working in this setup

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