tsgui: Gui for times series

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/tsgui.R


This GUI allows real-time simulations of ARMA and GARCH processes. Further models can be added by the user.


tsgui(user = NULL, wait = 1000, included.models =c("ARMA", "GARCH"))	  



a further class of model (or a list of such models), additional to ARCH(3,3) and GARCH(3,3)


non-negative integer. Users will usually not change this value. if the value is greater than 0, the control over the command line of R is returned to the user only after the tcltk window has been left. tsgui checks every wait / 1000 seconds whether the tcltk window has been left.


NULL or string vector giving the internally defined models that shall be available.


Sliders and Buttons of the GUI are:

‘New innovations’

The random seed is fixed when model parameters are changed. ‘New Innovations’ draws a new random seed


leaves the program


choose one of the given models to be displayed


length of the time series


the length of the burn in period


number of simulations (with different seeds) shown in the graphics


the distribution families of the independent errors. If more than one family is chosen the graphs are put on top of each other.

‘green button cpy’

allows to freeze the current choice of the parameter values. If it is pressed a new column appears with the frozen values. The effect becomes apparent when now the sliders are moved. The new column has a d for deleting that column and a 1 to switch this column with the current columns of the sliders.


The ARMA model is given by

Z_t - φ_1 Z_{t-1}- φ_2 Z_{t-2}- φ_3 Z_{t-3} = \varepsilon_t + θ_1 \varepsilon_{t-1} + θ2 \varepsilon_{t-2} + θ3 \varepsilon_{t-3}

The GARCH model is given by Z_t = σ_t \varepsilon_t and

σ_t^2 - β_1 σ^2_{t-1} - β_2 σ^2_{t-2} - β_3 σ^2_{t-3} = α_0 + α_1 Z_{t-1}^2 + α_2 Z_{t-2}^2


the parameters corresponding to the distributions of the INNOVATIONS


starting values for the burn in period

The argument user allows to define ARCH and GARCH models with different numbers of parameters, see the examples in ARMA.model and GARCH.model.

The argument user also allows to define one's own model. The example of such a definition is returned by ARMA.model. While ARMA.model() returns an overview and str(ARMA.model(), give.attr=TRUE) gives some more details, the code print(ARMA.model(), details=TRUE) gives the full definition of a time series:

time, burn.in, repetitions

the default values of the respective sliders, see above

*.min, *.max

The lower and upper bound of the slider values.


named vector; the names will be the titles of the sliders; phi contains all model parameters


note that all the three distribution functions have access to the values of all three INNOVATION PARAMETERS in the gui, since param is a vector of three elements


named vector of parameters. It could be also a shorter or longer vector than the standard vector of length 3


at least one of the components must be TRUE, indicating the default distribution


a list of 2 functions


returns the title of the model in dependence of the current values of the model parameters


returns a string of additional information on the model


for given innovations, i.e. realisations of the errors \varepsilon_i including burn in, the parameter values φ of the model and for given starting values start.ts the function calculates the time series, including burn in. Note that start.ts is a matrix of length{param} rows and n r columns, where n is the number of chosen distribution families and r is the number of repetitions. Similar, innovations is also


the starting values of the process in the burn-in period of the simulation


This function turns the starting values starting.ts into a matrix where is essentially the starting values starting.ts are written in each column. The number of columns are the number of chosen distribution family time the number of repetitions. Note that in the matrix the repetitions are grouped to gether, i.e. if r is the number of repetitions the first r rows refer to the r repetitions of the first chosen distribution.

The function is introduced to allow also for transformations of starting.ts for different distributions.


the starting values of the innovations in the burn-in period of the simulation


function analogue to starting.matrix.ts


A list with the latest chosen paremeters is returned.


Martin Schlather, schlather@math.uni-mannheim.de

See Also

ARMA.model, GARCH.model


  if (interactive()) tsgui()

tsgui documentation built on Sept. 4, 2020, 5:07 p.m.

Related to tsgui in tsgui...