Class BIMac
Defined in File bimac.h
Class Documentation
-
class BIMac
A class which maintains our uncertainty over the true IMac model.
This class maintains a Beta distribution for each transition at each grid cell.
See also
mod/imac.h
Members:
_alphaEntry: The matrix of alpha parameters for the lambda_entry parameter (free->occupied)
_betaEntry: The matrix of beta parameters for the lambda_entry parameter (free->occupied)
_alphaExit: The matrix of alpha parameters for the lambda_exit parameter (occupied->free)
_betaExit: The matrix of beta parameters for the lambda_exit parameter (occupied->free)
_alphaInit: The matrix of alpha parameters for the Pr(occupied at time 0) parameter, i.e. the initial state distribution
_betaInit: The matrix of beta parameters for the Pr(occupied at time 0) parameter, i.e. the initial state distribution
Public Functions
-
inline BIMac(int x, int y)
This constructor initialises all matrices to be full of ones.
- Parameters:
x – The length of the x dimension of the grid map (num cols)
y – The length of the y dimension of the grid map (num rows)
-
inline BIMac(const std::filesystem::path &inDir)
This constructor reads a BIMac config in from file.
- Parameters:
inDir – The directory where the BIMac files are stored
-
std::shared_ptr<IMac> posteriorSample()
Take a posterior sample from BIMac to get a single IMac instance.
- Returns:
A shared ptr to an IMac instance
-
std::shared_ptr<IMac> mle()
Compute the MLE given the observed data.
Given how BiMac is initialised, this corresponds to computing the mode of each beta distribution.
- Returns:
A shared ptr to an IMac instance
-
std::shared_ptr<IMac> posteriorMean()
Compute the posterior mean given the observed data.
As the + 1 part is already in the beta distribution, its just: alpha/(alpha + beta)
- Returns:
A shared ptr to an IMac instance
-
void updatePosterior(const std::vector<BIMacObservation> &observations)
Update the BIMac posterior given a new set of observations.
- Parameters:
observations – A list of BIMacObservations