TFQA: Tools for Quantitative Archaeology - Statistical Analysis Software for Archaeology TFQA
TFQA Logo

TFQA: Tools for Quantitative Archaeology
     kintigh@tfqa.com   +1 (505) 395-7979

TFQA Home
TFQA Documentation
TFQA Orders
Kintigh(ASU Directory)


MatchInterval: Evaluate Correspondence of
Extreme Climate Events and Cultural Transformations

This program provides as probabilistic evaluation of the correspondence in time between sets of cultural transformations and climate records as described and applied in Kintigh and Ingram (2018).  MatchInterval is a Windows program written in Delphi, an extension of Pascal as implemented in the Embarcadero RAD Studio XE.

Running the program

Important information on TFQA programs may be found at http://tfqa.com. See especially, Program Conventions and  Running TFQA under Windows. To run the program, copy MatchInterval.exe to a directory that includes the input data files you wish to evaluate (in CSV Format, as described below). Having navigated to that folder, when you doubleclick on MatchInterval.exe the program opens a  Windows "Run" Window . The program will prompt you for information that it needs to run. Default answers are provided in {curly braces} and can be obtained by just pressing Enter. Reply Y or N to yes or no questions.

Sample Input file

The program looks for input from two .csv (comma separated value) files that must be saved in the same directory on your computer as the .exe file. The CSV Files can be prepared in Notepad or a similar text editing program or in Excel, saved with the .csv extension. The transformations file has one line per cultural transformation with a start and and date, separated by a comma.The climate extremes file has one line per interval of climate extremes, again with a start and end date separated by a comma. 

ZuniTrans.csv

1250,1300
1350,1400

ZuniDry.csv

448,464
470,484
512,517
...
1519,1525

Sequence of Program Prompts

   ┌──────────────────────────────────────────────────────────────────────┐
   │                         MatchIntervals V2.2                          │
   │ Monte Carlo Assessment of Correspondence Between 2 Sets of Intervals │
   │                                                                      │
   │                    (C) 2013-2016 Keith W. Kintigh                    │
   │                         All Rights Reserved                          │
   │                                                                      │
   │                       2014 East Alameda Drive                        │
   │                        Tempe, Arizona  85282                         │
   └──────────────────────────────────────────────────────────────────────┘

Results File {.TXT} ? Zuni

Name of the output file, to be saved in the same directory.

Fixed (Transformations) Interval File (Start, End) {.CSV} ? ZuniTrans
File: ZUNITRANS.CSV
2   obs & 2 vars; 2 numeric & 0 string

Reply with the name of the file with the periods of transformations. The program provides some summary information.

Moving (Climate) Interval File (Start, End) {.CSV} ? ZuniDry
File: ZUNIDRY.CSV
31   obs & 2 vars; 2 numeric & 0 string

Reply with the name of the file with the periods of Climate Extremes. The program provides some summary information.

Start of Earliest Fixed Interval   1250
End of Latest Fixed Interval       1400
Start of Earliest Moving Interval   448
End of Latest Moving Interval      1525

Program report on the input data.

Analysis Interval Start Date     {448} ?
Analysis Interval End Date       {1525} ?
(Adjusted) Analysis Interval: 448 to 1525

Provide the starting and end dates of the interval you would like evaluated. These values default to the extreme dates of the climate data entered but a reduced range can be evaluated.

Number of Random Runs {1000000} ?
Random Generator Seed (0 to set from clock) {0} ?

Enter the number of random runs requested and a random number generator seed (only if you wish to reproduce a previous run).

Match: [O]verlap, Moving [L]ag Interval; Moving Lag/Fixed [U]ncertainty {U} ?
Impact Time Lag from Beginning of Moving Interval {5} ?
  Symmetric Uncertainty around Fixed Interval Start {Y} ?
  Fixed Start Uncertainty +/- {5} ?

The program now wants to know what rule you wish to use in deciding when a climate extreme matches a cultural transformation. (1) Overlap: any overlap in the intervals. (2) Moving Lag Interval assumes that there will be a fixed number of lag years from the start of the climate event to the beginning of a transformation. (3) Lag with Uncertainty assumes that there is both a lag and some undertainty associated with the cultural transformation dates. These options, and the program's operation are described more fully in the referenced article.

The additional prompts request the Lag and the Uncertainty, if needed.

Observed    Random Probability
 Matches   Average Random>=Obs
       1    0.6103      0.5183

Program Results. The observed number of matches is the actual number of matches (according to the rule you specified) between extreme climate events and cultural transformations in the input data. The Random Average is the average number of matches (according to the rule) over all random runs between extreme climate events and cultural transformations. Loosely speaking if the average number found is in the ballpark of the obserrved, we should be skecptical of a causal relationship.  The Probability given is the percentage of all random runs in which the observed number, or more, matches are observed.  In this case, a bit more than half the time a random run produced one (the observed) or more matches. With a large number of random runs this analysis may take several seconds to a few minutes depending on the speed of your computer. 

Run Again with Different Decision Rules {N} ?
Run Again with Different Data {N} ?

You can rerun the program if you wish.

Program End
OK to Close Program Window {Y} ?

The program provides this prompt to allow you to examine the on-screen results. One you reply with Y or Enter it will close that window and you won’t be able to recover it.

Sample Period Output File

The output file reproduces the input data (truncated here) and provides the results.

Program MatchIntervals v2.2 - Keith Kintigh - 2020-10-05 8:34:14 AM
================================
All Interval Data

Fixed Interval File:  ZUNITRANS.CSV
Moving Interval File: ZUNIDRY.CSV

      Fixed Intervals
   Start     End   Years
    1250    1300      51
    1350    1400      51

      Moving Intervals
   Start     End   Years
     448     464      17
     470     484      15
     512     517       6
...
    1519    1525       7
================================
Start of Earliest Fixed Interval   1250
End of Latest Fixed Interval       1400
Start of Earliest Moving Interval   448
End of Latest Moving Interval      1525

Analysis Start: 448   End: 1525   Years: 1078

Computation Start: 448   Computation End: 1525   Years: 1078
  Computation Start is the start of the moving interval or gap including 448
  Computation End is the end of the moving interval or gap including 1525

Years in Moving Intervals:  298 or  27.6% of Computation Interval
Don't start with Gap
Moving intervals must be at least 1 years long to be considered
Only Count 1 Match/Fixed Interval
Random Runs:  1000000
Random Number Generator Seed: -348905323

================================
Intervals Evaluated
  Note: Intervals before Analysis Start and End Dates are Ignored

      Fixed Intervals
   Start     End   Years
    1250    1300      51
    1350    1400      51

      Moving Intervals      Next
   Start     End   Years     Gap
     448     464      17       5
     470     484      15      27
     512     517       6      17
...
    1519    1525       7
================================

Rule 3 - Lag: 5  Uncertainty -5 : 5
     Impact Time Lag & Fixed Interval Uncertainty
     Moving Interval Impact Time Lag: 5 from Start of Moving Interval
     Impact is Up To 5 Years Before Dated Fixed Interval Start Date and
     Impact is Before 5 Years After Dated Fixed Interval Start Date

Match: Fixed  1250-1300  Moving 1250-1254

Observed    Random Probability
 Matches   Matches Rand.>=Obs.
       1    0.6103      0.5183

--------------------------------
Program End

References Cited

Kintigh, Keith W. and Scott Ingram

2018   Was the drought really responsible? Assessing statistical relationships between climate extremes and cultural transitions. Journal of Archaeological Science 89: 25-31. DOI:10.1016/j.jas.2017.09.006

Page Last Updated: 4 October 2020

Home Top Overview Ordering Documentation