Examples of GaussianEnsParticle


Examples of plm.ensemble.GaussianEnsParticle

        /*
         * K many sub-samples of x_{t-1} 
         */

        final GaussianEnsParticle transStateTmp =
            null;
//            new GaussianEnsParticle(particle.getPrevParticle(),
//                particle.getFilter(),
//                particle.getObs(),
//                particle.getState(),
//                stateSample);

        final double transStateLogLik =
            this.updater.computeLogLikelihood(transStateTmp, data)
                + particlePriorLogLik;

        final GaussianEnsParticle transState =
            this.forwardParticle(particle, data);

        logLikelihoods.add(transStateLogLik);
        particleSupport.add(transState);

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

    final CountedDataDistribution<GaussianEnsParticle> resampledParticles;
    /*
     * Water-filling resample, for a smoothed predictive set
     */
    resampledParticles =
        ExtSamplingUtils.waterFillingResample(
            Doubles.toArray(logLikelihoods),
            particleTotalLogLikelihood, particleSupport,
            this.random, this.numParticles);
    ResampleType resampleType = ((WFCountedDataDistribution) resampledParticles)
          .wasWaterFillingApplied() ?
            ResampleType.WATER_FILLING:
              ResampleType.NO_REPLACEMENT;

    /*
     * Update sufficient stats.
     */
    final CountedDataDistribution<GaussianEnsParticle> updatedDist =
        new CountedDataDistribution<GaussianEnsParticle>(true);
    for (final Entry<GaussianEnsParticle, MutableDouble> entry : resampledParticles
        .asMap().entrySet()) {
      final GaussianEnsParticle updatedEntry =
          this.updater.update(entry.getKey());
      updatedEntry.setResampleType(resampleType);
      updatedEntry.setStateLogWeight(entry.getValue().doubleValue());
      updatedDist.set(updatedEntry, entry.getValue().doubleValue(),
          ((MutableDoubleCount) entry.getValue()).count);
    }

    Preconditions
View Full Code Here

Examples of plm.ensemble.GaussianEnsParticle

          CountedDataDistribution.create(numParticles, true);
      for (int i = 0; i < numParticles; i++) {

        final KalmanFilter thisKf = this.initialKf.clone();

        final GaussianEnsParticle particle =
            null;
//            new GaussianEnsParticle(thisKf,
//                ObservedValue.<Vector>create(0, null)
//                );
       
        particle.setResampleType(ResampleType.NONE);

        final double logWeight = -Math.log(numParticles);
        particle.setStateLogWeight(logWeight);
        initialParticles.increment(particle, logWeight);
      }
      return initialParticles;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.