AutocorrelationsPlot STATBEAN®

 

Purpose: Plots the sample autocorrelation function or partial autocorrelation function for a time series. 


DataSource: any. 

acfplot


Read/Write Properties
Name Type Description Possible Values Default Value
confidenceLevel double Level of confidence for the probability limits as a percentage. 0.0001-99.9999 95.0
maximumLag int Maximum lag at which estimate in desired. 1+ 12
partial boolean Whether to display partial autocorrelations. true,false false
probabilityLimitsColor Color The color of the probability limits. Any valid Color. Color.red
replaceMissingValues boolean Replace any missing values within time time series. true,false true
seasonalLength int The number of time periods comprising a season. 1+ 1
showProbabilityLimits boolean Whether to display probability limits around zero. true,false true
timeSeriesVariableName String The name of the column with data values to be plotted. Any string. ""

Other Public Methods For Autocorrelation In Statistics
Name Description Arguments Return Value
double getAcfStandardError(int lag) Returns the standard error of the estimated autocorrelation. Lag (1-maximumLag). Standard error.
double getAutocorrelation(int lag) Returns the estimated autocorrelation. Lag (1-maximumLag). Estimated coefficient.
int getNumberOfMissingValuesReplaced() Returns the number of missing values replaced with estimates. None. Number replaced.
double getPacfStandardError(int lag) Returns the standard error of the estimated partial autocorrelation. Lag (1-maximumLag). Standard error.
double getPartialAutocorrelation(int lag) Returns the estimated partial autocorrelation. Lag (1-maximumLag). Estimated coefficient.

Code Sample For An Autocorrelation Graph

//create a datasource bean 
FileDataSource fileDataSource1 = new STATBEANS.FileDataSource(); 

//set the file name to be read 
fileDataSource1.setFileName("c:\\statbeans\\samples\\stocks.txt"); 

//create a plot bean 
AutocorrelationsPlot plot1 = new STATBEANS.AutocorrelationsPlot(); 

//override the top title 
plot1.setTopTitleLine1("Plot of Stock Price Data"); 

//override the axis titles 
plot1.setXaxisTitle("day"); 

//set the variable names for plotting 
plot1.setTimeSeriesVariableName("price"); 

//set number of lags desired 
plot1.setMaximumLag(24); 

//add the plot to the application frame 
add(plot1); 

//make the plot bean a listener for changes in the FileDataSource bean 
fileDataSource1.addDataChangeListener(plot1.listenerForDataChange); 

//instruct the fileDataSource bean to read the file 
fileDataSource1.readData();