Matlab Scripts for Trace Fitting

1. A Simple Example for Usage of KPC

The KPC Toolbox has been instrumented with extremely easy interface for users without any knowledge about Markovian Arrival Processes or statistics of a trace lik moments, autocorrelations. It requires an input of a trace of inter-arrival times. Assume we have a trace S from the standard testing case for MAP fitting cases, the BellCore 1989 trace collected by Bellcore Morristown Research and Engineering facility. The trace S is stored in the file BC-pAug89-trace.mat. After loading the mat file in matlab, the trace fitting procedure can be invoked as follows:

> load BC-pAug89-trace.mat > MAP = map_trace_kpcfit(S,10,10000); Constructing Moments and Autocorrelations from the trace ............. Constructing Bicovariance............................................. Fitting Moments, Autocorrelations and Bicovariance using KPCfit ......

The first parameter S stands for the sequence of inter-arrival times, the second parameter 10 means that the KPC fitting procedure is going to fit up to the 10th moment of the trace. The third parameter 10000 represents the first 10000 autocorrelations of the fitted MAP will be matched that of the trace. During the process of fitting, the status information will be prompted in the screen after every phase of fitting has started. The last three lines of above example are the status information jumping out to the screen in order to make the user not to be too boring while waiting for the results.

For users who are familiar with Markovian processes and know how to compute the required statistics from the trace, the KPC Toolbox provided another interface which is procedure "map_kpcfit".

Every file in the KPC Toolbox is a .m file and they are well commented. For the usage of every function, type "help filename", the information about what the function does and how the funcion works will be displayed immediately in the screen.

2. Some Techniques to Improve Fitting

Although KPC-Toolbox provides a simple interface, it doesn't mean that there are no flexibility for users with some some knowledge of statistics and want to tune the parameters. The KPC-Toolbox, the main file, in general takes a trace of inter-event times as input and then compute the statistics for fitting. During this statistics computing phase, the KPC-Toolbox also determines which higher order correlations will be fitted because it will be time costly to fit all the high orde correlations that can be estimated accurately for traces with more than 100000 samples. Therefore, the KPC-Toolbox selects a particular range of lags for the correlations with logarithmical sampling technique by default. Assume that the trace length is N, the KPC-Toolbox will calculate the correlations from lag 1 to lag N/10 and then sample 500 points logarithmically spaced between them for autocorrelation fitting, and sample 25 points between them for bicovariance fitting. However, sometimes, if the trace is very noisy, and the user knows a range of autocorrelations or bicovariance that can be estimated from the trace more accurately than others, the user can specify such a range in the fitting options.

For example, for a web server traffic trace. We can specify the range of correlations by the following:

> load S6-web-long-service-process; > blagrange = unique(round(logspace(log10(10),log10(80000),25))); > alagrange = unique(round(logspace(log10(1),log10(60000),500)))); > MAP = map_trace_kpcfit(S,10,10000,'BiCovLagsRange',blagrange, 'AcfLagsRange', alagrange);

Now the fitting results can be very good. If we do a queuing prediction based on the MAP model of the trace as an arrival process to an exponential server. At the 80% utilization, the queue length distribution matches the trace queuing behavior very well

3. Graphic Options

After the fitting, by default, the KPC-Toolbox will give the first 10 moments of the fitted MAP compared with the that of the trace. If specify an fitting results graph option, for example, still with the same trace as in part 2

> MAP = map_trace_kpcfit(S,10,10000,'ACFoption','acfplot');

Webdesign service by Sarkis. Outsourcing by FreelanceWebmarket.