compute_pairwise_norm_scalar: Title Compute scalar normalised pairwise distances

Description Usage Arguments Value Examples

View source: R/compute_pairwise_norm_scalar.R

Description

Title Compute scalar normalised pairwise distances

Usage

1
2
3
4
5
6
7
8
9
compute_pairwise_norm_scalar(
  .data,
  gran_x = NULL,
  gran_facet = NULL,
  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 facetss

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 weighted pairwise distance normalised through modeling raw distances as a function of total number of categories

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(tidyverse)
library(gravitas)
library(parallel)
sm <- smart_meter10 %>%
  dplyr::filter(customer_id %in% c("10017936"))
gran_x <- "day_week"
gran_facet <- "month_year"
v <- compute_pairwise_norm_scalar(sm, gran_x, gran_facet,
  response = general_supply_kwh, lambda = 0.67
)
# month of the year not working in this setup

Sayani07/hakear documentation built on Sept. 14, 2021, 10:59 a.m.