GOBNILP  f164d83
Functions
bge_posterior.c File Reference

Describes a set of functions used for computing the posterior matrix of a continuous data set. More...

#include <stdio.h>
#include <string.h>
#include <assert.h>
#include "bge_posterior.h"
Include dependency graph for bge_posterior.c:

Functions

void SetPosteriorParametricMatrix (Bge_Matrix *data, Bge_Matrix *prior_matrix, Bge_Matrix *posterior_matrix, int alpha_mu, int alpha_omega)
 Sets the posterior matrix of the normal wishart disturbution over precision matrix W and mean v. More...
 
void SetPriorParametricMatrix (int n, int alpha_mu, int alpha_omega, Bge_Matrix *prior_matrix)
 Defines the Prior matrix for the Wishart disturbution over precision matrix W. More...
 
void SetSampleMean (Bge_Matrix *data, Bge_Vector *mean_vec)
 Finds the sample mean of the given data. More...
 
void SetSampleVariance (Bge_Matrix *data, Bge_Vector *mean_vec, Bge_Matrix *variance_matrix)
 Finds the Sample Variance (multiplied by N-1) of a set of data. More...
 

Detailed Description

Describes a set of functions used for computing the posterior matrix of a continuous data set.

Function Documentation

◆ SetPosteriorParametricMatrix()

void SetPosteriorParametricMatrix ( Bge_Matrix data,
Bge_Matrix prior_matrix,
Bge_Matrix posterior_matrix,
int  alpha_mu,
int  alpha_omega 
)

Sets the posterior matrix of the normal wishart disturbution over precision matrix W and mean v.

Parameters
datathe problem data set
theprior matrix for the wishart disturbution over the precision matrix W
posterior_matrixthe posterior matrix that is set for the normal wishart joint disturbution over the precision matrix and mean

References BgeMatrixAddition(), BgeMatrixCreate(), BgeMatrixDelete(), BgeMatrixScalarMultipliciation(), BgeVectorCreate(), BgeVectorDelete(), BgeVectorOuterProduct(), SetPriorParametricMatrix(), SetSampleMean(), and SetSampleVariance().

Here is the call graph for this function:

◆ SetPriorParametricMatrix()

void SetPriorParametricMatrix ( int  n,
int  alpha_mu,
int  alpha_omega,
Bge_Matrix prior_matrix 
)

Defines the Prior matrix for the Wishart disturbution over precision matrix W.

Parameters
nthe number of variables in the gaussian network
alpha_muhyper parameter for the wishart disturbution (normally set to 1)
alpha_omegahyper parameter for the wishart disturbution (normally set to n + 2)
prior_matrixprior matrix T for the wishart disturbtion over precision matrix W (dimensions = n * n)

Referenced by SetPosteriorParametricMatrix().

◆ SetSampleMean()

void SetSampleMean ( Bge_Matrix data,
Bge_Vector mean_vec 
)

Finds the sample mean of the given data.

Parameters
datathe sample data used to calculate the mean
mean_vecthe output mean vector (capacity = data->cols)

References Bge_Vector::items.

Referenced by SetPosteriorParametricMatrix().

◆ SetSampleVariance()

void SetSampleVariance ( Bge_Matrix data,
Bge_Vector mean_vec,
Bge_Matrix variance_matrix 
)

Finds the Sample Variance (multiplied by N-1) of a set of data.

Parameters
datathe data set for the problem where rows = samples and cols = vars
mean_vecthe vector containing the means for each variable
variance_matrixthe output variance matrix (dimensions = data->cols * data->cols)

References BgeMatrixAddition(), BgeMatrixCreate(), BgeMatrixDelete(), BgeVectorCreate(), BgeVectorDelete(), BgeVectorOuterProduct(), BgeVectorSubtraction(), and Bge_Vector::items.

Referenced by SetPosteriorParametricMatrix().

Here is the call graph for this function: