Category

Friday, October 7, 2011

Correlation Coefficient

  • The correlation coefficient (or cross-correlation coefficient) gives a measure of correlation (linear dependence) between two variables X and Y. It takes the values between +1 and -1 inclusive.
    • if the value is +1: the two data sets have a perfect positive relationship (if one increases, then the other also increases)
    • if the value is -1: the two data sets have a perfect negative relationship

  • There are several correlation coefficients. Let's have a look at the common Pearson product-moment correlation coefficient (PPMCC).
  • PPMCC is defined as the covariance of the two variables divided by the product of their standard deviations:

                                           this defines the population correlation coefficient.

  • For a sample based representation, we have sample correlation coefficient:
  • Here, you can notice that divide by n (for E operation) in the numerator and the denominator is cancelled off .
  • Now let us see an example.
    • let data set X = {10, 20, 30, 40, 50, 60} and Y = {3, 5, 2, 3, 7, 4}
    • E(X) = (10+20+30+40+50+60) / 6 = 35; E(Y) = (3+5+2+3+7+4) / 6 = 4
    • Numerator: (10-35)(3-4)+(20-35)(5-4)+(30-35)(2-4)+(40-35)(3-4)+(50-35)(7-4)+(60-35)(4-4) = 60
    • Denominator: sqrt((10-35)^2 + (20-35)^2 + (30-35)^2 + (40-35)^2 + (50-35)^2 + (60-35)^2) * sqrt((3-4)^2 + (5-4)^2 + (2-4)^2 + (3-4)^2 + (7-4)^2 + (4-4)^2) = 167.332
    • r = 60/167.332 = 0.358569

  • When the two data sets are equal, we have:

    • If you calculate the PPMCC for X = {10, 20, 30, 40, 50} and Y = {1, 2, 3, 4, 5} you will find that it is equal to 1.
      • This means that for PPMCC to be equal to 1, you do not need the two data sets to be equal.
    • PPMCC can be used as a matching techniques
      • map matching
      • image matching
    Equation credit: wikipedia

    Thursday, September 22, 2011

    Central Limit Theorem (CLT)

    • Before defining central limit theorem let's clarify the term i.i.d.
      • independent and identically distributed (i.i.d) random variables - this means that the random variables we consider have the same probability distribution as the others and they are mutually independent. An example would be two dice experiments performed simultaneously.

    • Central limit theorem states that if you take the average of the outcomes of sufficiently large i.i.d random variables, with finite mean and variance, it follows a normal or Gaussian distribution. 

    • Here is an example. Suppose we throw a dice 10000 times. Then the outcome would more or less look like this (uniform distribution).

    • Now, let's throw 2 dices together 10000 times and observe the average (or you can observe the sum of the outcomes for that matter) of outcomes.

    • Now, you get the idea. Suppose we throw 50 dices together 10000 times and observe the average (or sum) of outcomes.

    • This looks like a normal distribution to me.
    • Wikipaedia says: "Since real-world quantities are often the balanced sum of many unobserved random events, this theorem provides a partial explanation for the prevalence of the normal probability distribution".

    Wednesday, August 17, 2011

    URDF and XACRO for Modeling

    • We use Unified Robot Description Format (URDF) to model robot links and joints. It is in an XML format containing a tree of links and joints. It includes the inertial, visual and collision knowledge of the object being model.
       
    • XACRO is an XML macro language. It can be used to create shorter and more manageable XML files than URDFs. This is helpful when more than one links have the same properties and dimensions, like a table leg. In a URDF file every table leg would have to have its own defined properties and dimensions, like a cylinder radius and height. But in a XACRO they could all equal one variable.
    e.g.
    <xacro:property name="width" value=".2" />
    <xacro:property name="bodylen" value=".6" />
    <link name="base_link">
       <visual>
          <geometry>
             <cylinder radius="${width}" length="${bodylen}"/>
          </geometry>
          <material name="blue">
             <color rgba="0 0 .8 1"/>
          </material>
       </visual>
     <collision>
       <geometry>
         <cylinder radius="${width}" length="${bodylen}"/>
       </geometry>
      </collision>
    </link>


    By using XACRO you can make your XML files manageable.

    Hello World!

    Here I will write what I learn during my PhD career in robotics.


    cheers!