Archive

Posts Tagged ‘time series’

Announcing StataNow

One of the most exciting times for us at StataCorp (and hopefully for you as well) is when we get to announce a new version of Stata, full of new features. Now, we hope to experience that feeling with you much more often.

Historically, we have released a new major version of Stata roughly every two years. We will still continue to do that, but most users will now have access to StataNow – a continuous-release Stata. StataNow gives you access to new features now, as soon as they are ready from the development, testing, and documentation groups. The features in StataNow are some of the same features that will also eventually appear in the next major release of Stata. StataNow users will get additional features on a continuous basis throughout the lifetime of a release.

You can read more about StataNow, including how to get it, and you can see its initial set of additional features. But let me tell you a little more about it here.

Many of you create features in Stata that you share with others via your own sites, the SSC archive, and the Stata Journal. And all of you write your own do-files as you perform your analyses in Stata. Knowing this, let me share with you a few technical details about StataNow.

First, StataNow is Stata. To be exact, the current Stata that most of you have is Stata 18.0. StataNow is Stata 18.5 (which we will call StataNow 18.5 from now on). When you are using StataNow, you should start your programs and do-files with version 18.5, just as you previously started them with version 18.0. Why is the version number different? Because StataNow is newer than Stata 18.0, and it is possible something in it will need to be version-controlled differently than in Stata 18. This is no different than when a new release comes out and it has a different version, 16.0, 17.0, 18.0, etc. As always, StataNow is backward compatible, so any programs, do-files, datasets, and so on from earlier versions will work, without changes, in StataNow.

What if we need to version-control something simultaneously in both Stata and StataNow? We would then release Stata 18.1 and StataNow 18.6.

The documentation and help files for Stata 18.0 and StataNow 18.5 are the same. StataNow features are included in them and clearly marked as such.

The dataset format in StataNow is the same as in Stata.

What are the new features in StataNow, and how often will we add features to StataNow? See the current set of new features. There is no set schedule for releasing new features, but we anticipate new features will be released fairly often – several times a year. We will release no new feature before its time, which means that anything released in StataNow is fully official, tested, validated, certified, and documented, just as all the features we put out in a new release of Stata.

When Stata 19 eventually comes out, it will of course include all the features that have come out along the way in StataNow as well as some additional new ones. Users of StataNow will automatically be able to upgrade to Stata 19 — actually, they will upgrade to StataNow 19.5 when Stata 19.0 comes out, and over time StataNow 19.5 will get additional features as soon as they are ready from the Stata elves.

We are excited to be able to give you the new features we add to Stata on a continuous basis, getting them into your hands sooner!

Bayesian threshold autoregressive models

Autoregressive (AR) models are some of the most widely used models in applied economics, among other disciplines, because of their generality and simplicity. However, the dynamic characteristics of real economic and financial data can change from one time period to another, limiting the applicability of linear time-series models. For example, the change of unemployment rate is a function of the state of the economy, whether it is expanding or contracting. A variety of models have been developed that allow time-series dynamics to depend on the regime of the system they are part of. The class of regime-dependent models include Markov-switching, smooth transition, and threshold autoregressive (TAR) models. Read more…

Just released from Stata Press: Environmental Econometrics Using Stata

Stata Press is pleased to announce the release of Environmental Econometrics Using Stata by Christopher F. Baum and Stan Hurn. Read more…

Just released from Stata Press: Introduction to Time Series Using Stata, Revised Edition

Stata Press is pleased to announce the release of Introduction to Time Series Using Stata, Revised Edition, by Sean Becketti. This edition has been updated for Stata 16 and is available in paperback, eBook, and Kindle format. In this book, Becketti introduces time-series techniques—from simple to complex—and explains how to implement them using Stata. The many worked examples, concise explanations that focus on intuition, and useful tips based on the author’s experience make the book insightful for students, academic researchers, and practitioners in industry and government. Read more…

Adding recession shading to time-series graphs

Introduction

Sometimes, I like to augment a time-series graph with shading that indicates periods of recession. In this post, I will show you a simple way to add recession shading to graphs using data provided by import fred. This post also demostrates how to build a complex graph in Stata, beginning with the basic pieces and finishing with a polished product.

Read more…
Categories: Graphics Tags: ,

Dynamic stochastic general equilibrium models for policy analysis

What are DSGE models?

Dynamic stochastic general equilibrium (DSGE) models are used by macroeconomists to model multiple time series. A DSGE model is based on economic theory. A theory will have equations for how individuals or sectors in the economy behave and how the sectors interact. What emerges is a system of equations whose parameters can be linked back to the decisions of economic actors. In many economic theories, individuals take actions based partly on the values they expect variables to take in the future, not just on the values those variables take in the current period. The strength of DSGE models is that they incorporate these expectations explicitly, unlike other models of multiple time series.

DSGE models are often used in the analysis of shocks or counterfactuals. A researcher might subject the model economy to an unexpected change in policy or the environment and see how variables respond. For example, what is the effect of an unexpected rise in interest rates on output? Or a researcher might compare the responses of economic variables with different policy regimes. For example, a model might be used to compare outcomes under a high-tax versus a low-tax regime. A researcher would explore the behavior of the model under different settings for tax rate parameters, holding other parameters constant.

In this post, I show you how to estimate the parameters of a DSGE model, how to create and interpret an impulse response, and how to compare the impulse response estimated from the data with an impulse response generated by a counterfactual policy regime. Read more…

Categories: Statistics Tags: ,

Estimating the parameters of DSGE models

Introduction

Dynamic stochastic general equilibrium (DSGE) models are used in macroeconomics to model the joint behavior of aggregate time series like inflation, interest rates, and unemployment. They are used to analyze policy, for example, to answer the question, “What is the effect of a surprise rise in interest rates on inflation and output?” To answer that question we need a model of the relationship among interest rates, inflation, and output. DSGE models are distinguished from other models of multiple time series by their close connection to economic theory. Macroeconomic theories consist of systems of equations that are derived from models of the decisions of households, firms, policymakers, and other agents. These equations form the DSGE model. Because the DSGE model is derived from theory, its parameters can be interpreted directly in terms of the theory.

In this post, I build a small DSGE model that is similar to models used for monetary policy analysis. I show how to estimate the parameters of this model using the new dsge command in Stata 15. I then shock the model with a contraction in monetary policy and graph the response of model variables to the shock. Read more…

Categories: Statistics Tags: ,

Long-run restrictions in a structural vector autoregression

\(\def\bfA{{\bf A}}
\def\bfB{{\bf }}
\def\bfC{{\bf C}}\)Introduction

In this blog post, I describe Stata’s capabilities for estimating and analyzing vector autoregression (VAR) models with long-run restrictions by replicating some of the results of Blanchard and Quah (1989). Read more…

Structural vector autoregression models

\(\def\bfy{{\bf y}}
\def\bfA{{\bf A}}
\def\bfB{{\bf B}}
\def\bfu{{\bf u}}
\def\bfI{{\bf I}}
\def\bfe{{\bf e}}
\def\bfC{{\bf C}}
\def\bfsig{{\boldsymbol \Sigma}}\)In my last post, I discusssed estimation of the vector autoregression (VAR) model,

\begin{align}
\bfy_t &= \bfA_1 \bfy_{t-1} + \dots + \bfA_k \bfy_{t-k} + \bfe_t \tag{1}
\label{var1} \\
E(\bfe_t \bfe_t’) &= \bfsig \label{var2}\tag{2}
\end{align}

where \(\bfy_t\) is a vector of \(n\) endogenous variables, \(\bfA_i\) are coefficient matrices, \(\bfe_t\) are error terms, and \(\bfsig\) is the covariance matrix of the errors.

In discussing impulse–response analysis last time, I briefly discussed the concept of orthogonalizing the shocks in a VAR—that is, decomposing the reduced-form errors in the VAR into mutually uncorrelated shocks. In this post, I will go into more detail on orthogonalization: what it is, why economists do it, and what sorts of questions we hope to answer with it. Read more…

Cointegration or spurious regression?

\(\newcommand{\betab}{\boldsymbol{\beta}}\)Time-series data often appear nonstationary and also tend to comove. A set of nonstationary series that are cointegrated implies existence of a long-run equilibrium relation. If such an equlibrium does not exist, then the apparent comovement is spurious and no meaningful interpretation ensues.

Analyzing multiple nonstationary time series that are cointegrated provides useful insights about their long-run behavior. Consider long- and short-term interest rates such as the yield on a 30-year and a 3-month U.S. Treasury bond. According to the expectations hypothesis, long-term interest rates are determined by the average of expected future short-term rates. This implies that the yields on the two bonds cannot deviate from one another over time. Thus, if the two yields are cointegrated, any influence to the short-term rate leads to adjustments in the long-term interest rate. This has important implications in making various policy or investment decisions.

In a cointegration analysis, we begin by regressing a nonstationary variable on a set of other nonstationary variables. Suprisingly, in finite samples, regressing a nonstationary series with another arbitrary nonstationary series usually results in significant coefficients with a high \(R^2\). This gives a false impression that the series may be cointegrated, a phenomenon commonly known as spurious regression.

In this post, I use simulated data to show the asymptotic properties of an ordinary least-squares (OLS) estimator under cointegration and spurious regression. I then perform a test for cointegration using the Engle and Granger (1987) method. These exercises provide a good first step toward understanding cointegrated processes. Read more…