Goal
metamodel()'s invalid-parameter branch computes setdiff(p, pnames), but p is never defined in that scope — it only exists as a loop variable in the oneway branch further down. Passing a parameter name absent from the PSA therefore raises object 'p' not found instead of the intended informative message, and the same path is reachable through calc_evppi() and calc_evsi().
Scope
- Change
setdiff(p, pnames) to setdiff(params, pnames) at R/metamodel.R:59
- Add a regression test asserting the intended message when
params names a parameter absent from the PSA
- Confirm the corrected message also surfaces when the path is reached via
calc_evppi() and calc_evsi()
Version: #172
Goal
metamodel()'s invalid-parameter branch computessetdiff(p, pnames), butpis never defined in that scope — it only exists as a loop variable in theonewaybranch further down. Passing a parameter name absent from the PSA therefore raisesobject 'p' not foundinstead of the intended informative message, and the same path is reachable throughcalc_evppi()andcalc_evsi().Scope
setdiff(p, pnames)tosetdiff(params, pnames)atR/metamodel.R:59paramsnames a parameter absent from the PSAcalc_evppi()andcalc_evsi()Version: #172