Learn R Programming

stUPscales (version 1.0.3.5)

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

Description

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

Usage

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

Value

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

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.

Author

J.A. Torres-Matallana

See Also

See Also as MC.summary

Examples

Run this code
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)

Run the code above in your browser using DataLab