Closed rho62 closed 1 year ago
There are already aliases in place for the dtrunc
family, so the user can simply call dtrunc*
. The dtrunc.trunc_*
functions are for internal use only (i.e. for dispatching from the generic dtrunc()
function). See example below:
The difference between dtrunc*
and d*
is that the former takes y
and eta
as arguments, whereas the latter uses x
and whatever the parameteres of the original distribution are. Should we worry about aligning those?
For the record, dtrunc()
can also be called directly if y
was generated from rtrunc()
. See image below, taken directly from example(dtrunc)
:
dtrunc()
is implemented, but the argument conformity is enough to keep this open. I'll just change the title accordingly.
Retrieving original parameters
Use natural2parameters()
for conversion. Try to change the function in a way that the user can call dtrunc()
with either the original parameters or the natural ones. If that is too hard, it should be preferred to call with the original parameters.
The truncated sampling functions names are on the form "rtruncXXXX" - Fine! The truncated density functions are however on the form "dtrunc.trunc_XXXX" eg. dtrunc.trunc_gamma. To be consistent and to conform with the base R, I suggest that all density functions are named on the form "dtruncXXXX"
Note the dtruncXXXX are also used in rtruncXXX for the discrete distributions. See #77