Read an Estimate from CSV - File.
This function reads an
estimate from the specified csv files. In this context, an
estimate of several variables is defined by its marginal distribution types, its marginal
[lower,upper] and, optionally, its correlations.
estimate_read_csv_old reads an estimate from CSV file(s) according to the deprecated
standard. This function is for backward compatibility only.
1 2 3
Name of the file containing the marginal information of the estimate that should be read.
logical. Used only when
Further parameters to be passed to
An estimate might consists of uncorrelated and correlated variables. This is reflected in the input file structure, which is described in the following.
CSV input file structures
The estimate is read from one or two csv files: the marginal csv file which is mandatory and the correlation csv file which is optional. The marginal csv file contains the definition of the distribution of all variables ignoring potential correlations. The correlation csv file only defines correlations.
The structure of the marginal distributions input file (mandatory)
File name structure:
|| ||Variable names|
|| ||Marginal distribution types|
|| ||Marginal 5%-quantiles|
|| ||Marginal 95%-quantiles|
Frequent optional columns are:
|| ||Short description of the variable.|
|| cf. ||Marginal 50%-quantiles|
|| ||Methods for calculation of marginal distribution parameters|
Columns without names are ignored. Rows where the
variable field is empty are also dropped.
The structure of the correlation file (optional)
File name structure:
Columns and rows are named by the corresponding variables. Only those variables need to be present which are correlated with others.
["rowname","columnname"] contains the correlation between the variables
columnname. Uncorrelated elements have to be set to
["name","name"] has to be set to
The matrix must be given in symmetric form.
Deprecated input standard (
File name structure of the correlation file:
An object of type
estimate which element
$marginal is read from
fileName and which element
$correlation_matrix is read from file
1 2 3 4 5 6 7 8 9 10 11 12 13
# Read the joint estimate information for the variables "sales", "productprice" and # "costprice" from file: ## Get the path to the file with the marginal information: marginalFilePath=system.file("extdata","profit-4.csv",package="decisionSupport") ## Read the marginal information from file "profit-4.csv" and print it to the screen as ## illustration: read.csv(marginalFilePath, strip.white=TRUE) ## Read the correlation information from file "profit-4_cor.csv" and print it to the screen as ## illustration: read.csv(gsub(".csv","_cor.csv",marginalFilePath), row.names=1) ## Now read marginal and correlation file straight into an estimate: parameterEstimate<-estimate_read_csv(fileName=marginalFilePath) print(parameterEstimate)