public QuietRealParameter getSample(ParametricDistribution distr, double upper, double lower) throws Exception { Double[][] sampleVals = distr.sample(1); QuietRealParameter sampleParameter = new QuietRealParameter(sampleVals[0]); sampleParameter.setUpper(upper); sampleParameter.setLower(lower); return sampleParameter; }
private double proposeNewValue( QuietRealParameter proposal, Double[] oldValues, ParametricDistribution distr, double upper, double lower) throws Exception { Double[] sampleVals = distr.sample(1)[0]; for (int i = 0; i < sampleVals.length; i++) { // if(distr instanceof DiracDeltaDistribution) // System.out.println(distr.getClass()); proposal.setValueQuietly(i, oldValues[i] + sampleVals[i]); } proposal.setUpper(upper); proposal.setLower(lower); return distr.calcLogP(new QuietRealParameter(sampleVals)); }