View source: R/individualEvpiSimulation.R
individualEvpiSimulation | R Documentation |
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.
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
)
welfare |
either a |
currentEstimate |
|
perfectProspectiveNames |
|
perfectProspectiveValues |
|
numberOfModelRuns |
|
randomMethod |
|
functionSyntax |
|
relativeTolerance |
|
verbosity |
|
The Individual EVPI is defined as the EVI with respect to a prospective information that assumes perfect knowledge on one particular variable.
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
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.