2006-PHYS-339 Statistics / Geiger

From McGill University Physics Department Technical Services Wiki

Table of contents

News

Tuesday January 24, 2006

Posted chisq.c, a table lookup for reduced Χ2 corresponding to 5% and 10% probabilities of exceeding reduced Χ2 as a function of number of degrees of freedom.

Files

  • Geiger handout (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/geiger.pdf) - PDF version of the lab handout
  • sample.data (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/sample.data) - The imfamous sample data as collected by defective acquisition software
  • geiger.tar.bz2 (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/geiger.tar.bz2) - Data collection package, see below for instructions


INSTRUCTIONS (This is what Mark means by "below")

Once the package is saved in the proper directory, do the following:

christian.voyer@hades:~/339/Geiger$ ls
geiger.tar.bz2

After checking the file is actually there, dearchive (untar, unpack, whatever you want to call it) the .tar.bz2 file with the following command:

christian.voyer@hades:~/339/Geiger$ tar -jxf geiger.tar.bz2 
christian.voyer@hades:~/339/Geiger$ ls
Makefile.in  configure  geiger.1  geiger.5  geiger.c  geiger.tar.bz2

Then, execute the configure program:

christian.voyer@hades:~/339/Geiger$ ./configure
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for X... libraries /usr/X11R6/lib, headers /usr/X11R6/include
checking for labmaster_initialize in -llabmaster... yes
checking for XCreateWindow in -lX11... yes
checking for GrSetMode in -lgrx20X... yes
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for gethostname... yes
configure: creating ./config.status
config.status: creating Makefile

Finally, check if the Makefile works:

christian.voyer@hades:~/339/Geiger$ make 
gcc  -I/usr/local/include -I/usr/X11R6/include -g -O2 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBLABMASTER=1 -DHAVE_LIBX11=1 -DHAVE_LIBGRX20X=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_GETHOSTNAME=1  -c geiger.c
gcc  -L/usr/local/lib -L/usr/X11R6/lib -o geiger geiger.o -lgrx20X -lX11 -llabmaster 
christian.voyer@hades:~/339/Geiger$ 

And from that you can move on to compiling your code and performing the experiment

Structure of data

Check the documentation in the source tar file

christian.voyer@hades:~$ man ./geiger.5
Reformatting geiger.5, please wait...

Reads

GEIGER(5)                   Lab Programmers Manual                   GEIGER(5)

NAME
       geiger - a data collection tool - the output data format

DESCRIPTION
       The  data  saved by the geiger program consists of two major parts, the
       header and the data-body.

HEADER
       The header is a single line consisting of 4 numbers:  replicas,  inter-
       vals,  columns  and  period.  replicas, intervals and columns are inte-
       gers, period is a floating point number.  The definitions of the param-
       eters are as follows:

       replicas
              The number of replicas requested.

       intervals
              The number of intervals per replica.

       columns
              The number of columns in the histogram.

       period The period in seconds requested by the user.  If the true period
              differed from this because of quantization this a user  problem.

DATA-BODY
       The  data-body  section  consists of replicas rows, each row containing
       columns numbers, separated by tab characters.  The sum of numbers in  a
       given  row  should  equal intervals.  The number in the Nth column of a
       replica represents the frequency of observation of N counts per  period
       during the replica measurement.

SEE ALSO
       geiger(1)

BUGS
       The period problem mentioned above.

AUTHOR
       Mark Orchard-Webb (orchard@physics.mcgill.ca)

Supplemental toys

  • chisq.c (http://www.ugrad.physics.mcgill.ca/resources/339/geiger/chisq.c) - This is an implementation of table C4. in Bevington. There are two functions of interest in this file:

double chisq_five (int dof)
returns the reduced Χ2 value which only 5% of replicas having dof are expected to exceed.
double chisq_ten (int dof)
returns the reduced Χ2 value which only 10% of replicas having dof are expected to exceed.
These functions are written in such a way that they can easily be pasted into another piece of code.