Package plm.hmm.HmmTransitionState

Examples of plm.hmm.HmmTransitionState.ResampleType


      classificationRate.accumulate(new MutableDouble(wfErr));
    }

    runningRate.accumulate(new MutableDouble(classificationRate.getSum()));

    ResampleType resampleType = distribution.getMaxValueKey().getResampleType();
    String[] wfClassLine = {
        Integer.toString(replication),
        Long.toString(obs.getTime()),
        this.modelId,
        evaluatorType, resampleType.toString(),
        Double.toString(classificationRate.getSum().value)
       };
    if (this.writer != null)
      this.writer.writeNext(wfClassLine);
  }
View Full Code Here


            rsFilter.update(rsDistribution, obsState);
   
            /*
             * Compute and output RS forward errors
             */
            ResampleType rsResampleType = rsDistribution.getMaxValueKey().getResampleType();
            Vector rsStateProbDiffs = computeStateDiffs(i, hmm.getNumStates(), rsDistribution, forwardResults);
            String[] rsLine = {Integer.toString(k), Integer.toString(i), "p(x_t=0|y^t)",
               rsResampleType.toString(),
               Double.toString(rsStateProbDiffs.getElement(0))};
            writer.writeNext(rsLine);
            log.info("rsStateProbDiffs=" + rsStateProbDiffs);
   
     
            if (i > numPreRuns) {
              wfFilter.update(wfDistribution, obsState);
       
              RingAccumulator<MutableDouble> pfAtTRate = new RingAccumulator<MutableDouble>();
              for (P state : wfDistribution.getDomain()) {
                final double err = (x == state.getClassId()) ? wfDistribution.getFraction(state) : 0d;
                pfAtTRate.accumulate(new MutableDouble(err));
              }
              pfRunningRate.accumulate(new MutableDouble(pfAtTRate.getSum()));
       
              ResampleType wfResampleType = wfDistribution.getMaxValueKey().getResampleType();
              Vector wfStateProbDiffs = computeStateDiffs(i, hmm.getNumStates(), wfDistribution, forwardResults);
              String[] wfLine = {Integer.toString(k), Integer.toString(i), "p(x_t=0|y^t)", "water-filling",
                 wfResampleType.toString(),
                 Double.toString(wfStateProbDiffs.getElement(0))};
              writer.writeNext(wfLine);
              log.info("wfStateProbDiffs=" + wfStateProbDiffs);
   
            }
View Full Code Here

    resampledParticles =
        ExtSamplingUtils.waterFillingResample(
            Doubles.toArray(logLikelihoods),
            particleTotalLogLikelihood, particleSupport,
            this.random, this.numParticles);
    ResampleType resampleType = ((WFCountedDataDistribution) resampledParticles)
          .wasWaterFillingApplied() ?
            ResampleType.WATER_FILLING:
              ResampleType.NO_REPLACEMENT;

    /*
 
View Full Code Here

    resampledParticles =
        ExtSamplingUtils.waterFillingResample(
            Doubles.toArray(logLikelihoods),
            particleTotalLogLikelihood, particleSupport,
            this.random, this.numParticles);
    ResampleType resampleType = ((WFCountedDataDistribution) resampledParticles)
          .wasWaterFillingApplied() ?
            ResampleType.WATER_FILLING:
              ResampleType.NO_REPLACEMENT;

    /*
 
View Full Code Here

    resampledParticles =
        ExtSamplingUtils.waterFillingResample(
            Doubles.toArray(logLikelihoods),
            particleTotalLogLikelihood, particleSupport,
            this.random, this.numParticles);
    ResampleType resampleType = ((WFCountedDataDistribution) resampledParticles)
          .wasWaterFillingApplied() ?
            ResampleType.WATER_FILLING:
              ResampleType.NO_REPLACEMENT;

    /*
 
View Full Code Here

    }

    // TODO determine when to resample
    final boolean resample = this.computeEffectiveParticles(propogatedParticles)
        /this.numParticles < 0.80;
    final ResampleType resampleType = resample ? ResampleType.REPLACEMENT : ResampleType.NONE;
    CountedDataDistribution<GaussianArTransitionState> resampledDist;
    if (resample) {
      resampledDist = new CountedDataDistribution<GaussianArTransitionState>(true);
      resampledDist.incrementAll(propogatedParticles.sample(random, this.numParticles));
    } else {
View Full Code Here

            ExtLogMath.add(particleTotalLogLikelihood, transStateLogLik
                + Math.log(particleCount));
      }
    }

    final ResampleType resampleType;
    final CountedDataDistribution<ParticleType> resampledParticles;
    if (this.resampleOnly) {
      resampledParticles = new CountedDataDistribution<ParticleType>(true);
      resampledParticles.incrementAll(ExtSamplingUtils
          .sampleReplaceCumulativeLogScale(
View Full Code Here

TOP

Related Classes of plm.hmm.HmmTransitionState.ResampleType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.