Package gov.sandia.cognition.statistics.distribution

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


        final KalmanFilter thisKf = this.initialKf.clone();
        final MultivariateGaussian thisPsiPrior = initialPriorPsi.clone();
        // TODO FIXME use t-distribution
        final MultivariateGaussian thisPsiPriorSmpler = thisPsiPrior.clone();
        thisPsiPriorSmpler.getCovariance().scaleEquals(sigma2Sample);
        final Vector psiSample = thisPsiPriorSmpler.sample(this.rng);

        final Vector alphaTerm = psiSample.subVector(0,
            psiSample.getDimensionality()/2 - 1);
        thisKf.getModel().setState(alphaTerm);
        thisKf.setCurrentInput(alphaTerm);
View Full Code Here


        thisKf.setModelCovariance(modelIdent);

        final MultivariateGaussian priorState = thisKf.createInitialLearnedObject();
        final MultivariateGaussian priorStateSmpler = thisKf.createInitialLearnedObject();
        priorStateSmpler.getCovariance().scaleEquals(sigma2Sample);
        final Vector priorStateSample = priorStateSmpler.sample(this.rng);


        final GaussianArHpWfParticle particle =
            new GaussianArHpWfParticle(thisKf,
                ObservedValue.<Vector>create(0, null), priorState,
View Full Code Here

      GaussianArHpWfParticle prevState, ObservedValue<Vector,?> data) {
    /*
     * Sample psi
     */
    final MultivariateGaussian priorPsi = prevState.getPsiSS();
    final Vector priorPsiSmpl = priorPsi.sample(this.getRandom());

    final KalmanFilter kf = prevState.getFilter().clone();

    /*
     * Update the filter parameters with the new psi.
View Full Code Here

       * current states (beta and the global mean), i.e. a draw from (x_t, x_{t-1} | y_t). FIXME XXX
       * The above isn't currently being done
       */
      final MultivariateGaussian priorBetaSmoothedDist = getSmoothedPriorDist(particle.getPriorBeta(),
        augResponseDist, observation, particle.getPriorPredictiveMean());
      final Vector priorBetaSmoothedSample = priorBetaSmoothedDist.sample(random);
      final MultivariateGaussian postBetaSmoothedDist = getSmoothedPostDist(particle.getPriorBeta(),
        augResponseDist, observation, particle.getPriorPredictiveMean());
      final Vector postBetaSmoothedSample = postBetaSmoothedDist.sample(random);

      final Vector priorGlobalMeanSample = particle.getPriorBeta().getMean();
View Full Code Here

      final MultivariateGaussian priorBetaSmoothedDist = getSmoothedPriorDist(particle.getPriorBeta(),
        augResponseDist, observation, particle.getPriorPredictiveMean());
      final Vector priorBetaSmoothedSample = priorBetaSmoothedDist.sample(random);
      final MultivariateGaussian postBetaSmoothedDist = getSmoothedPostDist(particle.getPriorBeta(),
        augResponseDist, observation, particle.getPriorPredictiveMean());
      final Vector postBetaSmoothedSample = postBetaSmoothedDist.sample(random);

      final Vector priorGlobalMeanSample = particle.getPriorBeta().getMean();
      final Vector postGlobalMeanSample = particle.getPriorBeta().sample(random);

      /*
 
View Full Code Here

        for (KalmanFilter kf : particlePriorHmm.getStateFilters()) {
          final MultivariateGaussian thisPriorOffset = priorOffsets.get(k).clone();
          thesePriorOffsets.add(thisPriorOffset);
          k++;

          final Vector systemSample = thisPriorOffset.sample(this.rng);
          final Vector offsetTerm = systemSample.subVector(0,
              systemSample.getDimensionality()/2 - 1);
          kf.getModel().setState(offsetTerm);
          kf.setCurrentInput(offsetTerm);
View Full Code Here

        }

        final KalmanFilter kf = Iterables.get(particlePriorHmm.getStateFilters(),
            sampledClass);
        final MultivariateGaussian priorState = kf.createInitialLearnedObject();
        final Vector priorStateSample = priorState.sample(this.rng);

        final GaussianArHpTransitionState particle =
            new GaussianArHpTransitionState(particlePriorHmm, sampledClass,
                ObservedValue.<Vector>create(0, null), priorState,
                priorStateSample,
View Full Code Here

      final int xDim = posteriorState.getInputDimensionality();
      final Matrix Ij = MatrixFactory.getDefault().createIdentity(xDim, xDim);
      final Matrix H = MatrixFactory.getDefault().createMatrix(xDim, xDim * 2);
      H.setSubMatrix(0, 0, Ij);
      H.setSubMatrix(0, xDim, MatrixFactory.getDefault().createDiagonal(predState.getStateSample()));
      final Vector postStateSample = posteriorState.sample(this.rng);
      final MultivariateGaussian priorPhi = predState.getPsiSS().get(predState.getClassId());
      final Vector phiPriorSmpl = priorPhi.sample(this.rng);
      final Vector xHdiff = postStateSample.minus(H.times(phiPriorSmpl));

      final double newN = invScaleSS.getShape() + 1d;
View Full Code Here

      final Matrix H = MatrixFactory.getDefault().createMatrix(xDim, xDim * 2);
      H.setSubMatrix(0, 0, Ij);
      H.setSubMatrix(0, xDim, MatrixFactory.getDefault().createDiagonal(predState.getStateSample()));
      final Vector postStateSample = posteriorState.sample(this.rng);
      final MultivariateGaussian priorPhi = predState.getPsiSS().get(predState.getClassId());
      final Vector phiPriorSmpl = priorPhi.sample(this.rng);
      final Vector xHdiff = postStateSample.minus(H.times(phiPriorSmpl));

      final double newN = invScaleSS.getShape() + 1d;
      final double d = invScaleSS.getScale() + xHdiff.dotProduct(xHdiff);
     
View Full Code Here

          H.transpose().times(postStateSample)));
      final MultivariateGaussian postPhi = systemOffsetsSS.get(predState.getClassId());
      postPhi.setMean(postPhiMean);
      postPhi.setCovariance(postAInv.scale(newInvScaleSmpl));
     
      final Vector postPhiSmpl = postPhi.sample(this.rng);
      final Matrix smplArTerms = MatrixFactory.getDefault().createDiagonal(
          postPhiSmpl.subVector(
              postPhiSmpl.getDimensionality()/2,
              postPhiSmpl.getDimensionality() - 1));
      kf.getModel().setA(smplArTerms);
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.