• Ingen resultater fundet

Current and Future Perspective

8.4 Current and Future Perspective

The adaptive quantile regression module has been very interesting to work with.

Especially the fact that this algorithm is not only theoretical, but can actually be tailored to be used in present applications, makes it very interesting.

8.4.1 WPPT Implementation

One of the long term goals of the translation of the adaptive quantile was to be able to implement the program into the WPPT application. The initial preparations for this process have been done, but due to time constraints, the actual integration will be carried out after completion of the thesis.

The module has been designed to be compatible with the event driven nature of WPPT, so the integration should be mainly a matter of defining events in WPPT which links to the methods in the adaptive quantile regression module.

With the module in place, WPPT should be able to provide better uncertainty estimates, which again will lead to more confidence in the predictions it per-forms. It will be extremely interesting to see how well the adaptive quantile uncertainty predictions perform on live data.

8.4.2 Alternative Uses For the Module

Probabilistic forecasts can be used in practically any situation where forecasts are quantifiable. This includes basic things such as water, power and heat supply and demand. Stock market forecasts might also benefit from better uncertainty measures.

The implemented program may not be an option for Wall Street anytime soon, but as a tool for general adaptive forecasts it offers an interesting alternative to static models.

If an effort was made to make a nice user friendly general purpose frontend, graphical or command line oriented, the program could be an interesting alter-native to other statistical models available. With the adaptive behavior, the program would be perfect for analyzing timeseries with prediction in mind.

Chapter 9

Conclusion

The purpose of thesis was to efficiently implement adaptive quantile regression in a native C program, based on a previous Matlab implementation. The two main reasons for this translation was to improve performance and make the algorithm available for the commercial WPPT application.

The implementation in C was very successful in terms of versatility and per-formance. The work required to translate the program was quite substantial because C, being a low level programming language, does not offer the same array of mathematical operations found in programs like Matlab and R.

Integrated interior point method and spline generation have made the program very versatile and easy to use as a module in other applications. The driver pro-grams written for the test cases only require a single text file with configuration in the top section and data below as input. A general purpose driver program for the module could make this adaptive quantile regression module very easy to use for non-programmers.

It has been shown very clearly that the performance of simplex is significantly better than the interior point method for adaptive quantile regression, since the knowledge of last optimum can be used to reduce the number of iterations needed to adjust towards the new optimum. Using simplex, however, does require the predictor to be updated very frequently, since the points defining the optimal

vertex may be thrown away thus rendering the previous solution invalid.

The performance techniques used throughout the development of the module have been described in detail in a theoretical context. Throughout develop-ment, these techniques have been an integral part of the design and have had a significant influence on achieving the shown performance. Performance libraries have been the method of choice for optimization, since using these ensures that the best performance is obtained on any given platform with an efficient per-formance library implementation. It was argued that the event driven modular approach was not ideal for function level parallelism and a speedup of 1.5 was recorded on a dual core machine, which may not have had the memory through-put needed for running this program at full speed on both cores.

A comparison between the simplex implementation done in Matlab and in C has argumented that the new implementation performs significantly better than the Matlab script. This does, however, need to be validated due to the different conditions in which the tests were run.

In response to problems with reliabilities, the adaptive algorithm was extended with a highly efficient penalty-based selection criteria. This proved to effectively remove problems related to the large number of data points located at zero. This system is a general solution to problems arising from peaks in distributions at any given value.

The quality of predictions has been tested in several ways, and the general picture points towards the adaptive algorithm being quite successful, but the update frequency does apparently not need to be hourly or even daily. This is good news for using the module in an online environment, where predictions and observations may not be available in a constant stream, but in daily or weekly bundles, which effectively prohibits constant updates.

The adaptive quantile regression algorithm has a significant potential for being a simple yet valuable addition to conventional static models for predicting un-certainties or as it was shown to actually calculate the prediction itself. The focus of the program’s usage in this thesis has been on wind power production, but there is nothing in the algorithm or module that restricts it from being used on any other given problem with similar properties.

Appendix A

Code Listing

A.1 Periodic Splines - R implementation

The following R function has been written by Henrik Aalborg Nielsen, Lektor / Associate Professor at DTU. The function was found athttp://www.biostat.

wustl.edu/

bs.per.ek <- function(x, period=24, degree=3, nknots=6) {

## EXPERIMENTAL

## The strange name means: B-spline, periodic, equidistant knots

## x must lie in [0 ; period) (if x == period it should be recorded as 0).

if(any(x < 0 | x >= period)) stop("x out of bounds") if(degree < 1) stop("degree must a positive integer")

## Construct knots

knots.x <- seq(0, period, length=nknots+1) delta <- diff(knots.x[1:2])

knots.left <- seq(from = -delta, by = -delta, length = degree)

knots.right <- seq(from = period + delta, by = delta, length = degree) knots <- c(knots.left, knots.x, knots.right)

## Design matrix:

X <- spline.des(x=x, knots=knots, ord=degree+1)$design X[, 1:degree] <- X[, 1:degree] + X[, ncol(X) - (degree-1):0]

X <- X[, 1:(ncol(X)-degree)]

return(X) }

Bibliography

[1] Jacek Gondzio and Andreas Grothey. Reoptimization with the primal-dual interior point method.SIAM Journal on Optimization, 13(3):842–864, 2002.

[2] John L. Hennesay and David A. Patterson. Computer Architecture - A Quantitative Approach. Morgan Kaufmann, fourth edition, 2006.

[3] Advanced Micro Devices Inc. 3DNow! Technology Man-ual, 2000. http://www.amd.com/us-en/assets/content type/

white papers and tech docs/21928.pdf.

[4] Intel. How to Choose between Hardware and Software Prefetch on 32-Bit Intel Architecture. http://www.intel.com/cd/ids/developer/asmo-na/

eng/82917.htm.

[5] Roger Koenker. Website: Quantile regression. http://www.econ.uiuc.

edu/roger/research/rq/rq.html.

[6] Roger Koenker. Quantile Regression. Cambridge University Press, 2005.

[7] SUN Microsystems. An Overview of UltraSPARC III Cu (rev 1.1), 2003.

http://www.sun.com/processors/whitepapers/USIIICuoverview.pdf.

[8] Jan Kloppenborg Møller. Time-adaptive quantile regression (matlab im-plementation and documentation). http://www2.imm.dtu.dk/jkm/.

[9] Jan Kloppenborg Møller. Modeling of uncertainty in wind energy forecast.

Master’s thesis, The Technical University of Denmark (DTU), 2006.

[10] Jan Kloppenborg Møller, Henrik Aalborg Nielsen, and Henrik Madsen.

Time-adaptive quantile regression. Computational Statistics and Data Analysis, 2006 (submitted).

[11] Hans Bruun Nielsen. Cubic splines. Technical University of Denmark, IMM http://www2.imm.dtu.dk/hbn/publ/, 1998.

[12] Hans Bruun Nielsen. Algorithms for linear optimization. Technical Univer-sity of Denmark, IMMhttp://www2.imm.dtu.dk/hbn/publ/, 1999.

[13] Pierre Pinson, Henrik Aalborg Nielsen, Jan Kloppenborg Møller, Henrik Madsen, and George Kariniotakis. Nonparametric probabilistic forecasts of wind power: required properties and evaluation. Wind Energy, 2007.