public class SeparateGaussianLogPrior extends SeparateLogPrior
LogPrior that defines a Gaussian prior on the parameters
of a set of DifferentiableStatisticalModels
and a set of class parameters. The variances v[i] for a
parameter i of a
DifferentiableStatisticalModel
fun[j] are determined from the base variance v[j]
asv[i] = v[j]*funs[j].getSizeOfEventSpaceForRandomVariablesOfParameter(j)
. DifferentiableStatisticalModels and to the
user-specified means for the class parameters.| Modifier and Type | Field and Description |
|---|---|
protected double[] |
mus
The means
|
protected double[] |
vars2
The variances
|
classMus, classVars, freeParameters, funs, vars| Constructor and Description |
|---|
SeparateGaussianLogPrior(double[] vars,
double[] classVars,
double[] classMus)
Creates a new
SeparateGaussianLogPrior from a set of base
variances vars, a set of class variances
classVars and a set of class means classMus. |
SeparateGaussianLogPrior(StringBuffer xml)
The standard constructor for the interface
Storable. |
| Modifier and Type | Method and Description |
|---|---|
void |
addGradientFor(double[] params,
double[] grad)
Adds the gradient of the log-prior using the current parameters to a
given vector.
|
double |
evaluateFunction(double[] x)
Evaluates the function at a certain vector (in mathematical sense)
x. |
int |
getDimensionOfScope()
Returns the dimension of the scope of the
Function. |
String |
getInstanceName()
Returns a short instance name.
|
void |
unset()
Resets all internally pre-computed values, e.g.
|
getNewInstance, set, toXMLevaluateGradientOfFunctionfindOneDimensionalMinpublic SeparateGaussianLogPrior(double[] vars,
double[] classVars,
double[] classMus)
SeparateGaussianLogPrior from a set of base
variances vars, a set of class variances
classVars and a set of class means classMus.vars - the base variances for each classclassVars - the class variancesclassMus - the class meansSeparateLogPrior.SeparateLogPrior(double[], double[], double[])public SeparateGaussianLogPrior(StringBuffer xml) throws NonParsableException
Storable.
Creates a new SeparateGaussianLogPrior out of its XML
representation.xml - the XML representation as StringBufferNonParsableException - if the SeparateGaussianLogPrior could not be
reconstructed out of the XML representation (the
StringBuffer could not be parsed)SeparateLogPrior.SeparateLogPrior(StringBuffer),
Storablepublic void unset()
SeparateLogPriorunset in class SeparateLogPriorpublic void addGradientFor(double[] params,
double[] grad)
LogPrioraddGradientFor in class LogPriorparams - the parametersgrad - the vectorpublic double evaluateFunction(double[] x)
throws DimensionException,
EvaluationException
Functionx.x - the current vectorDimensionException - if dim(x) != n, with 
EvaluationException - if there was something wrong during the evaluation of the
functionpublic int getDimensionOfScope()
FunctionFunction.n with

public String getInstanceName()
LogPriorgetInstanceName in class LogPrior