Skip to main content

Density Forecasting

  • Chapter
  • First Online:
Macroeconomic Forecasting in the Era of Big Data

Abstract

This chapter reviews different methods to construct density forecasts and to aggregate forecasts from many sources. Density evaluation tools to measure the accuracy of density forecasts are reviewed and calibration methods for improving the accuracy of forecasts are presented. The manuscript provides some numerical simulation tools to approximate predictive densities with a focus on parallel computing on graphical process units. Some simple examples are proposed to illustrate the methods.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 219.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 279.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 279.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Davidson and MacKinnon (2006) suggest to rescale the residuals so that they have the correct variance by \(\check {e}_{t} \equiv \left (\frac {n}{n-k}\right )^{0.5} \widehat {e}_{t}\).

  2. 2.

    Bose (1988) focuses on linear AR models with imposed stationarity (see assumption (A4) above). For an extension accounting for a possible unit root, see Inoue and Kilian (2002).

  3. 3.

    For longer horizons, test for independence is skipped.

  4. 4.

    See for the complete list of functions http://www.mathworks.com/help/distcomp/using-gpuarray.html.

References

  • Aastveit, K., Mitchell, J., Ravazzolo, F., & van Dijk, H. (2019). The evolution of forecast density combinations in economics. In J. H. Hamilton (Ed.), Oxford research encyclopedia of economics and finance. Amsterdam: North-Holland.

    Google Scholar 

  • Aastveit, K., Ravazzolo, F., & van Dijk, H. (2018). Combined density nowcasting in an uncertain economic environment. Journal of Business and Economic Statistics, 36(1), 131–145.

    Article  Google Scholar 

  • Aastveit, K. A., Foroni, C., & Ravazzolo, F. (2016). Density forecasts with MIDAS models. Journal of Applied Econometrics, 32(4), 783–801.

    Article  Google Scholar 

  • Aastveit, K. A., Gerdrup, K., Jore, A. S., & Thorsrud, L. A. (2014). Nowcasting GDP in real time: A density combination approach. Journal of Business and Economic Statistics, 32(1), 48–68.

    Article  Google Scholar 

  • Amisano, G., & Geweke, J. (2010). Comparing and evaluating Bayesian predictive distributions of asset returns. International Journal of Forecasting, 26(2), 216–230.

    Article  Google Scholar 

  • Andrews, D. W. K. (2002). Higher-order improvements of a computationally attractive “k”-step bootstrap for extremum estimators. Econometrica, 70(1), 119–162.

    Article  Google Scholar 

  • Anscombe, F. (1968). Topics in the investigation of linear relations fitted by the method of least squares. Journal of the Royal Statistical Society B, 29, 1–52.

    Google Scholar 

  • Bańbura, M., Giannone, D., & Reichlin, L. (2010). Large Bayesian vector auto regressions. Journal of Applied Econometrics, 25, 71–92.

    Article  Google Scholar 

  • Barnard, G. A. (1963). New methods of quality control. Journal of the Royal Statistical Society, Series A, 126, 255–259.

    Article  Google Scholar 

  • Bassetti, F., Casarin, R., & Ravazzolo, F. (2018). Bayesian nonparametric calibration and combination of predictive distributions. Journal of the American Statistical Association, 113(522), 675–685.

    Article  Google Scholar 

  • Bates, J., & Granger, C. (1969). The combination of forecasts. Operations Research Quarterly, 20(4), 451–468.

    Article  Google Scholar 

  • Berkowitz, J. (2001). Testing density forecasts, with applications to risk management. Journal of Business and Economic Statistics, 19(4), 465–474.

    Article  Google Scholar 

  • Berkowitz, J., & Kilian, L. (2000). Recent developments in bootstrapping time series. Econometric Reviews, 19(1), 1–48.

    Article  Google Scholar 

  • Billio, M., Casarin, R., Ravazzolo, F., & van Dijk, H. K. (2013). Time-varying combinations of predictive densities using nonlinear filtering. Journal of Econometrics, 177, 213–232.

    Article  Google Scholar 

  • Bose, A. (1988). Edgeworth corrections by bootstrap in autoregressions. Annals of Statistics, 16(4), 1709–1722.

    Article  Google Scholar 

  • Casarin, R., Craiu, R. V., & Leisen, F. (2016). Embarrassingly parallel sequential Markov-chain Monte Carlo for large sets of time series. Statistics and Its Interface, 9(4), 497–508.

    Article  Google Scholar 

  • Casarin, R., Grassi, S., Ravazzolo, F., & van Dijk, H. K. (2015). Parallel sequential Monte Carlo for efficient density combination: The deco MATLAB toolbox. Journal of Statistical Software, 68(3), 1–30.

    Article  Google Scholar 

  • Choi, H., & Varian, H. (2012). Predicting the Present with Google Trends. Economic Record, 88, 2–9.

    Article  Google Scholar 

  • Clements, M. P., & Galvao, A. B. (2014). Measuring macroeconomic uncertainty: US inflation and output growth (ICMA Centre Discussion Papers in Finance No. 2014/04). Henley-on-Thames: Henley Business School, Reading University.

    Google Scholar 

  • Clements, M. P., & Taylor, N. (2001). Bootstrapping prediction intervals for autoregressive models. International Journal of Forecasting, 17(2), 247–267.

    Article  Google Scholar 

  • Creel, M. (2005). User-friendly parallel computations with econometric examples. Computational Economics, 26, 107–128.

    Article  Google Scholar 

  • Davidson, R., & Flachaire, E. (2008). The wild bootstrap, tamed at last. Journal of Econometrics, 146(1), 162–169.

    Article  Google Scholar 

  • Davidson, R., & MacKinnon, J. G. (2006). Bootstrap methods in econometrics. In Palgrave handbooks of econometrics: Volume 1 econometric theory (pp. 812–838). Basingstoke: Palgrave Macmillan.

    Google Scholar 

  • Davison, A., & Hinkley, D. (1997). Bootstrap methods and their applications. Cambridge: Cambridge University Press.

    Book  Google Scholar 

  • Dawid, A. P. (1982). Intersubjective statistical models. Exchangeability in Probability and Statistics, 217–232.

    Google Scholar 

  • DeGroot, M. H., Dawid, A. P., & Mortera, J. (1995). Coherent combination of experts’ opinions. Test, 4, 263–313.

    Article  Google Scholar 

  • DeGroot, M. H., & Mortera, J. (1991). Optimal linear opinion pools. Management Science, 37(5), 546–558.

    Article  Google Scholar 

  • Del Negro, M., Hasegawa, B. R., & Schorfheide, F. (2016). Dynamic prediction pools: An investigation of financial frictions and forecasting performance. Journal of Econometrics, 192(2), 391–405.

    Article  Google Scholar 

  • Diebold, F., & Mariano, R. (1995). Comparing Predictive Accuracy. Journal of Business and Economic Statistics, 13, 253–263.

    Google Scholar 

  • Diebold, F. X., Gunther, T. A., & Tay, A. S. (1998). Evaluating density forecasts with applications to financial risk management. International Economic Review, 39(4), 863–83.

    Article  Google Scholar 

  • Djogbenou, A., Goncalves, S., & Perron, B. (2015). Bootstrap inference in regressions with estimated factors and serial correlation. Journal of Time Series Analysis, 36(3), 481–502.

    Article  Google Scholar 

  • Djogbenou, A., Goncalves, S., & Perron, B. (2017). Bootstrap prediction intervals for factor models. Journal of Business and Economic Statistics, 35(1), 53–69.

    Article  Google Scholar 

  • Durham, G., & Geweke, J. (2014). Adaptive sequential posterior simulators for massively parallel computing environments. In I. Jeliazkov & D. J. Poirier (Eds.), Bayesian model comparison (advances in econometrics (Chap. 34). Bingley: Emerald Group Publishing Limited.

    Google Scholar 

  • Einav, L., & Levin, J. (2014). Economics in the age of big data. Science, 346(6210), 715–718.

    Article  Google Scholar 

  • Geweke, J. (1989). Bayesian inference in econometric models using Monte Carlo integration. Econometrica, 57, 1317–1340.

    Article  Google Scholar 

  • Geweke, J., & Amisano, G. (2011). Optimal prediction pools. Journal of Econometrics, 164(1), 130–141.

    Article  Google Scholar 

  • Geweke, J., & Durham, G. (2012). Massively parallel sequential Monte Carlo for Bayesian inference. Sydney: University of Technology Sydney.

    Google Scholar 

  • Gneiting, T. (2011). Making and evaluating point forecasts. Journal of the American Statistical Association, 106, 746–762.

    Article  Google Scholar 

  • Gneiting, T., & Katzfuss, M. (2014). Probabilistic forecasting. Annual Review of Statistics and Its Application, 1, 125–151.

    Article  Google Scholar 

  • Gneiting, T., & Raftery, A. E. (2007). Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102, 359–378.

    Article  Google Scholar 

  • Gneiting, T., & Ranjan, R. (2013). Combining predicitve distributions. Electronic Journal of Statistics, 7, 1747–1782.

    Article  Google Scholar 

  • Goncalves, S., & Kilian, L. (2004). Bootstrapping autoregressions with conditional heteroskedasticity of unknown form. Journal of Econometrics, 123(1), 89–120.

    Article  Google Scholar 

  • Goncalves, S., & Perron, B. (2014). Bootstrapping factor-augmented regression models. Journal of Econometrics, 182(1), 156–173.

    Article  Google Scholar 

  • Granger, C. W. J. (1998). Extracting information from mega-panels and high-frequency data. Statistica Neerlandica, 52, 258–272.

    Article  Google Scholar 

  • Granger, C. W. J., & Pesaran, M. H. (2000). Economic and statistical measures of forecast accuracy. Journal of Forecasting, 19, 537–560.

    Article  Google Scholar 

  • Granger, C. W. J., & Ramanathan, R. (1984). Improved methods of combining forecasts. Journal of Forecasting, 3, 197–204.

    Article  Google Scholar 

  • Groen, J. J. J., Paap, R., & Ravazzolo, F. (2013). Real-time inflation forecasting in a changing world. Journal of Business & Economic Stastistics, 31, 29–44.

    Article  Google Scholar 

  • Guidolin, M., & Timmermann, A. (2009). Forecasts of US short-term interest rates: A flexible forecast combination approach. Journal of Econometrics, 150, 297–311.

    Article  Google Scholar 

  • Hall, P. (1985). Resampling a coverage process. Stochastic Processes and Their Applications, 20(2), 231–246.

    Article  Google Scholar 

  • Hall, S. G., & Mitchell, J. (2007). Combining density forecasts. International Journal of Forecasting, 23(1), 1–13.

    Article  Google Scholar 

  • Hansen, B. (2006). Interval forecasts and parameter uncertainty. Journal of Econometrics, 135, 377–398.

    Article  Google Scholar 

  • Hofmarcher, P., & Grün, B. (2019). Bayesian model averaging. In P. Fuleky (Ed.), Macroeconomic forecasting in the era of big data. Springer series “Advanced studies in theoretical and applied econometrics”.

    Google Scholar 

  • Hoogerheide, L., Kleijn, R., Ravazzolo, R., van Dijk, H. K., & Verbeek, M. (2010). Forecast accuracy and economic gains from Bayesian model averaging using time varying weights. Journal of Forecasting, 29(1–2), 251–269.

    Article  Google Scholar 

  • Inoue, A., & Kilian, L. (2002). Bootstrapping autoregressive processes with possible unit roots. Econometrica, 377–391.

    Google Scholar 

  • Kapetanios, G., Mitchell, J., Price, S., & Fawcett, N. (2015). Generalised density forecast combinations. Journal of Econometrics, 188, 150–165.

    Article  Google Scholar 

  • Kascha, C., & Ravazzolo, F. (2010). Combining inflation density forecasts. Journal of Forecasting, 29(1–2), 231–250.

    Article  Google Scholar 

  • Kloek, T., & van Dijk, H. (1978). Bayesian estimates of equation system parameters: An application of integration by Monte Carlo. Econometrica, 46, 1–19.

    Article  Google Scholar 

  • Knuppel, M. (2015). Evaluating the calibration of multi-step-ahead density forecasts using raw moments. Journal of Business & Economic Statistics, 33(2), 270–281.

    Article  Google Scholar 

  • Koop, G. (2003). Bayesian econometrics. Hoboken: John Wiley and Sons.

    Google Scholar 

  • Koop, G., & Korobilis, D. (2013). Large time-varying parameter VARs. Journal of Econometrics, 177, 185–198.

    Article  Google Scholar 

  • Kunsch, H. R. (1989). The jackknife and the bootstrap for general stationary observations. The Annals of Statistics, 17(3), 1217–1241.

    Article  Google Scholar 

  • LeSage, J. P. (1998). Econometrics: MATLAB toolbox of econometrics functions. Statistical Software Components, Boston College Department of Economics.

    Google Scholar 

  • Liu, R. (1988). Bootstrap procedures under some non-i.i.d. models. Annals of Statistics, 16, 1696–1708.

    Article  Google Scholar 

  • Mazzi, G., Mitchell, J., & Montana, G. (2014). Density nowcasts and model combination: Nowcasting Euro-area GDP growth over the 2008-9 recession. Oxford Bulletin of Economics and Statistics, 76(2), 233–256.

    Article  Google Scholar 

  • McAlinn, K., & West, M. (2019). Dynamic Bayesian predictive synthesis in time series forecasting. Journal of Econometrics, 210(1), 155–169.

    Article  Google Scholar 

  • Mitchell, J., & Hall, S. G. (2005). Evaluating, comparing and combining density forecasts using the KLIC with an application to the Bank of England and NIESR ’fan’ charts of inflation. Oxford Bulletin of Economics and Statistics, 67(s1), 995–1033.

    Article  Google Scholar 

  • Mitchell, J., & Wallis, K. (2011). Evaluating density forecasts: Forecast combinations, model mixtures, calibration and sharpness. Journal of Applied Econometrics, 26(6), 1023–1040.

    Article  Google Scholar 

  • Morozov, S., & Mathur, S. (2011). Massively parallel computation using graphics processors with application to optimal experimentation in dynamic control. Computational Economics, 1–32.

    Google Scholar 

  • Pascual, L., Romo, J., & Ruiz, E. (2001). Effects of parameter estimation on prediction densities: a bootstrap approach. International Journal of Forecasting, 17(1), 83–103.

    Article  Google Scholar 

  • Pettenuzzo, D., & Ravazzolo, F. (2016). Optimal portfolio choice under decision-based model combinations. Journal of Applied Econometrics, 31(7), 1312–1332.

    Article  Google Scholar 

  • Raftery, A., Karny, M., & Ettler, P. (2010). Online prediction under model uncertainty via dynamic model averaging: Application to a cold rolling mill. Technometrics, 52, 52–66.

    Article  Google Scholar 

  • Raftery, A. E., Gneiting, T., Balabdaoui, F., & Polakowski, M. (2005). Using Bayesian model averaging to calibrate forecast ensembles. Monthly Weather Review, 133, 1155–1174.

    Article  Google Scholar 

  • Raftery, A. E., Madigan, D., & Hoeting, J. A. (1997). Bayesian model averaging for linear regression models. Journal of the American Statistical Association, 92(437), 179–91.

    Article  Google Scholar 

  • Ranjan, R., & Gneiting, T. (2010). Combining probability forecasts. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 72(1), 71–91.

    Article  Google Scholar 

  • Ravazzolo, F., & Vahey, S. V. (2014). Forecast densities for economic aggregates from disaggregate ensembles. Studies in Nonlinear Dynamics and Econometrics, 18, 367–381.

    Google Scholar 

  • Robert, C. P., & Casella, G. (2004). Monte Carlo statistical methods (2nd ed.), Berlin: Springer.

    Book  Google Scholar 

  • Roberts, H. V. (1965). Probabilistic prediction. Journal of American Statistical Association, 60, 50–62.

    Article  Google Scholar 

  • Rossi, B., & Sekhposyan, T. (2013). Conditional predictive density evaluation in the presence of instabilities. Journal of Econometrics, 177(2), 199–212.

    Article  Google Scholar 

  • Rossi, B., & Sekhposyan, T. (2014). Evaluating predictive densities of us output growth and inflation in a large macroeconomic data set. International Journal of Forecasting, 30(3), 662–682.

    Article  Google Scholar 

  • Rossi, B., & Sekhposyan, T. (2019). Alternative tests for correct specification of conditional predictive densities. Journal of Econometrics, 208, 638–657.

    Article  Google Scholar 

  • Sloughter, J., Gneiting, T., & Raftery, A. E. (2010). Probabilistic wind speed forecasting using ensembles and Bayesian model averaging. Journal of the American Statistical Association, 105, 25–35.

    Article  Google Scholar 

  • Stock, J. H., & Watson, W. M. (1999). Forecasting inflation. Journal of Monetary Economics, 44, 293–335.

    Article  Google Scholar 

  • Stock, J. H., & Watson, W. M. (2002). Forecasting using principal components from a large number of predictors. Journal of American Statistical Association, 97, 1167–1179.

    Article  Google Scholar 

  • Stock, J. H., & Watson, W. M. (2005). Implications of dynamic factor models for VAR analysis. NBER Working Paper No. 11467.

    Google Scholar 

  • Stock, J. H., & Watson, W. M. (2014). Estimating turning points using large data sets. Journal of Econometris, 178, 368–381.

    Article  Google Scholar 

  • Tay, A., & Wallis, K. F. (2000). Density forecasting: A survey. Journal of Forecasting, 19, 235–254.

    Article  Google Scholar 

  • Terui, N., & van Dijk, H. K. (2002). Combined forecasts from linear and nonlinear time series models. International Journal of Forecasting, 18, 421–438.

    Article  Google Scholar 

  • Timmermann, A. (2006). Forecast combinations. In Handbook of economic fore-casting (Chap. 4, Vol. 1, pp. 135–196). https://doi.org/10.1016/S1574-0706(05)01004-9

    Chapter  Google Scholar 

  • Varian, H. (2014). Machine learning: New tricks for econometrics. Journal of Economics Perspectives, 28, 3–28.

    Article  Google Scholar 

  • Varian, H., & Scott, S. (2014). Predicting the present with Bayesian structural time series. International Journal of Mathematical Modelling and Numerical Optimisation, 5, 4–23.

    Article  Google Scholar 

  • Vergé, C., Dubarry, C., Del Moral, P., & Moulines, E. (2015). On parallel implementation of sequential Monte Carlo methods: The island particle model. Statistics and Computing, 25(2), 243–260.

    Article  Google Scholar 

  • Waggoner, D. F., & Zha, T. (2012). Confronting model misspecification in macroeconomics. Journal of Econometrics, 171, 167–184.

    Article  Google Scholar 

  • Wallis, K. F. (2003). Chi-squared tests of interval and density forecasts, and the Bank of England’s fan charts. International Journal of Forecasting, 19(3), 165–175.

    Article  Google Scholar 

  • Wallis, K. F. (2005). Combining density and interval forecasts: A modest proposal. Oxford Bulletin of Economics and Statistics, 67(s1), 983–994.

    Article  Google Scholar 

  • Wallis, K. F. (2011). Combining forecasts – forty years later. Applied Financial Economics, 21(1–2), 33–41.

    Article  Google Scholar 

  • West, K. (1996). Asymptotic inference about predictive ability. Econometrica, 64, 1067–1084.

    Article  Google Scholar 

  • Wu, C. (1986). Jackknife, bootstrap and other resampling methods in regression analysis. Annals of Statistics, 14, 1261–1295.

    Article  Google Scholar 

  • Yeh, A. B. (1998). A bootstrap procedure in linear regression with nonstationary errors. The Canadian Journal of Statistical Association, 26(1), 149–160.

    Article  Google Scholar 

  • Zarnowitz, V. (1969). Topics in the investigation of linear relations fitted by the method of least squares. American Statistician, 23, 12–16.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Francesco Ravazzolo .

Editor information

Editors and Affiliations

Appendix

Appendix

There is little difference between a CPU and a GPU MATLAB code as Listings 15.1 and 15.2, for example, show. The pseudo code, reported in the listings, generates random variables Y  and X and estimates the linear regression model Y =  + 𝜖, on CPU and GPU, respectively.

The GPU code, Listing 15.2, uses the command gpuArray.randn to generate a matrix of normal random numbers. The build-in function is handled by the NVIDIA plug-in that generates the random number with an underline raw CUDA code. Once the variables vY and mX are created and saved in the GPU memory all the related calculations are automatically executed on the GPU, e.g., inv is executed directly on the GPU. This is completely transparent to the user.

If further calculations are needed on the CPU then the command gather transfers the data from GPU to the CPU, see line 5 of Listing 15.2. There exist already a lot of supported functions and this number continuously increases with new releases.Footnote 4

Listing 15.1 MATLAB CPU code that generate random numbers and estimate a linear regression model

1    iRows  =  1000; iColumns  =   5;   % number  of  rows and columns

2     mX   =  randn (iRows ,  iColumns ) ;   % generate random numbers

3     vY  =  randn (iRows ,  1) ;

4    vBeta  =  inv ( mX   ’ * mX) * mX’ * vY;

Listing 15.2 MATLAB GPU code that generate random numbers and estimate a linear regression model

1    iRows  =  1000; iColumns  =   5;   % number  of  rows and columns

2     mX   =  gpuArray . randn (iRows ,  iColumns ) ;   % generate random numbers

3     vY  =  gpuArray . randn (iRows ,  1) ;

4    vBeta  =  inv ( mX   ’ * mX) * mX’ * vY;

5    vBeta  =  gather ( vBeta ) ;   %  transfer  data to CPU

As further examples in Listings 15.3 and 15.4 we show the GPU implementation of the accept/reject and the importance sampling algorithms presented in Sect. 15.5.

Listing 15.3 Accept/reject MATLAB GPU code

1 sampsize  =  1000000; % sample  s i z e  to use  for  examples

2  sig   =   1;                  % standard  deviation   of  the instrumental  density

3 samp  =  gpuArray . randn ( sampsize ,  1)  .*   sig ;   % step 1 in the A/R algorithm

4 ys  =  exp((− samp .ˆ2) /2)   .*  ( sin (6 * samp) .ˆ2   +  3  *(( cos (samp) .ˆ2) .*( sin (4*samp) .ˆ2) )  +  1) ;

5 wts  =  (1/ sqrt (2* pi ) )  .*  exp (− samp .ˆ2/2) ;

6 samp2  =  gpuArray . rand ( sampsize ,  1) ;

7 dens  =  samp(samp2<=(ys ) ./ wts ) ;     % step 2 in the A/R algorithm

8  target   =  gather ( dens ) ;             % step 3 in the A/R algorithm

Listing 15.4 Importance sampling GPU code

1 nIS  =  10000; nu  =  gpuArray (12) ;  nustar  =  gpuArray (7) ; % number  of   simulations ;  degree  of  freedom  of  the  target   density ;  degree  of  freedom  of  the proposal

2 muIS  =  gpuArray . nan( nIS ,  2) ;

3 wIS  =  gpuArray . nan( nIS ,  2) ;

4 x1  =  rant_GPU( nIS ,  nustar ) ;                      % Student t  proposals

5 x2  =   tan (( gpuArray . rand ( nIS ,  1) −   0.5)   *   pi ) ;   % Cauchy  proposals

6 wIS ( : ,  1)  =   w1_GPU(x1 ,  nu ,  nustar ) ;              % Importance weights

7 wIS ( : ,  2)  =   w3_GPU(x2 ,  nu) ;                      % Importance weights

8 muIS ( : ,  1)  =   sqrt ( abs (x1 ./(1− x1 ) ) ) ;

9 muIS ( : ,  2)  =   sqrt ( abs (x2 ./(1− x2 ) ) ) ;

10 muIScum ( : , 1 )= cumsum(muIS ( : , 1 ) .* wIS ( : , 1 ) ) . / ( 1 : nIS ) ’;

11 muIScum ( : , 2 )= cumsum(muIS ( : , 2 ) .* wIS ( : , 2 ) ) . / ( 1 : nIS ) ’;

12  %

13  % Additional  functions

14 function   w   =   w1_GPU(x , nu , nustar )      % Student ’ s t weights

15     w   =  tpdf_GPU(x ,  nu) ./ tpdf_GPU(x ,  nustar ) ;

16 end

17 function   w = w3_GPU(x , nu)               % Cauchy weights

18      w   =  tpdf_GPU(x ,  nu) ./  pdfcauchy_GPU(x ,  0 , 1) ;

19 end

20 function   f   =  tpdf_GPU(x , v)            % Student ’ s t GPU pdf

21 k  =   find (v>0  &  v <Inf ) ;

22      i f  any(k)

23         term  =  exp (gammaln(( v(k)  +  1) / 2) −   gammaln ( v ( k ) /2) ) ;

24         f (k)  =  term  ./  ( sqrt (v(k)* pi )  .*  (1  +  (x(k)  .ˆ  2)  ./  v(k) )  .ˆ   (( v(k)  +  1) /2) ) ;

25     end

26 end

27 function   f   =  pdfcauchy_GPU(x ,  a ,  b)   % Cauchy GPU pdf

28          f   =   1./( pi  .*  b  .*  (1  +   (( x −   a ) ./ b ) .ˆ2) ) ;

29 end

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Bassetti, F., Casarin, R., Ravazzolo, F. (2020). Density Forecasting. In: Fuleky, P. (eds) Macroeconomic Forecasting in the Era of Big Data. Advanced Studies in Theoretical and Applied Econometrics, vol 52. Springer, Cham. https://doi.org/10.1007/978-3-030-31150-6_15

Download citation

Publish with us

Policies and ethics