Monday, January 26, 2015

Car Sales 12-2014



Overall car sales are lower than expected.


Predicted Values 2014-12-01 Uni-DLMActual Values 2014-12-01log(Predicted DLM /Actual)Predicted Values 2014-12-01 RF-VARlog(Predicted RFVAR /Actual)
Acura667.614571.423-0.156638.471-0.111
Audi748.881640-0.157714.237-0.110
BMW1,231.5611,193.038-0.0321,347.554-0.122
Buick763.555736.269-0.036782.536-0.061
Cadillac655.731505.692-0.260580.159-0.137
Chevrolet6,835.1255,756.654-0.1726,122.498-0.062
Chrysler1,120.7991,047.808-0.0671,088.584-0.038
Dodge1,931.6391,619.538-0.1761,796.103-0.103
Ford7,970.1016,854.654-0.1517,841.763-0.135
GMC1,982.8011,686.692-0.1621,898.404-0.118
Honda4,761.9184,113.731-0.1464,646.172-0.122
Hyundai2,573.5712,064.308-0.2202,195.227-0.061
Infiniti481.029438.385-0.093498.734-0.129
Jaguar51.75648.192-0.07149.113-0.019
Jeep2,570.2222,211.115-0.1502,445.042-0.101
Kia1,691.1161,728.3080.0221,695.4020.019
Land.Rover186.583140.154-0.286153.189-0.089
Lexus1,401.4061,056.615-0.2821,261.509-0.177
Lincoln379.194312.038-0.195359.453-0.141
Mazda934.056817-0.134900.577-0.097
Mercedes.Benz1,182.4891,427.3080.1881,530.815-0.070
Mini201.142192.654-0.043214.853-0.109
Mitsubishi236.740251.3080.060263.551-0.048
Nissan3,842.3583,530.385-0.0853,752.873-0.061
Porsche150.558180.7310.183178.1170.015
Subaru1,937.0901,740.115-0.1072,012.891-0.146
Toyota6,542.2115,995.154-0.0876,486.288-0.079
Volkswagen1,310.0491,220.192-0.0711,307.579-0.069
Volvo153.500139.346-0.097144.812-0.038
Above are barplots for both the univariate DLM model and the RFVAR model I made last time. On the whole, the RFVAR performed better than DLM model. The success of the new technique shouldn't come as a huge surprise since it includes MANY explanatory variables and combines them in a nonlinear manner.  However, the old model predicted 5/29 car company sales better (in terms of sqrd residuals); BMW, Subaru, Infiniti, Mini, and Buick.

However, the success of the DLM predicted Mini compared to RFVAR is probably due to the fact that DLM's are much more susceptible to new data. This can be seen by viewing November's car predictions where the Mini Prediction was 22% off! This of course, was due the fact that Mini updated its main car, the Cooper. The DLM 'learned' from that error much better than an RFVAR did b/c an RFVAR weights all observations equally while DLM's heavily favor the most recent observation.  There are two ways I think I can improve the new technique: 1. introduce some sort of error term in regressors to make it a moving average model (RFVARMA anyone?) or 2. include new car updates as regressors... Stay tuned.




Predicted Values for DLM 2015-01-01Predicted Values for RFVAR 2015-01-01
Acura507.466482.503
Audi493.058534.796
BMW537.307942.241
Buick663.501662.867
Cadillac426.117422.310
Chevrolet5,354.7765,933.536
Chrysler982.456974.300
Dodge1,401.9671,485.997
Ford6,380.9885,864.732
GMC1,491.4371,401.825
Honda3,535.9733,607.157
Hyundai1,780.6591,998.811
Infiniti338.773339.410
Jaguar53.04154.888
Jeep2,055.6842,063.373
Kia1,734.4711,701.986
Land.Rover158.073175.358
Lexus778.053870.991
Lincoln287.213285.119
Mazda877.112839.224
Mercedes.Benz914.9661,070.583
Mini194.780156.332
Mitsubishi253.650251.183
Nissan3,359.4223,640.657
Porsche153.518124.497
Subaru1,671.1661,399.720
Toyota5,623.7145,806.384
Volkswagen1,050.9261,039.737
Volvo144.025165.600

Thursday, January 1, 2015

Vector Autoregression with Random Forests: New Technqiue

My previous predictions were fairly naive in that it only took previous values from each car make separately. However, other variables should be of importance (economic mostly) and could increase accuracy of predictions.

I've made new predictions based on a vector auto random forests. Like vector auto regressions, it models each time series with lagged values of itself and lag values of all other variables. The nice thing about using random forests, is that you don't necessarily need to worry about model specifications as the algorithm generally gives good predictions.

Below are predictions for December 2014 car sales.

Code

Predicted Values for 2014-12-01
Acura638.471
Audi714.237
BMW1,347.554
Buick782.536
Cadillac580.159
Chevrolet6,122.498
Chrysler1,088.584
Dodge1,796.103
Ford7,841.763
GMC1,898.404
Honda4,646.172
Hyundai2,195.227
Infiniti498.734
Jaguar49.113
Jeep2,445.042
Kia1,695.402
Land.Rover153.189
Lexus1,261.509
Lincoln359.453
Mazda900.577
Mercedes.Benz1,530.815
Mini214.853
Mitsubishi263.551
Nissan3,752.873
Porsche178.117
Subaru2,012.891
Toyota6,486.288
Volkswagen1,307.579
Volvo144.812