|
|||||||||
| Home >> All >> riso >> [ distributions overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
riso.distributions
Class Uniform

java.lang.Objectriso.distributions.AbstractDistribution
riso.distributions.Uniform
- All Implemented Interfaces:
- ConditionalDistribution, Distribution, java.io.Serializable
- public class Uniform
- extends AbstractDistribution
An instance of this class represents a uniform distribution over an interval. Rectangles and hyper-rectangles are not supported; maybe they should be.
| Field Summary | |
double |
a
The left end of the interval on which this uniform distribution is defined. |
double |
b
The right end of the interval on which this uniform distribution is defined. |
| Fields inherited from class riso.distributions.AbstractDistribution |
associated_variable |
| Constructor Summary | |
Uniform()
Empty constructor so objects can be constructed from description files. |
|
Uniform(double a,
double b)
Construct a uniform distribution from the specified endpoints. |
|
| Method Summary | |
double |
cdf(double x)
Compute the cumulative distribution function. |
java.lang.Object |
clone()
Create and return a copy of this uniform distribution. |
double[] |
effective_support(double epsilon)
Returns the support of this distribution. |
double |
expected_value()
Returns the expected value of this distribution. |
java.lang.String |
format_string(java.lang.String leading_ws)
Format this uniform distribution into a string, which can be parsed by parse_string. |
MixGaussians |
initial_mix(double[] support)
Returns an approximation containing several components. |
int |
ndimensions()
Always returns 1. |
double |
p(double[] x)
Compute the density at the point x. |
void |
pretty_input(riso.general.SmarterTokenizer st)
Inputs the parameters of this uniform distribution from a stream. |
double[] |
random()
Returns a random number drawn from the interval [a,b]. |
double |
sqrt_variance()
Returns the square root of the variance of this distribution. |
| Methods inherited from class riso.distributions.AbstractDistribution |
get_density, get_nstates, log_p, log_prior, ndimensions_child, ndimensions_parent, p, parse_string, pretty_output, random, set_variable, toString, update |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
a
public double a
- The left end of the interval on which this uniform distribution is defined.
b
public double b
- The right end of the interval on which this uniform distribution is defined.
| Constructor Detail |
Uniform
public Uniform()
- Empty constructor so objects can be constructed from description files.
Uniform
public Uniform(double a,
double b)
- Construct a uniform distribution from the specified endpoints.
| Method Detail |
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Create and return a copy of this uniform distribution.
- Specified by:
clonein interfaceConditionalDistribution- Overrides:
clonein classAbstractDistribution
ndimensions
public int ndimensions()
- Always returns 1.
- Specified by:
ndimensionsin interfaceDistribution- Overrides:
ndimensionsin classAbstractDistribution
cdf
public double cdf(double x)
throws java.lang.Exception
- Compute the cumulative distribution function.
- Specified by:
cdfin interfaceDistribution- Overrides:
cdfin classAbstractDistribution
p
public double p(double[] x)
- Compute the density at the point
x. This returns 1/(b-a) if x is between a and b, inclusive, and zero otherwise.
random
public double[] random()
- Returns a random number drawn from the interval [a,b].
- Specified by:
randomin interfaceDistribution- Overrides:
randomin classAbstractDistribution
pretty_input
public void pretty_input(riso.general.SmarterTokenizer st) throws java.io.IOException
- Inputs the parameters of this uniform distribution from a stream.
- Overrides:
pretty_inputin classAbstractDistribution
format_string
public java.lang.String format_string(java.lang.String leading_ws)
- Format this uniform distribution into a string, which can be parsed by parse_string.
- Specified by:
format_stringin interfaceConditionalDistribution- Overrides:
format_stringin classAbstractDistribution
expected_value
public double expected_value()
- Returns the expected value of this distribution.
- Specified by:
expected_valuein interfaceDistribution- Overrides:
expected_valuein classAbstractDistribution
sqrt_variance
public double sqrt_variance()
- Returns the square root of the variance of this distribution.
- Specified by:
sqrt_variancein interfaceDistribution- Overrides:
sqrt_variancein classAbstractDistribution
effective_support
public double[] effective_support(double epsilon)
- Returns the support of this distribution.
- Specified by:
effective_supportin interfaceDistribution- Overrides:
effective_supportin classAbstractDistribution
initial_mix
public MixGaussians initial_mix(double[] support)
- Returns an approximation containing several components.
The approximation is not very good.
- Specified by:
initial_mixin interfaceDistribution- Overrides:
initial_mixin classAbstractDistribution
|
|||||||||
| Home >> All >> riso >> [ distributions overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC