appendix: first steps towards xtremes and statpascal978-3-7643-7399...ogy (chapters 14–17) are...
TRANSCRIPT
Appendix:
First Steps towards Xtremesand StatPascal
Appendix A
The Menu System
A.1 Installation
Xtremes is a genuine Windows application so that any system running Windows98 (and newer) or NT 4 (and newer) is also capable of executing Xtremes.
To facilitate the installation, the CD–ROM contains an installation programthat copies all required files to your computer. The installation program startsautomatically when you insert the CD–ROM. One may choose an installationdirectory and select certain optional parts of the system. If you are unsure, we rec-ommend to accept the default options. Please make sure that you are logged in asan administrator when installing under Windows NT/2000/XP/2003 or WindowsVista 32–Bit.
Xtremes is deinstalled in the usual manner; i.e., by executing the optionSoftware in the Windows Control Panel. Please consult the Xtremes User Manualfor further information; a pdf version is accessible from its menu entry in theXtremes section of the Windows start menu.
A.2 Overview and the Hierarchy
Xtremes is a statistical software system that possesses graphics facilities, a facilityto generate and load data, an arsenal of diagnostic tools and statistical procedures,and a numerical part for Monte–Carlo simulations.
The development of Xtremes has been supported by Simon Budig (User-Formula facility), Martin Elsner (HTML help), Andreas Gaumann (help system),Sylvia Haßmann (censored data), Andreas Heimel (help system, ARMA estima-tors), Jens Olejak (minimum distance estimators), Wolfgang Merzenich (consul-tation on the StatPascal compiler), Reinhard Pfau (Linux port), Torsten Spill-mann (XGPL plots), Karsten Tambor (early version of the multivatiate mode),and Arthur Boshans, Carsten Wehn, Lars Fischer, Ralf Pollnow (MS Excel front-end) whose help is gratefully acknowledged.
468 A. The Menu System
The illustration on the right–hand side shows the hierarchy of the Xtremes system:
• Univariate and Multivariate Modes: the system is partitioned into a univari-ate and a multivariate mode that can be selected in the toolbar.
• Domains D(iscrete), SUM, MAX and POT: select certain domains in thetoolbar which correspond to different parametric models (discrete, Gaussian,extreme value (EV) or generalized Pareto (GP)) built for discrete data anddata that are sums, maxima or exceedances (peaks–over–threshold).
• The Menu–Bar: select menus for handling and visualizing data, plotting dis-tributions by analytical curves, estimating parameters etc. The Visualizemenu and larger parts of the Data menu are independent of the differentdomains.
• Menus: commands of the system are available in different menus.
• Dialog Boxes: if a menu command requires further parameters, a dialog boxis displayed.
• Graphics Windows: the result of a menu command is usually displayed in agraphics window.
• Local Menus: options and commands that are specific to a particular windowor dialog box are provided by means of a local menu (available with a right–click somewhere in the window or the dialog box).
• Special Facilities: in the toolbar, select tools to manipulate a graphic. Thesetools change the action taking place when one drags the mouse in a graphicswindow. For example, to change the coordinate system, you may click on the
coordinate tool in the toolbar and, then, pull up a rectangle.
• Help System: a context–sensitive online help is available by pressing the F1–key at any time besides the general help facility (option Index in the Helpmenu).
• Act, $, Hyd Supplements: special options for insurance, finance and hydrol-ogy (Chapters 14–17) are available.
• UFO: select the UserFormula facility to enter your own formulas to plotcurves, generate or to transform data (cf. Section A.5).
• StatPascal: the integrated programming language StatPascal is activatedby means of the SP button (cf. Appendix B and StatPascal User Manual).
Keep in mind that the options in the Visualize and Estimator menus mustbe applied to an active data set (read from a file or generated in the Data menu).Instructions about the installation of the system are given in Section A.1.
A.2. Overview and the Hierarchy 469
470 A. The Menu System
Professional Version
For details concerning the professional version of Xtremes we refer to the web–sitehttp://www.stat.math.uni-siegen.de/xtremes/.
Under this web–site one is also informed about the latest news about Xtremesand possible updates.
A.3 Becoming Acquainted with the
Menu System
A further possibility is to work closely with the online–help facility (press theF1–key or enter the Help... Index).
Plotting Histograms and Curves
Xtremes provides easy–to–use plotting facilities. The user can quickly plot a curve,adjust the coordinate system, get a list of the curves displayed in a plot windowor export the picture via the clipboard. A special facility is available for producingEPS–files (see Documenting Illustrations on page 478).
We partly repeat the operations which are required to plot the histogramsin Fig. 1.2. Make sure that the univariate D(iscrete) domain is active, that is, the
first button in the toolbar shows a single bullet and the button labeled ispressed.
Demo A.1. (Plotting Poisson Histograms.) (a) Select the option Distribution...Poisson in the univariate D(iscrete) domain and choose the parameter λ = 10.
Execute the Histogram option.
(b) The tool (activating the option mouse mode) may be employed to adjust thepositions of the plotted bars.
The user may change the parameters of a plotted histogram (or of a curve)by means of sliders which are an indispensable tool to work interactively with
data. Select the parameter varying mouse mode from the toolbar and clickonto a histogram or curve in a plot window to open a window with sliders for eachparameter.
Demo A.2. (Varying the Parameter of a Poisson Histogram.) First, plot a Pois-son histogram with parameter λ = 1. Select the parameter varying mouse mode
from the toolbar and click on the histogram of the Poisson distribution. Vary theparameter λ, and also change the boundaries for the possible parameter values. In Fig.A.1 there is a Poisson histogram with the pertaining slider and, in addition, a samplehistogram.
A.3. Becoming Acquainted with the Menu System 471
Fig. A.1. Interactive fitting of
a Poisson histogram (right) to
sample histogram (left).
Next, let us display a Pareto density on the screen. Now, activate the uni-variate POT domain, that is, the first button in the toolbar shows a single bullet
and the button labeled is pressed.
Demo A.3. (Plotting a Pareto Density.) Select the menu option Distribution...Pareto to open a dialog box asking for the parameters of the distribution The
dialog box for the Pareto distribution is displayed in Fig. A.2. Click on the Density buttonto plot the Pareto density for the chosen parameters. A plot window opens showing thegraph of the density.
Fig. A.2. Dialog box POT... Dis-
tribution... Pareto in the univariate
mode. Enter the parameters of the
Pareto distribution and plot a curve
using the buttons.
The coordinate system can be adjusted by using the local menu of the win-dow. Click inside the window with the right mouse button and select the optionChange coordinates. Xtremes stores the previous coordinates which may be re-
stored by executing the option Restore coordinates in the toolbar (click thebutton) or by pressing the Backspace key.
A more direct, interactive facility to modify the coordinate system is avail-able by selecting a certain mouse mode from the tool bar (explained in the nextsubsection).
One can get an overview of the curves plotted in a window utilizing the
472 A. The Menu System
menu option Edit Curves and Labels. A list with all curves is displayed, and onecan delete some curves or change their options like color, line style, brushes usedto hatch histograms, etc. If one wants to know the parameters of a plotted curve,
select the information mouse mode tool and click onto the curve.
Pictures may be exported. Click the option Print in the local menu to sendyour window to the printer. You can also copy it to the Windows clipboard orcreate EPS–files. Advanced options to format a plot are described on page 478.
Selecting a Mouse Mode
The mouse mode determines what happens if you click into a window. The defaultmode just brings a window into the foreground.
Other mouse modes are employed to move or delete curves, change colorsand plot options, add text, etc. Detailed explanations of all modes are given inSection A.4.
As an example, we describe the change of the coordinate system using aspecific mouse mode. Activate the coordinate changing mouse mode by clicking
the tool in the toolbar. In this mode, a new coordinate system is selected bypulling up a rectangle: click into the graphics window (left mouse key), hold downthe mouse key and move the cursor to the opposite corner. The rectangle may bepulled outside the window to enlarge the coordinate system.
Reading and Generating Data
At the beginning, the user should restrict himself to handling data included in thepackage or generated by Xtremes. To read a data set from the disk, execute themenu option Data... Read Data. The file dialog box of Windows appears.
Proceed to the dat folder and select any file. Xtremes loads this file andopens a window entitled Active Sample displaying information about the dataset. Read another data set and notice that the description of the active data setchanges.
Now, two data sets are kept in memory. One can choose the active data setfrom the ones already loaded by executing the menu option Data... Choose Data.A list of all data sets used in the current session is displayed and a new active dataset can be selected. Keep in mind that all visualization and estimation proceduresare based on the active data set.
If one needs to load multiple data sets from a different subdirectory, the Dragand Drop facility of Xtremes can be utilized. Just select the files in a directorylisting of Windows and drop them anywhere on the Xtremes window.
Xtremes also enables the user generating data sets. Use the menu optionData... Generate Univariate Data and select a distribution from the menu (seeDemo A.4). A dialog box opens asking for parameters, the sample size and afilename. Files are stored in the active directory of Xtremes.
A.3. Becoming Acquainted with the Menu System 473
After clicking OK the data set is generated and a short description appearsin the Active Sample window.
Visualization of Data
A simple way to display data is in the form of a text. Load a data set or generateone using Data... Generate Data and select the menu option Data... List Data.Then, Xtremes opens a text window showing your data set. You can use the scrollbar to browse the data.
The Visualize menu contains options to display sample dfs, qfs, histograms,scatterplots, mean and median excess functions, among others. Kernel Densityalso provides options that reflect the data points at the right, left or both endsof the support. The bandwidth can be chosen by the user, an automatic selection(via cross–validation) is available.
The visualization options are also available in the local menu of a List Datawindow. They are applied to the displayed data set (rather than the active one) ifselected from the local menu. An easy way to work with more than one data setis therefore to list them, minimize the windows and work with the local menus.
Time series (see Section A.4 for a description of the different types of datasets used in Xtremes) are visualized by means of the scatterplot option. Note thateach scatterplot is displayed in a separate window. You can cut points from a
scatterplot using the point selection (scissors) mouse mode tool . The optionLeast Squares Polynomial in the local menu of the scatterplot window leads to adialog box for polynomial regression.
The scatterplot option is also applicable to multivariate data. Depending onthe active mode (univariate or multivariate), the user has to select two or threecomponents. In the latter case, the points are displayed using a 3–D dynamic plot.
Applying Estimators to the Active Data
The three chapters in Part II of this book correspond to four different domains ofXtremes called D(iscrete), SUM, MAX and POT. Each domain provides differentdistributions and estimators in the Data... Generate Univariate Data, Distributionand Estimate menus. One may switch between the different domains by means ofthe buttons D(iscrete), POT, MAX and SUM in the toolbar.
In the following example, we focus on estimators in the POT domain becauseit provides the richest facilities.
474 A. The Menu System
Demo A.4. (Estimation Using the Hill Estimator.) To start, let us apply the Hillestimator to standard Pareto data.
(a) First, create a data set using Data... Generate Univariate Data... Pareto(GP1).(b) Next, execute the option Estimating... Hill(GP1/GP2) . Recall that generalizedPareto models are fitted to the upper tail of the distribution. Therefore, the estima-tor requires the number k of upper extremes to be used for the estimation. You canchange the number of extremes by clicking the up or down arrows in the estimator dialogbox.(c) A plot of αn,k or σn,k as a function in k is obtained using the diagram option. Choosethe desired parameters before clicking the button.
Various parametric curves (plotted with the estimated parameter values)can be selected from the estimator dialog box. Comparing these curves with thecorresponding nonparametric ones, the user is able to judge visually the quality ofthe estimation.
Similar dialog boxes are provided within the MAX and SUM domains. Onecan work with the other parts of Xtremes while estimator dialogs are open. It isalso possible to use two or more estimators at the same time to compare theirresults.
The Toolbar
The toolbar below the main menu provides a quick access to frequently used op-tions of Xtremes. The tools enable the user to select different parametric distri-butions in the main menu. They are also used to select a mouse mode. We startwith the tools already described in the Overview.
Switch menu bar from univariate to multivariate mode.
Switch menu bar from multivariate to univariate mode.
Activates pulldown menus for discrete models.
Activates pulldown menus for Gaussian models.
Activates pulldown menus for extreme value (EV) models.
Activates pulldown menus for generalized Pareto (GP) models.
Opens pulldown menu with options for hydrology data (Chapter 11).
Opens pulldown menu with options for insurances data (Chapter 12).
A.3. Becoming Acquainted with the Menu System 475
Opens pulldown menu with options for finance data (Chapter 13).
Opens pulldown menu providing UFO facilities.
Opens StatPascal Editor Window to enter and run StatPascal programs.
Next the tools are listed that are not described in the Overview.
Opens ASCII–editor window.
Opens the Windows file dialog box and loads a data set. The file dialogbox provides options to delete or copy files.
The active data set is displayed in a text window.
Restores coordinate system in active window to the size before the lastchange.
The toolbar is also used to select a mouse mode. The mouse mode determines theaction taking place when the user clicks into a window or onto a curve1.
Standard mouse mode: no special actions occurs.
Option mouse mode*: changes display options of a curve (e.g., color, linestyles, number of supporting points, etc.). The actual dialog box dependson the type of the curve.
Parameter varying mouse mode*: opens window with sliders for eachparameter of a curve. Parameters are changed dynamically while slidersare dragged.
Clipboard mouse mode*:
• moves the curves to the Xtremes clipboard window. When thismode is applied in the Xtremes clipboard window, the systemsasks for a destination window;
• a curve can be directly dragged to a different plot window (alsoto a scatterplot window), if the left mouse button is kept presseduntil the cursor is located in the destination window.
Deleting mouse mode*: deletes curves from a plot window.
1Mouse modes, where one must click onto a curve, are marked with *.
476 A. The Menu System
Information mouse mode*: displays parameters of curve.
Coordinate changing mouse mode: adjust the coordinate system bypulling up a rectangle or, in the trivariate setup, rotate the coordinatesystem.
Point selection mouse mode: use this mode to cut off points in a bivariatescatterplot. Options of the local menu of a scatterplot do not use the cutpoints.
Line drawing mouse mode: adds straight lines to a plot window.
Label mouse mode: adds text labels to a plot. See page 478 for details.
Curve tabulating mouse mode*: the supporting points of a curve can betabulated by storing them into a bivariate data set.For that purpose, adjust the coordinate system and the number of sup-porting points (enter the Change Coordinates box to adjust the range of
the supporting points and use the option tool to select the numberof supporting points).
A.4 Technical Aspects of Xtremes
This section discusses two technical aspects of Xtremes, namely the format of datasets and the mechanisms provided to export graphics.
Format of Data Sets
Data sets are stored as plain ASCII files. Certain specifications can be given atthe top of the file, such as the type of the data set and the sample size. Moreover,one may include a shorter and a more detailed description.
Data sets can be entered by utilizing any text editor available under MS–DOS or Windows. It is possible to use the integrated editor, yet one should beaware of the fact that Windows 95/98 and ME limits the text size of the editor to64 KBytes. Under Windows NT/2000/XP and Vista 32–Bit, text files of arbitrarysize can be handled.
We start with an example showing the data entry using the integrated editor.Suppose you want to create a univariate data set with the following values: 1, 3.5,7, −4.
Start the editor by selecting the editor button in the toolbar and click onthe Header button in the toolbar of the editor window. A dialog box asking forthe type of the data set opens. Select Univariate Data to create a template of aunivariate data set and fill in the following fields:
A.4. Technical Aspects of Xtremes 477
Xtremes Univariate Data
Type: Artificial example
\begin(description)
This is an artificial data set. It
was entered using the integrated editor.
\end(description)
Sample Size: 4
1
3.5
7
-4
17
The first line defines the type of the data set—in the present case XtremesUnivariate Data. A list of all types is given below. The second line starts withType: and provides a short description which will be shown in the list of loadeddata sets (Data... Choose Data). It is also added to the description of curves basedon this data set. The description must be restricted to one line.
Between the lines \begin(description) and \end(description), a longerdescription may be added. It is displayed in the Active Sample window. The nextline determines the size of the data set.
Then, the data are listed, one value for each line. After having typed thetext, save it to a file (e.g., in the subdirectory \dat). Afterwards, your data setbecomes the active one. One may also simulate a data set of the desired type usingthe option Generate... .
Xtremes particularly supports the following data types.
• Xtremes Univariate Data. Real data x1, . . . , xn in any order, as presentedabove. Execute Data... Transform Data... Sort to sort these data accordingto their magnitude.
• Xtremes Time Series. Pairs (i, xi) of integers i and reals xi as, e.g.,
1 17.5
2 −2
3 0.34
4 0.001
The discrete time must be given in increasing order. Some of the pairs (i, xi)can be omitted (see, e.g., ct–sulco.dat), so that the entry Sample Size is notnecessarily the number of data points within the file. It may be larger thanthe time of the last point if values were omitted at the end of the file.
• Xtremes Multivariate Data. Multivariate data (xi,1, . . . , xi,m) are storedusing m entries on a line.
478 A. The Menu System
Moreover, the line after Sample Size contains an entry defining the dimen-sion m of the data set. It is followed by m names surrounded by quotationmarks. They define the headers for the corresponding column, e.g.,
Sample Size: 12
Dimension: 4
“Month” “SO2” “NO” “O3”
1 75.2 13.4 17.2
2 83.1 17.9 15.4
3 . 12.8 11.3
4 43.9 15.3 11.3
Missing values are indicated as a dot. It is possible to combine related uni-variate data sets of different length to one multivariate data set. The rowscontaining a dot are ignored when the multivariate data set is transformedor converted.
• Data Sets Without Header. Xtremes can also load plain ASCII filescontaining just a matrix of data, without any headers. Such data sets aretreated as multivariate. Moreover, one can use decimal points or decimalcommas within a data set.
Discrete, grouped and censored data types are also available. Please consultthe Xtremes User Manual for details.
Data can be converted from one type into another by the option Data...Convert to. All canonical conversions are available. There are also some specialconversions.
One can apply the UserFormula facility to perform transformations not cov-ered by the menu system. More sophisticated conversions are accomplished bymeans of StatPascal programs.
Documenting Illustrations
Xtremes provides various tools to change the outer appearance of a plot and toexport it to other systems. We start with a description of advanced plot options(like different colors and line styles) that are used to prepare pictures for exporting.The following options are available:
• Coordinate System: the coordinate system is either displayed within thewindow or on a rectangle around the actual plot area. These options arecontrolled in the Change Coordinates box of the local menu. The portion ofthe plot area may be changed to provide space for the attachment of labelsoutside the frame using the Frame Size option.
A.4. Technical Aspects of Xtremes 479
• Line Styles and Colors: the option mouse mode tool is used to changethe plot options of a curve. A left–click onto the curves opens a dialog box(cf. Fig. A.3). The user may select
– predefined line styles,
– define his own line style by specifying the length of curve segments andgaps
as well as the thickness of the curve. For example, choose the values
– 1 and 1 to produce a dotted line,
– 4 and 4 to produce a dashed line.
These procedures lead to a better result on printed pages than the use ofpredefined line styles (except of the solid line).
Different sizes and hatch styles are provided for histograms. The local menuof a scatterplot window provides the Options entry to change the point size.
• Adding Text: select the label mouse mode tool and click at the positionwhere you want to put your label. The font and position of the text may be
changed using the parameter varying and option mouse mode tools.It is possible to display vertical text or to move a label to the edge of thewindow. Labels are treated like curves, so they may be moved to anotherwindow or deleted in the same way.
The box for curve options is presented in the following Fig. A.3. We suggestto use the solid line option or the “line” and “gap” facility.
Fig. A.3. Specify your own line style
in the input fields “line” and “gap”.
The contents of an Xtremes plot window may be exported, either by printinga window, saving it as an EPS (Encapsulated Postscript) file or storing it in theWindows clipboard.
480 A. The Menu System
• Printing: first, select the option Frame Size (Print/EPS) (cf. Fig. A.4) fromthe local menu of the active window to define the size of the picture andprovide space for the frame (see the next Demo A.1). Then, select Print tocopy the contents to your printer. Printer Setup is utilized to change optionsof the printer.
• Saving an EPS file: first, set the size of the picture and frame, as in theprevious case. Then, select Save as EPS file to store the contents in the EPSformat. Xtremes asks for a filename.
• Copying to the clipboard (Option Copy to Clipboard in the local menu): thecontents of the active window are copied to the clipboard in the standardbitmap format. It is possible to insert the contents of the clipboard in otherapplications like painting programs or word processors.
Fig. A.4. Frame Size (Print/EPS) di-
alog box. The user selects the size of the
coordinate system and provides space
for text displayed outside the actual
picture.
In the following demo further explanations are provided about the dialog boxin Fig. A.4.
Demo A.5. (Printing a Graphics Window.) Select the Frame Size (Print/EPS)option from the local menu and enter the size of your picture in the dialog box.
The values shown in Fig. A.4 entail a picture of the size 72mm × 52mm, the actual plotarea comprises 60mm × 40mm. After that, proceed with the Print option to copy theactive window to your printer or select Save as EPS file to create an EPS file that canbe included in other documents.LATEX–users may employ the epsf macro package, which provides commands to in-clude postscript files into LATEX documents (e.g., the commands \epsfxsize=72mm
\epsfbox{picture.eps} load picture.eps and scale it to a horizontal size of 72mm).
A.5. The UserFormula (UFO) Facilities 481
A.5 The UserFormula (UFO) Facilities
With UserFormula (UFO), the user can type in formulas that are used
• to evaluate expressions using a calculator;
• to plot univariate or bivariate curves;
• to generate data sets;
• to transform existing data sets.
The formulas are entered by using the notation of common programming lan-guages.
We give an overview of the functions that are available in UserFormula ex-pressions and describe the options of the UserFormula menu, which opens after
clicking the UFO button in the toolbar. Operations that are too complicatedfor UserFormula may be handled by using the integrated programming languageStatPascal, introduced in Appendix B.
Overview
One can access all distributions implemented in Xtremes by calls to predefinedfunctions. There are three different groups of predefined functions.
• Standard mathematical functions like abs(x) (absolute value), exp(x) (ex-ponential function), log(x) (natural logarithm) or sqrt(x) (square root),among others.
• Function calls—partly including a shape parameter a—under which one maygenerate data, such as betadata(a) or gumbeldata. The returned values areindependent for successive calls and governed by the respective distributionin its standard form. In addition, [0, 1)–uniform data may be called by thefunction random.
• Functions for densities, qfs and dfs (again partially including a shape param-eter a) such as:
– betadensity(a,x), betadf(a,x), betaqf(a,x);
– gaussiandensity(x), gaussiandf(x), gaussianqf(x); etc.
The last curve plotted within an Xtremes plot window is available under the nameactualcurve.
The chapter Library Functions within the StatPascal User Manual gives adetailed description of all predefined functions that are available within the User-Formula facility.
482 A. The Menu System
Calculator
The calculator allows the user to type in a formula and evaluate it. Fig. B.5 showsthe calculator dialog box.
Fig. A.5. Calculator dialog box.
Formulas typed in the upper edit
field are evaluated. The lower edit
field defines variables and func-
tions also available in other parts
of Xtremes.
In the lower part of the calculator window, you can define your own functionsand variables. Write your definitions in the edit field User Defined Functions andclick on the =–button. The definitions thus made are available within all dialogboxes providing a UserFormula facility. They can also be used in all edit fieldswhere a real value is expected, e.g., in the dialog boxes used for plots of parametriccurves. For example, a Gaussian density including a location parameter is definedin the following way:
Pi:=3.1415
gauss(mu,x):=1/sqrt(2*Pi)*exp(-(x-mu)**2/2)
The formulas are stored in the file formula.txt within the working directory.They are loaded again upon the next start of Xtremes.
Plotting Curves
The graph of a function x → f(x) or x → f(p, x) may be plotted in every graphicswindow. The optional parameter vector p = (p1, p2, p3) is changed by using the
parameter varying mouse mode tool . Instead of p1 one may also use p. Withinthe multivariate mode, a surface plot of a function (x, y) → f(x, y) is performed.
Demo A.6. (Plotting Gaussian Densities with Varying Location Parameter.) Click
the UFO button in the toolbar and select the option Plot curve from the popupmenu. Now, type the formula 1/sqrt(2*3.1415) * exp(-(x-p1)**2/2) in the edit fieldlabeled f(x) or f(p,x) in the dialog box. If you have entered the definitions shown in theCalculator box, you can also write gauss(p1, x).
A.5. The UserFormula (UFO) Facilities 483
Especially note the option for the destination window. Xtremes lists all openwindows, and you can also enter the name of a new window. Select OK to plotthe curve.
Generating Data
The UserFormula facility may be employed to generate univariate data sets. Clickthe UFO button and select the option Generate Data... A dialog box similar tothe one used for plotting curves is utilized.
Now, the user must specify a quantile function (qf) Q(x) that is applied to[0, 1)–uniform data. For example, use -log(x) to generate standard exponentialdata.
Data distributed according to the distributions implemented in Xtremes isavailable by means of the predefined functions *data (where * is replaced by thename of the distribution). For example, one might also write exponentialdata inthe above example.
Transforming Data
The UserFormula facility offers the transformation of univariate or multivariatedata sets and time series. When you select the option Transform Data... in theUFO menu, Xtremes asks for a transformation depending on the type of the activedata set.
• Univariate Data xi: specify a transformation T to generate the data T (xi).
• Time Series (ti, xi): specify two functions T1(t, x) and T2(t, x) to obtain thetime series values (T1(ti, xi), T2(ti, xi)). Note that real–valued times are al-lowed.
• Multivariate Data (xi,1, . . . , xi,m): specify transformations Tj . The systemgenerates
(T1(xi,1, . . . , xi,m), . . . , Tk(xi,1, . . . , xi,m)).
In addition to the transformation, one must specify k names for the columnsof the transformed data set. See Demo B.8.
Demo A.7. (Smoothing a Data Set Using Polynomial Regression.) Convert thedata set to a time series, display a scatterplot and add a regression polynomial.
Now, the polynomial is available as actualcurve. Therefore, one can apply the transfor-mation T1(t, x) = t and T2(t, x) = actualcurve(t) to store the values of the polynomial,evaluated at the times t of the original time series.
484 A. The Menu System
Fig. A.6. Transform Data dialog
box for multivariate data. The trans-
formation in (12.39) is applied to
football.dat (with changed signs).
Demo A.8. (UFO Transformation of Multivariate Data.) Read football.dat (cf.Example 8.2.1) and change the signs (Data... Transform Data... Change Signs).
Choose UFO and apply Transform Data. The dialog box Transform Data lists the columnnames X1 and X2 of the current data set on the left–hand side (see Fig. B.6) togetherwith the variable names x1 and x2 assigned to the values in the columns. In the editfield on the right–hand side, the user must define the names of the ith column (using thearrow button one may edit a template of the transformation T (x1, x2) = (x1, x2)). In ourexample, we use the names Goalpost and Endzone and add the transformed variables-(-x1/12)**1.2 and -(-x1/12)**1.2. Finally, press OK to execute the transformation.
Appendix B
The StatPascalProgramming Language
To enhance the flexibility of the system beyond the possibilities of the UserFor-mula facility, it is supplemented by the integrated Pascal–like programming lan-guage StatPascal. StatPascal programs are handled in the StatPascal editor win-dow which can be opened by selecting the button.
Exaggerating a bit, one can say that the pull–down menu system serves as aplatform for learning the specific functions and procedures available in StatPascal.Thus, many options in the menus and dialog boxes have their counterparts asfunctions in StatPascal.
When a StatPascal program is executed, use the implemented
• dialog boxes,
• plot windows and a StatPascal window for the output.
One may also attach StatPascal programs to the menu bar which provides a facilityto extend the menu system. We assume that the reader has a working knowledgeof the Pascal language.
In contrast to other common statistical languages, StatPascal is a stronglytyped language which is compiled and executed by an abstract stack machine.StatPascal is therefore usually faster than other systems.
The StatPascal User Manual contains a formal description of the syntax andan alphabetical list of all library functions. The first chapters of the StatPascal UserManual also include an introduction to basic (Pascal) programming techniques.
The installation program copies a pdf version of the StatPascal User Manualand Reference to the file spmanual.pdf in the sp subdirectory.
486 B. The StatPascal Programming Language
B.1 Programming with StatPascal: First Steps
This section enables the user to take the first steps into the StatPascal environ-ment. We mention the StatPascal editor and introduce some simple programs.
The StatPascal Editor
A StatPascal editor window is opened by selecting the button within thetoolbar. It provides the usual editing facilities of Windows. Text blocks can beexchanged by means of the clipboard utilizing the commands listed in AppendixA. Under Windows 95, the maximum file size of the editor window is limited to64 KBytes.
The toolbar enables the user to save and load text files. The Run optionis a short cut for the compilation and execution of a program. Fig. B.1 shows theStatPascal editor window, where the following tools are available.
New: erases the text within the StatPascal editor window.
Load: opens the file dialog box and loads a StatPascal program.
Save: writes the text in the StatPascal editor window to a disk file. If nofilename has been provided, the Save as option is activated.
Save as: writes the text in the StatPascal editor window to a disk fileafter asking for a file name.
Run: compiles and executes the program in the StatPascal editor win-dow.
Compile: compiles a program and stores the resulting binary under afilename, executes it or locates the position of a runtime error with thesource file.
Compiler Options: opens the Compiler Options dialog box, controllingparameters of the compiler and runtime environment.
Help: opens the StatPascal online help.
B.1. Programming with StatPascal: First Steps 487
The “Hello, World” Program
We start with the traditional “Hello, world” program to demonstrate the tech-niques of entering, compiling and running a StatPascal program. The user willimmediately recognize that the program looks like its Pascal equivalent.
program hello;
begin
writeln (’Hello, world!’)
end.
Type in the program, save it to a file (Save as, and click the Run button
to execute the program. If the program contains no errors, Xtremes opens theStatPascal window displaying the output.
The StatPascal Window
The procedures write, writeln and read of the Pascal language are provided toperform input and output operations in the StatPascal window. In Fig. B.1, wesee a program in the StatPascal editor window and its output in the StatPascalwindow.
Fig. B.1. StatPascal ed-
itor window with exam-
ple program (front) and
its output in the StatPas-
cal window (back).
The example program asks for real numbers t and displays the Gaussian den-sity ϕ(t). The predefined routines MessageBox, DialogBox and MenuBox (whichare described in the StatPascal manual) provide an alternative using dialog boxes.
Data Types and Structures
StatPascal provides most of the data types and data structures of the Pascallanguage. The predefined types
488 B. The StatPascal Programming Language
boolean, char, integer, real and string
are available, and the user can define new types using all data structures of Pascal(with the exception of variant records). Our examples use only the predefined datatypes in conjunction with the standard Pascal data structure array and the newdata structure vector which is introduced below.
Elements of a StatPascal Program
A StatPascal program consists of up to eight different sections. In the followingtable, we give a short explanation of the different sections of a program. As onecould see from the previous example programs, most of these sections are optional.
program name; a StatPascal program starts with the reserved wordprogram, followed by the name of the program
uses ... ; the optional uses lists libraries which are used bythe program
label ... ; the optional label starts the declaration of the labels
const ... ; the optional const defines constant values
type ... ; the optional type is used to assign names to userdefined data types (see page 489)
var ... ; the optional var declares the variables used in a pro-gram
procedure ... ;function ... ;
an arbitrary number of functions and proceduresmay be declared (see page 489)
begin...
end.
the mandatory main program contains the instruc-tions performed by the program
A tutorial on basic programming techniques with an introduction to standardPascal can be found in the StatPascal manual.
Vector and Matrix Types
StatPascal implements a new data structure vector which is similar to the arraystructure. Yet, one does not have to specify the number of elements when declaringa vector. A vector type is defined using the declaration
vector of type.
We start with a simple example which shows the usage of a real vector. Thefollowing program generates a Gaussian data set of size 100 under the location andscale parameters 2 and 3, and stores the data in the vector x. Then the samplemean and sample variance of the simulated data set are displayed.
B.1. Programming with StatPascal: First Steps 489
program example;
var x: vector of real;
begin
x := 2 + 3 * GaussianData (100);
writeln (mean (x), variance (x))
end.
Readers who are familiar with other statistical languages should note thatthe usual arithmetic and logical expressions (with componentwise operations) aswell as index operations are supported.
Vectors can also be used as arguments and return types of functions. Thelanguage provides implicit looping over the components of a vector if a functionoperates on the base type of a vector structure.
The following program demonstrates further vector operations. We performa numerical integration of a real–valued function f , defined on the interval [a, b],using the approximation∫ b
a
f(x) dx ≈n∑
i=1
f(ci) + f(ci+1)
2
b − a
n
where ci = a + (i − 1)(b − a)/n for i = 1, . . . , n + 1. The function f as well as theparameters a, b and n are provided as arguments.
type realfunc = function (real): real;
function integrate (f: realfunc; a, b: real; n: integer): real;
var fc: vector of real;
begin
fc := f (realvect (a, b, n + 1));
return sum (fc [1..n] + fc [2..(n+1)]) * (b-a) / (2*n)
end;
We start with a type declaration for the functional parameter. The first as-signment within the function integrate calculates the values f(ci), i = 1, . . . , n + 1and stores them in the variable fc.
Note that the call to the predefined function realvect returns a real vectorwith n + 1 equally spaced points between a and b, which is given as an argumentin the call of f.
In the second statement, we generate two integer vectors containing the valuesfrom 1 to n and from 2 to n + 1, which serve as indices to fc. The index operationyields two real vectors with the values (f(c1), . . . , f(cn)) and (f(c2), . . . , f(cn+1)).The + operator adds these vectors componentwise, and the predefined functionsum calculates the sum of the components of the resulting vector. Finally, thevalue of the integral is returned.
Next, we define a function square and calculate its integral.
490 B. The StatPascal Programming Language
function square (x: real): real;
begin
return x * x
end;
begin
writeln (integrate (square, 0, 1, 100)) (* 0.33335 *)
end.
The data structure matrix represents two–dimensional arrays where thenumber of rows and columns are determined at run time. The language providesan implicit conversion from two–dimensional arrays to matrices. One can also con-struct a matrix using the predefined function MakeMatrix, which fills a matrixwith the components of a vector. Matrices can be used in arithmetic operations.The multiplication of two matrices or of a matrix and a vector perform the usualmathematical matrix operations. As an example, we show a program that prints100 random variables simulated under a bivariate Gaussian distribution with co-variance matrix
Σ =
⎛⎝ 1 0.2
0.2 1.5
⎞⎠ .
Note that chol (S) returns a matrix C such that S = CCt.
program bivgauss;
var S, C: matrix of real;
i: integer;
begin
S := MakeMatrix (combine (1.0, 0.2, 0.2, 1.5), 2, 2);
C := chol (S);
for i := 1 to 100 do
writeln (C * GaussianData (2))
end.
Consult the StatPascal Reference Manual for further information about vec-tors and matrices.
B.2 Plotting Curves
StatPascal allows the user to open an Xtremes plot window and to display curvesand scatterplots in it. These windows and curves exactly act like the ones availablefrom the menu system.
In the following, we only discuss univariate curves and scatterplots. The sp
subdirectory of the Xtremes directory contains various example programs thatdemonstrate the graphical facilities of StatPascal.
B.2. Plotting Curves 491
Univariate Curves
Xtremes provides a predefined function plot which is utilized to plot univariatecurves. The function requires two vectors containing the points xi and values yi,the destination window and a description of the curve. A linear interpolation ofthe given points is displayed.
For example, the following program plots a Gaussian density in two Xtremesplot windows.
program gaussplot;
const n = 100;
var x, y: vector of real;
begin
x := realvect (-3, 3, n);
y := gaussiandensity (x);
plot (x, y, ’Density 1’, ’Gaussian density’);
plot (x, y, ’Density 2’, ’Gaussian density’)
end.
Fig. B.2 shows the output of the program. Two Xtremes plot windows (Den-sity 1 and Density 2) are opened by calls to plot. The curves are displayed as solidblack lines. One can change the plot options using the procedures listed at the endof this section.
Fig. B.2. The program
gaussplot and its out-
put in two Xtremes plot
windows.
Scatterplots
The scatterplot procedure, displaying scatterplots, is similar to the plot procedure.The routine requires three parameters: two arrays defining the points and thename of the scatterplot window. In the above example, the call to plot must be
492 B. The StatPascal Programming Language
replaced by scatterplot (x, y, ’Scatterplot’) to obtain a scatterplot of thepoints (x1, y1), . . . , (xn, yn).
B.3 Generating and Accessing Data
An important facility of StatPascal is the implementation of routines for data gen-eration and data transformation not covered by the menu system or UserFormula.In this section, we introduce functions and procedures to exchange data betweenStatPascal and Xtremes. Data stored in a StatPascal program (e.g., in a vector)are not used directly within Xtremes, and data sets loaded in Xtremes are notused by StatPascal automatically. Instead, all data transfer is accomplished bycalling predefined functions and procedures. They give the user access to the ac-tive data set from within a StatPascal program and allow to pass data collectedin a StatPascal vector to Xtremes, thus creating a new active data set.
We start with an example for generating standard Pareto data under theshape parameter α = 1.
program Pareto;
const n = 100;
alpha = 1.0;
var x : vector of real;
begin
x := paretodata (alpha, n);
createunivariate (x, ’pareto.dat’, ’Description’)
end.
Here n Pareto data are generated independently by the function paretodataand stored in the vector x. The call to createunivariate passes the data to Xtremes,that is, the data set stored in x is saved to the file pareto.dat which is then theactive one. In addition, a short comment is added. After having run the program,all options of the menu system can be applied to the new data set.
Passing Data from StatPascal to Xtremes
We now provide a more systematic description of the generation of data sets byStatPascal. Four different procedures are provided to pass data collected in avector from StatPascal to Xtremes. In the following examples, the data are savedto filename.dat in the working directory. One may create data sets of the followingtypes.
Xtremes Univariate Data: data x1, . . . , xn are collected in a real vector givenas argument to the call of the predefined procedure createunivariate.
var x: vector of real;
...
B.3. Generating and Accessing Data 493
createunivariate (x, ’filename.dat’, ’Description’);
Instead of a vector, a one–dimensional real array may be given as well.
Xtremes Time Series: in addition to the previous case, a vector containing thetimes ti of the observations must be provided.
var x : vector of real;
t : vector of integer;
...
createtimeseries (t, x, ’filename.dat’, ’Description’);
Xtremes Censored Data: besides a real vector containing the censored data,there is an integer vector with the censoring information.
var z : vector of real;
delta : vector of integer;
...
createcensored (z, delta, ’filename.dat’, ’Description’);
Xtremes Multivariate Data: the data xi,j are collected in a real matrix. Inaddition, a string with the column names, separated by ’|’, must be provided.
var x: matrix of real;
h: string;
...
h := ’Day|Month|...’;
createmultivariate (x, h, ’filename.dat’, ’Description’);
Note that a two–dimensional array can be provided instead of a matrix type,because the language supports an implicit type conversion from two–dimensionalarrays to matrix types.
As a result of such a procedure you will get an active data set of the typeas specified by the command create.... The Active Data window opens showingthe name of your data set and the description provided in the last argument.
Passing Data from Xtremes to StatPascal
Next, let us consider the case where active data are dealt with by StatPascal. Theactive data set is accessed by means of the following functions:
samplesize size of the active data set;
dimension dimension of the active data of type Xtremes MultivariateData. This function can also be applied to univariate data ora time series, yielding 1 or 2, respectively;
494 B. The StatPascal Programming Language
data(i) xi:n if x1, . . . , xn are Xtremes Univariate Data. Use the func-tion call data(i,1) to access the unsorted data;
data(i,j) xi,j if (x1,1, x1,2), . . . , (xn,1, xn,2) is the active time series. Mul-tivariate data are dealt with in the same way. If a grouped dataset is active, then data(i,1) returns the cell boundary ti anddata(i,2) the frequencies ni in cell [ti, ti+1). Moreover, censoreddata are treated like multivariate data with the censored datain the first component, the censoring information in the secondand the weights of the Kaplan–Meier estimate in the third one;
columndata(i) vector with the (unsorted) data in the ith column of the activedata set;
rowdata(i) vector with the data in the ith row of the active data set;
columnname(i) name of the ith column. This function yields an empty stringif not applied to a multivariate data set.
Demo B.1. (Translation of a Univariate Data Set.) We employ StatPascal to addthe value 5 to univariate data. Note that the vector structure allows us to deal
with data sets of any size.
program translation;
var x: vector of real;
begin
x := columndata (1);
createunivariate (x + 5, ’demo.dat’, ’’)
end.
We used the function call columndata (1) to access the unsorted data set.
Author Index
A
Aarssen, K., 456Aitchison, J., 245Akashi, M., 442Akgiray, V., 179, 374Anderson, C.W., 145, 450, 451Andrews, D.F., 85, 161Ashkar, F., 120, 138, 341Atkinson, H.V., 451
B
Buhlmann, H., 5, 425Bachelier, L.J.B.A., 374Bahr von, B., 434Baillie, R.T., 373Balakrishnan, N., 160Balkema, A.A., 27Barbour, A.D., 9Barndorff–Nielsen, O.E., 119Basrak, B., 398Becker, R., 272Beirlant, J., 137, 193, 195, 198Benjamin, J.R., 109Benktander, G., 156Beran, R.J., 88Berkowitz, J., 408Bhattacharya, G.K., 302Bhattacharya, R.N., 268Black, F., 374Bobee, B., 120, 138Bollerslev, T., 395Bomsdorf, E., 460Booth, G.G., 179, 374Breidt, F.J., 400Brockwell, P.J., 68, 168, 220, 223Brown, L.D., 88Brush, G.S., 358Buishand, T.A., 113
C
Caeiro, F., 197, 204Carey, J.R., 454Caserta, S., viii, 371, 395Castillo, E., 118Changery, M.J., 121Cheng, B.N., 289Chernick, M.R., 169Christoph, G., 174Cleveland, W.S., 69, 271Cohen, A.C., 160Coles, S.G., viii, 116, 322, 331, 450Cornell, C.A., 109Cottis, R.A., 441Cowing, T.G., 303Cox, D.R., 119Csorgo, S., 138, 306
D
Danıelsson, J., 395Datta, S., 220Davis, R.A., 68, 168, 169, 220, 221, 223,
398, 400Davison, A.C., 121, 142, 240, 334, 342, 357Daykin, C.D., 43de Haan, L., 19, 23, 27, 134, 145–147, 189,
196, 198, 204, 208, 398, 456Deheuvels, P., 138, 320Dekkers, A.L.M., 134Devroye, L., 38Diebold, F.X., 238, 374, 407Diebolt, J., 132, 155Dierckx, G., 193, 198Dietrich, D., viii, 145Drees, H., vi, 33, 52, 135, 138, 146, 147, 192,
195, 198, 207, 210, 216, 219, 320,448
Drosdzol, A., 276
496 Index
Dubey, S.D., 111, 123, 134Dunsmore, I.R., 245
E
Efron, B., 91Einmahl, J.H.J., 134El–Aroui, M.–A., 132, 155Embrechts, P., 401, 432, 434Enders, W., 373Engle, R.F., 395
F
Falk, M., viii, 23, 135, 189, 234, 238, 272,300, 313, 332
Fan, J., 403, 409Ferreira, A., 147Feuerverger, A., 193, 198Figueiredo, F., 204, 206Fill, H.D., 351Fiorenti, M., 122Fisher, R.A., 18, 47, 171, 187Fofack, H., 176Fraga Alves, M.I., 196, 206Frey, R., 401Frick, I., vFrick, M., 321, 326, 328
G
Ganssler, P., 235Galambos, J., 7, 23, 32, 118, 186, 293, 457Gangopadhyay, A.K., 239Garrido, M., 132, 155Gavrilov, L.A., 458Gavrilova, N.S., 458Geffroy, J., 293Gelder, van P., viiiGene Hwang, J.T., 88Genest, C., 275Gentleman, J.F., 10Gerber, H.–U., 412Girard, S., 132, 155Glynn, P.W., 155Gnedenko, B.V., 19Gogebeur, Y., 193Goldie, C.M., 185Gomes, M.I., v, viii, 143, 189, 190, 192–194,
196, 197, 201, 204, 206, 208Gompertz, B., 54
Goovaerts, M.J., 430Guillou, A., 198Gumbel, E.J., 117, 457Gunther, T.A., 238, 407
H
Husler, J., v, viii, 23, 144, 145, 147, 169,234, 238
Haight, F.A., 9Hall, P., 185, 193, 198Hamilton, J.D., 68Hampel, F.R., 34, 89, 118Hashofer, A.M., 143Hashorva, E., 296Haßmann, S., 129Heffernan, J.E., 322, 323, 331Herzberg, A.H., 85, 161Hesselager, O., 255Heyde, C., vHill, B.M., 129Hipel, K.W., x, 3Hipp, C., 432Hlubinka, D., 449Hogg, R.V., 50Holst, L., 9Hosking, J.R.M., viii, 119, 120, 337Houghton, J.C., 120Hsing, T., 169, 208Huang, X., 317, 320Huber, P.J., 89
I
Ishimoto, H., 442
J
Jansen, U., 114Janson, S., 9Jenkinson, A.F., 16Joe, H., 275, 297, 308Johnson, N.L., 111, 117, 285Jorion, P., 372, 382
K
Kotzer, S., 451Kannisto, V., 455Kasahara, K., 444Katz, R.W., vi, 353, 358, 359, 362, 365
Author Index 497
Kaufmann, E., vi, viii, 138, 182, 186, 189,195, 198, 235, 256, 313, 326, 328,445, 453
Kawakami, K., 451Kimball, B.F., 117Kinnison, R.P., 121Kluppelberg, C., 432Klugman, S.A., 50, 435Koedijk, K.G., 179Kogon, S. M., 178Kolata, G., 7, 454Komukai, S., 444Konecny, F., 342Kotz, S., 111, 117, 285Kowaka, M., 442Kozek, A., vi, 401Kremer, E., 412Kuczera, G., 349Kuon, S., 413, 425Kupiec, P. H., 408
L
Luhr, K.–H., 460Laycock, P.J., 441, 444Leadbetter, M.R., 23, 145, 168, 169Ledford, A.W., 322, 324, 331Lee, L., 301Li, D., v, 144, 146, 147Liedo, P., 454Lindgren, G., 23, 145Ling, S., 220Little, R.J.A., 274Loretan, M., 375Lu, J.–C., 301Lungu, D., viii
M
Macri, N., 457Madsen, H., 351Mandelbrot, B.B., 374Manteiga, W.G., 91Marohn, F., 119, 144, 189, 272Marron, J.S., 46Martins, M.J., 193, 194, 201, 206Masamura, K., 442Mason, D.M., 138Matsunawa, T., 99Matthys, G., 193
McCormick, W.P., 169, 220McCulloch, J.H., 178, 289McFadden, D., 303McMahon, P.C., 373McNeil, A.J., 401, 417Mendonca, S., 206Michel, R., 432Mikosch, T., 226, 275, 398, 432Miranda, C., 206Mises von, R., 16Montfort, van M.A.J., 120, 143Murakami, Y., 451
N
Nachtnebel, H.P., 342Nandagopalan, S., 169Naveau, P., 358, 362, 365Neves, M., 193, 201Nolan, J.P., viii, 172, 175, 176, 178, 285,
289North, M., 342
O
Orozco, D., 454Otten, A., 120
P
Panorska, A., 289Pantula, S.G., 209Parlange, M.B., 358, 362, 365Peng, L., 192, 220Pentikainen, T., 43Pereira, T.T., 135Pericchi, L.R., 109Perls, T.T., 456Pesonen, M., 43Pestana, D., 197Pfanzagl, J., 329Pfeifer, D., viii, 117Phillips, P.C.B., 375Pickands, J., 27, 134Pictet, O., 225Prescott, P., 134Pruscha, H., 61
R
Remillard, B., 275Revesz, P., 209
498 Index
Raaij, de G., 389Rachev, S.T., 289Radtke, M., viii, 189, 411, 413, 425Rao, R.R., 268Rasmussen, P.F., 138, 342Raunig, B., 389Reich, A., 413, 425Reiss, R.–D., 23, 33, 34, 52, 121, 129, 132,
138, 140, 169, 186, 192, 198, 234,238, 276, 293, 300, 313, 326, 328,332, 342, 448
Resnick, S.I., 169, 189, 198, 220, 221, 398Rice, J.A., 94Robinson, M.E., 141Rodrigues, L., 204Rodriguez–Iturbe, I., 109Ronchetti, E.M., 34, 89, 118Rootzen, H., 23, 145, 342, 398Rosbjerg, D., 138, 342, 351Rosenblatt, M., 234Ross, W.H., 116Rossi, F., 122Rousseeuw, P.J., 34, 89, 118Rousselle, J., 121, 341Rubin, D.B., 274Rytgaard, M., 129
S
Sanchez, J.M.P., 91Sarabia, J.M., 118Scarf, P.A., 441, 444Schutz, E.U., 460Schmithals, B., 460Schnieper, R., 415Scholes, M., 374Schupp, P., 405Seal, H.L., 5Seifert, B., 179Sellars, C.M., 451Serfling, R.J., 87, 281Shi, G., 451Shibata, T., 441Shorack, G.R., 163Sibuya, M., 74, 293, 451Simonoff, J.S., 46Smith, R.L., 111, 117, 121, 141, 142, 147,
185, 240, 305, 334, 342, 355, 357,358
Starica, C., 198, 220, 225Stahel, A.W., 34, 89, 118Stedinger, J.R., 351Stephens, M.A., 120Stork, P.A., 179Stoyan, D., 114Stoyan, H., 114Straub, E., 414Stute, W., 235
T
Tajvidi, N., 315, 342Takahashi, R., 451Tarleton, L.F., 359Tawn, J.A., 141, 305, 322, 324, 331Tay, A.S., 238, 407Taylor, S., 373, 400Teugels, J.L., 137, 195Thatcher, A.R., 455Thomas, M., 129, 132, 276, 342Tiago de Oliveira, J., 293, 305Tippett, L.H.C., 18, 187Todorovic, P., 121, 249Trimborn, M., 460Tsay, R.S., 262Tsuge, H., 442
U
Uemura, Y., 451Usuki, H., 451
V
Vaquera, H., viii, 140Vaupel, J.W., 454, 455Veraverbeke, N., 434Versace, P., 122Villasenor, J.A., viii, 140Viseu, C., 206Vries, de C.G., viii, 179, 371, 395, 396, 398Vylder, de F., 426, 430Vynckier, P., 137, 195
W
Walden, A.T., 134Wallis, J.R., 120Walshaw, D., 116Wang, Z., 143Wehn, C.S., vi, 401, 409
Author Index 499
Weiss, L., 134, 183Weissman, I., 143Wellner, J.A., 163Welsh, A.H., 185, 306Whitmore, G.A., 10Wicksell, S. D., 445Wiedemann, A., 276Williams, D. B., 178Wolf, W., 174Wood, E.F., 120, 337
X
Xin, H., 289
Y
Yao, Q., 403, 409Yates, J.R., 451Yuen, H.K., 305
Z
Zeevi, A., 155Zelenhasic, E., 249Zolotarev, V.M., 175Zwiers, F.W., 116
Subject Index
A
Aggregation, 170Angular component, 283, 311Annual maxima method, 10, 138Approximation
EV, of maxima, 18GP, of exceedance df, 27, 183normal
of gamma distributions, 122of sums, 30
penultimate, 187–189, 257Poisson
in a multinomial scheme, 152of binomial distribution, 8, 9of exceedances, 249of negative binomial distribution, 99
Asset prices, 5, 371Auto–tail–dependence function, 76, 325
sample, 76, 325Autocorrelation function, 72Autocovariance function, 72, 166, 167
sample, 72Automatic choice
of bandwidth, see Cross–validationof number of extremes, 137
B
Bartlett correctionin EV model, 119in GP model, 144
Bayesrisk, 102, 244
Beta function, 126Bias, 61, 89
–reduction, 190Black–Scholes
model, 374price, 392
Blocks method, see Annual maxima methodBootstrap
parametric, df, 91sample, 92, 431
C
Calendar effect, 373Canonical
dependence function, 317Censoring
fixed, type–I, II, 160random, 160
Central limit theorem, 30Characteristic function, 173Cluster size
distribution, 78, 208mean, 77, 208
reciprocal, see Extremal indexClustering of exceedances according to
blocks definition, 77runs definition, 77
Conditionextreme value, 145Hall, 185, 198Poisson(Λ, F ), 258Poisson(λ,F ), 248von Mises, 56, 186, 449Weiss, see δ–neighborhood of a GP df
Conditionaldensity, 228
posterior density as, 244distribution, 12, 228
of exceedances, 234of order statistics, 234
expectation, 50, 165, 230, 395Bayesian estimator as, 244covariate, 241serial, 241
501
502 Index
independence, 230, 245, 312mean function, 241q–quantile, 231
covariate, 241, 261function, 241serial, 241
variance, 166, 231, 395Confidence interval, 90
bootstrap, 91, 115, 431for functional parameter, 91
Contour plot, 269Copula, 275
empirical, 277Correlation coefficient, 267Covariance, 71, 165
matrix, 267sample, 71, 270
Covariate, 238, 355Critical region, 93Cross–validation, 46Cycle, 354
D
Data, 6American football (NFL), 306declustered, 78, 209, 252, 341deseasonalized, 70exceptional athletic records, 141exchange rate
black market, 179British pound vs U.S. dollar, 375Swiss franc vs U.S. dollar, 381
fire claimDanish, 417from UK, 42Norwegian, 415of industrial portfolio, 421
floodsof Feather River, 109of Moselle River, 70, 338
generation of, bybuilding mixtures, 38polar method, 38quantile transformation, 38
grouped, 152Iceland storm, 114liability insurance, 152maximum pit depth, 442
maximum temperature
at de Bilt, 113at Furnace Creek, 67
maximum wind–speeds
at Jacksonville, 121, 163at Vancouver, 10, 48multivariate, 274
missing, 67, 70, 274number of car accidents, 100ozone
at Mexico City, 140in San Francisco Bay Area, 308
pooling of, 343
spatial, 273stock market, 375tensile strength of sheet steel, 117
TV watching, 46, 59velocity of light (Michelson), 85
δ–neighborhood of a GP df, 183
Density, 7kernel, 45
for censored data, 163
Density, multivariate, 268kernel, 271representation of, by d–fold partial deriva-
tive, 268
Dependenceserial, 71, 208
Distance
Hellinger, 88, 184, 239, 257L2–, 88
Distribution(s)
Benktander II, 156beta (GP2), 24, 38, 124beta, two–parameter, 126
binomial, 8Burr, 156
as a mixture, see Distribution(s), mix-ture of, converse Weibull
Cauchy, 27, 38, 170, 172, 174χ2–, 123, 170
convolution of, 30double–exponential, see Distribution(s),
Laplace
ellipticalsymmetric, 287
endpoint of
Subject Index 503
left, 12right, 11
Erlang, 123exponential, 122exponential (GP0), 24, 37extreme value (EV)
fitting, to maxima, 57
two–component, 121fat–tailed, 31, 32Frechet (EV1), 15, 37, 38function (df), 7
marginal, 267
sample, 39gamma, 104, 106, 122, 125
convolution of, 122mean of, 104reciprocal, 104, 172
variance of, 104Gaussian, see Distribution, normalgeneralized Cauchy, 33generalized gamma, 125
double, 126
generalized logistic, 123generalized Pareto (GP), 23
fitting, to exceedances, 57geometric, 13, 27, 99, 145Gompertz, 11, 22, 37, 54, 124, 458, 462
GP–Gamma, 125GP–Gamma 2, 124Gumbel (EV0), 10, 15, 37, 124half–normal, 126heavy–tailed, 30, 69
super, 154Levy, 126, 172Laplace, 396leptokurtic, see Distribution(s), fat–tailedlimiting, of
exceedances, 27maxima, 18minima, 22sums, see Central limit theorem
log–gamma, 124, 125
log–normal, 32, 186, 349, 396log–Pareto, 154logistic, 123, 455mixture of, 32, 123, 154, 233
converse Weibull, 156
exponential, 154
Pareto, 154Poisson, 98, 249
multinomial, 95
negative binomial, 14, 99, 250normal, 17, 31, 172, 174
fitting, to data, 59kurtosis of, 31mixture of, 31, 32, 59, 379, 389
of maximum, 10of heterogeneous random variables,
10
of minimum, 11Pareto (GP1), 24, 37, 38, 124
as a mixture, see Distribution(s), mix-ture of, exponential
Pearson–type III, see Distribution(s),gamma
penultimate, 187, 189Poisson, 9
fitting, to discrete data, 59predictive, 245profit/loss, 384
Rayleigh, 22, 54regional frequency, 345
Student, 33, 95, 170, 179, 379, 396noncentral, 285with n degrees of freedom, 94, 170
sum–stable, 172, 379unimodal, 15Wakeby, 120
Weibull (EV2), 15, 38Distribution(s), multivariate
elliptical, 282, 296function (df), 266
sample, 270
Gumbel type II, see Distribution(s),multivariate, Gumbel–McFadden
Gumbel–McFadden, 301, 307
Husler–Reiss, 295, 307log–normal, 281Marshall–Olkin, 294, 306
normal (Gaussian), 280, 281spherical, 282, 296, 312
Student, 283, 285, 390sum–stable, 285
Domain of attraction
504 Index
max–, 18pot–, 27, 30, 184
E
EquationAR, 166ARMA, 167stochastic linear difference, see also Time
series, AR(p), 164Ergodic theory, 209Estimator
Bayes, 102, 103, 242for exponential model, 105for GP 1 model, 129
bias of, 89diagram of, 136Drees–Pickands (GP), 134Hill
MLE in GP1(u, µ = 0), 129bad performance of, 130, 132, 136,
184, 211, 212, 381bias–reduced, 194, 203, 205MLE in GP2(u), 133
in AR–modelYule–Walker, 168
in ARMA–modelHannan–Rissanen, 168innovations algorithm, 168MLE, 168
in GP modelfor degrees, 344
Kaplan–Meier, 162L–moment, 348least squares, in normal model, 87linear combination of ratios of spac-
ings (LRS)in EV model, 111in GP model, see Estimator, Drees–
Pickands (GP)M–
for scale parameter, 88in exponential (GP0) model, 89, 128in Pareto (GP1) model, 129
maximum likelihood (ML)in normal model, 85for censored data, 164in beta (GP2) model, 133in EV model, 111
in exponential (GP0) model, 84, 128in Frechet (EV1) model, 110in GP model, 134in Gumbel (EV0) model, 108in multivariate normal model, 281in negative binomial model, 100in Poisson model, 96
mean squared error (MSE) of, 89, 102,191
minimum distance (MD)in EV model, 111in normal model, 88
momentin GP model, 134in Gumbel (EV0) model, 108in negative binomial model, 99in normal model, 86
nonparametric density, see Density, ker-nel
Pickands (2–dim EV), 306, 307quick, in normal model, 87reduced–bias, 190unbiased, 89
Euclidean norm, 282Euler’s constant, 21, 108Exceedance(s), 8, 138
df, 12for Poisson(λ, F ) process, 249number of, 8time, see Time, arrival
Excess, 49df, 49, 53function
mean, 50median, 53sample mean, 52, 456trimmed mean, 52, 180
Expected shortfall, 385conditional, 406
Extremal index, 79, 168Extreme value index, 208Extremes
conditional, 238
F
Forecast, see PredictionFubini theorem, 235
for conditional distributions, 235
Subject Index 505
G
Gamma function, 19, 104Gompertz law, 54, 453Gumbel method, see Annual maxima method
H
Hazardfunction, 53
cumulative, 53reciprocal, 55sample, 55, 456
rate, 53, 458Histogram
of discrete distribution, 9, 470Poisson, 97sample, 44, 97
Homogeneity property, 304Horror case, 19
I
Index flood, 344, 345Innovation algorithm, see Simulation, of ARMA
time seriesIntensity, 248, 262, 447
function, 259measure, 259, 262, 447
J
Jackknife method, 193
K
Kendall’s τ , 267, 284Kurtosis, 31
L
L–CV, 347L–kurtosis, 347L–moment ratios, 347L–moments, 86, 346L–skewness, 347L–statistic, 87Lag, see Time, lagLeadbetter’s mixing conditions, 168Least squares method, 64, 65Legendre polynomials, 346Level, T–year, 12, 13Likelihood
function, 84, 103
Location and scale parameters, 16, 36vectors, 279
Lowess, see Regression, local weighted
M
Matrixorthogonal, 282transposed, 266unit, 280, 282
Maxima, 9of GP random variables, 29
McSize, see Cluster size, meanMean
number of exceedances, see Mean, valuefunction
of binomial distribution, 8of EV distribution, 20of gamma distribution, 122of GP distribution, 30of negative binomial distribution, 99of Poisson distribution, 9sample, 41value function, 8, 18
of homogeneous Poisson process, 248of inhomogeneous Poisson process,
258of Polya–Lundberg process, 250
vector, 266sample, 270
Minima, 11, 110, 117Mode(s), 15
of EV distributions, 21Model
Poisson–GP, 153Poisson–Pareto (Poisson–GP1), 152
Momentscentered, 20of EV distributions, 19of GP distributions, 29sample, 41
Mortality rate, see Hazard, rateMoving averages, 66
Nadaraya–Watson, 66
N
Newton–Raphson iteration, 171
O
506 Index
Order statistics, 12, 40, 141, 234Outlier, 47
P
P–P plots, 63p–value, 93, 95, 96, 330Parameter
canonical, 299, 300, 307tail dependence, 75, 300, 316
Parameterizationα–
of EV distributions, 15of GP distributions, 24
γ–of EV distributions, 16of GP distributions, 25
Partial duration values, see ExceedancesPeaks–over–threshold, see Exceedance(s)Pickands dependence function, 327Polynomial, MA and AR, 167Posterior
density, 103, 244Power function, 330Prediction, 235, 244
linear, 245Predictive
density, 238distribution, 237, 406
in Bayesian framework, 245VaR, 406
Priorconjugate, 104–106density, 102
Probability weighted moments, 346Probable maximum loss (PML), 419Process
counting, 248, 415Polya–Lundberg, 250point, 259Poisson, 247, 262
homogeneous (Poisson(λ)), 248inhomogeneous (Poisson(Λ)), 258mixed, 249
white–noise, 164, 397
Q
Quantile(s), 35bivariate, 269
extreme, 208function (qf), 35, 120
sample, 42sample, 42
Quantile–Quantile (Q–Q) plot, 61EV, 62, 112GP, 62normal, 62
R
Radial component, 282, 311, 328Random variables
uncorrelated, 71, 267Regression
fixed design, 65local weighted, 69slope, 64
Regularly varying, 182, 186Reinsurance treaty
ECOMOR, 411excess–of–loss (XL), 4, 411stop–loss, 411
Reproductivitypot–
of Benktander II distributions, 157of converse truncated Weibull dis-
tributions, 157sum–
of gamma distributions, 122Residual life
df, see Excess, dfmean, function, see Excess, function,
meanResiduals, 69Return period, see Time, interarrivalReturns, 5, 371
volatility of, 377Risk
contour plot, 430process, 412
RiskMetrics, 400Robust statistics, 34, 88, 128, 129Rotation, 282Run length, see Clustering, of exceedances
according to, run definition
S
Scatterplot, 48
Subject Index 507
3–D, 273Seasonal component, 69Self–similarity, 170, 171Separation, seasonal, 120Service
life, 441Simulation
of ARMA time series, 168Skewness coefficient
of EV distributions, 21sample, 41, 119
Slowly varying, 183, 186Spacings, 120Spectral expansion
differentiable, 326Stability
max–, 19min–, 23pot–, 25, 182sum–, 31, 126, 172, 174
STABLE, 173Standard deviation, 21Stationarity
covariance–, see Stationarity, weakstrict, 165, 207
of Gaussian time series, 165weak, 72, 165, 397
StatPascalaccessing active data with, 493editor, 486generating data with, 492plots, 490Reference Manual, 485Vector Types, 488window, 487
Strengthof material, 7of bundles of threads, 7of material, 110, 117tensile, 117
Survivor function, 11, 54marginal, 267multivariate, 266
T
T–day capital, 7T–unit depths, 6, 7T–year discharge, see Level, T–year
T–year initial reserve, 7, 430
Tailbehavior, 355dependence
coefficient of, 322dependence/independence, 75, 328
testing for, 329probability, 52
Testχ2–
for EV models, 120in multinomial model, 95, 98
goodness–of–fit, 61for EV models, 120
for Poisson model, 97likelihood ratio (LR)
in EV model, 118in GP model, 144
in multinomial model, 96, 98selection of null–hypothesis, 329t–, in normal model, 94UMP, in normal model, 94
TheoremBalkema–de Haan–Pickands, 27Falk–Marohn–Kaufmann, 189Fisher–Tippett, 18Tiago de Oliveira–Geffroy–Sibuya, 292
Threshold, 8random, 138T–year, 4
for heterogeneous random variables,251
given a Poisson process, 252median, 251
Time
arrival, 13, 247for mixed Poisson process, 250Pareto, 250
early warning, 430
interarrival, 13exponential, 247
lag, 72ruin, 429
Time seriesAR(p), 166, 221ARCH(p), 397, 399ARMA(p,q), 167, 210
508 Index
causal, 167GARCH(p,q), 210, 224, 400, 401, 403Gaussian AR(1), 73, 165, 325, 326MA(∞), 167MA(q), 166
Cauchy, 166Gaussian, 166
Transformationprobability, 38, 234, 235, 407quantile, 38Rosenblatt, 234, 407theorem for densities, 280Wicksell, 446
Trend, 354
U
UFO, 481calculator, 482
Utilityfunction, 303maximizing, 304
V
Value–at–Risk (VaR), 384conditional
covariate, 262serial, 401, 409
Varianceof binomial distribution, 8of EV distribution, 20of gamma distribution, 122of GP distribution, 30of negative binomial distribution, 99of Poisson distribution, 9of Student distribution, 33sample, 41
Varying functionregularly, 326slowly, 323
Vectortransposed, 266
Volatility, 374
W
Wicksell’s corpuscle problem, 33, 445
X
Xtremes
clipboard, 475, 480data
format, 476generating, 472missing, 478reading, 472types, 477
editor, 476illustrations, 478installation, 467mouse mode, 475
coordinate changing, 468, 472information, 472label, 479option, 470, 479parameter varying, 470, 479, 482point selection (scissors), 473
overview, 467plots, 470printing, 480starting, 470system requirements, 467toolbar, 470, 471, 474
Bibliography
[1] Baillie, R.T. and McMahon, P.C. (1989). The Foreign Exchange Market: The-ory and Econometric Evidence. Cambridge University Press, Cambridge.
[2] Beirlant, J., Teugels, J.L. and Vynckier, P. (1996). Practical Analysis of Ex-treme Values. Leuven University Press, Leuven.
[3] Best, P. (1998). Implementing Value at Risk. Wiley, Chichester.
[4] Bobee, B. and Ashkar, F. (1991). The Gamma Family and Derived Distribu-tions Applied in Hydrology. Water Resources Publications, Littleton.
[5] Brockwell, P.J. and Davis, R.A. (1987). Time Series: Theory and Methods.Springer, New York.
[6] Castillo, E. (1988). Extreme Value Theory in Engineering. Academic Press,Boston.
[7] Christoph, G. and Wolf, W. (1992). Convergence Theorems with a StableLimit Law. Akademie Verlag. Berlin.
[8] Cleveland, W.S. (1993). Visualizing Data. Hobart Press, New Jersey.
[9] Coles, S. (2001). An Introduction to the Statistical Modeling of ExtremeValues. Springer, London.
[10] Daykin, C.D., Pentikainen, T. and Pesonen, M. (1994). Practical Risk Theoryfor Actuaries. Chapman & Hall, London.
[11] Embrechts, P., Kluppelberg, C. and Mikosch, T. (1997). Modelling ExtremalEvents for Insurance and Finance. Springer, New York.
[12] Enders, W. (1995). Applied Econometric Time Series. Wiley, New York.
[13] Extreme Values: Floods and Droughts. (1994). Proceedings of InternationalConference on Stochastic and Statistical Methods in Hydrology and Environ-mental Engineering, Vol. 1, 1993, K.W. Hipel (ed.), Kluwer, Dordrecht.
[14] Extreme Value Theory. (1989). Proceedings of Oberwolfach Meeting, 1987,J. Husler and R.–D. Reiss (eds.), Lect. Notes in Statistics 51, Springer, NewYork.
[15] Extreme Value Theory and Applications. (1994). Proceedings of GaithersburgConference, 1993, J. Galambos et al. (eds.), Vol. 1: Kluwer, Dortrecht, Vol. 2:Journal Research NIST, Washington, Vol. 3: NIST Special Publication 866,Washington.
510 Bibliography
[16] Falk, M., Husler, J. and Reiss, R.–D. (1994). Laws of Small Numbers: Ex-tremes and Rare Events. DMV–Seminar Bd 23. Birkhauser, Basel.
[17] Falk, M., Husler, J. and Reiss, R.–D. (2004). Laws of Small Numbers: Ex-tremes and Rare Events. 2nd ed., Birkhauser, Basel.
[18] Fan, J. and Yao, Q. (2003). Nonlinear Time Series. Springer, New York.
[19] Fang, K.–T., Kotz, S. and Ng, K.–W. (1990). Symmetric Multivariate andRelated Distributions. Chapman and Hall, London.
[20] Galambos, J. (1987). The Asymptotic Theory of Extreme Order Statistics.2nd ed. Krieger: Malabar, Florida (1st ed., Wiley, New York, 1978).
[21] Gentleman J.F. and Whitmore G.A. (1995). Case Studies in Data Analysis.Lect. Notes Statist. 94, Springer–Verlag, New York.
[22] Gerber, H.–U. (1979). An Introduction to Mathematical Risk Theory. HuebnerFoundation Monograph 8, Philadelphia.
[23] Gray, H.L. and Schucany, W.R. (1972). The Generalized Jackknife Statistic.Marcel Dekker.
[24] Gumbel, E.J. (1958). Statistics of Extremes. Columbia Univ. Press, New York.
[25] Haan, L. de (1970). On Regular Variation and its Application to the WeakConvergence of Sample Extremes. Math. Centre Tracts 32, Amsterdam.
[26] Hamilton, J.D. (1994). Time Series Analysis. Princeton University Press,Princeton.
[27] Hampel, F.R., Ronchetti, E.M., Rousseeuw, P.J. and Stahel, A.W. (1986).Robust Statistics. Wiley, New York.
[28] Hogg, R.V. and Klugman, S.A. (1984). Loss Distributions. Wiley, New York.
[29] Hosking, J.R.M. and Wallis, J.R. (1997). Regional Frequency Analysis. Cam-bridge Univ. Press, Cambridge.
[30] Huber, P.J. (1981). Robust Statistics. Wiley, New York.
[31] Johnson, N.L. and Kotz, S. (1970). Distributions in Statistics: ContinuousUnivariate Distributions–1, –2. Houghton Mifflin, Boston.
[32] Johnson, N.L. and Kotz, S. (1972). Distributions in Statistics: ContinuousMultivariate Distributions. Wiley, New York.
[33] Jorion, P. (2001). Value at Risk: The New Benchmark for Controlling MarketRisk. (first edition 1997), McGraw–Hill, New York.
[34] Kinnison, R.P. (1985). Applied Extreme Value Statistics. Battelle Press,Columbus.
[35] Klugman, S.A. (1992). Bayesian Statistics in Actuarial Sciences. Kluwer, Dor-drecht.
[36] Klugman, S.A., Panjer, H.H. and Willmot, G.E. (1998). Loss Models, FromData to Decisions. Wiley, New York.
[37] Kowaka, M., Tsuge, H., Akashi, M., Masamura, K. and Ishimoto, H. (1994).Introduction to Life Prediction of Industrial Plant Materials, Application ofthe Extreme Value Statistical Method for Corrosion Analysis. Allerton Press(Japanese version, 1984, Maruzen, Tokyo.)
511
[38] Kutoyants, Yu.A. (1998). Statistical Inference for Spatial Poisson Processes.Lect. Notes in Statistics 134, Springer, New York.
[39] Leadbetter, M.R., Lindgren, G. and Rootzen, H. (1983). Extremes and RelatedProperties of Random Sequences and Processes. Springer, New York.
[40] Mandelbrot, B.B. (1997). Fractals and Scaling in Finance. Springer, NewYork.
[41] McCullagh, P. and Nelder, J.A. (1989). Generalized Linear Models. SecondEdition. Chapman and Hall, London.
[42] Reiss, R.–D. (1989). Approximate Distributions of Order Statistics. Springer,New York.
[43] Reiss, R.–D. (1993). A Course on Point Processes. Springer, New York.
[44] Resnick, S.I. (1987). Extreme Values, Regular Variation, and Point Processes.Springer, New York.
[45] Rosbjerg, D. (1993). Partial Duration Series in Water Resources. Institute ofHydrodynamics and Hydraulic Engineering. Technical University, Lyngby.
[46] Samorodnitsky, G. and Taqqu, M.S. (1994). Stable Non–Gaussian RandomProcesses. Chapman & Hall, New York.
[47] SCOR Notes: Catastrophe Risks. 1993, J. Lemaire (ed.)
[48] Serfling, R.J. (1980). Approximation Theorems of Mathematical Statistics.Wiley, New York.
[49] Shao, J. and Tu, D. (1995). The Jackknife and the Bootstrap. Springer, NewYork.
[50] Simonoff, J.S. (1996). Smoothing Methods in Statistics. Springer, New York.
[51] Statistics for the Environment 2, Water Related Issues. (1997). Proceedingsfor the SPRUCE Conference, Rothamsted, 1993, V. Barnett and K.F. Turk-man (eds.), Wiley, Chichester.
[52] Statistics for the Environment 3, Pollution Assessment and Control. (1997).Proceedings for the SPRUCE Conference, Merida, 1995, V. Barnett and K.F.Turkman (eds.), Wiley, Chichester.
[53] The Handbook of Risk Management and Analysis. (1996). C. Alexander (ed.)Wiley, Chichester.
[54] Taylor, S. (1986). Modeling Financial Time Series. Wiley, Chichester.
[55] Tukey, J.W. (1977). Exploratory Data Analysis. Addison–Wesley, Reading.