11. State Prediction
State Prediction
State Prediction Formulas
Posterior\ Mean \ \ \ \ \ \ \ \large \mu' = \mu_1 + \mu_2
Posterior\ Variance \ \ \ \ \large \sigma^{2'} = \sigma^2_1 + \sigma^2_2
Start Quiz:
#include <iostream>
#include <math.h>
#include <tuple>
using namespace std;
double new_mean, new_var;
tuple<double, double> state_prediction(double mean1, double var1, double mean2, double var2)
{
new_mean = //TODO: Code the state prediction mean function mu;
new_var = //TODO: Code the state prediction variance function sigma square;
return make_tuple(new_mean, new_var);
}
int main()
{
tie(new_mean, new_var) = state_prediction(10, 4, 12, 4);
printf("[%f, %f]", new_mean, new_var);
return 0;
}
#include <iostream>
#include <math.h>
#include <tuple>
using namespace std;
double new_mean, new_var;
tuple<double, double> state_prediction(double mean1, double var1, double mean2, double var2)
{
new_mean = mean1 + mean2;
new_var = var1 + var2;
return make_tuple(new_mean, new_var);
}
int main()
{
tie(new_mean, new_var) = state_prediction(10, 4, 12, 4);
printf("[%f, %f]", new_mean, new_var);
return 0;
}