/** * 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> (lower bound and higher bound). * * @param x Value at which the gradient must be computed. * @param param Values for lower and higher bounds. * @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 2. */ public double[] gradient(double x, double ... param) throws NullArgumentException, DimensionMismatchException { validateParameters(param); final double lo = param[0]; final double hi = param[1]; return new double[] { 1 / (lo - x), 1 / (hi - x) }; }
/** * 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> (lower bound and higher bound). * * @param x Value at which the gradient must be computed. * @param param Values for lower and higher bounds. * @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 2. */ public double[] gradient(double x, double ... param) throws NullArgumentException, DimensionMismatchException { validateParameters(param); final double lo = param[0]; final double hi = param[1]; return new double[] { 1 / (lo - x), 1 / (hi - x) }; }
/** * Computes the value of the logit at {@code x}. * * @param x Value for which the function must be computed. * @param param Values of lower bound and higher bounds. * @return the value of the function. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 2. */ public double value(double x, double ... param) throws NullArgumentException, DimensionMismatchException { validateParameters(param); return Logit.value(x, param[0], param[1]); }
/** * Computes the value of the logit at {@code x}. * * @param x Value for which the function must be computed. * @param param Values of lower bound and higher bounds. * @return the value of the function. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 2. */ public double value(double x, double ... param) throws NullArgumentException, DimensionMismatchException { validateParameters(param); return Logit.value(x, param[0], param[1]); }
/** * 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> (lower bound and higher bound). * * @param x Value at which the gradient must be computed. * @param param Values for lower and higher bounds. * @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 2. */ public double[] gradient(double x, double ... param) throws NullArgumentException, DimensionMismatchException { validateParameters(param); final double lo = param[0]; final double hi = param[1]; return new double[] { 1 / (lo - x), 1 / (hi - x) }; }
/** * Computes the value of the logit at {@code x}. * * @param x Value for which the function must be computed. * @param param Values of lower bound and higher bounds. * @return the value of the function. * @throws NullArgumentException if {@code param} is {@code null}. * @throws DimensionMismatchException if the size of {@code param} is * not 2. */ public double value(double x, double ... param) throws NullArgumentException, DimensionMismatchException { validateParameters(param); return Logit.value(x, param[0], param[1]); }