Spectral Analysis*

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

NicolasR
Posts: 81
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Spectral Analysis*

Postby NicolasR » Sat Feb 22, 2014 1:53 pm

This thread is about the Spectral Analysis add-in which calculates various spectral analysis tools for time series :series:. It's an improved version of the periodogram add-in, it has new methods to calculate spectal density and a significance test signal that could be used as a white noise test.

Regards, Nicolas Ronderos Pulido
Last edited by NicolasR on Fri Nov 03, 2017 10:35 am, edited 1 time in total.

ecofin
Posts: 178
Joined: Fri May 10, 2013 11:24 am

Re: Spectral Analysis*

Postby ecofin » Sun Feb 23, 2014 12:49 pm

It is exactly what I need, Thank you for all your efforts, I'm :D .

trubador
Did you use forum search?
Posts: 1518
Joined: Thu Nov 20, 2008 12:04 pm

Re: Spectral Analysis*

Postby trubador » Thu Feb 27, 2014 1:05 pm

Yes, a very comprehensive and useful add-in. Thanks for sharing...

felix.casares
Posts: 21
Joined: Fri Jun 21, 2013 11:34 am

Re: Spectral Analysis*

Postby felix.casares » Wed Aug 13, 2014 10:54 am

i don´t know much about spectral analysis, can i use one of any elements ofs this to make hp filter for daily frequency time serie?

please help

NicolasR
Posts: 81
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: Spectral Analysis*

Postby NicolasR » Wed Aug 13, 2014 2:45 pm

The Hodrick Prescott filter is a low pass filter, that is, it preserves the low frequency components in the spectrum (long run). Therefore, you can use the estimated spectrum of your series to see if there is any significant peak at the low frequency components, if there is not, the smoothed series with de HP filter would be based on artificially inflated frequency components.

Hope it helps.

Regads.

NicolasR
Posts: 81
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: Spectral Analysis*

Postby NicolasR » Tue Jan 13, 2015 1:51 pm

The version 2.0 of the spectral analysis add-in is now available. It contains tests for detecting periodic components, white noise and Gaussian white noise, also it performs an automatic procedure for extracting cycles of a time series, named significant pass filter (SPF). The add-in could also be used to perform dynamic Fourier analysis, the program file can be found below and in the add-in file. In the PDF document of the add-in are showed the spectral theory of economic series and some examples using the add-in applied to data of the Industrial Production Index, the Chicago Board Options Exchange S&P 100 volatility index (VXO) and the exchange rate Euro/Dollar.

Regads.

Code: Select all

mode quiet
'---------------------------------------------------------------Dynamic Spectra Inputs----------------------------------------------------------------
!step=1 'Step parameter for the rolling
!window=100 'Number of data that will be used to estimate the spectrum
'-----------------------------------------------------------------Static Spectral Inputs------------------------------------------------------------------
%series="vxo"
%s_window="Bartlett-Priestley" 'Periodogram, Hamming, Hann, Bartlett, Parzen, Truncated, Daniell, Bartlett-Priestley
!criteria=0.05 'Selection criteria for the spectral filter
%log_scale="N" 'Y/N
!truncation=20 'Truncation point
'----------------------------------------------------------------------------------------------------------------------------------------------------------------
!obs=@obs({%series})
!start=@ifirst({%series})
!end=@ilast({%series})
!nrolls=(!obs-!window)/!step
!loop=0
for !i=0 to !obs-!window step !step
   !loop=!loop+1
   %first = @otod(!start+!i)
   %last = @otod(!start+!i+!window)
   smpl {%first} {%last}
      if %log_scale="N" then
         {%series}.spectral({%s_window},table,truncation=!truncation,criteria=!criteria)
      else if %log_scale="Y" then
         {%series}.spectral({%s_window},table,truncation=!truncation,criteria=!criteria,log)
      endif
   endif
   for !j=1 to !window/2
      table(!window/2+1,!nrolls+2) dynamic(1,!loop+1)=@pagesmpl
      table(!window/2+1,!nrolls+2) dynamic(!j+1,1)=data(!j+1,2)
      table(!window/2+1,!nrolls+2) dynamic(!j+1,!loop+1)=data(!j+1,4)
   next
   for !j=!start to @obsrange
      if !criteria<1 then
         if sf_wsum(!j)<>NA then
            vector(@obsrange,1) cycle(!j,1)=sf_wsum(!j)
         endif
      else
         if mf_wsum(!j)<>NA then
            vector(@obsrange,1) cycle(!j,1)=mf_wsum(!j)
         endif
      endif
   next
   if !criteria<1 then
      %s_m="s"
      else
      %s_m="m"
   endif
   if %s_window="Periodogram" then
      delete data {%s_m}f_wsum {%s_window}01
   else if %s_window="Bartlett-Priestley" then
         %priestley=@right(%s_window,9)
         delete data periodogram_{%priestley} {%s_m}f_wsum
         else
         delete data periodogram_{%s_window} {%s_m}f_wsum
      endif
   endif
   scalar roll=@floor((!loop/!nrolls)*100)
   !roll_=roll
   statusline Rolling Percentaje: (!roll_%)
next
smpl @all
mtos(cycle,stochastic_cycle)
delete roll cycle
'----------------------------------------------------------------------------------------------------------------------------------------------------------------

lofficer
Posts: 2
Joined: Mon Feb 09, 2015 10:53 am

Re: Spectral Analysis*

Postby lofficer » Mon Feb 09, 2015 11:35 am

I have version 2.0 of spectralanalysis. In order to do cross-spectral analysis, I need sine and cosine coefficients by frequency, not just plotted. Please help. Explain how I can do this without entering your program. If I alter your program, there will be future issues when you alter your program and I want to stick to your program. Thanks.

NicolasR
Posts: 81
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: Spectral Analysis*

Postby NicolasR » Tue Feb 10, 2015 12:45 pm

Hi lofficer,

The add-in only performs univariate spectral analysis, in fact I´m working on a cross spectral analysis add-in I belive it will be ready in a couple of months.

lofficer
Posts: 2
Joined: Mon Feb 09, 2015 10:53 am

Re: Spectral Analysis*

Postby lofficer » Wed Feb 11, 2015 10:44 am

Thanks. I look forward to your cross-spectral program.

clubmed
Posts: 81
Joined: Sun Nov 30, 2014 3:03 am

Re: Spectral Analysis*

Postby clubmed » Sat Feb 14, 2015 2:19 am

thanks for the STR Add-in it's very useful 8)
i have two suggestions,
1-can you improve this Add-in to calculate (views the series of cumulative and frequency) and show the Cumulative spectral distribution (graph).
2-EViews 9 beta can now estimate the ARFIMA model, can you write an Add-in test of GPH (Geweke-Porter-Hudak test long memory).

Kind Regards. MED

NicolasR
Posts: 81
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: Spectral Analysis*

Postby NicolasR » Mon Feb 16, 2015 9:00 am

The cumulative spectrum could be calculated simply with the command @cumsum(%spectrum_name). The test sounds interesting but it is not in my plans, sorry.

Best regards.

Nicolas.

StoyanKiryazov
Posts: 1
Joined: Mon Apr 27, 2015 7:15 am

Re: Spectral Analysis*

Postby StoyanKiryazov » Mon Apr 27, 2015 7:20 am

Hi Nicolas,

many thanks for the great add-in. It is really helpful. May I ask if you have any progress with the cross-spectral tools? A few months ago you mentioned you were working on this.

Thank you.

Kind regards,
Stoyan

nicotrader
Posts: 30
Joined: Sat Jun 06, 2015 11:48 am

Re: Spectral Analysis*

Postby nicotrader » Sun Jun 07, 2015 10:59 am

Hi all, i have a problem with spectral analysis add in.
I work with high frequency financial observation.
Whit more 10.0000 observation the system returns error "OUT OF MEMORY MATRIX"
Can you fix this problem?

NicolasR
Posts: 81
Joined: Mon Nov 04, 2013 6:22 pm
Location: Here

Re: Spectral Analysis*

Postby NicolasR » Tue Jun 09, 2015 7:27 am

Hi,

If you are working with 100.000 observations the add-in will not work. However if you click options-->General options-->Advanced system options and change the memory reserved for windows to 200 you will probably can work with 12000 observations (in a 32 bit version). Increase the temporal aggregation will afect the short-run cycle that you might find, In financial data I doubt that there is a cicle of this type. What are you trying to find or prove?

Regards.

nicotrader
Posts: 30
Joined: Sat Jun 06, 2015 11:48 am

Re: Spectral Analysis*

Postby nicotrader » Tue Jun 09, 2015 11:23 am

Nicolas i m work with high frequency data (5min rivelation), in one day, for exp. Sep500 future there are 250 5min rivelation multiply for cycle of 30 day or more and get a 7500 observation, multiply for back test 2 years at least.....

I think software should allow econometric analysis of time series high frequency, everything else is the past.
I urge you to implement the software. I paid this software 1750 Dollars!


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 1 guest