Risk_Objective_Import: Import Risk Objective data from Excel file

Description Usage Arguments Details Value See Also Examples

View source: R/Risk_Objective.R

Description

Risk_Objective_Import imports the Risk objective's data from an excel file. The required data are a sheet containing parcels' Sigma and a sheet containing parcels' Correlation.
Function creates a list named Risk_Objective, where Risk_Objective[["Sigma"]] stores the the sigmas of parcels, Risk_Objective[["Correlation"]] stores the the Correlation of parcels.
This function is not sensitive to the order the parcels are stored in the sheet and will automatically store parcels sorted with the same order they were stored in Parcels.

Usage

1
2
3
Risk_Objective_Import(Address, Sigma_Sheet = "Sigma",
                             Correlation_Sheet= "Correlation", Silence = FALSE,
                             Env= .GlobalEnv)

Arguments

Address

A string: the location and name of the excel file.

Sigma_Sheet

A string: the name of the sheet holding the parcels' sigmas' data. (Default: "Sigma")

Correlation_Sheet

A string: the name of the sheet holding the parcels' Correlations' data. (Default: "Correlation")

Silence

A binary parameter: if FALSE, the function will report a summary message. If TRUE, the function will be silent. (Default: FALSE)

Env

the environment where the package should create or access variables. By default the package works in the R's Global environment. (Default: .GlobalEnv)

Details

Risk objective is a quadratic function representing the portfolio optimization problem, and this function is to be Minimized. The optimal value for this objective is zero and the optimal solution is to have all parcels divested (unprotected). Therefore, there is no single objective optimizer for this objective, as its optimal solution is priorly known. (For more information refer to the paper)

To import the data, the excel file should include two sheets. A sheet including parcels' sigmas, and the name of the sheet is passed as Sigma_Sheet.
The first row of this sheet will be ignored as captions. The first column of the sheet should include names, and the second column should include sigmas.
Here is an example Sigma table:


The second sheet should include the matrix of parcels' correlation, and the name of the sheet is passed as Correlation_Sheet.
The first row of this sheet will be ignored. If the problem has n parcels, then the correlation sheet should have n+1 columns. The first column of the sheet should include names and the other n columns should have the n*n correlation matrix. The Correlation matrix should be a symmetric matrix whose diogonal elements are all one.
The member in the i+1'th row and j+1'th column will then be the correlation between the parcels whose names are in the i+1 and j+1 row in the first column. Remember the first column has the parcel names.
Here is an example Correlation table:

Example Plot Title

Value

NULL (creates some variables in the environment but returns nothing)

See Also

Other Risk Objective: Risk_Objective_Create()

Other Import Functions: First_Objective_Import(), Import_data(), Parcels_Import(), Second_Objective_Import()

Examples

1
2
3
4
5
6
## Not run: 

Risk_Objective_Import("C:\\example.xlsx", Sigma_Sheet = "Sigma",
                      Correlation_Sheet= "Correlation")

## End(Not run)

paymanghasemi/SiteOpt documentation built on April 8, 2021, 3:44 a.m.