Package gov.sandia.cognition.statistics.distribution

Examples of gov.sandia.cognition.statistics.distribution.MultivariateStudentTDistribution


      // TODO FIXME
      final Matrix stPriorPredPrec = mPriorPredCov.inverse().scale(
          transParticle.getSigma2SS().getShape()/transParticle.getSigma2SS().getScale());


      MultivariateStudentTDistribution mPriorPredDist = new MultivariateStudentTDistribution(
          transParticle.getSigma2SS().getShape(),
          mPriorPredMean, stPriorPredPrec);

      final double logCt = mPriorPredDist.getProbabilityFunction().logEvaluate(
          observation.getObservedValue());

      return logCt;
    }
View Full Code Here


      final InverseGammaDistribution sigma2SS = predState.getSigma2SS().clone();
      // TODO FIXME matrix inverse!!
      final Matrix postStatePrec = posteriorState.getCovarianceInverse().scale(
          sigma2SS.getShape()/sigma2SS.getScale());
      MultivariateStudentTDistribution postStateMarginal = new MultivariateStudentTDistribution(
          sigma2SS.getShape(),
          posteriorState.getMean(), postStatePrec);
      final Vector postStateSample = postStateMarginal.sample(this.rng);
     
      final Vector psiPriorSmpl = predState.getPsiSample();
      // x_t
      final Vector xHdiff = postStateSample.minus(H.times(psiPriorSmpl));
View Full Code Here

              - centeringDist.getInputDimensionality() + 1d;
      final double kappa = centeringDist.getCovarianceDivisor();
      final Matrix newComponentPriorPredPrecision =
          centeringDist.getInverseWishart().getInverseScale()
              .scale(2d * (kappa + 1d) / (kappa * newComponentPriorPredDof));
      final MultivariateStudentTDistribution newComponentPriorPred =
          new MultivariateStudentTDistribution(newComponentPriorPredDof, centeringDist
              .getGaussian().getMean(), newComponentPriorPredPrecision.inverse());

      final double newComponentLogLikelihood =
          Math.log(particle.getAlpha()) - Math.log(particle.getAlpha() + particle.getIndex())
              + newComponentPriorPred.getProbabilityFunction().logEvaluate(observation);
      componentPriorPredLogLikelihoods[0] = newComponentLogLikelihood;

      double totalLogLikelihood = newComponentLogLikelihood;

      /*
       * Now, evaluate log likelihood for the current mixture components
       */
      int n = 0;
      for (final MultivariateGaussian component : particle.getDistributions()) {

        final double componentN = particle.getCounts().getElement(n);
        final double componentPriorPredDof =
            2d * centeringDist.getInverseWishart().getDegreesOfFreedom() + componentN
                - centeringDist.getInputDimensionality() + 1d;
        final Vector componentPriorPredMean =
            centeringDist.getGaussian().getMean().scale(kappa)
                .plus(component.getMean().scale(componentN)).scale(1d / (kappa + componentN));


        final Vector componentCenteringMeanDiff =
            centeringDist.getGaussian().getMean().minus(component.getMean());
        final Matrix componentD =
            component.getCovariance().plus(
                componentCenteringMeanDiff.outerProduct(componentCenteringMeanDiff).scale(
                    kappa * componentN / (kappa + componentN)));

        final Matrix componentPriorPredCovariance =
            centeringDist
                .getInverseWishart()
                .getInverseScale()
                .plus(componentD.scale(1d / 2d))
                .scale(
                    2d * (kappa + componentN + 1d) / ((kappa + componentN) * componentPriorPredDof));

        // FIXME TODO avoid this inverse!
        final MultivariateStudentTDistribution componentPriorPred =
            new MultivariateStudentTDistribution(componentPriorPredDof, componentPriorPredMean,
                componentPriorPredCovariance.inverse());

        final double componentLogLikelihood =
            Math.log(componentN) - Math.log(particle.getAlpha() + particle.getIndex())
                + componentPriorPred.getProbabilityFunction().logEvaluate(observation);

        componentPriorPredLogLikelihoods[n + 1] = componentLogLikelihood;
        totalLogLikelihood = LogMath.add(totalLogLikelihood, componentLogLikelihood);
        n++;
      }
View Full Code Here

         */
        final InverseGammaDistribution sigma2SS = particle.getSigma2SS();
        // TODO FIXME matrix inverse!!
        final Matrix postStatePrec = particle.getState().getCovarianceInverse().scale(
            sigma2SS.getShape()/sigma2SS.getScale());
        MultivariateStudentTDistribution postStateMarginal = new MultivariateStudentTDistribution(
            sigma2SS.getShape(),
            particle.getState().getMean(), postStatePrec);
        final Vector stateSample = postStateMarginal.sample(this.getRandom());

        final GaussianArHpWfParticle transStateTmp =
            new GaussianArHpWfParticle(particle.getPrevParticle(),
                particle.getFilter(),
                particle.getObs(),
View Full Code Here

TOP

Related Classes of gov.sandia.cognition.statistics.distribution.MultivariateStudentTDistribution

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.