Main Menu     Actuary, Finance, ... StatPascal (SP)


UserFormula (UFO)

The UserFormula facility enables the user to insert formulas for plotting curves, generating or transforming data and transforming parameters in the EV/GP models. The user can define his own functions which then become available in nearly every edit field. A calculator for evaluating formulas is also provided. More general mechanisms are available by means of the built-in programming language StatPascal.

Introduction
Calculator
Plot Curve
Generate Data
Transform Data
Transform Parameters

Ufo: Further Examples
Ufo: Predefined Functions
Ufo: Syntax of Formulas



Introduction

A formula specified by the user may be plotted by entering its definition in the edit field f(x,p). Xtremes plots the functions x -> f(x,p) where p may be varied using the up and down arrow.
Moreover, data sets may be transformed or generated by giving an explicit formula. In the first case the transformation T(x) is applied a to every point of the active univariate date set. In the latter case a quantile transformation is applied to i.i.d random variables generated according to the uniform distribution on [0,1].
The syntax for formulas is simular to that in programming languages; operators and predefined functions may be combined in the usual way. For example, enter the term

1/sqrt(2*3.1415)*exp(-(x-p)**2/2)

to plot a normal density with varying location parameter.
You may also define your own functions in the
Calculator by typing the name of the function and its parameters followed by the definition. The functions you define may call each other, but exercise caution to provide a correct termination condition when defining direct or indirect recursive calls. Note that each function must be entered on a separate line. The definitions are saved in the text file FORMULA.TXT in the directory where the program file XTREMES.EXE is located.
For example, if you enter the definition

norm(x,mu) = 1/(sqrt(2*3.1315)) * exp(-(x-mu)**2/2)

you may plot normal densities with varying location parameter by evaluating the term

norm(x,p) .

Calculator

The calculator evaluates formulas entered in the upper edit field. Simply enter expressions like 5+2*3 and press . The results are displayed in the output field. You can use predefined functions or define your own functions in the lower edit field. For example, write

gauss(x,m,s)=gaussiandensity((x-m)/s)/s

to define the function gauss. Formulas defined in this edit field are available in other UFO-dialog boxes.
Click the Copy button to copy the results of a calculation to the clipboard. The = button is used to evaluate an expression, while the OK parses the user defined functions and closes the dialog box.
 

Plot Curve

Univariate
Multivariate
 

Plot Curve (Univariate mode)

One can plot the graph of a function f(x) or f(x,p), where p is an additional parameter that can be changed interactively using the
Parameter Varying Tool in the Toolbar.
Examples for valid functions are:
3*x+5
paretodensity(p,x)
You can enter any name for the destination window in the field Select window. If the window does not exist, a new one is created.
 

Plot Curve (Multivariate mode)

One can plot the graph of a function f(x,y), where the range of x and y is defined by the values entered under Support of function. Xtremes displays a
Surface Plot of the function.
 

Generate Data

A univariate data set is generated by applying a quantile transformation Qf(x) to independent data generated under the uniform distribution on [0,1).
 

Transform Data

Univariate
Time Series
Multivariate
 

Transform Data (Univariate)

A transformation T(x) is applied to the points of the active univariate data set.
 

Transform Data (Time Series)

Specify two functions T1(t, x) and T2(t, x) to transform the active time series

(t[i], x[i])

to the time series

(T1(t[i], x[i]), T2(t[i], x[i])).

Real-valued times are allowed.
 

Transform Data (Multivariate)

Specify transformations T1, T2, ... Tk to obtain the transformed data set (T1(x), T2(x), ... Tk(x)) where x is the vector containing the rows of the active multivariate data set.
The left-hand side of the dialog box displays the column names of the multivariate data sets and assigns variable names x1, x2, ... to the columns. On the right-hand side, the user defines the names of the columns of the transformed data set as well as a transformation. The arrow button provides a template of the transformation T(x) = x.
 
Example:
If the active data set contains three columns labeled x, y and z, then on the left-hand size of the dialog box the following is displayed:
x: x1
y: x2
z: x3

To obtain a data set with the columns Col1 and Col2, where Col1 is set to 2*x and Col2 is set to y+z, one defines the following transformation on the right-hand side:
Col1: 2*x1
Col2: x2+x3

Demo B.3 of Statistical Analysis contains a complete example.
 

Transform Parameters (EV/GP)*

Recall that two different parametrizations are possible in the EV/GP models, namely, the alpha and gamma parametrization (see Statistical Analysis, Sections 1.3 and 1.4). A dialog box allows to transform parameters from one mode into the other one.

© 2005
Xtremes Group · updated Jun 21, 2005