MC.summary.agg: Summary statistics computation of aggregated Monte Carlo...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/MC.summary.R

Description

A function that computes the summary statistics of aggregated Monte Carlo simulation result.

Usage

1
MC.summary.agg(summ, det, delta, func.agg, func.agg.p)

Arguments

summ

A dataframe with n observations of 15 variables, where n is the number observations or time steps of the data. The 15 variables are time series with the summary statistics of the Monte Carlo data. This dataframe is in the format as is described in the MC.summary function value.

det

A dataframe that contains the deterministic simulation.

delta

A numeric value that represents the level of aggregation (required time stemp) in minutes.

func.agg

The aggregation function to be applied to the summ dataframe.

func.agg.p

The aggregation function to be applied to the independient variable p1 from summ dataframe.

Value

A dataframe containing the summ data aggregated to the level defined by delta

Author(s)

J.A. Torres-Matallana

See Also

See Also as MC.summary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(stUPscales)
library(EmiStatR)

data(P1)
colnames(P1)

new_data <- t(matrix(data = rep(runif(nrow(P1), 10, 100), 5), nrow = nrow(P1), ncol = 5))
new_summary <- MC.summary(p1 = P1, data = new_data)
str(new_summary)
head(new_summary)

# deterministic simulation
det <- rnorm(nrow(P1), 45, .15)

# level of aggregation
delta <- 60*2 # 2 hours

new_summary_agg <- MC.summary.agg(summ = new_summary, det, delta, func.agg = mean, func.agg.p = sum)
str(new_summary_agg)
head(new_summary_agg)

stUPscales documentation built on May 6, 2019, 1:08 a.m.