|
Commons Math example source code file (EmpiricalDistribution.java)
The Commons Math EmpiricalDistribution.java 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/LICENSE-2.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.math.random; import java.io.IOException; import java.io.File; import java.net.URL; import java.util.List; import org.apache.commons.math.stat.descriptive.StatisticalSummary; import org.apache.commons.math.stat.descriptive.SummaryStatistics; /** * Represents an <a href="http://random.mat.sbg.ac.at/~ste/dipl/node11.html"> * empirical probability distribution</a> -- a probability distribution derived * from observed data without making any assumptions about the functional form * of the population distribution that the data come from.<p> * Implementations of this interface maintain data structures, called * <i>distribution digests, that describe empirical distributions and * support the following operations: <ul> * <li>loading the distribution from a file of observed data values * <li>dividing the input data into "bin ranges" and reporting bin frequency * counts (data for histogram)</li> * <li>reporting univariate statistics describing the full set of data values * as well as the observations within each bin</li> * <li>generating random values from the distribution * </ul> * Applications can use <code>EmpiricalDistribution implementations to * build grouped frequency histograms representing the input data or to * generate random values "like" those in the input file -- i.e., the values * generated will follow the distribution of the values in the file.</p> * * @version $Revision: 817128 $ $Date: 2009-09-20 21:30:53 -0400 (Sun, 20 Sep 2009) $ */ public interface EmpiricalDistribution { /** * Computes the empirical distribution from the provided * array of numbers. * * @param dataArray the data array */ void load(double[] dataArray); /** * Computes the empirical distribution from the input file. * * @param file the input file * @throws IOException if an IO error occurs */ void load(File file) throws IOException; /** * Computes the empirical distribution using data read from a URL. * * @param url url of the input file * @throws IOException if an IO error occurs */ void load(URL url) throws IOException; /** * Generates a random value from this distribution. * <strong>Preconditions:
Other Commons Math examples (source code examples)Here is a short list of links related to this Commons Math EmpiricalDistribution.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 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.