Fits harmonic models to rainfall probabilities for a Markov model (J.O. Ong’ala & D.B. Baird).
|Controls printed output for each fitted model (
||What plots to display (
||Defines the number of harmonics to fit (1…4); default 2|
||What to save in a spreadsheet (
||Supplies the table of counts by Markov class and day within the year (1…366)|
||Window to plot the graph; default 3 for a single class and 1 otherwise|
||The title for the plot; default forms an automatic description|
||Saves a pointer to variates of fitted rainfall probabilities by day for each wet state|
||File (with extension
RFFPROBABILITY fits harmonic (Fourier) models with a period of 366 days to rainfall counts produced by
RFSUMMARY. The Markov model fitted by
RFSUMMARY splits the days into different classes based on the history of the preceding days. The daily states, order and type of the Markov model can be formed by
RFSUMMARY. The harmonic model is a linear combination of sine and cosine terms with periods of 366/n.. The number of harmonic terms (n) is specified by the
NHARMONICS option, and can be 1, 2, 3 or 4.
COUNTS parameter supplies the table of counts for each Markov class by day within the year (1…366). The
RESULTS parameter can save fitted probabilities by wet class for each day.
Printed output of the summaries is controlled by the
FIT directive. The probabilities can be displayed in a spreadsheet by setting option
SPREADSHEET=results. This creates a sheet containing variates giving the fitted probabilities for each day in the year by the wet Markov classes. The spreadsheet can be saved to a file by setting the
OUTFILE parameter to a Genstat or Excel spreadsheet filename (
You can set option
PLOT=results to plot the fitted probabilities. The
TITLE parameter can supply a title for the graph; if this not set, a descriptive title will be created from the Markov-chain options. The
WINDOW parameter specifies the window to use for the graph.
The procedure calculates sine and cosine terms for the number of harmonics and fits a binomial generalized linear model to the counts of wet days vs dry days for each history from the preceding days.
Ong’ala, J.O. (2011). Simplifying the Markov chain analysis of rainfall data using Genstat. MSc Thesis, Maseno University.
CAPTION 'RFFPROBABILITY example','41 years rainfall for Katumani, Kenya'; \ STYLE=meta,minor IMPORT [PRINT=summary] '%Data%/Rainfall Katumani 1961-2001.gsh' RFSUMMARY [PRINT=*; PLOT=*; DAY=Date; ORDER=1] Rainfall; \ COUNTS=RFCounts; AMOUNTS=RFAmounts RFFPROBAB [PLOT=results] COUNTS=RFCounts; \ TITLE='Katumani rainfall probabilities 1961-2001'