It looks like the distribution parameters are always implemented as read-only private members that are validated when an instance is created, and each distribution provides a "getter" method for each parameter. So it looks like a user can never directly set a parameter in an instance of a distribution. If that is true, couldn't a lot of the validation of the distribution parameters that takes place in functions such as pdf() and cdf() be removed?
(Sorry if I've asked this before. I might have, but now I can't find such a discussion.)
It looks like the distribution parameters are always implemented as read-only private members that are validated when an instance is created, and each distribution provides a "getter" method for each parameter. So it looks like a user can never directly set a parameter in an instance of a distribution. If that is true, couldn't a lot of the validation of the distribution parameters that takes place in functions such as
pdf()andcdf()be removed?(Sorry if I've asked this before. I might have, but now I can't find such a discussion.)