# Dynamic Model Averaging in Economics and Finance with fDMA: A Package for R
## 1 Introduction
However, fDMA as little as possible was written in C++, because it is desired that the package can be modified by the user if he or she would find it necessary. Indeed, during the new researches usually some kind of modification of DMA is proposed. Therefore, it is desirable for the package to be rather a flexible tool, than the very efficient, but still a black-box for the user. This is reasonable indeed. From one point of view the applications of DMA are rapidly increasing, meaning that a user-friendly package is necessary. But on the other hand, DMA is still an object of fundamental researches. For instance, [PERSON] and [PERSON] [13] considered the usefulness of switching Gaussian state space models in DMA. [PERSON] [14], [PERSON] [15] and [PERSON] and [PERSON] [16] discussed multiple Vector Autoregression (VAR) models in context of DMA. A sort of likelihood tempering and sequential quasi-Bayesian mixture modelling in the presence of models' misspecification and the data corruption was studied by [PERSON] and [PERSON] [17]. Secondly, fDMA still allows the user to use modifications of DMA which eDMA lacks, like for example Occam's window, Google data, other method of updating variance in the state space equation than the recursive moment estimator, etc. For example, only fDMA is able to compute Median Probability Model out of the discussed packages. Finally, fDMA allows also for information-theoretic averaging (a non-Bayesian method) to be performed similarly like DMA, and some other methods. In this way, the user can not only compute DMA, DMS and Median Probability Model, but also compare the outcomes with some alternative methods. Such a feature is actually important in practical applications. Of course, fDMA is not any try to compete with packages solely devoted to these alternative methods. It is rather an additional feature that helps to do the necessary work in a very quick and simple way in R [18], or the wrapper of the existing R packages allowing to present the outcomes in a consistent way [19, 20, 21, 22, 23, 24, 25]. Also packages graphics, grDevices, parallel, stats, utils are used by fDMA. Classes and methods are available in fDMA package. In particular, outputs can be easily visualised with print, summary and plot. In case of plots, the user can specify plot(x,non.interactive=TRUE) in order to plot all possible plots for the object x without the menu. If not specified, non.interactive=FALSE is used, i.e., the user through the menu has to choose the type of plot he or she wants. The package is available from CRAN [5]. It can be easily installed:  
R> install.packages(\"fDMA\")The manual for the package contains numerous examples and the most basic literature references are provided there. Finally, it should be mentioned that there exist packages implementing the \"static\" Bayesian Model Averaging (BMA) and Bayesian Model Selection (BMS). They are BMA for BMA [26], BMS [27] for BMS and mlogitBMA [28] for BMA with multinomial logit data. Moreover, as BMA is a quite popular method in social and nature sciences, there exist also packages which apply BMA/BMS as a part of certain modelling schemes. In particular, ensembleBMA [29] uses BMA to create probabilistic forecasts from ensemble forecasts and weather observations. metaBMA [30] uses BMA for some meta-analysis models. INLABMA [31] fits spatial econometrics models with the help of BMA. dga [32] uses BMA for capture-recapture. spatial.gev.bma [33] allows to fit a hierarchical spatial model for the generalized extreme value distribution with the option of Bayesian Model Averaging over the space of covariates. MHTrajectoryR [34] uses BMS in logistic regression for the detection of adverse drug reactions.