xoopR / distr6

R6 object-oriented interface for probability distributions.
https://xoopr.github.io/distr6/
Other
99 stars 23 forks source link

Is imputation as wrapper correct? #34

Closed RaphaelS1 closed 5 years ago

RaphaelS1 commented 5 years ago

Currently we have that imputation of d/p/q/r should be wrappers, for example for a distribution X with a pdf and no cdf, a user can impute the cdf via:

ImputeCdf$new(X, strategy = "pdf2cdf")

However the problem with this is that if a user imputes p/q/r all from d then they end up with a distribution called imputedR_imputedQ_imputedP_X with parameters imputedR_imputedQ_imputedP_param1.

I think it is more sensible to have these imputations as functions that take as input the distribution and alter the respective function. e.g. imputeCDF(X) would return X but with the cdf imputed via a given strategy. Then we could include dynamic comments in the function and add to the distribution description a note detailing the imputation.

Thoughts?

RaphaelS1 commented 5 years ago

See #35