20 #include "../wrappers/rng/rng.h" 25 #define OptImpDensity OptimalImportanceDensity 28 LinearAnalyticConditionalGaussian * MeasPdf)
29 : AnalyticConditionalGaussian(SystemPdf->DimensionGet(),
30 SystemPdf->NumConditionalArgumentsGet()
31 + MeasPdf->NumConditionalArgumentsGet()),
32 _SystemPdf(SystemPdf),
35 Matrix tmp((SystemPdf->DimensionGet()),(SystemPdf->DimensionGet()));
36 tmp = (SystemPdf->AdditiveNoiseSigmaGet().inverse()
37 + ( MeasPdf->MatrixGet(0).transpose() * (Matrix) (MeasPdf->AdditiveNoiseSigmaGet().inverse()) * MeasPdf->MatrixGet(0) )).inverse();
38 tmp.convertToSymmetricMatrix(this->_additiveNoise_Sigma);
39 this->_additiveNoise_Mu = 0.0;
42 OptImpDensity::~OptImpDensity(){};
45 OptImpDensity::ExpectedValueGet()
const 47 ColumnVector mean(DimensionGet()); mean = 0.0;
49 for (
int i=0; i < NumConditionalArgumentsGet() ; i++)
51 arg = ConditionalArgumentGet(i);
52 mean += (ColumnVector) (this->MatrixGet(i) * arg);
54 mean += AdditiveNoiseMuGet();
59 OptImpDensity::CovarianceGet()
const 61 return AdditiveNoiseSigmaGet();
65 OptImpDensity::dfGet(
int i)
const 67 assert(i < NumConditionalArgumentsGet() && i >= 0);
72 OptImpDensity::NumConditionalArgumentsSet(
int numconditionalarguments)
74 cerr <<
"You probably don't want to use this one, do you?" << endl;
78 OptImpDensity::MatrixSet(
int i,
const Matrix & m)
80 assert(i < NumConditionalArgumentsGet());
85 OptImpDensity::MatrixGet(
int i)
const 87 assert(i < NumConditionalArgumentsGet());