Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining scenarios by description vs. from data/cases (i.e., by experience) #30

Open
hneth opened this issue Mar 24, 2021 · 1 comment

Comments

@hneth
Copy link
Owner

hneth commented Mar 24, 2021

Idea

riskyr currently assumes that scenarios are defined by 3 essential probabilities (typically prev, sens, and spec or fart, plus some population size N) or 4 essential frequencies (typically hi, mi, fa, and cr).

A more flexible setup would allow defining scenarios either from parameters (i.e., "by description) or from data or cases (i.e., "by experience").

  1. By description: Define a scenario from parameters (to create/simulate cases):

    • provide 4 essential frequencies (i.e., specifying the result)
    • provide 3 essential probabilities, N, and round to exact frequencies
    • provide 3 essential probabilities, N, and sample from given probabilities
  2. By experience: Define scenario from data or cases (to compute/extract parameters):

    • provide binary data frame of cases (and frame 2x2 matrix)
    • provide non-binary data frame of cases and a criterion to be maximized to binarize predictor variable

ToDo

See comp_popu() for a first function that generates data/cases (as df popu) from one type of description:

  • from 4 essential frequencies

Add option for generating corresponding simulations: Generate popu (as df):

  • from probabilities and N (using exact or rounded values)
  • from probabilities and N (and sample() from N)

Define a complementary function desc_data() that generates the description from (binary or binarized) data or cases.

@hneth
Copy link
Owner Author

hneth commented Aug 18, 2022

This issue is partially addressed by the interplay between the read_popu() and write_popu() functions in riskyr v0.4.0.

More complete treatments are conceivable, but not a current priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant