MC.summary: Summary statistics computation of Monte Carlo simulation

View source: R/MC.summary.R

MC.summaryR Documentation

Summary statistics computation of Monte Carlo simulation

Description

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

Usage

MC.summary(p1, data)

Arguments

p1

The independient variable. A dataframe object with two columns and number of rows equal to the number of rows of the Monte Carlo simulated data. The first column, named "time", contains the vector of time of the time series in format POSIXct. The second column contains the observations of the time series.

data

A matrix or a dataframe that contains the results of a Monte Carlo simulation, with number of rows equal to the number of Monte Carlo realizations and number of columns equal to the number of oservations i.e. equal to the number of rows of "p1".

Details

This function is internally invoked by the MC.analysis function to compute the summary statistics of the Monte Carlo simulation under analysis.

Value

A dataframe with n observations of 15 variables, where n is the number of columns of the "data" argument. The 15 variables are time series with the summary statistics of the Monte Carlo data: 1) idx: an index for the dataset equal to 1; 2) Mean: the mean; 3) Sd: the standard deviation; 4) Variance, the variance; 5) q05: the five percent quantile; 6) q25: the 25 percent quantile; 7) q50: the 50 percent quantile; 8) q75: the 75 percent quantile; 9) q95: the 95 percent quantile; 10) q995: the 99.5 percent quantile; 11) q999: the 99.9 percent quantile; 12) Max: the maximum; 13) Sum: the sum; 14) time: the time; 15) p1: the independient variable.

Author(s)

J.A. Torres-Matallana

Examples

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)

stUPscales documentation built on Sept. 18, 2023, 9:07 a.m.