#

PHYCS 3730/6720 Lab Exercise

Reference
Answer file **Mylab19.txt**.

#### Exercise 1 Learning to guess chi square.

The
file guess.pdf
contains a figure showing a straight line fit to data.
Estimate the value of chi square for this fit to within a few tenths.
Do this "by eye". No need for a calculator or program. State the
number of degrees of freedom. Explain how you arrived at this
estimate.

For the remaining exercises we experiment with linear least squares fitting.
The data set we work with is
x y sigma
------------
4 3 1
5 5 2
6 8 1

#### Exercise 2. Getting the best slope and intercept

For this dataset, find the matrix \(M\) and vector \(c\) in Eqs
(10) and (11) of the handout.
Find the best slope \(m\) and intercept \(b\) from Eqs (15)
and (16).

Put your answer in the answer file.

#### Exercise 3. Chi square surface

Find the minimum chisquare from Eq (2) of the handout.
Write the equation for the chisquare surface as a function of the
deviation of the parameters from the best fit values. That is, insert
the numerical values of the coefficients of Eq (19). Keep it
in terms of \(u = \Delta m\) and \(v = \Delta b \).

Please put your answer in the answer file.

#### Exercise 4. Plotting the error ellipses

The error ellipses are the contour levels of the chi square surface.
Construct the contour plot for \( \chi^2 - \chi^2_0 \). That is, the
elevation of chi square above the minimum. (So zero elevation is at
the center of the ellipses.) You may use either gnuplot or Pyplot.
For gnuplot, use **splot** to do it. We want to plot the contours
as a function of the deviations
\(u = \Delta m \) and \(v = \Delta b\). The following gnuplot
commands may also help with **splot**:

set view 0,0
set isosamples 50,50
set contour
set cntrparam levels discrete 1,2

For Pyplot, see the course notes linked above. You might want to
use a smaller value of **delta** there for better resolution.
Find the standard deviations in \(m\) and \(b\) by using the
maximum and minimum values on the \( \chi^2 - \chi^2_0 = 1 \) contour.

Please give your answer in the answer file.