|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.tumba.ngram.bayes.DiscreteFunction pt.tumba.ngram.bayes.ProbabilityFunction
public class ProbabilityFunction
***************************************************************
Field Summary | |
---|---|
protected BayesNet |
bn
|
protected java.util.Vector |
properties
|
Fields inherited from class pt.tumba.ngram.bayes.DiscreteFunction |
---|
values, variables |
Constructor Summary | |
---|---|
ProbabilityFunction()
Default constructor for a ProbabilityFunction. |
|
ProbabilityFunction(BayesNet b_n,
DiscreteVariable[] pvs,
double[] v,
java.util.Vector prop)
Constructor for ProbabilityFunction. |
|
ProbabilityFunction(BayesNet b_n,
int n_vb,
int n_vl,
java.util.Vector prop)
Constructor for ProbabilityFunction. |
|
ProbabilityFunction(DiscreteFunction df,
BayesNet b_n)
Constructor for ProbabilityFunction. |
|
ProbabilityFunction(DiscreteFunction df,
double[] new_values)
Constructor for ProbabilityFunction. |
Method Summary | |
---|---|
void |
add_property(java.lang.String prop)
Add a property to the current ProbabilityFunction. |
double |
evaluate(int[] value_indexes)
Evaluate a function given a (possibly partial) instantiation of variables through the markers. |
double |
evaluate(java.lang.String[][] variable_value_pairs)
Evaluate a function given a list of pairs (Variable Value) which specifies a value of the function. |
double |
expected_value(DiscreteFunction df)
Obtain expected value of a DiscreteFunction The current implementation is very limited; it assumes that both the ProbabilityFunction object and the DiscreteFunctions object has a single variable, and the variable must be the same for both functions. |
java.util.Enumeration |
get_enumerated_properties()
Get an Enumeration with the properties of the current ProbabilityFunction. |
int |
get_position_from_indexes(int[] variable_indexes)
Get position in a function from a (possibly partial) instantiation of variables through the indexes. |
java.util.Vector |
get_properties()
Get the properties of the current ProbabilityFunction. |
double |
posterior_expected_value(DiscreteFunction df)
Obtain posterior expected value of a DiscreteFunction This assumes that the probability values are unnormalized, equal to p(x, e) where e is the evidence. |
void |
print(java.io.PrintStream out)
Print method. |
(package private) void |
process_properties()
|
void |
remove_property(int i)
Remove a property in a given position in the current ProbabilityFunction. |
void |
remove_property(java.lang.String prop)
Remove a property in the current ProbabilityFunction. |
void |
save_xml_0_3(java.io.PrintStream out)
Save the contents of a ProbabilityFunction object into a PrintStream in the XMLBIF v0.3 format. |
void |
save_xml(java.io.PrintStream out)
Save the contents of a ProbabilityFunction object into a PrintStream. |
void |
set_properties(java.util.Vector prop)
Set the properties. |
void |
set_value(java.lang.String[][] variable_value_pairs,
double val)
Set a single value of the probability function. |
double |
variance(DiscreteFunction df)
Calculate the variance of a DiscreteFunction. |
Methods inherited from class pt.tumba.ngram.bayes.DiscreteFunction |
---|
evaluate, get_index, get_indexes, get_position_from_indexes, get_value, get_values, get_variable, get_variables, memberOf, multiply, normalize_first, normalize, number_values, number_variables, print, same_variables, set_value, set_values, set_variable, sum_out |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.Vector properties
protected BayesNet bn
Constructor Detail |
---|
public ProbabilityFunction()
public ProbabilityFunction(BayesNet b_n, int n_vb, int n_vl, java.util.Vector prop)
public ProbabilityFunction(BayesNet b_n, DiscreteVariable[] pvs, double[] v, java.util.Vector prop)
public ProbabilityFunction(DiscreteFunction df, double[] new_values)
public ProbabilityFunction(DiscreteFunction df, BayesNet b_n)
Method Detail |
---|
void process_properties()
public void set_value(java.lang.String[][] variable_value_pairs, double val)
public double evaluate(java.lang.String[][] variable_value_pairs)
public double evaluate(int[] value_indexes)
public int get_position_from_indexes(int[] variable_indexes)
public double expected_value(DiscreteFunction df)
public double posterior_expected_value(DiscreteFunction df)
public double variance(DiscreteFunction df)
public void save_xml_0_3(java.io.PrintStream out)
public void save_xml(java.io.PrintStream out)
public void print(java.io.PrintStream out)
print
in class DiscreteFunction
public java.util.Vector get_properties()
public void set_properties(java.util.Vector prop)
public java.util.Enumeration get_enumerated_properties()
public void add_property(java.lang.String prop)
public void remove_property(java.lang.String prop)
public void remove_property(int i)
i
- Position of the property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |