Difference between revisions of "Decision"

From Testiwiki
Jump to: navigation, search
m (Rcode)
m (Answer)
 
(8 intermediate revisions by 2 users not shown)
Line 16: Line 16:
 
{| {{prettytable}}
 
{| {{prettytable}}
 
|+ '''A typical structure of a data table of a decision.
 
|+ '''A typical structure of a data table of a decision.
! Decision !! Option !! Variable !! Cell !! Change !! ...!! Value !! Description
+
!Decision maker!! Decision !! Option !! Variable !! Cell !! Change !! ...!! Value !! Description
 
|----
 
|----
 +
| The person or group who can decide about this. Typically, one of the stakeholder groups.
 
| A group of options that are exclusive and the choice between them is made by one decision making body.
 
| A group of options that are exclusive and the choice between them is made by one decision making body.
 
| An option within one decision.
 
| An option within one decision.
 
| A variable whose value is to be changed by the decision option.
 
| A variable whose value is to be changed by the decision option.
 
| A cell whose value is to be changed within the variable data table.  
 
| A cell whose value is to be changed within the variable data table.  
| The type of change. Possible options:
+
| The type of change. Possible options are listed below the table.
* '''Add''' the value to the existing value.
 
* '''Multiply''' the value with the existing value.
 
* '''Replace''' the existing value with this value.
 
* '''Remove''' those rows from the variable that fulfil the cell criterion.
 
* '''Insert''' rows to the variable based on data in the decision.
 
* '''Split''' the existing random sample into two parts from the value. This is especially needed in upstream inference.
 
 
| The table may also contain other indices. The functions dealing with decision variables use the default merge functionality when combining objects.
 
| The table may also contain other indices. The functions dealing with decision variables use the default merge functionality when combining objects.
 
| The value to be used in the calculations.
 
| The value to be used in the calculations.
 
| This row contains descriptions about columns. The next rows contain examples.
 
| This row contains descriptions about columns. The next rows contain examples.
 
|----
 
|----
 +
| City of Kuopio
 
| Energy saving education
 
| Energy saving education
 
| Training to house owners
 
| Training to house owners
Line 42: Line 38:
 
| Energy training leads to renovation of houses and leads to heating demand reduction by 6 %.
 
| Energy training leads to renovation of houses and leads to heating demand reduction by 6 %.
 
|----
 
|----
 +
| City of Kuopio
 
| Public transport subsidy
 
| Public transport subsidy
 
| More money to bus transport
 
| More money to bus transport
Line 51: Line 48:
 
| Energy consumption of buses increases diesel use by 2.5 % but the reduced car transport causes a net reduction of 5 % in fuel use.
 
| Energy consumption of buses increases diesel use by 2.5 % but the reduced car transport causes a net reduction of 5 % in fuel use.
 
|----
 
|----
 +
| City of Kuopio
 
| Public transport subsidy
 
| Public transport subsidy
 
| Much more money to bus transport
 
| Much more money to bus transport
Line 61: Line 59:
 
|}
 
|}
  
===Rcode===
+
Possible options for the column ''Change''.
 
+
* '''Add''' the value to the existing value.
<rcode name="answer" label="Only defines functions">
+
* '''Multiply''' the value with the existing value.
 
+
* '''Replace''' the existing value with this value.
############### decisions.apply takes a decision table and applies that to an assessment.
+
* '''Remove''' those rows from the variable that fulfil the cell criterion.
## scen is a data.frame that must have columns Decision, Option, Variable, Cell, Change, Result. It can have several variables.
+
* '''Insert''' rows to the variable based on data in the decision.
decisions.apply <- function(scen) {
+
* '''Split''' the existing random sample into two parts from the value. This is especially needed in upstream inference.
out <- as.list(unique(scen$Variable))
 
names(out) <- as.character(unique(scen$Variable))
 
for(variables in unique(scen$Variable)) {
 
out[[variables]] <- scenarios.apply(scen[scen$Variable == variables, ])
 
}
 
return(out)
 
}
 
 
 
 
 
############## scenarios.apply takes the decision table and applies all decisions described on that.
 
## scen is a data.frame that must have columns Decision, Option, Variable, Cell, Change, Result. It must have only one variable.
 
scenarios.apply <- function(scen) {
 
decs <- data.frame(temp = 1)
 
for(decisions in unique(scen$Decision)) {
 
temp <- as.character(scen[scen$Decision == decisions, "Option"])
 
temp <- data.frame(Options = c(temp, "BAU"))
 
colnames(temp) <- decisions
 
decs <- merge(decs, temp)
 
}
 
 
 
out <- merge(decs[colnames(decs) != "temp"], get(as.character(scen$Variable[1]))) # This should be updated so that if necessary, the variable is downloaded from Opasnet Base.
 
out <- options.apply(scen, out)
 
return(out)
 
}
 
 
 
##### decisions apply the decisions to the cells of a variable. Parameters:
 
## dec: a data.frame with decisions. It must contain columns Cell, Change, and Result.
 
## var: a variable data frame.
 
options.apply <- function(dec, var) {
 
for(s in 1:nrow(dec)) { # Each row in decision handled separately
 
cell <- strsplit(as.character(dec$Cell[s]), split = ";")
 
cell <- strsplit(cell[[1]], split = ":")
 
cond <- as.character(dec$Decision[s])
 
cond <- var[, cond] == cond # Only the rows with the relevant option.
 
for(r in 1:length(cell)) { # All Cell conditions extracted and combined with AND.
 
cond <- cond * (var[, cell[[r]][1]] == cell[[r]][2])
 
}
 
cond <- as.logical(cond)
 
if(dec$Change[s] == "Replace" ) {var[cond, "Result"] <- dec$Result[s]}
 
if(dec$Change[s] == "Add"    ) {var[cond, "Result"] <- dec$Result[s] + var[cond, "Result"]}
 
if(dec$Change[s] == "Multiply") {var[cond, "Result"] <- dec$Result[s] * var[cond, "Result"]}
 
}
 
return(var)
 
}
 
 
 
</rcode>
 
 
 
 
 
'''Test code
 
  
<rcode include="page:Decision|name:answer">
+
[[OpasnetUtils/CheckDecisions]]
library(xtable)
 
var1 <- data.frame(c = c("A", "A", "C"), d = c("D", "E", "E"), Result = 4:6)
 
var2 <- var1
 
dec <- data.frame(Decision = rep(c("Decision 1", "Decision 2"), each = 2), Option = c("OptA", "OptB"), Variable = c("var1", "var1", "var1", "var2"), Cell = c("c:A;d:E", "d:D"), Change = c("Replace", "Multiply"), Result = 7:10)
 
var1
 
dec
 
out <- decisions.apply(dec)
 
cat("Variable", names(out)[1], "\n")
 
print(xtable(out[[1]]), type = 'html')
 
cat("Variable", names(out)[2], "\n")
 
print(xtable(out[[2]]), type = 'html')
 
  
</rcode>
+
[[op_fi:Päätös]]
  
 
==Rationale==
 
==Rationale==

Latest revision as of 14:10, 19 January 2014


<section begin=glossary />
Decision is a special kind of variable: it answer a question like this: "What are different decisions that decision maker X can make in situation Y, and what are different options of each decision?" Decision maker X may be a single individual, a decision making body with several individuals, or a set of separate decision makers, who each can decide about some but not all decisions. In such a situation, an especially interesting part of the related assessment is to look at the interactions of the decisions by different decision makers, none of which can fully control the decision situation.
The decisions have a special role in causal diagrams, as they list such specific structural parts of variables in a causal diagrams that can be modified by a decision maker. Without a decision, the causal diagram describes the business-as-usual (BAU) situation. A decision variable describes how the situation changes if a decision maker chooses an option over another options of a decision.

<section end=glossary />

Question

How should decisions be described in open assessment and what should their structure be?

Answer

A typical structure of a data table of a decision.
Decision maker Decision Option Variable Cell Change ... Value Description
The person or group who can decide about this. Typically, one of the stakeholder groups. A group of options that are exclusive and the choice between them is made by one decision making body. An option within one decision. A variable whose value is to be changed by the decision option. A cell whose value is to be changed within the variable data table. The type of change. Possible options are listed below the table. The table may also contain other indices. The functions dealing with decision variables use the default merge functionality when combining objects. The value to be used in the calculations. This row contains descriptions about columns. The next rows contain examples.
City of Kuopio Energy saving education Training to house owners Energy balance in Kuopio Activity: Residential; Fuel: Heat Multiply 0.94 Energy training leads to renovation of houses and leads to heating demand reduction by 6 %.
City of Kuopio Public transport subsidy More money to bus transport Energy balance in Kuopio Activity: Transport; Fuel: Petrochemical products Multiply 0.95 Energy consumption of buses increases diesel use by 2.5 % but the reduced car transport causes a net reduction of 5 % in fuel use.
City of Kuopio Public transport subsidy Much more money to bus transport Energy balance in Kuopio Activity: Transport; Fuel: Petrochemical products Multiply 0.9 Energy consumption of buses increases diesel use by 5 % but the reduced car transport causes a net reduction of 10 % in fuel use.

Possible options for the column Change.

  • Add the value to the existing value.
  • Multiply the value with the existing value.
  • Replace the existing value with this value.
  • Remove those rows from the variable that fulfil the cell criterion.
  • Insert rows to the variable based on data in the decision.
  • Split the existing random sample into two parts from the value. This is especially needed in upstream inference.

OpasnetUtils/CheckDecisions

Rationale

Previously, it was thought that decision variables are an essential starting point of a causal diagram, and that they should be general and applicable to all possible situations where that causal diagram is used. Now the thinking is different. Decisions are seen as descriptions of plausible options decision makers have in a particular situation. Decisions are implemented in an assessment as scenarios (deliberate deviations from the truth, asking: "What would happen if the truth about the decision maker's action was this?"). It was previously also thought that decisions are probability distributions about what a decision maker will decide, and assessment-specific scenarios are used separately to select the interesting options from the decision distribution in a particular assessment. Now the thinking is different: instead of attempting to describe all the decisions explicitly, the core of a causal diagram does not describe any decisions. It just describes the phenomena that are important for understanding a situation, such as activities, emissions, exposures, and health effects. Decisions that may change the future situation are implicitly included in the probability distributions as uncertainties. Then, decisions are added to that for describing how e.g. activities would change if some decision options would be chosen. Mathematically, this means that one or more variables in a model are conditionalised to reflect the impact of decisions. In other words, decision variables are used as scenarios. What are scenarios, anyway?

A scenario is a deliberate deviation from the truth in a description. In the case of decisions, it is a particular value of some variable that is changed if the decision option at hand is implemented. It can also be a set of particular values of several variables changed by the decision. For policy assessments, often several scenarios are defined and then compared to each other, e.g. if the impacts of a certain policy (measure) is assessed. A particular set of scenarios can be saved and used in several risk assessments. A scenario therefore can be a part of an assessment but is not an assessment itself. In a sense, BAU is not a scenario, it is our best estimate about what will actually happen, implicitly including all plausible decisions by all decision makers.

A decision describes changes in values of other variables. These changes must be within the range of values the variable has.R↻

See also

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>