/** * Constructs instance with the specified observed points. * * @param observations Observed points from which to guess the * parameters of the Gaussian. * @throws NullArgumentException if {@code observations} is * {@code null}. * @throws NumberIsTooSmallException if there are less than 3 * observations. */ public ParameterGuesser(WeightedObservedPoint[] observations) { if (observations == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } if (observations.length < 3) { throw new NumberIsTooSmallException(observations.length, 3, true); } final WeightedObservedPoint[] sorted = sortObservations(observations); final double[] params = basicGuess(sorted); norm = params[0]; mean = params[1]; sigma = params[2]; }
/** * Constructs instance with the specified observed points. * * @param observations Observed points from which to guess the * parameters of the Gaussian. * @throws NullArgumentException if {@code observations} is * {@code null}. * @throws NumberIsTooSmallException if there are less than 3 * observations. */ public ParameterGuesser(WeightedObservedPoint[] observations) { if (observations == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } if (observations.length < 3) { throw new NumberIsTooSmallException(observations.length, 3, true); } final WeightedObservedPoint[] sorted = sortObservations(observations); final double[] params = basicGuess(sorted); norm = params[0]; mean = params[1]; sigma = params[2]; }
/** * Constructs instance with the specified observed points. * * @param observations Observed points from which to guess the * parameters of the Gaussian. * @throws NullArgumentException if {@code observations} is * {@code null}. * @throws NumberIsTooSmallException if there are less than 3 * observations. */ public ParameterGuesser(WeightedObservedPoint[] observations) { if (observations == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } if (observations.length < 3) { throw new NumberIsTooSmallException(observations.length, 3, true); } final WeightedObservedPoint[] sorted = sortObservations(observations); final double[] params = basicGuess(sorted); norm = params[0]; mean = params[1]; sigma = params[2]; }