/** * 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(Collection<WeightedObservedPoint> observations) { if (observations == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } if (observations.size() < 3) { throw new NumberIsTooSmallException(observations.size(), 3, true); } final List<WeightedObservedPoint> sorted = sortObservations(observations); final double[] params = basicGuess(sorted.toArray(new WeightedObservedPoint[0])); 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(Collection<WeightedObservedPoint> observations) { if (observations == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } if (observations.size() < 3) { throw new NumberIsTooSmallException(observations.size(), 3, true); } final List<WeightedObservedPoint> sorted = sortObservations(observations); final double[] params = basicGuess(sorted.toArray(new WeightedObservedPoint[0])); 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(Collection<WeightedObservedPoint> observations) { if (observations == null) { throw new NullArgumentException(LocalizedFormats.INPUT_ARRAY); } if (observations.size() < 3) { throw new NumberIsTooSmallException(observations.size(), 3, true); } final List<WeightedObservedPoint> sorted = sortObservations(observations); final double[] params = basicGuess(sorted.toArray(new WeightedObservedPoint[0])); norm = params[0]; mean = params[1]; sigma = params[2]; }