Fits harmonic models to mean rainfall amounts 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 number within the year (1…366)|
||Supplies the table of mean rainfall by wet Markov class and day|
||Window for the graph; default 3 for a single class and 1 otherwise|
||Title for the graph; default forms an automatic description|
||Saves a pointer to the variates of fitted rainfall means by day for each wet class|
RFFAMOUNT fits harmonic (Fourier) models with a period of 366 days to rainfall summaries 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, but only models with two states are handled. 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.
AMOUNTS parameters give the table of rainfall counts and mean amounts for each Markov state by day within the year (1…366). The
RESULTS parameter can save variates of fitted amounts for the wet (e.g. ww and wd) Markov classes for each day within a year.
Printed output of the summaries is controlled by the
FIT directive. The fitted amounts can be displayed in a spreadsheet using by setting option
results. This creates a sheet containing the variates giving the fitted amounts of rainfall 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 amounts. 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 gamma generalized linear model to the rainfall means weighted by the counts of the number of wet days.
Ong’ala, J.O. (2011). Simplifying the Markov chain analysis of rainfall data using Genstat. MSc Thesis, Maseno University.
CAPTION 'RFFAMOUNT example','41 years data 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 RFFAMOUNT [PLOT=results; SPREADSHEET=results] COUNTS=RFCounts; \ AMOUNTS=RFAmounts; TITLE='Katumani rainfall amounts 1961-2001'