Questions and Answers on Tme Series Modeling


Questions and Answers on Tme Series Modeling

Author
Message
JoeyR
Junior Member
Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)

Group: Forum Members
Posts: 11, Visits: 1

Should I be trying to replicate the NEAS results?

[NEAS: This is an independent student project. The NEAS postings are suggestions to get you started. You can construct an ARIMA model, compare two or more models for a given era, compare two or three eras by type of model of by model parameters, examine seasonality, test out-of-sample forecasts, and many other items.]


jnissley
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Posts: 2, Visits: 1
To reproduce the regression outputs produced by NEAS, you must perform a regression with the series as the Y variable, and the series lagged one period (yt-1)  [yt-1] as the X variable. You can look at the source data of their charts to make sure you are picking up the same time period.
JoeyR
Junior Member
Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)

Group: Forum Members
Posts: 11, Visits: 1

Why do use the two y-values?  I'm not sure I understand that piece.  Does this compare first differences - I'm not too familiar with the Excel lingo (regression pack) so I don't know what it is doing once I give it the information.  I suppose that would be a useful Rachael/Jacob discussion NEAS can post - How does Excel interpret/use data to perform regression.

JR

Excel Regression Built-in Function

[NEAS: An extract from a posting for the regression analysis student project:]

Jacob: Do we solve for the ordinary least squares estimators by the equations in the textbook?

Rachel: Excel provides a built-in regression function. If we use a hundred simulation to test the accuracy of the estimators, we code a VBA macro or an Excel table with the formulas from the textbook. For the student project, it is easier to use the regression built-in function.

Jacob: Where is the Excel regression built-in function?

Rachel: Choose the tools menu from the menu bar. From the menu, choose data analysis. You may have to include the data analysis add-in to your version of Excel. From data analysis, choose regression.

Jacob: Simpler Excel built-in functions determine a linear trend line using regression. Can we use those built-in functions?

Rachel: Those Excel functions use a single independent variable. For two or more independent variables, we need the Excel add-in.

Jacob: How do we include the data analysis add-in?

Rachel: Check to see if the add-in is already installed. Some actuarial departments have the add-in installed.

If the add-in is not installed, choose add-ins… from the tools menu. From the menu that appears, choose analysis toolpak. To work with VBA, include also the analysis toolpak vba.

Your version of Excel may differ. If you can’t find the regression built-in function, post a question on the discussion forum, listing your version of Excel and of windows.

Jacob: Are we doing regression analysis or time series? We speak about an ARIMA(2,1,0) model and then use the Excel built-in regression function.

Rachel: We have three elements:

If the time series has an order of homogeneity greater than 0, we take first or second differences. This is spreadsheet arithmetic; you don’t need sophisticated functions.

For an autoregressive model, we use linear regression with the Excel built-in regression function. If you want, you can add your own functions or VBA macros.

A moving average model is harder to code in Excel, since it uses non-linear regression. The textbook explains how to identify a moving average process by spikes in the sample autocorrelation function that are followed by white noise. In practice, it is hard to identify these spikes. You may comment whether the sample autocorrelation function suggests a moving average term, but you do not have to model this term. Moving average terms are not common.

 


jnissley
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: Forum Members
Posts: 2, Visits: 1

You are fitting an equation of the form yt = Ayt-1 +B.

[ yt = A × yt-1 + B ]

Performing a regression gives least-squares estimates of A and B. This is really just an AR(1) model, but if A >1, it is not stationary (random walk) and you need to first difference. What they are doing in their example is showing that the series have an upward linear trend and so needs to be differenced.

[NEAS:

Jacob: What if A = 1?

Rachel: If A = 1, the process is not stationary. It is a random walk, and we take first differences.

Jacob: If A = 1 and B = 0, isn’t the current value also the mean?

Rachel: If A = 1 and B = 0, the current value is the one period forecast. The process is not stationary and does not have a mean. The mean is B / (1 – A), which is not defined if A = 1.]


n2thornl
Junior Member
Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Posts: 21, Visits: 1

What are you guys using for the data?

I had thought that the data NEAS used in the Excel file for the example was just that... an example. We can't use the same exact data. We have to choose something else.

So, if anyone wants to share how they chose their data, that would be appreciated.

Currently I am thinking I will use the long term rates in the Excel file, and split into three periods, similar to what was done for the example using the short term treasury rates. So, I guess I'm doing a 'comparisons' type of project. I had originally wanted to compare interest rates pre and post 9/11, but I don't want to waste the time tracking that info done, plus it would only be about 30-40 data points for the post 9/11 rates, which apparently isn't enough. Just tossing this out there.

[NEAS:

Jacob: Can we use the same data as on the NEAS spreadsheets? Or should we use other data?

Rachel: You can use the same data or other data; the choice is yours.

Jacob: Why not place more data on the web site?

Rachel: We placed limited data on the discussion forum because some candidates fear they have missed something if they have not used all the data.

Jacob: If we use the same data, won’t we get the same results?

Rachel: The sample workbook shows illustrations, not results. Even for the eras of each series, you might choose other periods. Your project might focus on the choice of eras, examining means, drifts, and variances in various periods, fitting models, and making forecasts.

Jacob: Would comparing pre-9/11 vs post-9/11 interest rates be a good project?

Rachel: This is a perfectly good project, though it may not show much. You would compare the two eras and see if any differences are significant.]


SaulGood
Forum Newbie
Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Posts: 1, Visits: 1
Is anyone else having trouble matching the third regression output example in the excel file? I am having no problem matching the other three but for some reason the third one is giving me trouble.

Also, in regards to n2thornl's post, I was under the impression that we could use the same data that NEAS used in their example. I gather this from the text in the "Time Series: Independent Student Projects" posting that reads:

"We provide the time series on the web site along with specific project templates. If you are not sure that you fully understand the concepts, use these interest rates, for two reasons:

You can compare your results with the examples in the project templates.

You can discuss the modeling of these time series on the discussion forum."

Is there another posting that says something that contradicts this?


[NEAS: Correct. Using the same data and the same eras helps you get started. You still complete the project yourself, but you have an outline.]


JoeyR
Junior Member
Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)

Group: Forum Members
Posts: 11, Visits: 1

I'm still thinking this through.  My impressions were the same as yours (ie the 3-month T-bill broken into 3-time periods was out-of-bounds) for the included NEAS example.  I'm thinking of using the CPI data (non-sesonally adjusted) and testing two/three models: no seasonal adjustment, 6-month seasonal adjustment and(maybe if I have time) 12-month seasonal adjustment.

I'm actually finding it pretty easy to walk through how to do an analysis by using the text book, following through starting in chapter 16.  Chapter 19 explains in better detail of what to do when putting a model together.  Section 19.1 in particular is a very good step-by-step guide on what to do when assembling a model.

I'll try and post when I'm completed and I would be more than happy to help others along in completing their project!

JR

[NEAS does not say exactly what to do, but this the proper direction. Begin by dividing into eras; examine the interest rates and the first differences.

Jacob: Should we examine six month seasonality or 12 month seasonality?

Rachel: We normally examine 12 month seasonality, unless we have a reason to assume six month seasonality.

Jacob: What if the six month sample autocorrelation is significant?

Rachel: Annual seasonality may cause a six month autocorrelation. Use a 12 month AR parameter, and see if the six month sample autocorrelation is still significant. If it is, compare out-of-sample forecasts for six month seasonality vs 12 month seasonality. This is a potential student project.

Jacob: What might cause six month seasonality?

Rachel: Auto premiums and policies have six month seasonality because of the six month policies. Actuarial exam statistics have six month seasonality because of the semi-annual exam sittings. University statistics have six month seasonality because of their semesters.

Jacob: Should we use the examples in the textbook for the student project?

Rachel: The last five modules in the course cover Chapter 19; these are good examples, but they are more complex, since the authors fit higher order ARIMA models.

Jacob: Should we review the earlier chapters as well?

Rachel: The entire course focuses on constructing and testing ARIMA models. The earlier chapters explain how to charts, plots, correlograms, sample and partial autocorrelation functions, regression analysis, first and second differences, and the various statistical tests to construct and choose a good model.]


n2thornl
Junior Member
Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)Junior Member (21 reputation)

Group: Forum Members
Posts: 21, Visits: 1

Saulgood-

What, if anything, did anyone do to 'test' their data before trying to fit a model? The postings mention checking it for a few things (none of which I understood, so I can't recall offhand) before beginning to attempt to fit a model. So, I'm talking like, before even taking first differences or anything involving the autocorrelation function...

 

[NEAS:

Jacob: Where do we start? The textbook and postings discuss many items; is there a specific order?

Rachel: The order depends on the goals of your project and the results of previous steps. We suggest some common steps, though you vary them for your project.

Jacob: How would one start?

Rachel: Start by graphing the data. The type of graph depends on the question. To examine if monthly interest rates have a long-term drift, use a 12 month moving average. This eliminates seasonality, smooths random fluctuations, and highlights long-term trends. To examine if the stochasticity changes over time, we don’t use a moving average.

Jacob: The graph is just visual; shouldn’t we use statistical tests?

Rachel: We start with graphs. To test for random walks, we graph the interest rates and their first differences. We graph the sample autocorrelations (form a correlogram) which shows the pattern. For seasonality, we graph the interest rates and the correlogram.

Jacob: After forming the graphs and charts, do we construct an ARIMA model?

Rachel: We first see if we should separate the time series into intervals. We focus on means, drifts, and variances in each period.

Jacob: How do we know how to choose the periods?

Rachel: Choose them initially by examining the graphs, and then calculate the mean, drift, and variance of each period.

Jacob: Do we examine if the differences in the means, drifts, and variances are statistically significant?

Rachel: One might do this. The tests for statistically significant differences are not on the time series syllabus, and they are not required for the student project.

Jacob: If the means and drifts differ, must we use separate ARIMA models?

Rachel: Not necessarily. The means and drifts may differ for the original series, but not for the first or second differences. In some cases the drift may differ by time period, but the ARIMA model may help explain (and predict) the changing drift.

Jacob: What else should we examine in each project?

Rachel: We check for seasonality. We examine the correlogram, and if we observe spikes at 12 month periods, we use a seasonal ARIMA parameter and compare the models with and without the seasonal parameter. If we don’t observe spikes, we don’t need the statistical tests.

Jacob: Do we always use the Durbin-Watson statistic, Bartlett’s test, and the Box-Pierce Q statistic?

Rachel: If the student project selects one ARIMA model from a choice of two or more models, we examine these tests. In almost all student projects, at least one or two of these tests are used.


NewTubaBoy
Forum Member
Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)Forum Member (25 reputation)

Group: Forum Members
Posts: 25, Visits: 1
First you have to test if it is stationary.  If it's not make  a stationary model by taking the first difference.  Then using this first difference you have to test and see if it's white noise.  there are several tests to test this.  If it is then there is no reason to model it as ARIMA.  It probably won't be white noise though.  Then, you can start fitting.  i thought this was all really well laid out in one of the posts they provided the Step by Step fitting post. 
JoeyR
Junior Member
Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)Junior Member (11 reputation)

Group: Forum Members
Posts: 11, Visits: 1

Follow the Rachael/Jacob discussion in http://www.neas-seminars.com/discussions/shwmessage.aspx?ForumID=174&MessageID=4771, this walks you through the different types of tests and when they are useful to perform (i.e. Q-test, DW, etc.)

My steps are:

1.  Calculate deviations and first differences and plot.

[NEAS: Graph the time series and check for drifts and seasonality. For drifts, compute moving averages. Use 12 month moving averages for monthly rates. A drift appears as a consistent upward or downward trend. A fluctuating trend may be stochasticity, not trend. For seasonality, the correlogram is a better graph. Sales volumes show large year-end changes; we need a correlogram to see slight seasonality in interest rates.

Compute deviations and see if the mean or variance is changing. If the means, drifts, or variances differ by time period, we may need to separate the time series into eras to construct ARIMA models. If the deviations are below zero on one side of the graph and above zero on the other side, the mean is changing. If the average size of the deviations changes, the variance is changing.

Several types of models are common; they have distinct graphs and correlograms. White noise shows no pattern. For white noise, examine the graph of the deviations. The devations should appear as random fluctuations about zero. The average deviation size may vary over time, suggesting a change in the variance or conditional heteroscedasticity. White noise may have a positive mean, but no trends or cycles.

A random walk takes several forms. A random walk with no drift means that an upward movement in one month is equally likely to be followed by another upward movement as by a downward movement. A trend (drift) does not negate a random walk, but we may have to detrend the rates or take first differences.]

2.  Calculate the autocorrelation function and plot vis-a-vis correllogram (SP?).  If the autocorrelation function tends to zero your series may be stationary.  There are few ways to test (ie using tests above).  I then took first differences and calculated the autocorrelation function.  This showed positive signs of being stationary - this was confirmed by calculating and plotting the autocorrelation function for the second difference (the autocorrelation function tended to zero quickly and remained there with some stability).

[NEAS: The sample autocorrelation function and correlogram are powerful tools. Weak seasonality may be obscured in a scatterplot of the interest rates but may show up in the correlogram. Autoregressive, moving average, and ARMA models have distinct sample autocorrelation functions. Check for geometric decay (autoregressive), spikes (moving average), or both.]

3.  Since I am comparing two models (seasonality adjustment vs no seasonality) I calculated a 6-month diffence and a difference of the 6-month differences and plotted their autocorrelation functions.

[NEAS: Start with a 12 month difference, even if you see a six month autocorrelation.]

4.  I calculated the DW and Q stats.

[NEAS: On the write-up, be sure to state the hypothesis and what the test shows.]

5.  That's were I've got to for now.

My idea for completion is to plot my two fitted models against actual data and see which one replicates (ie fits) the best and perhaps do some forecsasts using the data.

 Does the above sound reasonable to everyone? Input/criticism would be appreciated.

JR


GO
Merge Selected
Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

  • Login with twitter
  • Login with twitter
Select a Forum....











































































































































































































































Neas-Seminars

Search