From b556725171b539dcaf2adc61e5cd40b6f5346b0d Mon Sep 17 00:00:00 2001 From: tasshi / Masaharu TASHIRO <33759872+mshrtsr@users.noreply.github.com> Date: Fri, 30 Dec 2022 01:04:41 +0900 Subject: [PATCH] chore: add limitations section of `Gaussian::fit` (#53) --- src/gaussian/gaussian.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gaussian/gaussian.rs b/src/gaussian/gaussian.rs index d0ebb9d..9c3c725 100644 --- a/src/gaussian/gaussian.rs +++ b/src/gaussian/gaussian.rs @@ -139,6 +139,14 @@ impl Gaussian { /// assert_abs_diff_eq!(gaussian, estimated, epsilon = 1e-9); /// ``` /// + /// # Limitations + /// + /// - `x_vec` must have at least one element + /// - All elements of `y_vec` must be positive numbers + /// - If the distribution is "long-tailed", it affects the fitting accuracy. + /// - A detailed description can be found in Reference 1. + /// - Also, you can see the reproduction and workaround in [GitHub](https://github.com/mshrtsr/fitting-rs/issues/6#issuecomment-1367095969). + /// /// # References /// \[1\] [E. Pastuchov ́a and M. Z ́akopˇcan, ”Comparison of Algorithms for Fitting a Gaussian Function used in Testing Smart Sensors”, Journal of Electrical Engineering, vol. 66, no. 3, pp. 178-181, 2015.](https://www.researchgate.net/publication/281907940_Comparison_of_Algorithms_For_Fitting_a_Gaussian_Function_Used_in_Testing_Smart_Sensors) pub fn fit(x_vec: Array1, y_vec: Array1) -> Result, Error> {