getProbability: Classify the typical days by searching for external factors...

View source: R/getProbability.R

getProbabilityR Documentation

Classify the typical days by searching for external factors (e.g. climate factors) explaning the occurence of a particular typical day

Description

Classify the typical days by searching for external factors (e.g. climate factors) explaning the occurence of a particular typical day

Usage

getProbability(climate, cluster, levelsProba = c(1/3, 2/3),
  extrapolationNA = TRUE, writeProba = FALSE, outputFile = tempdir())

Arguments

climate

data.table, the first column contains the dates (header : Date, format : YYYY-MM-DD), other columns are external variable whose name must be given in the header. Data should be given with a daily time step.

cluster

data.table output of clusteringTypicalDays or clusterTypicalDaysForOneClass

levelsProba

numeric or list. if numeric, contains a vector of quantiles which will be used for all external variables and classes. if list, quantiles are described independenly for each class and each external variable (see examples below)

extrapolationNA

logical should NA values of the matrix be extrapolated (TRUE) or not (FALSE)

writeProba

logical if you want to save the result in a rds file.

outputFile

character a folder where the rds result is saved

Examples


## Not run: 
# load climate daily time serires
library(data.table)
climate <- fread(system.file("testdata/climate_example.txt",package = "fbClust"))

# load clustering results (or build them with clusteringTypicalDays function())
clusterTD <- readRDS(system.file("testdata/allTypDays.rds", package = "fbClust"))

# get Probability matrices
MatProb <- getProbability(climate, clusterTD)


clusterTD[, Class := c("Class1", "Class2")]
levelsProba <- list(Class1 = list(FR_load = c(0.5), DE_wind = c(1/3, 2/3), DE_solar = .5),
                   Class2 = list(FR_load = c(0.5, 0.7), DE_wind = c(.5))
)

)
MatProb <- getProbability(climate, clusterTD, levelsProba = levelsProba, extrapolationNA = FALSE)
MatProb2 <- getProbability(climate, clusterTD, levelsProba = levelsProba, extrapolationNA = TRUE)


## End(Not run)

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