I am performing a Seasonal and Trend Decomposition by Loess on a yearly time series, where I extract a long term trend and tri-annual quasi-periodic series from the raw data. The problem is that it doesn't seem to exist an option of ts
with periodicity on the order of years. Nevertheless, I was able to overcome this limitation by running the analyses with a random frequency for the TS and the final results were satisfactory:
loessyearly <- ts(yrobs, start = 1993, frequency = 2) #create a TS with random frequency of 2
stlyearly <- stl(loessyearly, s.window = 3, t.window = 9) #s.window = 3 to smooth under a quasi-periodicity of three years
Obviously, when plotting the graphs the X-axis follows the frequency I choose at random (i.e. 2 years):
However, I would like the x-axis to depict one year per each observation (i.e. frequency = 1). Is that possible?
I know an option would be trying this decomposition with stlplus()
, but I would like to try it via stl()
first, since I found it even more difficult o deal with the graphical options of the stlplus()
function.
Thank you!