individualEvpiSimulation {decisionSupport} | R Documentation |
Individual Expected Value of Perfect Information Simulation
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
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 |
currentEstimate |
|
perfectProspectiveNames |
|
perfectProspectiveValues |
|
numberOfModelRuns |
|
randomMethod |
|
functionSyntax |
|
relativeTolerance |
|
verbosity |
|
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 forcurrentEstimate
$prospective
-
welfareDecisionAnalysis
object for singleperfectProspectiveNames
or a list ofwelfareDecisionAnalysis
objects for severalperfectProspectiveNames
. $evi
-
Expected Value of Information(s) (EVI)(s) gained by the perfect knowledge of individual variable(s) w.r.t. the current estimate.
See Also
eviSimulation
, welfareDecisionAnalysis
, mcSimulation
, estimate
Examples
# 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)