Closed evaenns closed 5 years ago
I suggest that we require the PSA outputs to be formatted as two different types of objects:
Thoughts?
I think that sounds good! I actually just changed the ceac()
function to take 2 matrices: costs and effectiveness, so that would work with your proposal, Fernando.
Do you think we should have a psa
class? The function to create it could enforce some of the conditions (parameters, cost, effectiveness, etc., should all have the same number of rows, for example).
Excellent!
Yeah, I think that could work. Would you generate a psa object from the cost, effectiveness and input parameter matrices? Or would you ask the user to create a psa matrix ex-ante and then the function will just make the matrix a psa class?
It could be something like make_psa_obj <- function(list_of_outcomes, cost, param)
, and then it could return a psa object. I don't know yet how many functions make use of the PSA results, but it could standardize it across the functions.
It could be something like
make_psa_obj <- function(list_of_outcomes, cost, param)
, and then it could return a psa object. I don't know yet how many functions make use of the PSA results, but it could standardize it across the functions.
Makes sense, although I can see a trade off here by adding a new function but also, one the psa object is created, then it's easier to use later on. Right of the bat, can think of at least 5 core functions that use psa: CEAC, EVPI, Expected loss curves (ELC), EVPPI, EVSI and also other ones like OWSA, TWSA, and TORNADO using regression metamodeling.
I think a PSA object makes sense, given that it is the backbone of so many of these other functions. I think the key is to have the make_psa_obj()
function have really clear error messages and that the PSA object have some nice summary methods so it is easy for a user to view what they have created.
see PSA object in #15
How should we require PSA results be formatted for input into dampack functions? We need to balance ease of use for the user (e.g. how will they typically have a PSA stored), flexibility, and clarity in structure of the functions. The format needs to be able to handle: