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

Description Usage Arguments Examples

View source: R/clusterTypicalDaysForOneClass.R

Description

Run a clustering algorithm for a given historical period. It creates clusters by gathering the most similar days and chooses 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

1
2
3
clusterTypicalDaysForOneClass(dates, vertices, nbCluster, hourWeight = rep(1,
  24), className = NULL, reportPath = getwd(), report = TRUE,
  id_start = 1, maxDomainSize = 10000)

Arguments

dates

character, vector of date (format YYYY-MM-DD).

vertices

data.table, 5 columns :

  • Date : date (

  • Period : Hour (1:24), period i corresponds to the hourly time-step [i-1 ; i]

  • BE : belgium vertices

  • DE : german vertices

  • FR : french vertices

This parameter can be obtained with the function ptdfToVertices.

nbCluster

numeric, number of clusters

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.

className

character, name of the class characterizing the studied time period

reportPath

character, path where the report is written. Defaut to getwd()

report

boolean, if TRUE, reports are generated.

id_start

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
library(data.table)
vertices <- fread(system.file("dataset/vertices_example.txt",package = "flowBasedClustering"))
dates <- seq(as.Date("2016-08-09"), as.Date("2018-09-01"), by = "day")
hourWeight = rep(1, 24)

out1 <- clusterTypicalDaysForOneClass(vertices = vertices,
                                      dates = dates, nbCluster = 2,
                                      className = "myName", id_start = 5, report = FALSE)

out2 <- clusterTypicalDaysForOneClass(vertices = vertices,
                                      dates = dates, nbCluster = 4,
                                      className = "myName2", id_start = 7, report = FALSE)

rbindlist(list(out1, out2))

rte-antares-rpackage/flowBasedClustering documentation built on Nov. 21, 2020, 11:21 a.m.