# individualEvpiSimulation: Individual Expected Value of Perfect Information Simulation In decisionSupport: Quantitative Support of Decision Making under Uncertainty

## Description

The Individual Expected Value of Perfect Information (Individual EVPI) is calculated based on a Monte Carlo simulation of the values of two different decision alternatives.

## Usage

 ```1 2 3 4 5 6 7 8``` ```individualEvpiSimulation(welfare, currentEstimate, perfectProspectiveNames = row.names(currentEstimate), perfectProspectiveValues = colMeans(as.data.frame(random(rho = currentEstimate, n = numberOfModelRuns, method = randomMethod, relativeTolerance = relativeTolerance))[perfectProspectiveNames]), numberOfModelRuns, randomMethod = "calculate", functionSyntax = "data.frameNames", relativeTolerance = 0.05, verbosity = 0) ```

## Arguments

 `welfare` either a `function` or a `list` with two `functions`, i.e. `list(p1,p2)`. In the first case the function is the net benefit (or welfare) of project approval (PA) vs. the status quo (SQ). In the second case the element `p1` is the function valuing the first project and the element `p2` valuing the second project, viz. the welfare function of `p1` and `p2` respectively. `currentEstimate` `estimate`: describing the distribution of the input variables as currently being estimated. `perfectProspectiveNames` `character vector`: input variable names that are assumed to be known perfectly with prospective information. `perfectProspectiveValues` `numeric vector`: of the same length as `perfectProspectiveNames` with the corresponding values assumed to be known perfectly. `numberOfModelRuns` `integer`: The number of running the welfare model for the underlying Monte Carlo simulation. `randomMethod` `character`: The method to be used to sample the distribution representing the input estimate. For details see option `method` in `random.estimate`. `functionSyntax` `character`: function syntax used in the welfare function(s). For details see `mcSimulation`. `relativeTolerance` `numeric`: the relative tolerance level of deviation of the generated confidence interval from the specified interval. If this deviation is greater than `relativeTolerance` a warning is given. `verbosity` `integer`: if `0` the function is silent; the larger the value the more verbose is output information.

## Details

The Individual EVPI is defined as the EVI with respect to a prospective information that assumes perfect knowledge on one particular variable.

## Value

An object of class `eviSimulation` with the following elements:

`\$current`

`welfareDecisionAnalysis` object for `currentEstimate`

`\$prospective`

`welfareDecisionAnalysis` object for single `perfectProspectiveNames` or a list of `welfareDecisionAnalysis` objects for several `perfectProspectiveNames`.

`\$evi`

Expected Value of Information(s) (EVI)(s) gained by the perfect knowledge of individual variable(s) w.r.t. the current estimate.

`eviSimulation`, `welfareDecisionAnalysis`, `mcSimulation`, `estimate`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22``` ```# Number of running the underlying welfare model: n=10000 # Create the current estimate from text: estimateText<-"variable, distribution, lower, upper revenue1, posnorm, 100, 1000 revenue2, posnorm, 50, 2000 costs1, posnorm, 50, 2000 costs2, posnorm, 100, 1000" currentEstimate<-as.estimate(read.csv(header=TRUE, text=estimateText, strip.white=TRUE, stringsAsFactors=FALSE)) # The welfare function: profitModel <- function(x){ list(Profit=x\$revenue1 + x\$revenue2 - x\$costs1 - x\$costs2) } # Calculate the Individual EVPI: individualEvpiResult<-individualEvpiSimulation(welfare=profitModel, currentEstimate=currentEstimate, numberOfModelRuns=n, functionSyntax="data.frameNames") # Show the simulation results: print(sort(summary(individualEvpiResult)),decreasing=TRUE,along="Profit") hist(individualEvpiResult, breaks=100) ```