[FREE PDF sample] Econometrics and Data Science: Apply Data Science Techniques to Model Complex Problems and Implement Solutions for Economic Problems 1st Edition Tshepo Chris Nokeri ebooks
[FREE PDF sample] Econometrics and Data Science: Apply Data Science Techniques to Model Complex Problems and Implement Solutions for Economic Problems 1st Edition Tshepo Chris Nokeri ebooks
com
OR CLICK HERE
DOWLOAD NOW
https://ebookmeta.com/product/data-science-revealed-1st-edition-
tshepo-chris-nokeri/
ebookmeta.com
https://ebookmeta.com/product/the-ios-annual-volume-21-carrying-a-
torch-to-distant-mountains-edited-by-yoram-cohen/
ebookmeta.com
Quantum Information Concepts in Open Quantum Systems 1st
Edition Bassano Vacchini
https://ebookmeta.com/product/quantum-information-concepts-in-open-
quantum-systems-1st-edition-bassano-vacchini/
ebookmeta.com
https://ebookmeta.com/product/biology-and-ecology-of-earthworms-
fourth-edition-clive-arthur-edwards/
ebookmeta.com
https://ebookmeta.com/product/sleet-sugar-1st-edition-s-j-tilly/
ebookmeta.com
https://ebookmeta.com/product/public-school-debt-administration-
william-b-castetter/
ebookmeta.com
https://ebookmeta.com/product/comparative-politics-of-latin-america-
democracy-at-last-3rd-edition-daniel-c-hellinger/
ebookmeta.com
Thinking While Doing Explorations in Educational Design
Build Stephen Verderber (Editor)
https://ebookmeta.com/product/thinking-while-doing-explorations-in-
educational-design-build-stephen-verderber-editor/
ebookmeta.com
Tshepo Chris Nokeri
Apress Standard
The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
1. Introduction to Econometrics
Tshepo Chris Nokeri1
(1) Pretoria, South Africa
This chapter explains data science techniques applied to the field of econometrics.
To begin, it covers the relationship between economics and quantitative methods,
which paves the way for the econometrics field. It also covers the relevance of
econometrics in devising and revising the economic policies of a nation. It then
summarizes machine learning, deep learning, and structural equation modeling.
To conclude, it reveals ways to extract macroeconomic data using a standard
Python library.
Econometrics
Econometrics is a social science subclass that investigates broad business
activities at the macro level, i.e., at the country, region, or continent level. It is an
established social science field that employs statistical models to investigate
theoretical claims about macroeconomic phenomena. Figure 1-1 is a
simplification of econometrics. Organizations like the statistical bureau capture
economic activities across time, which they make available to the public.
Practitioners, such as economists, research analysts, and statisticians alike,
extract the data and model it using algorithms grounded on theoretical
frameworks in order to make future predictions.
Figure 1-1 Econometrics
Before you proceed with the contents of this book, be sure that you
understand the basic concepts that relate to economics and statistics.
Economic Design
Economic design is grounded on the notion that if we can accurately estimate
macroeconomic phenomenon, we can devise mechanisms that help manage it. As
mentioned, there are several well-established organizations from which one can
extract factual macroeconomic data. Note that we cannot estimate the whole
population, but we can use a sample (a representative of the population) because
there are errors in statistical estimations. Because there is a pool of reliable
macroeconomic data sources, we can apply the data and investigate consistent
patterns by applying quantitative models to make sense of an economy. When we
are confident that a model estimates what we intend it to estimate and does so
exceptionally, we can apply such a model to predict economic events. Remember
that the primary purpose of a scientific enterprise is to predict events and control
underlying mechanisms by applying quantitative models.
Econometrics uses statistical principles to estimate the parameters of a
population, but the ultimate litmus test is always economic ideology. Only
economic theory can validate/invalidate the results, which can be further used to
determine causation/correlation, etc. It should be apparent that politics occupies
a paramount role in modern life. At most, the political sentiments typically
accompany a firm belief about the economy and how it ought to be. Such beliefs
might not reflect economic reality. When the considered belief about the economy
is absurd, there is no way of combating pressing societal problems with devised
solutions. To satisfactorily solve an economic problem, you must have a logical
view; otherwise, feelings, standard assumptions, and authoritarian knowledge
dilute your analysis of an economy.
In summary, policymakers apply econometrics to devise and revise economic
policies so that they can correctly solve economic problems. This entails that they
investigate historical economic events, develop complex quantitative models, and
apply findings of those models (provided they are reliable) to drive economic
policies. Econometrics is an approach for finding answers to questions that relate
to the economy. Policymakers who are evidence-oriented drive policymaking
initiatives by applying factual data rather than depending on political and
economic ideologies.
Understanding Statistics
Statistics is the field concerned with discovering consistent patterns in raw data
to derive a logical conclusion regarding a recognized phenomenon. It involves
investigating the central tendency (the mean value) and dispersion of data (the
standard deviation) and then studying theoretical claims about the phenomenon
by applying quantitative models. In addition, business institutions apply it in ad
hoc reporting, research, and business process controls. Researchers, in addition,
apply statistics in fields like natural sciences, physical sciences, chemistry,
engineering, and social sciences, among other fields. It is the backbone of
quantitative research.
import wbdata
country = ["USA"]
indicator = {"FI.RES.TOTL.CD":"gdp_growth"}
df = wbdata.get_dataframe(indicator, country=country,
convert_date=True)
Listing 1-1 Loading Data from the World Bank Library
wbdata extracts the data and loads it into a pandas dataframe. Figure 1-5
demonstrates the wbdata workflow.
Extracting data from the wbdata library requires that you specify the country
ID. Given that the World Bank includes several countries, it is burdensome to
know the IDs of all of them. The most convenient way to find a country’s ID is to
search for it by name (see Listing 1-2). For this example, we entered China, and
it returned Chinese countries, including their IDs.
wbdata.search_countries("China")
id name
---- --------------------
CHN China
HKG Hong Kong SAR, China
MAC Macao SAR, China
TWN Taiwan, China
Listing 1-2 Searching for a Country ID
Extracting data from the wbdata library requires that you specify the
economic indicator’s ID as well. Given that the World Bank includes several
macroeconomic indicators, it is burdensome to know the IDs of all the indicators.
The most convenient way to find an indicator’s ID is to search for it by name (see
Listing 1-3). For this example, we entered inflation and it returned all
indicators that contain the word “inflation,” including their IDs.
wbdata.search_indicators("inflation")
id name
-------------------- ------------------------------------
-------------
FP.CPI.TOTL.ZG Inflation, consumer prices (annual
%)
FP.FPI.TOTL.ZG Inflation, food prices (annual %)
FP.WPI.TOTL.ZG Inflation, wholesale prices (annual
%)
NY.GDP.DEFL.87.ZG Inflation, GDP deflator (annual %)
NY.GDP.DEFL.KD.ZG Inflation, GDP deflator (annual %)
NY.GDP.DEFL.KD.ZG.AD Inflation, GDP deflator: linked
series (annual %)
Listing 1-3 Searching for Macroeconomic Data
The wbdata library includes several data sources, like World Development
Indicators, Worldwide Governance Indicators, Subnational Malnutrition Database,
International Debt Statistics, and International Debt Statistics: DSSI, among
others. This book focuses predominantly on sources that provide economic data.
It also covers social indicators. Listing 1-4 demonstrates how to retrieve indicator
sources using wbdata.get_source() (see Table 1-1).
sources = wbdata.get_source()
sources
Listing 1-4 Retrieving the World Bank Sources
wbdata.get_topic()
Listing 1-5 Retrieve Topic
Practical Implications
This book expands on the present body of knowledge on econometrics. It covers
ways through which you can apply data science techniques to discover patterns in
macroeconomic data and draw meaningful insights. It intends on accelerating
evidence-based economic design—devising and revising economic policies based
on evidence that we derive from quantitative-driven models. This book is for
professionals who seek to approach some of the world’s most pressing problems
by applying data science and machine learning techniques. In summary, it will
enable you to detect why specific social and economic activities occur, and help
you predict the likelihood of future activities occurring. The book assumes that
you have some basic understanding of key concepts of statistics and economics.
Footnotes
1 Indicators | Data (worldbank.org)
3 IMF Data
© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
T. C. Nokeri, Econometrics and Data Science
https://doi.org/10.1007/978-1-4842-7434-7_2
This chapter introduces the standard univariate (or simple) linear regression model,
called the ordinary least-squares model, which estimates the intercept and slope while
diminishing the residuals (see Equation 2-1). It applies the model to determine the
relationship between the interest rates that U.S. banks charge for lending and the
market value of goods and services that U.S. households consume annually. It includes
ways of conducting covariance analysis, correlation analysis, model development,
cross-validation, hyperparameter optimization, and model performance analysis.
The ordinary least-squares model is one of the most common parametric methods.
It establishes powerful claims regarding the data—it expects normality (values of a
variable saturating the mean value) and linearity (an association between an
independent variable and a dependent variable). This chapter uses the most common
parametric method, called the ordinary least-squares model, to investigate the
association between the predictor variable (the independent variable) and the
response variable (the dependent variable). It’s based on a straight-line equation (see
Figure 2-1).
Figure 2-1 Line of best fit
Figure 2-1 shows a straight line in red and the independent data points in green—
the line cuts through the data points. Equation 2-1 shows the ordinary least-squares
equation.
(Equation 2-1)
Where is the predicted response variable (the expected the U.S. final
consumption expenditure in this example), represents the intercept—representing
the mean value of the response variable (the U.S. final consumption expenditure in U.S.
dollars for this example), represents the predictor variable (the U.S. lending
interest rate in this example), and 1 is the slope—representing the direction of the
relationship between X (the U.S. lending interest rate) and the final consumption
expenditure (in current U.S. dollars). Look at the straight red line in Figure 2-1—the
slope is positive). Finally, represents the error in terms (refer to Equation 2-2).
(Equation 2-2)
Where εi is the error in term (also called the residual term )—representing the
difference between yi (the actual U.S. final consumption expenditure) and i (the
Discovering Diverse Content Through
Random Scribd Documents
The roof was thatched, whence arose the accident. The walls were
of timber, for nothing was burnt but wood and straw. The building
was ‘flanked with a ditch, and forced out of a marish’. It had a stage-
house ‘round as taylors clewe’, and carried a silken flag. There were
two narrow doors, and hard by stood an alehouse. The new Globe
built after the fire was tiled for greater safety. In other respects
there was probably no great change. The building is described in
1634 as of timber, upon an old foundation. The maps, if they can be
trusted, figure it as polygonal, rather than strictly round. No doubt it
was round inside; an ‘amphytheator’, it is called in Holland’s Leaguer.
The Sharers Papers of 1635 mention the tiring-house door, at which
money was taken. James Wright tells us that it was a summer
house, large and partly open to the weather, and that the acting was
always by daylight. Malone conjectured that the name ‘Globe’ was
taken from the sign, ‘which was a figure of Hercules supporting the
Globe, under which was written Totus mundus agit histrionem’.[1293]
I do not know where he got this information.
Taylor was then an old man of seventy-seven and his memory would
easily go back to the time of the early maps. To his testimony may
be added that of Stowe, who says in his Survey of London (1598):
[1415]