Blog Archive

Saturday, December 18, 2021

Fractional Frequency Flexible Fourier Form ARDL: A Demonstration

Introduction

This method has been applied in three known published papers. They're all published between 2020 and 2021 and this is suggestive of the future boom of this approach. It's therefore important that we discuss it here. I'll be discussing the estimation part of this method in this post. The other part, which involves bootstrap, will be discussed in a subsequent post. 

Let's delve into it at once. Why this kind of formulation? Yes, the economy goes through a lot of changes mostly in the short run. But long-run changes also take place rather smoothly and unnoticeably. Modelling smooth, slow and steady changes in the economic relation is a profitable venture in policy analysis. The Fourier flexible form is a good methodological proposition for this modelling. Even so, some changes are not smooth even in the long run. Violent changes do take place. Wars. All manners of pandemic. Benign, beneficial and nevertheless sudden changes also do take place. Ushering in a new regime of democratically elected office holders often signals the enthronement of rules of law and a good bait to the investors, who come with new technologies that eventually reset the path of long-term outcomes in the economy. These changes too, though not smooth, can still be efficiently captured by Fourier form. Earlier discussants of this modelling strategy include Gallant, Davies, Becker, Enders, Li in their various publications. Omay joins the train by introducing the fractional frequency idea, which was extended by Olayeni, Tiwari and Wohar to long T panel. Other ideas of modelling slow changes are due to Bierens and co-authors, who propose the Chebyshev approximation. 

The method 

All that I want to show you is how to implement this model using the ARDL method in Eviews. First, I will invite you to read one of the previous posts in this blog, where I have briefly discussed the ARDL method. (Read about it here.) More importantly, the section, ARDL at a Glance will be helpful. Pay attention to Cases 1 and 2 under the model specifications. I further invite you to read about the bootstrap method here. In this post, we are going to apply the knowledge of bootstrap. Consider the following model, which I call FARDL(p,q):\[\Delta y_t=\theta+d(t)+\rho y_{t-1}+\gamma x_{t-1} +\sum_{j=1}^{p-1}\psi_j\Delta y_{t-j}+\sum_{j=0}^{q-1}\varphi_j\Delta x_{t-j}+\epsilon_t\]where\[d(t)=\sum_{k=1}^n\alpha_k\text{cos}\left(\frac{2\pi k t}{T}\right)+ \sum_{k=1}^n\beta_k\text{sin}\left(\frac{2\pi k t}{T}\right)\]To estimate this model, a couple of practical issues are involved that you will need to sort out very early. The first is the choice of the frequency. At what frequency will the estimation be conducted? Trivial as it might appear, it has implications for the results. The second is the number of Fourier terms to be included. In the generic specification given above, the number of terms is set to \(n\). In a more serious study, this has to be determined too. Most often, the selection criteria are used for this purpose and the goal is to selected the value that minimizes the criterion used. I will assume these two issues are already sorted out and what remains is to proceed to estimation. In line with the approach employing fractional frequency, one frequency parameter will be used. However, we'll grid-search for its optimal value. Thus, we state as follows, setting \(n=1\):\[d(t)=\alpha\text{cos}\left(\frac{2\pi k t}{T}\right)+\beta\text{sin}\left(\frac{2\pi k t}{T}\right)\]

Fractional frequency

In most studies it may be instructive to find the fractional frequency rather than arbitrarily impose a particular integer frequency. The reason is that the integer frequency imposed may well not be supported by the data. Therefore, it is crucial to find the frequency that delivers the optimal value in terms of the information criterion so chosen. Finding the optimal fractional frequency itself deserves some note.  In this section, I give a thorough discussion of one way this optimal value can be found. First, I present the snippet of the code that does that. Get the code here. Subsequently, I explain what the snippet does and how it does it. 

Code snippet... 


Here is the code to find the fractional frequency parameter value: 
  1. matrix(1000,2) matrixAIC=na
  2. !c=1
  3. for !k=0.1 to 4 step 0.01
    • equation fourierardl.ardl lcons lincome @ cos(2*@pi*!k*@obsnum/@obssmpl) sin(2*@pi*!k*@obsnum/@obssmpl)
    • matrixAIC(!c,2)=fourierardl.@aic
    • matrixAIC(!c,1)=!k
    • !c=!c+1
  4. next
  5. vector minvecAIC=@cimin(matrixAIC)
  6. !indexminAIC=minvecAIC(2)
  7. scalar kstar=matrixAIC(!indexminAIC,1)

 

...and the explanation

What this code snippet does is to find the value of the frequency, \(k^*\), that minimizes the Akaike Information Criterion (AIC). You can change this to any of the other criteria (@schwarz or @hq). The first line, Line 1, declares the matrix object as the storage. The order is obviously more than what is needed but does not pose any problem since I set that to na. I need a counter and it is declared in Line 2. In Line 3, a for-next-step loop is initialized. This is complemented by Line 4. Every command issued within this loop will not only be carried out, it will be repeated 391 times, with the values of \(k\) incrementing \(0.1, 0.11,0.12,\dots,3.99,4.00\). By default, that is, without step included in Line 3, the integer values will be assumed. Since we need a fine grid, over which we want to search, we reduce the step to \(0.01\) on each iteration. 

The commands within the loop need to be explained. The first bullet declares an equation object named fourierardl and assigns ARDL method to it. ardl refers to the second model specification already discussed in a post here. Thus, the command says the model should estimated without including the trend specification at all. Therefore, without the fixed regressors included, the specification would simply read

        equation fourierardl.ardl lcons lincome @

However, to include the Fourier flexible form terms in the model, we treat them as fixed regressors and they are placed just immediately after @-sign:

         @ cos(2*@pi*!k*@obsnum/@obssmpl) sin(2*@pi*!k*@obsnum/@obssmpl) 

This means the Fourier flexible form terms are to be treated as fixed regressors in the estimation.

Next, we need the associated AIC. It is an equation data member and can be accessed as declared in the second bullet. The AIC value at the iteration !c is grabbed and stored in the first column of matrixAIC. The corresponding frequency parameter value is likewise stored in the second column of matrixAIC. The last bullet within the loop is the counter initialized at Line 2. It is being incremented by 1 just to ensure what has been stored previously is not overwritten. Otherwise, it will be zero-work done! So pay attention to such little things.

Immediately outside the loop (well, I call it post-loop section), we need to find one of those 391 frequency parameter values corresponding to the least of the 391 AIC values. One way to do this is to first identify the index of the least AIC value. The matrix utility function @cimin() achieves that for us. It gives us the index of the least value in each column of a matrix. In this case, it will return the 2 indices of the least values, the first for the first column and the other for the second column. For a newbie, here is a lurking slippery source of error. The index so identified in the first column should not be given a hoot. This is because the second element in the second column is the least and the index will read 1. This is not what we want. We want the value of \(k\), call it \(k^*\), that corresponds to the least value of AIC. If you don't get this point, you can open the vector minvecAIC and examine the elements. I'm pretty sure, the value in the first entry will be 1 and always 1!

Then how do we select the corresponding value of the frequency parameter? We need to first grab the index of the least AIC. Since the values of AIC are stored in the second column, the index must be the second element in minvecAIC. It is selected by issuing minvecAIC(2), with 2 indicating the second element in minvecAIC. I assign it to a scalar !indexminAIC in Line 6. Now, finally, in Line 7, I select the coveted value of frequency parameter. The command  scalar kstar=matrixAIC(!indexminAIC,1)says look up the value in Row !indexminAIC and Column 1. Remember the frequency parameters are in the second column.

Optimal fractional frequency


In Figure 1, we present the graph of the optimal fractional frequency. It is observed immediately that the value of the frequency parameter that achieves the minimal AIC is 2.78. There is no way we would have known this had we not grid searched as we did in the preceding section. This figure is the graphical representation of the elements in matrixAIC and has been plotted using xy-line graph so that we have AIC on the y-axis and k on the x-axis. The vertical dashed line is a marker of the the optimal value located at point 2.78 on the x-axis. You can also add this to your work to lend credence to its worth.

Having gone this far, the question is: what next?

Figure 1: Optimal frequency

Yes, what next?


Yes the next thing is the FARDL estimation. But if you have been following closely, you will have noticed we've already done so for 391 regressions. One of them, which must be reported, is what we are looking for here. And that is the one that corresponds to the optimal frequency just found in the section above. We are not going to estimate 391 regression models again. Rather, we only need to plug in the optimal frequency parameter and estimate just one regression model. That model is the FARDL we are looking for. Let's do it together. You already savvy about what to do, ehn? Since the optimal frequency parameter, \(k^*\), is already in the workfile, it means you can use it in subsequent computations. Let's use point-and-click approach at this point. 

Figure 2 shows what we should be doing. Note in particular the scalar for the frequency parameter. It is now the optimal one:

Figure 2: What FARDL dialog box should look like

Figure 3 shows the results of this estimation, a FARDL(2,0). The output from this estimation can be analyzed as usual. As shown in Figure 4, we can carry out the bounds testing. 

Figure 3: FARDL Output


Figure 4: Bounds testing


What about carrying out the Augmented FARDL? Of course, that too is possible. Just use the Augmented ARDL addin for this; it can be found here

FYI: If you already installed the old version of this addin, released prior to this post, you might need to download the new one again and reinstall it. Only the updated version of this addin is guaranteed to handle this augmented bounds testing for Fourier ARDL without a glitch.

Figure 5: Augmented Bounds Testing

Figure 6: Testable Form for the FARDL

The current augmented addin also produces an OLS version of the long-run form useful in its own right as shown in Figure 6. In subsequent post, this will come in handy. Therefore, in this post, no further comment on why it's important. 

If this helps, just hit the follow button.👉😉😏 I will hear load and clear. Thank you.








3 comments:

Unknown said...

Thank you so much sir

Gus said...

Thank you for sharing You knoledge, but i don't understand who are the new search what use this method. Greetings

Anonymous said...

Merci bcq

Unit root test with partial information on the break date

Introduction Partial information on the location of break date can help improve the power of the test for unit root under break. It is this ...