BREAKING

mardi 24 septembre 2013

Graphics and Stats in Une Easy Package

As always in experimental science,  you need to analyze the data you  collect to see what it's telling you  about the world. ln the beginning  stages, you usually need to be able  to do some graphical analysis to get  an overall view of any trends being  revealed by your experiment. Qnce  you get to the point of having a  model you want to test, you then  need to run some statistical tests  to see how well your model fits the  data. lt always is more convenient  to learn one tool rather than two.  To this end, there is the package  called SciDAVis (Scientific Data  Analysis and Visualization,  http://scidavis.sourceforge.net).  SciDAVis started life as a fork of  QtiPlot. lt has moved quite a bit  from the original codebase with the  addition of several new features  and changes to the underlying  data structures. The functionality  it provides is similar to commercial  programs like Origin and SigmaPlot.  lt also is similar to another open-  source program called LabPlot. ln  fact, beginning in 2008, these two  projects started working together on  a common back end while continuing  with their own front ends and their  own feature sets. ln this article, I take  a quick look at some of the things  you can do with SciDAVis for your  own data analysis tasks.  First, you need to install SciDAVis.  Most distributions should have a  package available. ln Debian-based  distributions, you can install it with:  sudo apt-get install sctdavts  Binaries also are available  for l\/lac OS X. If binaries aren't  available, you can download  the source tarball and build it  specifically for your system. You  need to have the Qt libraries  installed, because the interface is  built using them.  When you first start SciDAVis,  you get an empty project and  an empty data table with two  columns of numeric values (Figure  1). Selecting a column displays the  details of that column in a window  on the right-hand side. Selecting  the description tab lets you change  the name of the column, as well as
  
Figure 1. Opening SciDAVis gives you an empty two-column data table.   
add a comment describing what the  column represents. The type tab  lets you change what kind of data  you can enter for this column from  numeric to text, month names, day  names or full dates. You also can  set the format of the data type for  each column.  When you are first learning to  use SciDAVis, you probably will just  want some junk data to play With.  You can do this easily by right-  clicking the columns and selecting  “Fill Selection with". Then, you  can fill the column with either row  numbers or random numbers. Qnce  you have some data available, you  can create new columns that are  functions of the values stored in  the other columns. To access this  functionality, you need to select  the formula tab in the right-hand  side pane. ln order to explore some  of the other features, let's set the  first column to be the row numbers  and the second column to be a set  of random numbers (Figure 2).  One of the first things you will  Want to do is plot the data to see  what it looks like. To do a basic  plot, you simply can right-click on  a column and select Plot. If you       

Figure 2. You can use fill functions to create data in order to try things out.

 are just doing an initial look at the  shape of the data, select Plot->Line  or Plot-›Scatter (Figure 3). The x  axis is simply the index values, and  the y values are the data elements  from the column.  If you want to do more  complicated plots, SciDAVis provides  a full plotting wizard. To access the  wizard, either press Ctrl-Alt-W or  click View->Plot Wizard. This will  pop up a new window where you  can select which columns will be  used for the x, y and z axes. You  also have the option of selecting  columns to represent the errors  24 / SEPTEMBER 2013 I WWW.LlNUXJOURNAL.COM  for the x and y axes. You need to  create a new curve where you can  set the relevant columns. You can  create multiple curves that will all  be plotted on the same graph. You  then get a new window with the  plots generated.  The point of SciDAVis is to make  this type of work easy, so you  can double-click on the various  elements to edit the details of your  graphs. Double-clicking on the  title, or the axis labels, will pop up  a window where you can change  the content and the display. You  also can change the details of the       

Figure 3. Scatter plots are only a couple mouse clicks away.
axes themselves.
Double-clicking on  an axis will pop up a new window  where you can set the scale, the  type of grid, the axis displays and  a set of general options (Figure  4). Each of these sets of options is  available under its own tab in the  option window.  Once the graph looks the way  you want it, you will want a copy  for your publications. To do this,  you either can right-click on the  graph and select Export or click on  the menu item File->Export Graph.  Then you can select your preferred  file format for saving the image.  Although graphs can be very  useful when trying to get an  intuitive grasp of the shape of  your data, you do need to back up  this intuition with hard numbers.  The first thing to do, usually,  is simply look at the column  statistics. Right-clicking on the  column, you would select Column  Statistics. This creates a new table  where you will get the number of  rows in the column, along with  other statistics like the standard  deviation, variance, sum, minimum  and maximum. You can see if  there is any correlation between  

Figure 4. You can change all of the elements of your graphs.
two columns.
     You need to select  two columns from your table,  and then click on the menu item  Analysis-›Correlate. This will pop  up a new graph window showing  a picture of the correlation. Two  new columns will be added to your  data table where you can find the  lag and correlation values of this  particular analysis.  If the data you are looking at  has some type of periodicity, you  26 / SEPTEMBER 2013 I WWW.LlNUXJOURNAL.COM  can calculate an FFT of it to see  the spread of frequencies within  your data. By selecting a column  and clicking on the menu item  Analysis-›FFT, you will get a pop-  up window where you can select  the details of the FFT you want to  calculate. Once these are set, click  OK, and a new graph window will  be displayed with the FFT plotted  (Figure 5).  Once you have had a chance to    


Figure 5. FFT analysis is useful in signal processing.
look at your data, you may have  started to form an idea of a model  that represents the system you were  measuring. An idea is not enough,  however. You actually need to do  some calculations and see whether  your model fits the data you  collected. Two options are available.  The first is to use the Fit Wizard.  You can access it by clicking on the  menu item Analysis->Fit Wizard.  This pops up a window where you  can build a function describing your  model. Once you have built up your  model, click the button called Fit.  This pops up a new window where  you can select the details of doing  the actual fitting of the generic  function to your data. Here you can  set the initial guesses and select  the algorithm used to do the actual  fitting (Figure 6).  You also can set how many  iterations to try and the  tolerance of when you can stop.  When everything is set to your  satisfaction, click the Fit button.  This pops up a new graph window,  plus an output window detailing  the results of trying to do the fit.  The other option of trying to fit  your model is to start with your
Figure 6. The Fit Wizard lets you define your model and see how well it fits your data.

initial graph. ln this case, you start willing to go through the manual.  by right-clicking the main graph  window and selecting the Analyze  option. This opens a submenu  where you can select one of a  number of common defaults, such  as linear, polynomial, exponential  growth or decay, among several  others. You also can open the Fit  Wizard from this submenu.  This article has been only a very  short introduction. Lots of other  functions are available if you are    Also, you have the option of using  Python as a scripting language  within SciDAVis in order to do even  more complicated data analysis.  You might need to compile from  source, however, if the binaries  available to you don't include this  functionality. Hopefully, you will  take the time to learn what may  be a very useful tool for analyzing  your experimental data.  -Jorzvnznmmn

    

Aucun commentaire:

Enregistrer un commentaire

 
Copyright © 2013 Key Pirate
Distributed By Free Blogger Templates | Design by FBTemplates | emThemes
    Twitter Facebook Google Plus Vimeo Videosmall Flickr YouTube