*/
public DblParamSet negLogPrior()
{
//There will be one prior probability for each parameter.
//Get the uniform priors for all parameters first. This initializes with default priors.
DblParamSet priors = super.negLogPrior();
String[] names = priors.parameterSet();
DblParamSet priorParameters = this.getPriorParams();
for (int j=0;j<names.length;j++)
{
String priorname = "mean_"+names[j];
if (priorParameters.hasParameter(priorname))
{
DblMatrix mean = (DblMatrix)priorParameters.getParam(priorname);
priorname = "var_"+names[j];
DblMatrix var = (DblMatrix)priorParameters.getParam(priorname);
this.normal.setMean(mean);
this.normal.setVariance(var);
//Calculate and set the prior probability for the current value of the parameter.
DblMatrix VAL = this.getParam(names[j]);
priors.setParam(names[j],this.normal.pdf(VAL));
}
else
{
priorname = "mean_log_"+names[j];
if (priorParameters.hasParameter(priorname)) //Parameter is log-normal...
{
DblMatrix mean = (DblMatrix)priorParameters.getParam(priorname);
priorname = "var_log_"+names[j];
DblMatrix var = (DblMatrix)priorParameters.getParam(priorname);
this.normal.setMean(mean);
this.normal.setVariance(var);
//Calculate and set the prior probability for the current value of the parameter.
DblMatrix VAL = this.getParam(names[j]);
priors.setParam(names[j],this.normal.pdf(DblMatrix.log(VAL)));
}
else
{
priorname = "mean_log_delta_"+names[j]; //Order restricted parameters.
if (priorParameters.hasParameter(priorname)) //Parameter is order-restricted...
{
DblMatrix mean_log_delta = (DblMatrix)priorParameters.getParam(priorname);
priorname = "var_log_delta_"+names[j];
DblMatrix var_log_delta = (DblMatrix)priorParameters.getParam(priorname);
this.normal.setMean(mean_log_delta);
this.normal.setVariance(var_log_delta);
//Calculate delta.