Category

Monday, May 28, 2012

Hi guys,

Well, global variables are not encouraged in MATLAB. But, sometimes you may want to initialize an object with some parameters and you would like to access some global parameters as well.

Here is what you can do.
  • Create a file (say Params.m) for storing such global variables.
          insert your global parameters like this:
          global MY_GLOBAL; MY_GLOBAL = 1;
  • Next, include this file in your main .m file.
          Params;
  • Afterthat, in your class file, inside the constructor function (or any other function)
          global MY_GLOBAL;
          obj.xyz = MY_GLOBAL;

done!


Tuesday, May 1, 2012

Sensor model and Likelihood Function

  • The probabiloty density function (pdf) p(z|x) serves as the sensor model.
  • This can be thought of in two ways:
    • to build the sensor model: we can fix x = x and ask what pdf in z results. Then, p(z|x) is a function of z. An exmaple would be, say we know the true location of a target then p(z|x) is the distribution of the observation.
    • when the sensor model is established observatione are made and z = z will be fixed. From this then we want to infer the state x. Thus, p(z|x) will then be a distribution of x. This distribution is called the likelihood function. L(x) = p(z|x)
  • In the case of likelihood function we know the observation z = z. But, that does not mean we are going to calculate p(x|z); we are still dealing with p(z|x).