How to forecast CPU demand from a time series? I have some real data from the past. The data show application demand (for example cpu demand) at a certain time slot. The data looks like this for example: 

3,2,1,5,7,8,9,1,3,12,4,5

These 12 values show the application demand of cpu in first 12 hours of a day respectively: 3 was the demand between 00:00 and 01:00m, 2 the demand between 01:00 - 02:00 etc...
So what I have is a bunch of values and what I would like to do with this is a forecasting or estimation of application demand in the future. Say I have 120 values showing the demand of 10 days of 12 hours each. Based on these data, I want to estimate with which probability the demand values will be more or less than the previous ones. 
How can I achieve this with R? I think this question is not directly related to R, but thought there are people with great knowledge in general who can give me some concrete ideas. 
Thanks for your precious time!
 A: Start with the forecast package in R.  Both auto.arima and ets have predict and forecast methods that are useful.
Here is an example:
#Make a periodic dataset
set.seed(1)
data <- c(3,2,1,5,7,8,9,1,3,12,4,5)
data <- rep(data,5)
data <- data+seq(1,length(data)) #Add trend
data <- data+rnorm(length(data))*5 #Add noise
data <- ts(data,frequency=12)
plot(data)

#Build models
library(forecast)
model1 <- StructTS(data)
model2 <- ets(data)
model3 <- auto.arima(data)
model4 <- stl(data,s.window='periodic')

#Test accuracy (on training data)
round(accuracy(model1),4)
round(accuracy(model2),4)
round(accuracy(model3),4)
p4 <- model4$time.series
p4 <- p4[,'seasonal']+p4[,'trend']+p4[,'remainder']
round(accuracy(data,p4),4)  #This model needs to be tested OUT of sample

#Forecast 1 period
f1 <- forecast(model1,h=12) #this fails for some reason
f2 <- forecast(model2,h=12)
f3 <- forecast(model3,h=12)
f4 <- forecast(model4,h=12)

par(mfrow = c(2,2))
plot(f1)
plot(f2)
plot(f3)
plot(f4)

A: What you are doing is time series analysis, and there are many packages for that.  Take a look at the Task View to get you started.
Probably the simplest analysis to do (and you should always start simple) is to decompose the series into a daily effect, a trend and irregular components.  Take a look at the stl function.
A: If you have reliable historical data, you can use an MCMC approach
check the following articles out, 
http://lpenz.github.com/articles/df0pred-2/index.html
http://lpenz.github.com/articles/df0pred-3/index.html
He does prediction of hard drive space requirements using MCMC.
A: "I have 120 values showing the demand of 10 days of 12 hours each." . This is a mixed frequency problem where you might have an integrated model containing an ARIMA component describing the within day structure and a Transfer Function component ( generalization of regression ) to deal with the daily effects. These "daily effects" might be impacted by heretofore unknown ( but statistically identifiable via Intervention Detection ) Pulses, Level Shifts and Local Time Trends. Furthermore there may be day-of-the-week; day-of-the-month ; week/month of-the-year effects. There might also be patterns before ,on and after known events. Additionally there may be evidented non-constant error variance suggesting GLS/GARCH or even changes in parameters over time. 
After forming such a model with proven Gaussian errors it seems to me a straightforward application using the confidence limits of the forecast vis-a-vis the last value to assess the probability that you are seeking. 
A: From a math aspect. They finding the distribution of your data (Poisson, exponential, uniform, etc). Calculate the average to get an approximate mean. Then apply the Central Limit Theorem to find the normal distribution of samples of averages. This will let you find a good confidence interval for your estimate of that mean.
