# Dynamic Model Averaging in Economics and Finance with fDMA: A Package for R
## 9 An Example: Oil Market
less [1,1] \"-3.5690\" \" 0.0004\" \" 0.9998\" \" 0.0002\" [2,] \"-1.3787\" \" 0.1690\" \" 0.9155\" \" 0.0845\" [3,] \" 0.9754\" \" 0.3301\" \" 0.1650\" \" 0.8350\"  
Assuming 5% significance level the null hypothesis can be rejected for the naive forecast. The alternative hypothesis which can be assumed is that the naive forecast has less accuracy than the selected DMA model. In other words, the selected model outperforms in some sense the naive forecasting. **10. Comparison with Other Packages**  
The speed comparison for the existing packages for Dynamic Model Averaging is presented in $economic_activity represents Google Trends for \"economic activity\",
* trends$2 The evaluation was based on estimating a model with 10 explanatory variables, i.e., \(2^{10}=1024\) models were averaged. The suitable formula was executed 5 times for every tested package. Actually, this is a small sample, but a lot of speed checks were done during writing fDMA package. During that time it was very often experienced that variation (dispersion) of time taken for evaluation is very small. Therefore, such a small sample seems enough to give the user some insight. Simultaneously, larger sample does not seem necessary. \begin{table}
\begin{tabular}{l r r r r} \hline \hline
**Package** & **Min** & **Mean** & **Median** & **Max** \\ \hline fDMA & 7.80 & 7.89 & 7.91 & 7.94 \\ \hline eDMA & 0.88 & 0.88 & 0.88 & 0.89 \\ \hline dma & 61.55 & 62.07 & 62.05 & 62.50 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Speed comparison of DMA packages (in s.). The speed comparisons were done with a help of microbenchmark package by [PERSON] et al. [192]. The calculations were done on an Intel(r) CoreTM i5-6200U CPU 2.30 GHz machine with 20 GB RAM and under Debian 9 (Stretch). It can be seen that fDMA is faster than dma, but not than eDMA. Indeed, eDMA is extremely fast. The price is however that this package is mostly written in C++. On the other hand, fDMA is more easy to modify by the user familiar with R. It was mentioned already that in many researches with DMA, the authors slightly modify the original method. Therefore, it seems reasonable to aim for having an easier to modify, but a bit slower package. Finally, the purpose for writing fDMA was not to compete with other packages. The motivation was to provide a tool yet unavailable for users. In other words, the aim was rather to complement the existing tools. Therefore, the stress was put on implementing things not available in other packages. The author believes that fDMA will be useful for some researchers. By publishing fDMA package they will have more choices which tool to use, and they would be able to choose among the products more tailored for their needs and various applications. Somehow subjective comparison of the three packages is presented in Table 3.  
Finally, Figure 7 presents a comparison of sequential vs. parallel computations, i.e., time of execution the function fDMA with the argument parallel = FALSE (default) and with parallel = TRUE. It can be seen that a time gain is obtained when the number of variables is over 10, or more precisely: if the number of estimated model exceeds 1024. Of course, this number is not precise; moreover, it can depend on hardware and software used. Nevertheless, it gives some general warning that because of overheads parallel computations are not always faster. Unfortunately, the gain from parallel computations is not so dramatic. Anyways, this gain is present, and in the case of, for instance, estimation of multiple models, can be highly beneficial for the user. In particular, it is often  
**Funding:** Research funded by the Polish National Science Centre grant under the contract number DEC-2015/19/N/HS4/00205. **Conflicts of Interest** The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript, or in the decision to publish the results.