/** * Returns natural logarithm of density estimate for given value based on given instance. * * @param inst the instance to make the prediction for. * @param the value to make the prediction for. * @return the natural logarithm of the density estimate * @exception Exception if the intervals can't be computed */ public double logDensity(Instance instance, double value) throws Exception { // Get density estimator UnivariateDensityEstimator e = getDensityEstimator(instance, true); // Return estimate return e.logDensity(value); }
/** * Returns natural logarithm of density estimate for given value based on given instance. * * @param inst the instance to make the prediction for. * @param the value to make the prediction for. * @return the natural logarithm of the density estimate * @exception Exception if the intervals can't be computed */ public double logDensity(Instance instance, double value) throws Exception { // Get density estimator UnivariateDensityEstimator e = getDensityEstimator(instance, true); // Return estimate return e.logDensity(value); }
/** * Returns an N * 2 array, where N is the number of prediction * intervals. In each row, the first element contains the lower * boundary of the corresponding prediction interval and the second * element the upper boundary. * * @param inst the instance to make the prediction for. * @param confidenceLevel the percentage of cases that the interval should cover. * @return an array of prediction intervals * @exception Exception if the intervals can't be computed */ public double[][] predictIntervals(Instance instance, double confidenceLevel) throws Exception { // Get density estimator UnivariateIntervalEstimator e = (UnivariateIntervalEstimator)getDensityEstimator(instance, false); // Return intervals return e.predictIntervals(confidenceLevel); }
/** * Returns an N * 2 array, where N is the number of prediction * intervals. In each row, the first element contains the lower * boundary of the corresponding prediction interval and the second * element the upper boundary. * * @param inst the instance to make the prediction for. * @param confidenceLevel the percentage of cases that the interval should cover. * @return an array of prediction intervals * @exception Exception if the intervals can't be computed */ public double[][] predictIntervals(Instance instance, double confidenceLevel) throws Exception { // Get density estimator UnivariateIntervalEstimator e = (UnivariateIntervalEstimator)getDensityEstimator(instance, false); // Return intervals return e.predictIntervals(confidenceLevel); }
UnivariateQuantileEstimator e = (UnivariateQuantileEstimator)getDensityEstimator(instance, true);
UnivariateQuantileEstimator e = (UnivariateQuantileEstimator)getDensityEstimator(instance, true);