Package gov.sandia.cognition.statistics.distribution

Examples of gov.sandia.cognition.statistics.distribution.InverseGammaDistribution.sample()


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

        final InverseGammaDistribution thisSigma2Prior = this.initialPriorSigma2.clone();
        final double sigma2Sample = thisSigma2Prior.sample(this.rng);

        final KalmanFilter thisKf = this.initialKf.clone();
        final MultivariateGaussian thisPsiPrior = initialPriorPsi.clone();
        // TODO FIXME use t-distribution
        final MultivariateGaussian thisPsiPriorSmpler = thisPsiPrior.clone();
View Full Code Here


          H.transpose().times(postStateSample)));
      final MultivariateGaussian postPsi = predState.getPsiSS().clone();
      postPsi.setMean(postPsiMean);
      postPsi.setCovariance(postAInv);
     
      final double sigma2Smpl = sigma2SS.sample(this.rng);
      final GaussianArHpWfParticle postState =
          new GaussianArHpWfParticle(kf, predState.getObservation(),
              posteriorState, postStateSample,
              sigma2SS, postPsi,
              sigma2Smpl, predState.getPsiSample());
View Full Code Here

 
    /*
     * Perform the Kalman update to get the posterior state suff. stats.
     */
    final InverseGammaDistribution priorSigma2 = prevState.getSigma2SS().clone();
    final double sigma2Sample = priorSigma2.sample(this.getRandom());
    MultivariateGaussian posteriorState = prevState.getState().clone();
    // TODO FIXME gross hack!
//    posteriorState.getCovariance().scaleEquals(sigma2Sample);
//    kf.setMeasurementCovariance(Iy.scale(sigma2Sample));
//    kf.setModelCovariance(Ix.scale(sigma2Sample));
View Full Code Here

         * the constant offset varies.
         * As well, we need to set/reset the kalman filters to adhere
         * to the intended model.
         */
        final List<MultivariateGaussian> thesePriorOffsets = Lists.newArrayList();
        final double invScaleSample = thisPriorInvScale.sample(this.rng);
        int k = 0;
        for (KalmanFilter kf : particlePriorHmm.getStateFilters()) {
          final MultivariateGaussian thisPriorOffset = priorOffsets.get(k).clone();
          thesePriorOffsets.add(thisPriorOffset);
          k++;
View Full Code Here

     
      invScaleSS.setScale(d);
      invScaleSS.setShape(newN);
     
      // FIXME TODO: crappy sampler
      final double newInvScaleSmpl = invScaleSS.sample(this.rng);
     
      /*
       * Update state and measurement covariances, which
       * have a strict dependency in this model (equality).
       */
 
View Full Code Here

         * In this model, covariance is the same across components;
         * the constant offset varies.
         * As well, we need to set/reset the kalman filters to adhere
         * to the intended model.
         */
        final double scaleSample = thisPriorScale.sample(this.rng);

        final MultivariateGaussian thisPriorOffset = initialPriorPsi.clone();

        final Vector systemSample = thisPriorOffset.sample(this.rng);
        final Vector offsetTerm = systemSample.subVector(0,
View Full Code Here

     
      scaleSS.setScale(d);
      scaleSS.setShape(newN);
     
      // FIXME TODO: crappy sampler
      final double newScaleSmpl = scaleSS.sample(this.rng);
     
      /*
       * Update state and measurement covariances, which
       * have a strict dependency in this model (equality).
       */
 
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.