Unfortunately you have few technical errors here.
You cannot make ARIMAX-model with library(forecast) function auto.arima. Xreg argument makes it regression model with ARMA errors. That is something which I had to learn hard way by wondering the results... :)
And you have to supply FUTURE values for the xreg argument in the forecast-function. Split your data into two parts: 1) one to fit model 2) future values for the exogenous variables. Auto.arima does not forecast future values of xreg variables by ARIMA-models.
If you want to try ARIMAX-models try library(TSA) with arimax-function which of course has different syntax than auto.arima - function... :)
EDIT:
Here is example for using auto.arima with xreg argument with data set having first data for model parameters estimation and then for forecasting.
library(forecast);
apu=read.table("demo_1.csv",sep=";",dec=",",header=TRUE);
apux=read.table("demo_2.csv",sep=";",dec=",",header=TRUE);
apuxx=read.table("demo_3_xreg.csv",sep=";",dec=",",header=TRUE);
apu2=ts(data=apu[2],start=c(2011,1),deltat=1/365);
apu3=ts(data=apu[3],start=c(2011,1),deltat=1/365);
apu4=ts(data=apux[1],start=c(2011,1),deltat=1/365);
Acf(apu2);
Pacf(apu2);
apu5=ts.intersect(apu3,apu4);
apu6=ts(data=apuxx[3],start=c(2013,263),deltat=1/365);
apu7=ts(data=apuxx[2],start=c(2013,263),deltat=1/365);
apu8=ts.intersect(apu6,apu7);
sarimax=auto.arima(apu2, d=NA, D=NA, max.p=5, max.q=5,
max.P=365, max.Q=365, max.order=5, start.p=2, start.q=2,
start.P=1, start.Q=1, stationary=FALSE, seasonal=TRUE,
ic=c("aicc","aic", "bic"), stepwise=TRUE, trace=FALSE,
approximation=(length(apu2)>100 | frequency(apu2)>12), xreg=apu5,
test=c("kpss","adf","pp"), seasonal.test=c("ocsb","ch"),
allowdrift=TRUE, lambda=0, parallel=FALSE, num.cores=NULL);
print(sarimax$arma);
print(accuracy(sarimax));
print(sarimax$coef);
plot(sarimax$residuals);
print(Box.test(sarimax$residuals,lag=30,type=c("Ljung-Box")));
sarimaxpredicts=forecast(sarimax, h=7,level=c(75,80,90,95), fan=FALSE, xreg=apu8, lambda=sarimax$lambda,bootstrap=FALSE, npaths=5000);
plot(sarimaxpredicts);
Best Answer
"Hey guy, what is the ultra-secret recipe of coca-cola ?".
I don't think you will get a precise answer.
I think it is a very complex and well optimised process, I don't have any other clue. I can only imagine that it is very far from a supply and demand process (in the basic economical sense).
It will depends on stocks, localisation of stocks, price to move stocks, price of oil, price of suppliers, contracts with transport companies. You may also add reviews, the price of other item bought with it, the price of other item bought by customer who bought the item, the money generated by advertising.... Who knows ? Macro economics datas ? Rumors on the market ? Laws to be passed ? All these data can have an influence over price, their past values and their forecasting too (this can be genralized to their financial contracts and derivatives). I am pretty sure that they learn patterns over that. That's all... the rest is in the mind of 10 (maximum) research/risk manager at Amazon an I think that only the head of their research departement has the whole picture...
Edit: I forgot the irrationnal parts of building price such as "10.01 is expensive, you know what is nice ? 9.99" or " - It's too expensive, the price should be lowered. - why ? -because I said so !"