

Java example source code file (RealDistribution.java)
The RealDistribution.java Java example source code/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.commons.math3.distribution; import org.apache.commons.math3.exception.NumberIsTooLargeException; import org.apache.commons.math3.exception.OutOfRangeException; /** * Base interface for distributions on the reals. * * @since 3.0 */ public interface RealDistribution { /** * For a random variable {@code X} whose values are distributed according * to this distribution, this method returns {@code P(X = x)}. In other * words, this method represents the probability mass function (PMF) * for the distribution. * * @param x the point at which the PMF is evaluated * @return the value of the probability mass function at point {@code x} */ double probability(double x); /** * Returns the probability density function (PDF) of this distribution * evaluated at the specified point {@code x}. In general, the PDF is * the derivative of the {@link #cumulativeProbability(double) CDF}. * If the derivative does not exist at {@code x}, then an appropriate * replacement should be returned, e.g. {@code Double.POSITIVE_INFINITY}, * {@code Double.NaN}, or the limit inferior or limit superior of the * difference quotient. * * @param x the point at which the PDF is evaluated * @return the value of the probability density function at point {@code x} */ double density(double x); /** * For a random variable {@code X} whose values are distributed according * to this distribution, this method returns {@code P(X <= x)}. In other * words, this method represents the (cumulative) distribution function * (CDF) for this distribution. * * @param x the point at which the CDF is evaluated * @return the probability that a random variable with this * distribution takes a value less than or equal to {@code x} */ double cumulativeProbability(double x); /** * For a random variable {@code X} whose values are distributed according * to this distribution, this method returns {@code P(x0 < X <= x1)}. * * @param x0 the exclusive lower bound * @param x1 the inclusive upper bound * @return the probability that a random variable with this distribution * takes a value between {@code x0} and {@code x1}, * excluding the lower and including the upper endpoint * @throws NumberIsTooLargeException if {@code x0 > x1} * * @deprecated As of 3.1. In 4.0, this method will be renamed * {@code probability(double x0, double x1)}. */ @Deprecated double cumulativeProbability(double x0, double x1) throws NumberIsTooLargeException; /** * Computes the quantile function of this distribution. For a random * variable {@code X} distributed according to this distribution, the * returned value is * <ul> * <li> Other Java examples (source code examples)Here is a short list of links related to this Java RealDistribution.java source code file: 
Copyright 19982019 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.