Lab #3:  Fitting a nonstationary spatial covariance model using the MCMCdeform program.

The MCMCdeform.exe program and all R code and data files described here are  available in this zip file: Rcode.and.data.zip You want to put all these things on your desktop (don't worry about the executable file, it is already there).

1. The  folder Output on your desktop contains output from MCMCdeform from a run of 400,000 MCMC iterations, with every 200th  iteration saved. To get a feeling for what you can do with the output, you want to examine it using the R code in MCMC.read.R.  Before you use that code, you need to change the address where the files are kept (replace "peter" by "studentxx"). You will also need the R functions dist2full, Fdrawtps, Flamb2, FLmatrix, Fseval, and Flink.cor.
Fairly detailed explanations of the program are provided in the manual.  See the end of that document for an explanation of the input and output.

2. To develop an understanding of the MCMC program for fitting a spatial deformation model, run the MCMCdeform program on the spatial covariance matrix derived from 124 2-week average NOx concentration data at 28 monitoring sites in southern California.  Time series plots of the raw data from which these covariances were computed are provided in the file CA.2wkmeanlog.trendfits.jpg.   You will want to run relatively few MCMC iterations in order to obtain a result in a reasonable amount of time. The program estimates how long it will take to run, so you may want to stop it and change the input if it looks unreasonable.

The executable file, MCMCdeform.exe, should sit in the same folder as the input files listed here.  On the virtual machine they are all on the Desktop. You will need to have the text files below (ca28.nox.*.txt) on the desktop of the virtual machine. The program will ask for:

            You want to modify the number of MCMC iterations, and play some with the other parameters in the input file to get some feel for how they affect the results.

3. Look at the results of your runs, compare them to the run used in question 1, and discuss the outcome. As usual, a report is due in a week, but we will see how long things take, and may use the following Thursday as a lab session if needed. In that case the report will be due two weeks from today.


 
 


Here are a couple of GIS maps of the LA area:
011306_LA.jpg
011306_population.jpg

R code for visualizing MCMC output from deformation program.

California NOx data input files