top of page
  • Google+ Social Icon
  • Twitter Social Icon
  • LinkedIn Social Icon
  • Facebook Social Icon

First Task Complete (a.k.a count the instances of Gaussian)

  • Eric Birtcil
  • Feb 27, 2017
  • 3 min read

Firstly, my apologies for the late post. There will be two posts this week to compensate for last week's oversight. Unfortunately, I did not have anything interesting enough to present last week, but this week is not the same story.

Today, I was able to create a code that models a 2-dimensional model of a normal, or Gaussian, distribution. That just seems like a bunch of useless words, so let me go into some more detail. A normal distribution is a statistical representation of probability. Many people colloquially know this shape as a bell curve.

In this model, the probability is highest at the mean and decreases exponentially according to the Gaussian equation. In this model, 68% of the data falls within the first standard deviation. The integral of the normal distribution curve is equal to one, which is expected for a model of probability because the total probability is 100% or 1.

Now that we have an understanding of this model, let's extend this to 2 dimensions. This idea now means that we are finding the probability density over an area. Imagine that you are looking for a screw that you dropped on the floor. The most likely place to find the screw would be right where you dropped it. However, screws are tricky and can move around. This 2 dimensional Gaussian distribution maps the likelihood that you would find the screw in that region. We can imagine that you probably won't be finding the screw 30 ft away, so the probability in that region is near zero, whereas the probability that you will find the screw right where you dropped it or around there is quite high. Now that I have talked circles around the idea, let's look at an example image.

As you can see, the probability at the center of the region is the highest. This model is created by applying the same mathematical idea to 2 dimensions rather than 1. This figure looks as though the Gaussian distribution you see above was revolved about the vertical axis to form a solid.

This color model is very nice because it is represented in 3 dimensions, which can be misleading when I am talking about 2 dimensional probability; however, probability is not a spacial dimension.

My goal for the past week and today was to create a representation of this statistical model using Python, one of many programming languages. The image that I created looks like the one that I included on my first blog post, but that image was not the one that I created. Below is the image that I created in Python.

The brightness of a particular region represents the probability. The brighter the spot, the higher the probability. If you compare the image above with the color figure from earlier, you can see that they exhibit the same mathematical property as the brightest point is in the center and becomes dimmer as you move outward. This image is almost as if you were looking at he color figure from above.

The code used to accomplish this took some time. Not because of the length or complexity, but because I had never used Python prior to this project. This first task is meant to be a learning experience for me, to familiarize myself with the language. I had much help from Dr. Ertel who introduced me to some of Python and helped me get started on this task.

For those that are interested, the code I used to create this image is below:

Don't worry if this makes no sense. It made no sense to me as well a few days ago. However, if you are ambitious or understand programming, there it is.

The next task is to be able to turn this circular distribution into an ellipse. Who's excited?!


留言


RECENT POST
bottom of page