clusteringTypicalDays: Generate a set of flow-based typical days on one time period

View source: R/ClusteringTypicalDays.R

clusteringTypicalDaysR Documentation

Generate a set of flow-based typical days on one time period

Description

Run a clustering algorithm on the different classes of the calendar (getCalendar) Its principle is to create clusters by gathering the most similar days of each class and to choose among them the best representative: it will be a so-called typical day. The metric used to determine the similarity of two days is a weighted sum of 24 hourly distances, meaning the distances between the domains of the two days at the same hour.

Usage

clusteringTypicalDays(calendar, PLAN, VERT = NULL, hubDrop = list(NL =
  c("BE", "DE", "FR", "AT")), nbClustWeek = 1, nbClustWeekend = 1,
  hourWeight = rep(1, 24), idStart = 1, maxDomainSize = 20000,
  ponderate = FALSE)

Arguments

calendar

list, vector of date for each period. Can be obtain with getCalendar

PLAN

data.table, at least ram, Date, Period and two ptdf columns :

  • ptdfAT : autrichian vertices

  • ptdfBE : belgium vertices

  • ptdfDE : german vertices

  • ptdfFR : french vertices

  • ram : line limits

  • Date : date in format YYYY-MM-DD

  • Period : hour in the day, between 1 and 24

PLAN is generated in this format with the function getPreprocPlan

VERT

data.table, the same Date, Period and ptdf we have in PLAN. Default = NULL This parameter can be obtained with the function getVertices.

hubDrop

list, list of hubs in the ptdf, with the ones which should sustracted to the others as the names of the arrays which themself contain the ones which be sustracted

nbClustWeek

numeric, number of clusters for week period(working days). Defaut to 3

nbClustWeekend

numeric, number of clusters for weekend period. Defaut to 1

hourWeight

numeric, vector of 24 weights, one for each hour of the day. The clustering algorithm will be more accurate for the flow-based domains of the hours with a relatively higher weight.

idStart

numeric, first identifier of the returned typical days. Default value is 1

maxDomainSize

numeric limit of domain size in each axis. The function will return an error if one domain or more exceed these limits.

ponderate

logical if TRUE, each angular sector have the same weight in the clustering metric. E.g. BE and FR imports, DE and NL exports is one sector.

Examples


## Not run: 
library(data.table)
library(quadprog)
PLAN <- readRDS(system.file("testdata/plan_test2.rds", package = "fbClust"))
calendar <- list()
calendar$interSeasonWe <- c("2018-10-01", "2018-10-02")
calendar$interSeasonWd <- c("2018-10-03", "2018-10-04")
hubDrop <- list(NL = c("BE", "DE", "FR", "AT"))
hourWeight = rep(1, 24)
nbClustWeek <- 1
nbClustWeekend <- 1
maxDomainSize <- 20000
 clusteringTypicalDays(
 calendar = calendar, PLAN = PLAN, VERT = NULL, hubDrop = hubDrop,
 maxDomainSize = maxDomainSize, nbClustWeek = nbClustWeek, 
 nbClustWeekend = nbClustWeekend, hourWeight = hourWeight)


## End(Not run)


rte-antares-rpackage/fbClust documentation built on July 4, 2023, 12:06 a.m.