public <E extends UnivariateDistribution> E getParameterPosteriorTimeT(Variable parameter) { if (parameter.isParameterVariable()) { Variable newVar =this.svbTimeT.getPlateuStructure().getEFLearningBN().getParametersVariables().getVariableByName(parameter.getName()); return this.svbTimeT.getParameterPosterior(newVar); }else { Variable newVar =this.dagTimeT.getVariables().getVariableByName(parameter.getName()); return this.svbTimeT.getParameterPosterior(newVar); } }
/** * Updates the model at time 0 using a given {@link DynamicDataInstance}. * @param dataInstance a {@link DynamicDataInstance} object. * @return a {@code double} value. */ private double updateModelTime0(DynamicDataInstance dataInstance) { this.plateauStructure.setEvidenceTime0(dataInstance); this.plateauStructure.runInferenceTime0(); for (Variable var: plateauStructure.getEFLearningBNTime0().getParametersVariables()){ EF_UnivariateDistribution uni = plateauStructure.getEFParameterPosteriorTime0(var).deepCopy(); plateauStructure.getEFLearningBNTime0().setDistribution(var, uni); this.plateauStructure.getNodeOfVarTime0(var).setPDist(uni); } return this.plateauStructure.getLogProbabilityOfEvidenceTime0(); }
public <E extends UnivariateDistribution> E getParameterPosteriorTime0(Variable parameter) { if (parameter.isParameterVariable()) { Variable newVar =this.parallelVBTime0.getSVB().getPlateuStructure().getEFLearningBN().getParametersVariables().getVariableByName(parameter.getName()); return this.parallelVBTime0.getParameterPosterior(newVar); }else { Variable newVar =this.dagTime0.getVariables().getVariableByName(parameter.getName()); return this.parallelVBTime0.getParameterPosterior(newVar); } }
/** * Updates the model at time T using a given list of {@link DynamicDataInstance}s. * @param batch a {@code List} of {@link DynamicDataInstance}s. * @return a {@code double} value. */ private double updateModelTimeT(List<DynamicDataInstance> batch) { this.plateauStructure.setEvidenceTimeT(batch); this.plateauStructure.runInferenceTimeT(); for (Variable var: plateauStructure.getEFLearningBNTimeT().getParametersVariables()){ EF_UnivariateDistribution uni = plateauStructure.getEFParameterPosteriorTimeT(var).deepCopy(); plateauStructure.getEFLearningBNTimeT().setDistribution(var,uni); this.plateauStructure.getNodeOfVarTimeT(var,0).setPDist(uni); } return this.plateauStructure.getLogProbabilityOfEvidenceTimeT(); }