Created on 2007-09-21.00:00:00 last changed 171 months ago
[ Stephan Tolksdorf adds pre-Bellevue: ]
In [rand.dist.norm.chisq]:
Delete ", where n is a positive integer" in the first paragraph.
Replace both occurrences of "explicit chi_squared_distribution(int n = 1);" with "explicit chi_squared_distribution(RealType n = 1);".
Replace both occurrences of "int n() const;" with "RealType n() const;".
In [rand.dist.norm.f]:
Delete ", where m and n are positive integers" in the first paragraph.
Replace both occurrences of
explicit fisher_f_distribution(int m = 1, int n = 1);with
explicit fisher_f_distribution(RealType m = 1, RealType n = 1);Replace both occurrences of "int m() const;" with "RealType m() const;".
Replace both occurrences of "int n() const;" with "RealType n() const;".
In [rand.dist.norm.t]:
Delete ", where n is a positive integer" in the first paragraph.
Replace both occurrences of "explicit student_t_distribution(int n = 1);" with "explicit student_t_distribution(RealType n = 1);".
Replace both occurrences of "int n() const;" with "RealType n() const;".
Proposed resolution:
See N2424 for the proposed resolution.
[ Sophia Antipolis: ]
Marc Paterno: The generalizations were explicitly left out when designing the facility. It's harder to test.
Marc Paterno: Ask implementers whether floating-point is a significant burden.
Alisdair: It's neater to do it now, do ask Bill Plauger.
Disposition: move to review with the option for "NAD" if it's not straightforward to implement; unanimous consent.
[ Bellevue: ]
In N2424. Not wildly enthusiastic, not really felt necessary. Less frequently used in practice. Not terribly bad either. Move to OPEN.
chi_squared_distribution, fisher_f_distribution and student_t_distribution have parameters for the "degrees of freedom" n and m that are specified as integers. For the following two reasons this is an unnecessary restriction: First, in many applications such as Bayesian inference or Monte Carlo simulations it is more convenient to treat the respective param- eters as continuous variables. Second, the standard non-naive algorithms (i.e. O(1) algorithms) for simulating from these distributions work with floating-point parameters anyway (all three distributions could be easily implemented using the Gamma distribution, for instance).
Similar arguments could in principle be made for the parameters t and k of the discrete binomial_distribution and negative_binomial_distribution, though in both cases continuous parameters are less frequently used in practice and in case of the binomial_distribution the implementation would be significantly complicated by a non-discrete parameter (in most implementations one would need an approximation of the log-gamma function instead of just the log-factorial function).
Possible resolution: For these reasons, I propose to change the type of the respective parameters to double.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg3597 |
2010-10-21 18:28:33 | admin | set | messages: + msg3596 |
2010-10-21 18:28:33 | admin | set | messages: + msg3595 |
2010-10-21 18:28:33 | admin | set | messages: + msg3594 |
2007-09-21 00:00:00 | admin | create |