Training assessment: Difference between revisions
Jump to navigation
Jump to search
(→Calculations: Fixed) |
(→Calculations: under construction, testing a few things) |
||
Line 85: | Line 85: | ||
name="answer" | name="answer" | ||
graphics="1" | graphics="1" | ||
include="page:OpasnetUtils/Summary|name:summary" | |||
> | > | ||
library(OpasnetUtils) | library(OpasnetUtils) | ||
library(xtable) | library(xtable) | ||
library(ggplot2) | library(ggplot2) | ||
net.cost <- new("ovariable", | net.cost <- new("ovariable", | ||
Line 111: | Line 113: | ||
) | ) | ||
decisions <- opbase.data("Op_en5677.decisions") | decisions <- tidy(opbase.data("Op_en5677.decisions")) | ||
# The next row should happen inside tidy but it doesn't. Why? | |||
decisions <- decisions[ , colnames(decisions) != "Obs"] | |||
# BAU options are added to each combination Decisionmaker - Decision - Variable. This should be included in the DecisionTableParser. | |||
BAUs <- decisions[!duplicated(decisions[c("Decisionmaker", "Decision", "Variable")]), ] | |||
BAUs$Change <- "Add" | |||
BAUs$Result <- 0 | |||
BAUs$Option <- "BAU" | |||
decisions <- rbind(decisions, BAUs) | |||
DecisionTableParser(decisions) | DecisionTableParser(decisions) | ||
Line 118: | Line 131: | ||
health.impact <- EvalOutput(health.impact) | health.impact <- EvalOutput(health.impact) | ||
health.impact <- CheckDecisions(health.impact) | health.impact <- CheckDecisions(health.impact) | ||
print(xtable(health.impact@output[1:20,]), type = "html") | #print(xtable(health.impact@output[1:20,]), type = "html") | ||
probabilities <- new("ovariable", | probabilities <- new("ovariable", | ||
Line 127: | Line 139: | ||
) | ) | ||
# | summary(health.impact) | ||
# | |||
# | ggplot(health.impact@output, aes(x = Year, y = health.impactResult, colour = Health.promotion)) + | ||
geom_point() + | |||
theme_grey(base_size = 24) | |||
######################### | |||
#endp <- function(dectable) | |||
dectable <- tidy(opbase.data("Op_en5677.endpoints")) | |||
dectable | |||
out <- health.impact@output | |||
# Conditions: Constructing a list of logical vectors which correspond to those rows of our new data.frame that we want to apply | |||
# effects on. | |||
cond <- list() | |||
# Build multiple condition vectors that correspond to a unique decision - option combination | |||
for (j in 1:nrow(dectable)) { | |||
# In the decision table format conditions are given in the "Cell"-column separated by ";". | |||
sel1 <- strsplit(as.character(dectable[j, "Cell"]), split = ";")[[1]] | |||
# ":" defines index - location matches as a condition. | |||
sel2 <- strsplit(sel1, split = ":") # No need for lapply, since strsplit is a vectorized function and current list depth is 1. | |||
# Create a list of conditions which the decision and option specific condition vector consists of. | |||
print(sel1) | |||
print(sel2) | |||
selection <- list() | |||
for (k in 1:length(sel1)) { # For each condition separated by ";" | |||
if (length(sel2[[k]]) > 1) { # If ":" has been used for condition k | |||
locs <- strsplit(sel2[[k]][2], split = ",")[[1]] # Split by "," for multiple locs per given index | |||
selection[[k]] <- out[, sel2[[k]][1]] %in% locs # Match our data.frame to the condition | |||
#print(selection) | |||
} | |||
} | |||
# Match all conditions given for this decision - option combination. | |||
selection <- as.data.frame(selection) | |||
selection$optslice <- out[[as.character(dectable[["Decision"]][j])]] == dectable[["Option"]][j] # We only want rows where the relevant option is in use to be affected | |||
selection <- as.matrix(selection) | |||
cond[[j]] <- apply( | |||
selection, | |||
1, | |||
all | |||
) | |||
} | |||
} else { # Otherwise use given condition functions. | |||
for (j in 1:length(dec@condition)) { | |||
cond[[j]] <- dec@condition[[j]](variable@output) | |||
} | |||
} | |||
# Effects | |||
if (length(dec@effect) == 1 & dec@effect[[1]](variable@output) == 0) { | |||
eff <- list() | |||
for (j in 1:nrow(dectable)) { | |||
eff[[j]] <- EffectPreset(dectable[["Change"]][j]) # Returns a standard function from presets defined below. | |||
} | |||
} else { | |||
eff <- dec@effect | |||
} | |||
# Applying effects | |||
for (j in 1:nrow(dectable)) { | |||
out[ | |||
cond[[j]], | |||
paste(variable@name, "Result", sep = "") | |||
] <- eff[[j]]( | |||
out[ | |||
cond[[j]], | |||
paste(variable@name, "Result", sep = "") | |||
], | |||
dectable[["Result"]][j] | |||
) | |||
} | |||
variable@marginal <- colnames(out) %in% c(colnames(variable@output)[variable@marginal], colnames(temp2)) | |||
variable@output <- out | |||
} | |||
# return(variable) | |||
#} | |||
######################## | |||
</rcode> | </rcode> |
Revision as of 15:24, 1 January 2013
Moderator:Jouni (see all) |
This page is a stub. You may improve it into a full page. |
Upload data
|
This is a training assessment about an imaginary, simple case. The purpose is to illustrate assessment functionalities.
Scope
Question
What decisions are worth implementing in the training assessment?
Boundaries
- Time: Year 2012 - 2020
Scenarios
- Factory can reduce emissions, or continue business as usual.
- School can increase health education, decrease it to save money, or continue business as usual.
Intended users
- Anyone who wants to learn to make open assessments.
Participants
- Main participants:
- YMAL,
- Summer workers of YMAL in 2012,
- Participants of [[Decision analysis and risk management 2013}}
Answer
Conclusions
Results
Not yet available.
Rationale
Assessment-specific data
- Decisions
Obs | Decisionmaker | Decision | Option | Variable | Cell | Change | Unit | Amount | Description |
---|---|---|---|---|---|---|---|---|---|
1 | Factory | Cleaning.policy | Reduce emissions | exposure | Year:2020 | Multiply | - | 0.5 | |
2 | School | Health.promotion | Increase health education | health.impact | Year:2020 | Multiply | - | 0.9 | |
3 | School | Health.promotion | Promotion budget reduced | health.impact | Year:2020 | Multiply | - | 1.1 |
- Probabilities
Obs | Stakeholder | Variable | Cell | Probability | Description |
---|---|---|---|---|---|
1 | City of Kuopio | exposure | Cleaning.policy: Reduce emissions | 0.8 | |
2 | City of Kuopio | exposure | Cleaning.policy: BAU | 0.2 | |
3 | Factoy | health.impact | Health.promotion: Increase health education | 0.1 | |
4 | Factoy | health.impact | Health.promotion: Promotion budget reduced | 0.4 | |
5 | Factoy | health.impact | Health.promotion: BAU | 0.5 |
- Endpoints
Obs | Stakeholder | Variable | Cell | Model | Result | Description |
---|---|---|---|---|---|---|
1 | City of Kuopio | health.impact | Year:2012 | Weighted sum | 1000 | |
2 | City of Kuopio | health.impact | Year:2020 | Weighted sum | 1000 | |
3 | Citizens | health.impact | Year:2012 | Weighted sum | 1000 | |
4 | Citizens | health.impact | Year:2020 | Weighted sum | 2000 | Future years are twice as important. |
- Variables
- exposure: Training exposure
- health.impact: Training health impact
- training.costs: Training costs
- Analyses
- Decision analysis on each policy: Which option minimises the health risks?
- Value of information (VOI) analysis for each policy about the major variables in the model and the total VOI.
Calculations
See also
Help pages | Wiki editing • How to edit wikipages • Quick reference for wiki editing • Drawing graphs • Opasnet policies • Watching pages • Writing formulae • Word to Wiki • Wiki editing Advanced skills |
Training assessment (examples of different objects) | Training assessment • Training exposure • Training health impact • Training costs • Climate change policies and health in Kuopio • Climate change policies in Kuopio |
Methods and concepts | Assessment • Variable • Method • Question • Answer • Rationale • Attribute • Decision • Result • Object-oriented programming in Opasnet • Universal object • Study • Formula • OpasnetBaseUtils • Open assessment • PSSP |
Terms with changed use | Scope • Definition • Result • Tool |
- Descriptions of a previous structure
- ----#: . Päätöksenteon sokea piste: se mitä ihmiset eivät näe mutta eivät myöskään huomaa etteivät näe. Kuitenkin tutkimalla sitä mitä mitä ihmiset eivät näe saadaan selville asioita sokeasta pisteesta. Ymmärtämällä sokeaa pistettä voidaan keksiä asioita jotka järjestelmällisesti jäävät huomaamatta ja asioita, joilla voidaan korjata järjestelmällisiä puutteita. Avoin arviointi on tämmöinen päätöksenteon järjestelmällisten puutteiden korjausmekanismi. --Jouni 08:55, 1 May 2012 (EEST) (type: truth; paradigms: science: comment)
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>