Docsity
Docsity

Prepara i tuoi esami
Prepara i tuoi esami

Studia grazie alle numerose risorse presenti su Docsity


Ottieni i punti per scaricare
Ottieni i punti per scaricare

Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium


Guide e consigli
Guide e consigli

Monte Carlo simulation, Sintesi del corso di Economia

You can do MC with this document,

Tipologia: Sintesi del corso

2020/2021

Caricato il 26/05/2021

ismail-shah-afridi
ismail-shah-afridi 🇮🇹

1 documento

1 / 16

Toggle sidebar

Spesso scaricati insieme


Documenti correlati


Anteprima parziale del testo

Scarica Monte Carlo simulation e più Sintesi del corso in PDF di Economia solo su Docsity! International Journal of Mathematics and Computational Science Vol. 4, No. 1, 2018, pp. 18-33 http://www.aiscience.org/journal/ijmcs ISSN: 2381-7011 (Print); ISSN: 2381-702X (Online) * Corresponding author E-mail address: A Practical Guide for Creating Monte Carlo Simulation Studies Using R Mohamed Reda Abonazel* Department of Applied Statistics and Econometrics, Institute of Statistical Studies and Research, Cairo University, Cairo, Egypt Abstract This paper considers making Monte Carlo simulation studies using R language. Monte Carlo simulation techniques are very commonly used in many statistical and econometric studies by many researchers. So, we propose a new algorithm that provides researchers with basics and advanced skills about how to create their R-codes and then achieve their simulation studies. Our algorithm is a general and suitable for creating any simulation study in statistical and econometric models. Moreover, we provide some empirical examples in econometrics as applications on this algorithm. Keywords Autocorrelation Problem, Econometric Modeling, Graphical Presentation Methods, Ridge Estimation, Seemingly Unrelated Regressions Model Received: March 15, 2018 / Accepted: April 3, 2018 / Published online: May 28, 2018 @ 2018 The Authors. Published by American Institute of Science. This Open Access article is under the CC BY license. http://creativecommons.org/licenses/by/4.0/ 1. Introduction Frequently, the properties of statistical and econometric models cannot easily be developed through statistical and econometric theories alone, due to complexity or gaps in understanding, necessitating the use of empirical methods. How do we empirically study a theoretical model? Well we have to find an actual instance of it that is conducive to study. But this is usually an impossible proposition. So, Monte Carlo simulation (MCS) techniques have been used to generate data indistinguishable from data collected from actual phenomena that adhered to the specifications of our model. MCS techniques are thus uniquely suited to empirically studying the properties of theoretical models and this is how they're most often used (See [14]). Historically, MCS method proved to be successful and was an important instrument in the Manhattan Project of World War II. After the war, the method was continually in use and became a prominent tool in the development of the hydrogen bomb. The Rand Corporation and the U.S. Air Force were two of the top organizations that were funding and circulating information on the use of MCS method (See [25]). Now it is used routinely in many different fields such as business, engineering, science and finance. This paper focuses on the usage of MCS techniques in statistics and econometrics. 1 We can summarize the general advantages or goals of MCS techniques in the following four points: First, evaluate the performance of an inference method. Second, evaluate the robustness of parametric inference to assumption violations. Third, compare the statistical properties of different estimators. Finally, make inferences when weak statistical theory exists for an estimator. Mooney [19] presented the general methodology of MCS, which mentions in most statistical literature, in the following five steps: Step 1: Specify the pseudo-population in symbolic terms in 1 For more details about MCS methods that used in statistics and econometrics, see, e.g., [9], [7], [25], [13], [22], and [3]. International Journal of Mathematics and Computational Science Vol. 4, No. 1, 2018, pp. 18-33 19 such a way that it can be used to generate samples by writing a code to generate data in a specific method. Step 2: Sample from the pseudo-population in ways that show the topic of interest. Step 3: Estimate the parameter using a pseudo-sample and store it in a vector. Step 4: Repeat steps 2 and 3 L-times where L is the number of trials. Step 5: Construct a relative frequency distribution of resulting values which is a Monte Carlo estimate of the sampling distribution of under the conditions specified by the pseudo-population and the sampling procedures. The above algorithm is commonly used in most books and paper that discuss the methodology of MCS because it summarizes the basic steps to create MCS study. However, this algorithm has not provided to the researcher sufficient details about how to conduct each step in this algorithm. Moreover, it not contains important assumptions about the population, sample, model, and estimation method. While that these assumptions are very effective on the performance of MCS. Therefore, we will propose a comprehensive algorithm to create a professional MCS study using R- language (one of the best programming languages). This paper is organized as follows. Section 2 provides the proposed algorithm. Section 3 presents two empirical examples in econometrics as applications on our algorithm. In Section 4, the graphical presentation methods for simulation results have been discussed. Finally, Section 5 offers the concluding remarks. 2. The Proposed Algorithm: The Full Steps to Create a MCS Study In this section, we provide a complete algorithm of MCS study. We explain our algorithm through an application in regression framework, especially; we will use Monte Carlo technique to prove that ordinary least squares (OLS) estimator of classical linear regression (CLR) model is unbiased and efficient. Our algorithm contents five main stages as follows: Stage one: Planning for the study In this stage, we should put the plan for our simulation study; this plane contains two important subjects: First, specify our goals of the study (in our example the goal is: prove that OLS estimators of CLR model is unbiased and efficient). Second, studying and understanding the model that will use in the study. (Study the theoretical framework of CLR model). The CLR model is given as:  =  +  (1) where  is  × 1 dependent variable vector,  is  × independent variables matrix,  is × 1 unknown parameters vector, and  is  × 1 error term vector. Assumptions: A1.1:  = 0,  = . A1.2:  is non-stochastic matrix and  ,  = 0. A1.3:  is full column rank matrix, i.e.,   = . The OLS estimator of  is given as:  =  !" (2) Specify the simulation controls (sample size (n), number of the independent variables ( − 1), standard deviation of the error term ( ), theoretical assumptions of CLR model (A1 to A3 above), and so on). Specify the criteria that will calculate in the simulation study (Bias and variance of OLS estimators, that are given as): $%&' ( =  − ; (3) ' ( =   !". (4) We would like to point out here that the simulation criteria, in all MCS studies, are divided into two types; theoretical and empirical criteria. The theoretical criteria are defined as the measures that proved theoretically, for example, the formula of the variance of OLS estimator that given in equation (4). While the empirical criteria are defined as the measures that not proved theoretically and have been concluded from a simulated data and they based on the true parameters of population, for example, the formula of the bias of OLS estimator that given in equation (3), despite the fact that the OLS estimator is theoretically unbiased. 2 Stage two: Building the model We can build our model by generate all simulation controls. In this stage, we must follow the following steps by order: Step 1: Suppose any values as true values of the parameters vector . Step 2: Choose the sample size n. Step 3: Generate the random values of the error vector  under the model assumptions. Step 4: Generate the fixed values of the independent variables matrix X under A1.2 and A1.3. 2 The empirical criteria are commonly used in recent studies that discuss advanced models, see, e.g., [1], [4], [29], and [28]. 22 Mohamed Reda Abonazel: A Practical Guide for Creating Monte Carlo Simulation Studies Using R Stage four: The Replications From previous stage, we get the values of bias and variance for only one experiment (one sample). Therefore, we repeat this experiment (K # 1) times, and then we take the average of these K estimates as in the following code: Table 3. Simulation results when n = 5,   1, 1 , 8  1, and 3  0.50. Bias OLS Bias GLS Var OLS Var GLS Beta 0 0.00051 0.00071 16.76125 16.22938 Beta 1 0.00598 0.00819 4.61890 3.46068 Stage five: Evaluating and presenting the results In this stage, we check and evaluate the simulation result. The evaluation process aims to answer an important question: Are the results consistent with the theoretical framework or not? Table 3 indicates that the variance of GLS estimates is less than the variance of OLS estimates. While the bias of OLS and GLS estimates are very close to zero. This result is consistent with the theoretical framework, and then we can rely on these results. After this evaluation, we can repeat calculate the simulation criteria again in different situations. In other words, we repeat calculate the values of bias and variance under different simulation factors that were given in Table 2. Therefrom, the complete program and the final table of this study are: International Journal of Mathematics and Computational Science Vol. 4, No. 1, 2018, pp. 18-33 23 Table 4. The results of the Monte Carlo study when the replications equal to 10000. LM LN LM LN LM LN LM LN O 5 5 15 15 30 30 50 50 8  1, 3  0.50 Bias OLS -0.019 -0.007 0.006 0.000 -0.004 -0.003 -0.002 0.001 Bias GLS -0.017 -0.005 0.006 0.001 -0.005 0.000 -0.002 0.001 Var OLS 4.899 2.560 0.375 0.120 0.156 0.123 0.088 0.084 Var GLS 4.855 2.287 0.355 0.094 0.151 0.081 0.086 0.050 8  5, 3  0.50 Bias OLS -0.010 -0.044 0.006 -0.010 0.007 0.000 -0.003 -0.011 Bias GLS -0.008 -0.036 0.005 -0.008 0.005 0.001 -0.003 -0.004 Var OLS 23.958 11.527 1.960 1.172 0.781 0.429 0.444 0.418 Var GLS 23.482 10.059 1.867 0.906 0.755 0.283 0.433 0.262 8  1, 3  0.90 Bias OLS 0.014 0.000 -0.009 0.007 -0.002 0.001 0.003 0.004 Bias GLS 0.017 0.002 -0.009 0.001 -0.003 0.003 0.002 0.003 Var OLS 24.811 1.169 15.031 0.401 5.703 0.188 2.622 0.174 24 Mohamed Reda Abonazel: A Practical Guide for Creating Monte Carlo Simulation Studies Using R LM LN LM LN LM LN LM LN O 5 5 15 15 30 30 50 50 Var GLS 24.660 1.089 14.734 0.199 5.390 0.074 2.415 0.035 8  5, 3 = 0.90 Bias OLS -0.023 -0.040 -0.039 0.015 0.029 -0.019 -0.002 -0.008 Bias GLS -0.017 -0.037 -0.018 0.002 0.031 -0.010 -0.006 -0.010 Var OLS 97.974 22.108 62.250 3.054 24.718 0.918 14.549 2.362 Var GLS 96.886 15.198 60.711 0.527 23.194 0.266 13.517 0.200 In general, Table 4 indicates that the variance of GLS estimates is less than the variance of OLS estimates in all simulation situations. Moreover, the variances of OLS and GLS estimates are increasing when RST and U are increased. But when O is increasing, the variances of estimates are decreased. While the values of bias for all estimates are very close to zero in all simulation situations. In this application, we have studied the estimation properties of single-equation regression model. However there are many studies are used the MCS techniques in multi-equation regression models (such as, panel data models, and simultaneous equation models), see, e.g., [27] and [20]. In multi-equation regression models, the creating of MCS study is difficult in most statistical and econometric studies. So, we will present an application on a multi-equation regression model. Application II: Ridge Estimation of SUR Model The seemingly unrelated regressions (SUR) model has been proposed by Zellner [30] on the assumption that the explanatory variables in the model are independent. But this assumption is very hard in economic models, because in most of the empirical works the researchers are often concerned about problem with the data, namely multicollinearity problem. This problem arises in situations when the explanatory variables are highly inter-correlated. Then it becomes difficult to disentangle the separate effects of each of the explanatory variables on the dependent variable. As a result, the estimated parameters may be statistically insignificant and/or have, unexpectedly, different signs. Thus, conducting a meaningful statistical inference would be difficult for the researcher. Srivastava and Giles [24] proposed the general ridge estimator for this model when the independent variables are affected by multicollinearity. Several ridge estimators are proposed and compared by [6]. In general, the studies on ridge regression estimators are pioneered by [16-17], and later followed by [26], [8], [24], [15], [23], [11], [18], and [5]. In most of these studies, the authors are used the simulation techniques to study the properties of some new proposed estimators and compared their properties with other popular existing estimators. Stage one: Planning for the study Now we apply the first stage, so we specify four factors as follows: 1. Specify our goal of the study: The goal here is compere between the performance of Zelner’s (GLS) and ridge estimators of SUR model when the independent variables are affected by multicollinearity. 2. Study theoretical framework of the model: Consider the SUR model as m-system equations given by: - × 1 = - × V WV × 1 + X- × 1 (5) where  is the vector of endogenous variable, and  =Y%Z[2\ ; with 2 ( % = 1, 2, … , - ) is the matrix of the exogenous variables of equation number % with dimension  × 2 , and W is the parameters vector with V = ∑ 2]21" , while X is the errors vector. Assumptions: A2.1: X = 0, XX = ^ "" " ⋯ "]"  ⋯ ]⋮ ⋮ ⋱ ⋮]" ] ⋯ ]]_ ⨂ = Σ⨂ = Ψ. A2.2:  is non-stochastic matrix and  , X = 0. A2.3:  is full column rank matrix, i.e.,   = V. Under these assumptions, Zellner’s estimator of W in (5) and mean square error (MSE) of it are given by: Wcd = Ψ!" !"Ψ!", ef 'Wcd( = Ψ!" !". (6) While, the ridge estimation of this model and MSE of it are given by: Wcg = Ψ!" + h !"Ψ!", ef 'Wcg( = i Ψ!" + h !"× Ψ!" + hWWh × Ψ!" + h !" j, (7) where h is a V × V matrix with nonnegative elements. Note that if h is a diagonal matrix then the estimator Wcg is regarded as an extension of the general ridge regression estimator. Further, if h = k with  is nonstochastic scalar then the estimator Wcg is like the ordinary ridge regression estimator (see [24]). International Journal of Mathematics and Computational Science Vol. 4, No. 1, 2018, pp. 18-33 27 Stage four: The Replications In this stage, we repeat this experiment (K # 1) times, and then we take the average of these K estimates as in the following code: Table 6. Simulation results when -  3,   10, and 3‰  .90. Zelner SF SK AS new 1 new 2 new 3 TMSE 103.918 41.485 6.112 1.839 2.549 0.569 0.442 Stage five: Evaluating and presenting the results In this stage, we check and evaluate the results by answer the following question: Are the results consistent with the theoretical framework or not? Table 6 indicates that TMSE values of all ridge estimators are less than TMSE values of Zelner’s estimator, and the results are consistent with the theoretical framework, then we can rely on these results. Therefrom, the complete program and the final table of this study are: 28 Mohamed Reda Abonazel: A Practical Guide for Creating Monte Carlo Simulation Studies Using R Table 7. TMSE values for the different estimators when -  3. O Zellner SF SK AS new 1 new 2 new 3 3‰ .70 10 33.758 3.670 1.939 3.104 1.613 0.593 0.681 25 1.011 0.690 0.618 2.382 0.714 0.390 0.335 50 0.291 0.211 0.204 2.747 0.258 0.199 0.203 100 0.136 0.096 0.098 2.839 0.127 0.108 0.134 3‰ .80 10 75.078 10.887 2.990 2.189 2.025 0.508 0.432 25 1.205 0.808 0.742 2.651 0.858 0.445 0.334 50 0.466 0.318 0.309 2.760 0.395 0.267 0.226 100 0.186 0.127 0.140 1.970 0.171 0.144 0.119 3‰ .90 10 195.774 18.456 4.597 1.777 2.389 0.654 0.514 25 3.726 2.444 1.968 2.003 1.788 0.586 0.362 50 0.921 0.612 0.625 1.802 0.711 0.424 0.240 100 0.430 0.283 0.286 2.405 0.368 0.242 0.142 3‰ .98 10 899.949 91.424 16.424 1.272 3.400 0.514 0.421 25 19.969 13.050 8.136 1.452 3.621 0.471 0.204 50 5.326 3.472 3.244 1.967 2.411 0.454 0.161 100 2.043 1.341 1.351 1.596 1.335 0.455 0.153 In general, Table 7 indicates that TMSE values of all ridge estimators are always less than TMSE values of Zelner’s estimator. Moreover, TMSE values of all estimators are decreasing when  is increased. And new 3 estimator is the best estimator because it has minimum TMSE in all simulation situations. 4. Graphical Presentation for Simulation Results The standard presentation for the simulation results is the tables (as in above). However, in many studies the tables are not readable, so should be present the results by the graphs. Generally, the graphs that used in most studies can be summarized to two types; 2-dimansional (2D) and 3D graphs. In this section, we represent the results of the two applications (in above) using 2D and 3D graphs. For the first application, we present the standard errors (SE) of OLS and GLS estimates for different  and 3 in bar graphs using the following R-code: International Journal of Mathematics and Computational Science Vol. 4, No. 1, 2018, pp. 18-33 29 Figure 1. The standard errors of OLS and GLS estimates for different  and 3 when 8  5. Figure 1 confirms our conclusions from Table 4 and adds an important note: that the gain from applying GLS method is increasing in " than ‹. In other words, SE of GLS estimates is always less than SE of OLS estimates for each of ‹ and ", but it is more noted in " than ‹. n = 5 n = 15 n = 30 n = 50 OLS GLS SE(β0 ^ ), ρ = 0.5 0 1 2 3 4 n = 5 n = 15 n = 30 n = 50 OLS GLS SE(β0 ^ ), ρ = 0.9 0 2 4 6 8 n = 5 n = 15 n = 30 n = 50 OLS GLS SE(β1 ^ ), ρ = 0.5 0 .0 1 .0 2 .0 3 .0 n = 5 n = 15 n = 30 n = 50 OLS GLS SE(β1 ^ ), ρ = 0.9 0 1 2 3 4 32 Mohamed Reda Abonazel: A Practical Guide for Creating Monte Carlo Simulation Studies Using R Figure 3 displays the relative efficiency of four ridge estimators under the effect of  and 3‰ together, and it indicates that the efficiency of SF and SK is not improving when  and/or 3‰ are increasing. While the efficiency of new 2 and new 3 is very improving when 3‰ is increasing, but this efficiency is worsened when  is increasing. These conclusions are not clear in Figure 2. 5. Conclusion In this paper, we proposed a complete algorithm to make professional MCS studies using R. This algorithm is a suitable for creating any simulation study in statistical and econometric models. This algorithm is considered as a practical guide for researchers to conduct their simulation studies in statistics and econometrics. Practically, empirical examples have been presented as applications on our algorithm. These applications proved that this algorithm is very easy and general for different studies even if the objectives of each study are different. Moreover, the graphical presentation methods for simulation results have been discussed. In future work, we publish this algorithm in an R-package so that more researchers will benefit, especially who are not proficient in programming. References [1] Abonazel, M. R. (2014). Some estimation methods for dynamic panel data models. PhD thesis. Institute of Statistical Studies and Research. Cairo University. [2] Abonazel, M. R. (2014). Statistical analysis using R, Annual Conference on Statistics, Computer Sciences and Operations Research, Vol. 49. Institute of Statistical Studies and research, Cairo University. DOI: 10.13140/2.1.1427.2326. [3] Abonazel, M. R. (2015). How to Create a Monte Carlo Simulation Study using R: with Applications on Econometric Models. Working paper, No. 68708. University Library of Munich, Germany. Online at: https://mpra.ub.uni- muenchen.de/68708 [4] Abonazel, M. R. (2017). Generalized estimators of stationary random-coefficients panel data models: Asymptotic and small sample properties, Revstat Statistical Journal (in press). Online at: https://www.ine.pt/revstat/pdf/GENERALIZEDESTIMATOR SOFSTATIONARY.pdf [5] Alkhamisi, M., Khalaf, G., Shukur, G. (2006). Some modifications for choosing ridge parameters. Communications in Statistics-Theory and Methods, 35 (11): 2005-2020. [6] Alkhamisi, M., Shukur, G. (2008). Developing ridge parameters for SUR model. Communications in Statistics- Theory and Methods, 37 (4): 544-564. [7] Barreto, H., Howland, F. (2005). Introductory econometrics: using Monte Carlo simulation with Microsoft excel. Cambridge University Press. [8] Brown, P. J., Zidek, J. V. (1980). Adaptive multivariate ridge regression. The Annals of Statistics, 8 (1): 64-74. [9] Craft, R. K. (2003). Using spreadsheets to conduct Monte Carlo experiments for teaching introductory econometrics. Southern Economic Journal, 69 (3): 726-735. [10] Crawley, M. J. (2012). The R book. John Wiley & Sons. [11] Firinguetti, L. (1997). Ridge regression in the context of a system of seemingly unrelated regression equations. Journal of Statistical Computation and Simulation, 56 (2): 145-162. [12] Gujarati, D. N. (2003) Basic econometrics. 4th ed. McGraw- Hill Education. [13] Gentle, J. E., Härdle, W. K., Mori, Y. (2012). Handbook of computational statistics: concepts and methods. Springer Science & Business Media. [14] Haft, J. (2014). A Review of Basic Monte Carlo Methods. It is available online at: http://www.reed.edu/economics/parker/s14/312/Fin_Reports/4 .pdf [15] Haitovsky, Y. (1987). On multivariate ridge regression. Biometrika, 74 (3): 563-570. [16] Hoerl, A. E., Kennard, R. W. (1970). Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12 (1): 55-67. [17] Hoerl, A. E., Kennard, R. W. (1970). Ridge regression: applications to nonorthogonal problems. Technometrics, 12 (1): 69-82. [18] Kibria, B. G. (2003). Performance of some new ridge regression estimators. Communications in Statistics- Simulation and Computation, 32 (2): 419-435. [19] Mooney, C. Z. (1997). Monte Carlo simulation. Sage University Paper Series on Quantitative Applications in the Social Sciences, series no. 07-116. Thousand Oaks, CA: Sage. [20] Mousa, A., Youssef, A. H., Abonazel, M. R. (2011). A Monte Carlo study for Swamy’s estimate of random coefficient panel data model. Working paper, No. 49768. University Library of Munich, Germany. Online at https://mpra.ub.uni-muenchen.de/49768 [21] Robert, C., Casella, G. (2009). Introducing Monte Carlo Methods with R. Springer Science & Business Media. [22] Robert, C., Casella, G. (2013). Monte Carlo statistical methods. Springer Science & Business Media. [23] Saleh, A. M. E., Kibria, B. M. G. (1993). Performance of some new preliminary test ridge regression estimators and their properties. Communications in Statistics-Theory and Methods, 22 (10): 2747-2764. [24] Srivastava, V. K., Giles, D. E. (1987). Seemingly unrelated regression equations models: estimation and inference (Vol. 80). CRC Press. [25] Thomopoulos, N. T. (2012). Essentials of Monte Carlo Simulation: Statistical Methods for Building Simulation Models. Springer Science & Business Media. [26] Vinod, H. D. (1978). A survey of ridge regression and related techniques for improvements over ordinary least squares. The Review of Economics and Statistics, 60 (1): 121-131. International Journal of Mathematics and Computational Science Vol. 4, No. 1, 2018, pp. 18-33 33 [27] Youssef, A. H., Abonazel, M. R. (2009). A comparative study for estimation parameters in panel data model. Working paper, No. 49713. University Library of Munich, Germany. [28] Youssef, A. H., Abonazel, M. R. (2017). Alternative GMM estimators for first-order autoregressive panel model: an improving efficiency approach. Communications in Statistics- Simulation and Computation 46 (4): 3112–3128. [29] Youssef, A. H., El-sheikh, A. A., Abonazel, M. R. (2014). New GMM estimators for dynamic panel data models. International Journal of Innovative Research in Science, Engineering and Technology 3: 16414–16425. [30] Zellner, A. (1962). An efficient method of estimating seemingly unrelated regressions and tests for aggregation bias. Journal of the American statistical Association, 57 (298): 348- 368.
Docsity logo


Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved