/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** * Computes the value of the gradient at {@code x}. * The components of the gradient vector are the partial * derivatives of the function with respect to each of the * <em>parameters</em> (norm, mean and standard deviation). * * @param x Value at which the gradient must be computed. * @param param Values of norm, mean and standard deviation. * @return the gradient vector at {@code x}. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 3. * @throws NotStrictlyPositiveException if {@code param[2]} is negative. */ public double[] gradient(double x, double ... param) throws NullArgumentException, DimensionMismatchException, NotStrictlyPositiveException { validateParameters(param); final double norm = param[0]; final double diff = x - param[1]; final double sigma = param[2]; final double i2s2 = 1 / (2 * sigma * sigma); final double n = Gaussian.value(diff, 1, i2s2); final double m = norm * n * 2 * i2s2 * diff; final double s = m * diff / sigma; return new double[] { n, m, s }; }
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }
/** * Computes the value of the gradient at {@code x}. * The components of the gradient vector are the partial * derivatives of the function with respect to each of the * <em>parameters</em> (norm, mean and standard deviation). * * @param x Value at which the gradient must be computed. * @param param Values of norm, mean and standard deviation. * @return the gradient vector at {@code x}. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 3. * @throws NotStrictlyPositiveException if {@code param[2]} is negative. */ public double[] gradient(double x, double ... param) throws NullArgumentException, DimensionMismatchException, NotStrictlyPositiveException { validateParameters(param); final double norm = param[0]; final double diff = x - param[1]; final double sigma = param[2]; final double i2s2 = 1 / (2 * sigma * sigma); final double n = Gaussian.value(diff, 1, i2s2); final double m = norm * n * 2 * i2s2 * diff; final double s = m * diff / sigma; return new double[] { n, m, s }; }
/** * Computes the value of the Gaussian at {@code x}. * * @param x Value for which the function must be computed. * @param param Values of norm, mean and standard deviation. * @return the value of the function. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 3. * @throws NotStrictlyPositiveException if {@code param[2]} is negative. */ public double value(double x, double ... param) throws NullArgumentException, DimensionMismatchException, NotStrictlyPositiveException { validateParameters(param); final double diff = x - param[1]; final double i2s2 = 1 / (2 * param[2] * param[2]); return Gaussian.value(diff, param[0], i2s2); }
/** * Computes the value of the Gaussian at {@code x}. * * @param x Value for which the function must be computed. * @param param Values of norm, mean and standard deviation. * @return the value of the function. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 3. * @throws NotStrictlyPositiveException if {@code param[2]} is negative. */ public double value(double x, double ... param) throws NullArgumentException, DimensionMismatchException, NotStrictlyPositiveException { validateParameters(param); final double diff = x - param[1]; final double i2s2 = 1 / (2 * param[2] * param[2]); return Gaussian.value(diff, param[0], i2s2); }
/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }
/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }
/** * Computes the value of the gradient at {@code x}. * The components of the gradient vector are the partial * derivatives of the function with respect to each of the * <em>parameters</em> (norm, mean and standard deviation). * * @param x Value at which the gradient must be computed. * @param param Values of norm, mean and standard deviation. * @return the gradient vector at {@code x}. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 3. * @throws NotStrictlyPositiveException if {@code param[2]} is negative. */ public double[] gradient(double x, double ... param) throws NullArgumentException, DimensionMismatchException, NotStrictlyPositiveException { validateParameters(param); final double norm = param[0]; final double diff = x - param[1]; final double sigma = param[2]; final double i2s2 = 1 / (2 * sigma * sigma); final double n = Gaussian.value(diff, 1, i2s2); final double m = norm * n * 2 * i2s2 * diff; final double s = m * diff / sigma; return new double[] { n, m, s }; }
/** * Computes the value of the Gaussian at {@code x}. * * @param x Value for which the function must be computed. * @param param Values of norm, mean and standard deviation. * @return the value of the function. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 3. * @throws NotStrictlyPositiveException if {@code param[2]} is negative. */ public double value(double x, double ... param) throws NullArgumentException, DimensionMismatchException, NotStrictlyPositiveException { validateParameters(param); final double diff = x - param[1]; final double i2s2 = 1 / (2 * param[2] * param[2]); return Gaussian.value(diff, param[0], i2s2); }
/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** {@inheritDoc} */ @Override public double[] gradient(double x, double ... p) { double[] v = { Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY }; try { v = super.gradient(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; } };
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }
/** {@inheritDoc} */ @Override public double value(double x, double ... p) { double v = Double.POSITIVE_INFINITY; try { v = super.value(x, p); } catch (NotStrictlyPositiveException e) { // NOPMD // Do nothing. } return v; }