Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

riso.distributions
Class Beta  view Beta download Beta.java

java.lang.Object
  extended byriso.distributions.AbstractDistribution
      extended byriso.distributions.Beta
All Implemented Interfaces:
ConditionalDistribution, Distribution, java.io.Serializable

public class Beta
extends AbstractDistribution

An instance of this class represents a beta distribution.


Field Summary
 double p
           
 double q
           
 
Fields inherited from class riso.distributions.AbstractDistribution
associated_variable
 
Constructor Summary
Beta()
          Default constructor for this class.
Beta(double p, double q)
          Constructs a beta distribution with the specified parameters.
 
Method Summary
 double cdf(double x)
          Compute the cumulative distribution function of this beta distribution.
 double[] effective_support(double epsilon)
          Always returns the interval [0,1] -- this is the support of all beta distributions.
 double expected_value()
          Returns the expected value of this distribution.
 java.lang.String format_string(java.lang.String leading_ws)
          Formats a string representation of this distribution.
 double log_prior()
          Computes the log of the prior probability of the parameters of this distribution, assuming some prior distribution has been established.
 int ndimensions()
          Returns the number of dimensions in which this distribution lives.
 double p(double[] x)
          Computes the density at the point x.
 void pretty_input(riso.general.SmarterTokenizer st)
          Read an instance of this distribution from an input stream.
 double[] random()
          Return an instance of a random variable from this distribution.
 double sqrt_variance()
          Returns the square root of the variance of this distribution.
 double update(double[][] x, double[] responsibility, int niter_max, double stopping_criterion)
          Use data to modify the parameters of the distribution.
 
Methods inherited from class riso.distributions.AbstractDistribution
clone, get_density, get_nstates, initial_mix, log_p, ndimensions_child, ndimensions_parent, p, parse_string, pretty_output, random, set_variable, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p

public double p

q

public double q
Constructor Detail

Beta

public Beta(double p,
            double q)
Constructs a beta distribution with the specified parameters.


Beta

public Beta()
Default constructor for this class. Sets parameters p and q to 1.

Method Detail

ndimensions

public int ndimensions()
Returns the number of dimensions in which this distribution lives. Always returns 1.

Specified by:
ndimensions in interface Distribution
Overrides:
ndimensions in class AbstractDistribution

p

public double p(double[] x)
Computes the density at the point x.


cdf

public double cdf(double x)
Compute the cumulative distribution function of this beta distribution.

Specified by:
cdf in interface Distribution
Overrides:
cdf in class AbstractDistribution

log_prior

public double log_prior()
                 throws java.lang.Exception
Computes the log of the prior probability of the parameters of this distribution, assuming some prior distribution has been established. This may not be meaningful for all distributions.

Specified by:
log_prior in interface Distribution
Overrides:
log_prior in class AbstractDistribution

random

public double[] random()
                throws java.lang.Exception
Return an instance of a random variable from this distribution. This method is not implemented.

Specified by:
random in interface Distribution
Overrides:
random in class AbstractDistribution

update

public double update(double[][] x,
                     double[] responsibility,
                     int niter_max,
                     double stopping_criterion)
              throws java.lang.Exception
Use data to modify the parameters of the distribution. This method is not implemented.

Specified by:
update in interface Distribution
Overrides:
update in class AbstractDistribution

expected_value

public double expected_value()
Returns the expected value of this distribution.

Specified by:
expected_value in interface Distribution
Overrides:
expected_value in class AbstractDistribution

sqrt_variance

public double sqrt_variance()
Returns the square root of the variance of this distribution. This is equal to the scale parameter times the square root of the shape parameter.

Specified by:
sqrt_variance in interface Distribution
Overrides:
sqrt_variance in class AbstractDistribution

effective_support

public double[] effective_support(double epsilon)
                           throws java.lang.Exception
Always returns the interval [0,1] -- this is the support of all beta distributions.

Specified by:
effective_support in interface Distribution
Overrides:
effective_support in class AbstractDistribution

format_string

public java.lang.String format_string(java.lang.String leading_ws)
Formats a string representation of this distribution. Since the representation is only one line of output, the argument leading_ws is ignored.

Specified by:
format_string in interface ConditionalDistribution
Overrides:
format_string in class AbstractDistribution

pretty_input

public void pretty_input(riso.general.SmarterTokenizer st)
                  throws java.io.IOException
Read an instance of this distribution from an input stream. This is intended for input from a human-readable source; this is different from object serialization.

Overrides:
pretty_input in class AbstractDistribution