Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "optimal_importance_density.h"
00020 #include "../wrappers/rng/rng.h"
00021
00022
00023 namespace BFL
00024 {
00025 #define OptImpDensity OptimalImportanceDensity
00026
00027 OptImpDensity::OptImpDensity(AnalyticConditionalGaussian * SystemPdf,
00028 LinearAnalyticConditionalGaussian * MeasPdf)
00029 : AnalyticConditionalGaussian(SystemPdf->DimensionGet(),
00030 SystemPdf->NumConditionalArgumentsGet()
00031 + MeasPdf->NumConditionalArgumentsGet()),
00032 _SystemPdf(SystemPdf),
00033 _MeasPdf(MeasPdf)
00034 {
00035 Matrix tmp((SystemPdf->DimensionGet()),(SystemPdf->DimensionGet()));
00036 tmp = (SystemPdf->AdditiveNoiseSigmaGet().inverse()
00037 + ( MeasPdf->MatrixGet(0).transpose() * (Matrix) (MeasPdf->AdditiveNoiseSigmaGet().inverse()) * MeasPdf->MatrixGet(0) )).inverse();
00038 tmp.convertToSymmetricMatrix(this->_additiveNoise_Sigma);
00039 this->_additiveNoise_Mu = 0.0;
00040 }
00041
00042 OptImpDensity::~OptImpDensity(){};
00043
00044 ColumnVector
00045 OptImpDensity::ExpectedValueGet() const
00046 {
00047 ColumnVector mean(DimensionGet()); mean = 0.0;
00048 ColumnVector arg;
00049 for (int i=0; i < NumConditionalArgumentsGet() ; i++)
00050 {
00051 arg = ConditionalArgumentGet(i);
00052 mean += (ColumnVector) (this->MatrixGet(i) * arg);
00053 }
00054 mean += AdditiveNoiseMuGet();
00055 return mean;
00056 }
00057
00058 SymmetricMatrix
00059 OptImpDensity::CovarianceGet() const
00060 {
00061 return AdditiveNoiseSigmaGet();
00062 }
00063
00064 Matrix
00065 OptImpDensity::dfGet(int i) const
00066 {
00067 assert(i < NumConditionalArgumentsGet() && i >= 0);
00068 return _ratio[i];
00069 }
00070
00071 void
00072 OptImpDensity::NumConditionalArgumentsSet(int numconditionalarguments)
00073 {
00074 cerr << "You probably don't want to use this one, do you?" << endl;
00075 }
00076
00077 void
00078 OptImpDensity::MatrixSet(int i, const Matrix & m)
00079 {
00080 assert(i < NumConditionalArgumentsGet());
00081 _ratio[i] = m;
00082 }
00083
00084 const Matrix&
00085 OptImpDensity::MatrixGet(int i) const
00086 {
00087 assert(i < NumConditionalArgumentsGet());
00088 return _ratio[i];
00089 }
00090
00091 }
bfl
Author(s): Klaas Gadeyne, Wim Meeussen, Tinne Delaet and many others. See web page for a full contributor list. ROS package maintained by Wim Meeussen.
autogenerated on Thu Feb 11 2016 22:31:57