Functions | Variables
testGaussianMixture.cpp File Reference

Test hybrid elimination with a simple mixture model. More...

#include <gtsam/discrete/DecisionTreeFactor.h>
#include <gtsam/discrete/DiscreteConditional.h>
#include <gtsam/discrete/DiscreteKey.h>
#include <gtsam/hybrid/HybridBayesNet.h>
#include <gtsam/hybrid/HybridGaussianConditional.h>
#include <gtsam/hybrid/HybridGaussianFactorGraph.h>
#include <gtsam/inference/Key.h>
#include <gtsam/inference/Symbol.h>
#include <gtsam/linear/GaussianConditional.h>
#include <gtsam/linear/NoiseModel.h>
#include <CppUnitLite/TestHarness.h>
Include dependency graph for testGaussianMixture.cpp:

Go to the source code of this file.

Functions

double Gaussian (double mu, double sigma, double z)
 Gaussian density function. More...
 
const DiscreteKey m (M(0), 2)
 
int main ()
 
double prob_m_z (double mu0, double mu1, double sigma0, double sigma1, double z)
 
 TEST (GaussianMixture, GaussianMixtureModel)
 
 TEST (GaussianMixture, GaussianMixtureModel2)
 

Variables

const DiscreteValues m1Assignment {{M(0), 1}}
 
DiscreteConditional::shared_ptr mixing
 

Detailed Description

Test hybrid elimination with a simple mixture model.

Author
Varun Agrawal
Frank Dellaert
Date
September 2024

Definition in file testGaussianMixture.cpp.

Function Documentation

◆ Gaussian()

double Gaussian ( double  mu,
double  sigma,
double  z 
)

Gaussian density function.

Definition at line 47 of file testGaussianMixture.cpp.

◆ m()

const DiscreteKey m ( M(0)  ,
 
)

◆ main()

int main ( )

Definition at line 166 of file testGaussianMixture.cpp.

◆ prob_m_z()

double prob_m_z ( double  mu0,
double  mu1,
double  sigma0,
double  sigma1,
double  z 
)

Closed form computation of P(m=1|z). If sigma0 == sigma1, it simplifies to a sigmoid function. Hardcodes 60/40 prior on mode.

Definition at line 56 of file testGaussianMixture.cpp.

◆ TEST() [1/2]

TEST ( GaussianMixture  ,
GaussianMixtureModel   
)

Definition at line 67 of file testGaussianMixture.cpp.

◆ TEST() [2/2]

TEST ( GaussianMixture  ,
GaussianMixtureModel2   
)

Definition at line 111 of file testGaussianMixture.cpp.

Variable Documentation

◆ m1Assignment

const DiscreteValues m1Assignment {{M(0), 1}}

Definition at line 40 of file testGaussianMixture.cpp.

◆ mixing

Initial value:
=
std::make_shared<DiscreteConditional>(m, "60/40")

Definition at line 43 of file testGaussianMixture.cpp.

m
const DiscreteKey m(M(0), 2)


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:09:53