ggpmisc icon indicating copy to clipboard operation
ggpmisc copied to clipboard

Support fitting of Normal and other distributions

Open aphalo opened this issue 2 months ago • 1 comments

As with other model fits, but in this case for univariate data, support plotting of prediction and annotation with parameter estimates.

  • stat_edf_area(): ggplot2::stat_density() does the job for plotting, a wrapper supporting fewer kernels could be useful for consistency with stat_edf_params().

  • stat_edf_params(): numeric values and character labels for the fitted distributions. ~~One option would be assuming normality and simply computing mean() and sd.~~

  • Are these needed at all? ~~Probably not.~~ Fitting one Normal is just a special case of mixture of Normals.

  • [x] Consider if the same stats would be able to support univariate mixtures. #85 Yes for Normal

  • [x] Consider which annotations in addition to $\bar x$ and $\sigma$ would be useful. The SE of these parameter estimates.

  • [ ] Can kurtosis parameters be estimated and made available as labels?

  • [ ] What other distributions can be supported?

aphalo avatar Nov 14 '25 13:11 aphalo

The best bet for adding support for fitting various distributions individually seems to be to use MASS::fitdstr() as it is safe to depend on 'MASS' as is already being imported.

aphalo avatar Nov 18 '25 23:11 aphalo

stat_distrmix_line() and stat_distrmix_line() support also fitting a single distribution. Currently, the Normal.

  • [ ] What other distributions can be supported?
  • lognormal, possibly
  • Gamma, possibly

aphalo avatar Dec 15 '25 22:12 aphalo