/** * Simple constructor. * * @param observations Sampled observations. * @throws NumberIsTooSmallException if the sample is too short. * @throws ZeroException if the abscissa range is zero. * @throws MathIllegalStateException when the guessing procedure cannot * produce sensible results. */ public ParameterGuesser(Collection<WeightedObservedPoint> observations) { if (observations.size() < 4) { throw new NumberIsTooSmallException(LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE, observations.size(), 4, true); } final WeightedObservedPoint[] sorted = sortObservations(observations).toArray(new WeightedObservedPoint[0]); final double aOmega[] = guessAOmega(sorted); a = aOmega[0]; omega = aOmega[1]; phi = guessPhi(sorted); }
/** * Simple constructor. * * @param observations Sampled observations. * @throws NumberIsTooSmallException if the sample is too short. * @throws ZeroException if the abscissa range is zero. * @throws MathIllegalStateException when the guessing procedure cannot * produce sensible results. */ public ParameterGuesser(Collection<WeightedObservedPoint> observations) { if (observations.size() < 4) { throw new NumberIsTooSmallException(LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE, observations.size(), 4, true); } final WeightedObservedPoint[] sorted = sortObservations(observations).toArray(new WeightedObservedPoint[0]); final double aOmega[] = guessAOmega(sorted); a = aOmega[0]; omega = aOmega[1]; phi = guessPhi(sorted); }
/** * Simple constructor. * * @param observations Sampled observations. * @throws NumberIsTooSmallException if the sample is too short. * @throws ZeroException if the abscissa range is zero. * @throws MathIllegalStateException when the guessing procedure cannot * produce sensible results. */ public ParameterGuesser(Collection<WeightedObservedPoint> observations) { if (observations.size() < 4) { throw new NumberIsTooSmallException(LocalizedFormats.INSUFFICIENT_OBSERVED_POINTS_IN_SAMPLE, observations.size(), 4, true); } final WeightedObservedPoint[] sorted = sortObservations(observations).toArray(new WeightedObservedPoint[0]); final double aOmega[] = guessAOmega(sorted); a = aOmega[0]; omega = aOmega[1]; phi = guessPhi(sorted); }