The statistical methods described here use S-Plus, a statistical package available at http://www.mathsoft.com/splus.html.

Additional software and extensions for S-Plus are available at http://lib.stat.cmu.edu/S/.

The command S-Plus will start up the package on most platforms. This will automatically create a .Data directory where the S-Plus data will be stored. The examples shown in these pages assume that whatever files are being scanned in are in the same directory where S-Plus was started, as are any object files which are necessary. If this is not the case, the path should be included in the scan calls. The C files which are used in some of the methods above need to be compiled to an object file, which is what the S-Plus routines actually use.

Splus is a statistical package which allows the user a wide flexibility in

Simple Splus objects include not only numbers, vectors and matrices, but
also inherent and user-defined functions.

Following is a sample session, with comments denoted by "#". ">" is the prompt.
Splus	# Starts Splus from shell


#Starts graphics window.

#All of the usual arithmetic and logical operators are present.  
> 8

#The "help()" function allows for on-line help about any Splus object, be it
#function, etc.

help(X11) #Provides help on the command X11().

#To attach a directory different form .Data, use the attach command:

#For more information

#One can create and dimension a vector of length n, filled with zeros, by
#the command "vect <- rep(0,n)".   "<-" or "_" is the assignment operator.  

hestimates <- rep(0,50)

#This is a nice way to create a vector which can be used later, e.g. in a
#FOR loop.  The vector elements are referred to as "hestimates[i]".

#One can simulate stable series with the command "rstab".

sample.series <- rstab(1000, index=1.5)  # Length 1000, alpha=1.5.

tsplot(sample.series)	# Produces time series plot.

#One can also simulate non-symmetric stable series -- the parametrization 
#used in this case is special -- see Samorodnitsky and Taqqu, Chapman 
#and Hall, 1994, p. 43.

> 0.8194

> 1   .5  
# $coefficients produces a subset of the output, namely, the coefficients
# of a least square fit(Intercept, slope). 
# (Residuals, etc. can also be obtained).

stem(sample.series)  # Produces stem plot (median, quartiles, etc.)

# One can simulate long-range dependent series (FARIMA) with the command
# "arima.fracdiff.sim" .  For the right syntax, use help:


#or look at the function:


sample.series2 <- arima.fracdiff.sim(model=list(d=0.3),n=1000)
> 1.293

#Most of the statistical methods take a vector as the "data" variable, and
#run the vector through some manipulations, and usually come up with
#numerical results and a plot.  For example, 

#(1) Create and dimension an array:
# Creates an array of zeros 50 by 1000.  Members of array can be referenced as 
# farima.data[i,j].  A whole column or row of array can be referenced as 
# farima.data[i,] or  farima.data[,j].

#(2) Fill in array 
# Now we put simulated long-range dependent series into array, making 50
# series, each length 1000.  We use a FOR loop.

for(i in 1:50){

#(3) Use an estimation procedure:
# Suppose we want to estimate the scaling parameter H using the Aggregated
# Variance method.  We will use the function "plotvar" contained in the
# file "file.S".  The source command reads in the contents of this file.


#Now we estimate H using our Aggregated Variance method.
for (i in 1:50}{

#(4) Examine results:
#Since we are analyzing 50 series, we do not usually want to see plots.

#Now one can find statistics for the estimator of H.
hist(hestimates) #returns histogram of this vector.

#(5) Writing results to outside file, sink all output:
sink() # closes file.

# To see what objects one has defined, use the command:


# This lists everything which has been defined and not deleted.
# To delete things use rm().


# To see what an object is, type in the name:

plotvar	#returns the definition of the function plotvar
hestimates  #returns the values of the vector hestimates

#To split graphics window into 4 sub-plots, 2 by 2.  


#For info on axes, title, captions, etc.


#To save a graphic (plot): One has to regenerate the output and direct it
#to a file instead of the X11 window.  Last device created and not yet
#closed is the default.   Open file:

plotvar(sample.series, plot=T)  #generate plot  (portrait is default).
dev.off()                       #close file 

#Alternatively, the print button on the X11() window saves a postscript
#file as a by-product of printing.  (Saved in directory where S-Plus was 
#started.  The default is landscape, but portrait printing can be done by 
#pressing the "print orientation" button in the X11() window.

# Control-C interrupts.  Control-Z suspends.