compute_pairwise_dist: Title computing all within and between facet distances...

View source: R/compute_pairwise_dist.R

compute_pairwise_distR Documentation

Title computing all within and between facet distances between quantile categories given a data

Description

Title computing all within and between facet distances between quantile categories given a data

Usage

compute_pairwise_dist(
  .data,
  gran_x = NULL,
  gran_facet = NA,
  response = NULL,
  quantile_prob = seq(0.01, 0.99, 0.01),
  dist_ordered = TRUE,
  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 facets

response

univarite response variable

quantile_prob

probabilities

dist_ordered

if categories are ordered

lambda

value of tuning parameter for computing weighted pairwise distances

Value

the raw weighted pairwise within-facet and between-facet distances

Examples

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

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