NCSS Statistical Software. , contains a periodic (cyclic) component. A natural model of the periodic component would be

Similar documents
23.2. Representing Periodic Functions by Fourier Series. Introduction. Prerequisites. Learning Outcomes

Some Basic Information about M-S-D Systems

Time series Decomposition method

ACE 562 Fall Lecture 5: The Simple Linear Regression Model: Sampling Properties of the Least Squares Estimators. by Professor Scott H.

Solutions to Odd Number Exercises in Chapter 6

Biol. 356 Lab 8. Mortality, Recruitment, and Migration Rates

Types of Exponential Smoothing Methods. Simple Exponential Smoothing. Simple Exponential Smoothing

THE UNIVERSITY OF TEXAS AT AUSTIN McCombs School of Business

Matlab and Python programming: how to get started

STATE-SPACE MODELLING. A mass balance across the tank gives:

ACE 562 Fall Lecture 8: The Simple Linear Regression Model: R 2, Reporting the Results and Prediction. by Professor Scott H.

ES.1803 Topic 22 Notes Jeremy Orloff

ACE 564 Spring Lecture 7. Extensions of The Multiple Regression Model: Dummy Independent Variables. by Professor Scott H.

d 1 = c 1 b 2 - b 1 c 2 d 2 = c 1 b 3 - b 1 c 3

Chapter 15. Time Series: Descriptive Analyses, Models, and Forecasting

Chapter 7: Solving Trig Equations

Kriging Models Predicting Atrazine Concentrations in Surface Water Draining Agricultural Watersheds

20. Applications of the Genetic-Drift Model

5.1 - Logarithms and Their Properties

EECS 2602 Winter Laboratory 3 Fourier series, Fourier transform and Bode Plots in MATLAB

Licenciatura de ADE y Licenciatura conjunta Derecho y ADE. Hoja de ejercicios 2 PARTE A

Final Spring 2007

Lecture 3: Exponential Smoothing

Summer Term Albert-Ludwigs-Universität Freiburg Empirische Forschung und Okonometrie. Time Series Analysis

OBJECTIVES OF TIME SERIES ANALYSIS

On Measuring Pro-Poor Growth. 1. On Various Ways of Measuring Pro-Poor Growth: A Short Review of the Literature

2.7. Some common engineering functions. Introduction. Prerequisites. Learning Outcomes

Chapter 4. Truncation Errors

Two Coupled Oscillators / Normal Modes

Vehicle Arrival Models : Headway

A Bayesian Approach to Spectral Analysis

Explaining Total Factor Productivity. Ulrich Kohli University of Geneva December 2015

23.5. Half-Range Series. Introduction. Prerequisites. Learning Outcomes

Echocardiography Project and Finite Fourier Series

Traveling Waves. Chapter Introduction

Nature Neuroscience: doi: /nn Supplementary Figure 1. Spike-count autocorrelations in time.

t is a basis for the solution space to this system, then the matrix having these solutions as columns, t x 1 t, x 2 t,... x n t x 2 t...

1 Differential Equation Investigations using Customizable

) were both constant and we brought them from under the integral.

Diebold, Chapter 7. Francis X. Diebold, Elements of Forecasting, 4th Edition (Mason, Ohio: Cengage Learning, 2006). Chapter 7. Characterizing Cycles

Physics 180A Fall 2008 Test points. Provide the best answer to the following questions and problems. Watch your sig figs.

2.3 SCHRÖDINGER AND HEISENBERG REPRESENTATIONS

State-Space Models. Initialization, Estimation and Smoothing of the Kalman Filter

Chapter 2. First Order Scalar Equations

Wavelet Methods for Time Series Analysis. What is a Wavelet? Part I: Introduction to Wavelets and Wavelet Transforms. sines & cosines are big waves

Quarterly ice cream sales are high each summer, and the series tends to repeat itself each year, so that the seasonal period is 4.

3.1 More on model selection

Section 7.4 Modeling Changing Amplitude and Midline

Mixed Models Random Coefficients

STAD57 Time Series Analysis. Lecture 5

Guest Lectures for Dr. MacFarlane s EE3350 Part Deux

Econ107 Applied Econometrics Topic 7: Multicollinearity (Studenmund, Chapter 8)

Chapters 6 & 7: Trigonometric Functions of Angles and Real Numbers. Divide both Sides by 180

Physics 235 Chapter 2. Chapter 2 Newtonian Mechanics Single Particle

Math 2142 Exam 1 Review Problems. x 2 + f (0) 3! for the 3rd Taylor polynomial at x = 0. To calculate the various quantities:

10. State Space Methods

HW6: MRI Imaging Pulse Sequences (7 Problems for 100 pts)

How to Deal with Structural Breaks in Practical Cointegration Analysis

KINEMATICS IN ONE DIMENSION

6.003 Homework #9 Solutions

Properties of Autocorrelated Processes Economics 30331

Section 4.4 Logarithmic Properties

Lecture 2-1 Kinematics in One Dimension Displacement, Velocity and Acceleration Everything in the world is moving. Nothing stays still.

Finish reading Chapter 2 of Spivak, rereading earlier sections as necessary. handout and fill in some missing details!

ACE 562 Fall Lecture 4: Simple Linear Regression Model: Specification and Estimation. by Professor Scott H. Irwin

!!"#"$%&#'()!"#&'(*%)+,&',-)./0)1-*23)

From Complex Fourier Series to Fourier Transforms

FITTING EQUATIONS TO DATA

Bias in Conditional and Unconditional Fixed Effects Logit Estimation: a Correction * Tom Coupé

( ) ( ) if t = t. It must satisfy the identity. So, bulkiness of the unit impulse (hyper)function is equal to 1. The defining characteristic is

Physics 127b: Statistical Mechanics. Fokker-Planck Equation. Time Evolution

Exponential Smoothing

1 Evaluating Chromatograms

Methodology. -ratios are biased and that the appropriate critical values have to be increased by an amount. that depends on the sample size.

Matrix Versions of Some Refinements of the Arithmetic-Geometric Mean Inequality

USP. Surplus-Production Models

WEEK-3 Recitation PHYS 131. of the projectile s velocity remains constant throughout the motion, since the acceleration a x

4.1 Other Interpretations of Ridge Regression

15. Vector Valued Functions

Lecture Notes 2. The Hilbert Space Approach to Time Series

Decimal moved after first digit = 4.6 x Decimal moves five places left SCIENTIFIC > POSITIONAL. a) g) 5.31 x b) 0.

Mathcad Lecture #8 In-class Worksheet Curve Fitting and Interpolation

Phys1112: DC and RC circuits

Navneet Saini, Mayank Goyal, Vishal Bansal (2013); Term Project AML310; Indian Institute of Technology Delhi

Christos Papadimitriou & Luca Trevisan November 22, 2016

Chapter 11. Heteroskedasticity The Nature of Heteroskedasticity. In Chapter 3 we introduced the linear model (11.1.1)

ME 452 Fourier Series and Fourier Transform

Robust estimation based on the first- and third-moment restrictions of the power transformation model

Lab #2: Kinematics in 1-Dimension

6.003 Homework #9 Solutions

R t. C t P t. + u t. C t = αp t + βr t + v t. + β + w t

Analyze patterns and relationships. 3. Generate two numerical patterns using AC

Section 4.4 Logarithmic Properties

Solutions from Chapter 9.1 and 9.2

Smoothing. Backward smoother: At any give T, replace the observation yt by a combination of observations at & before T

STRUCTURAL CHANGE IN TIME SERIES OF THE EXCHANGE RATES BETWEEN YEN-DOLLAR AND YEN-EURO IN

3.1.3 INTRODUCTION TO DYNAMIC OPTIMIZATION: DISCRETE TIME PROBLEMS. A. The Hamiltonian and First-Order Conditions in a Finite Time Horizon

Representing a Signal. Continuous-Time Fourier Methods. Linearity and Superposition. Real and Complex Sinusoids. Jean Baptiste Joseph Fourier

Principle of Least Action

Sterilization D Values

Transcription:

NCSS Saisical Sofware Chaper 468 Specral Analysis Inroducion This program calculaes and displays he periodogram and specrum of a ime series. This is someimes nown as harmonic analysis or he frequency approach o ime series analysis. Suppose we believe ha a ime series, X, conains a periodic (cyclic) componen. A naural model of he periodic componen would be where R f d e X = R cos( f + d) + e is he ampliude of variaion. Normally, he cosine varies beween -1 and 1. Hence, if R is 6, hen he erm would vary beween -6 and 6. The impac of he ampliude is in he size (heigh or magniude) of he wave. The lengh of he wave is no influenced by he ampliude. is he frequency of periodic variaion, measured in number of radians per uni ime. This is he frequency scale of he plos. If we divide π by f, we ge he corresponding wavelengh. This is he wavelengh scale of he plos. The impac of he frequency is o change he lengh of a cycle. As f increases, he lengh of he cycle decreases. A model wih f = would have a cycle lengh equal o onehalf he cycle lengh of a model wih f = 1. is he phase. Changing he phase causes a shif in he beginning of he cycle. is he random error (noise) of he series abou he period componen. is he ime period number. Usually, =1,, 3,..., N. Since cos(f+d) = cos(f) cos(d) - sin(f) sin(d), his model may be wrien in he alernaive form where a = R cos(d) and b = -R sin(d). X = a cos( f) + b sin( f) + e This model is a muliple regression model wih wo independen variables. In his case, he independen variables are X1 = cos(f) and X = sin(f). The regression coefficiens are B1 = a and B = b. In pracice, he variaion in a ime series may be modeled as he sum of several differen individual waves occurring a differen frequencies. The generalizaion of his model o he sum of frequencies may be wrien symbolically as or, using he alernaive form, as ( ) X = R cos f + d + e j j j j= 1 ( ) j sin( j ) X = a cos f + b f + e j j j= 1 j= 1 Noe ha if he f j were nown consans, and we le W = cos( f ) and Z ( f ) rewrien in he usual muliple regression form: r r s = sin, hen his could be s 468-1 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis X = a W + b Z + e j j j= 1 j= 1 j j where he a s and he b s are he regression coefficiens o be esimaed. This is an example of a harmonic regression. Fourier analysis is he sudy of approximaing funcions using he sum of sine and cosine erms. This sum is called he Fourier series represenaion of he funcion. Specral analysis is idenical o Fourier analysis excep ha insead of approximaing a funcion, he sum of sine and cosine erms approximaes a ime series ha includes a random componen. Noe ha he coefficiens (he a s and b s) may be esimaed using muliple regression. One quesion ha arises is how o selec he frequencies. The highes frequency ha can be fi o he daa is π. The lowes is one cycle for he whole lengh of series, which amouns o a frequency of π / N (N is he lengh of he series). Hence, one popular choice of frequencies is o selec he N/ frequencies given by The h frequency is ofen referred o as he h harmonic. f = π / N, ( = 1,,, N / ) This se of frequencies is paricularly popular when woring by hand because i resuls in cerain simplificaions due o well-nown rigonomeric ideniies. However, here is nohing in naure ha says ha a series will follow hese raher han some oher se. Tha is why he program les you specify a range of frequencies. In he analysis of variance, we sudy he pariioning of he oal variaion (sum of squares) given by N ( ) SST = X X = 1 ino he sum of squares for facor A, facor B, ec. Similarly, in specral analysis we are ineresed in pariioning he oal sum of squares ino amouns associaed wih each frequency. I urns ou ha he sum of squares for a paricular frequency, SS, is given by SS ( b ) N = a + If we regard SS as he porion of he oal sum of squares accouned for by frequencies in he range f ± π, N we can draw a hisogram so ha he area of each bar is proporional SS. The heigh of he hisogram would be N ( ) ( a b = + ) I f The plo of I(f) versus f is called he periodogram. 4π This definiion of he periodogram equaes he oal sum of squares o he area under he periodogram. I(f) may be calculaed direcly from he daa as ( ) I f = [ X cos ( π / N )] + X sin ( π / N ) Nπ [ ] The periodogram is someimes calculaed using he fas Fourier ransform (FFT). This mehod is no used in his program for hree reasons. Firs, he increase in speed of he FFT is no significan unil N is greaer han one housand. For series of he lengh we normally anicipae for our users, he FFT would provide lile speed improvemen. Second, when using he FFT, he lengh of he series (N) mus be a power of (, 4, 8, 16, 3, 64, 18, 56, 51, 104, ec.). If N is no a power of, hen enough zeros mus be added o bring he lengh of he series o he nex 468- NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis power of. Suppose he lengh of a paricular series was 60. You would need o add 5 zeros o bring he lengh o 51. This could dramaically disor your resuls. (FFT users use various windows or filers o remove he effec of hese zeros. Since we do no pad wih zeros, we do no need hese filers.) Third, we can calculae he periodogram for any se of frequencies, no jus he se given above. This is very useful when you wan o invesigae a paricular range of frequencies. The sample periodogram has been shown o have some poor saisical properies. Recenly, echniques for specral analysis have improved on he periodogram by smoohing i. The smoohed periodogram is an esimae of he power specral densiy or simply he specral densiy of he series. The smoohing used in his program is simply an m-erm moving average of he periodogram. The value of m is specified as he Smoohing Lengh opion. Praciioners sugges ha a value of m near N/40 is reasonable. A large value of m may mae he graph oo smooh while a value oo small may include spurious peas. Specral analysis offers an ineresing addiion o oher mehods of ime series analysis. For hose who wish o find more ou abou i, we srongly recommend he boo by C. Chafield (1984). I offers a horough, readable reamen of a difficul, bu useful, subjec. Daa Srucure The daa are enered in a single variable. Missing Values When missing values are found in he series, hey are eiher replaced or omied. The replacemen value is he average of he neares observaion in he fuure and in he pas or he neares non-missing value in he pas. If you do no feel ha his is a valid esimae of he missing value, you should manually ener a more reasonable esimae before using he algorihm. These missing value replacemen mehods are paricularly poor for seasonal daa. We recommend ha you replace missing values manually before using he algorihm. Procedure Opions This secion describes he opions available in his procedure. Variables Tab Specify he variable on which o run he analysis. Time Series Variable Time Series Variable Specify he variable on which o run he analysis. Use Logarihms Specifies ha he log (base 10) ransformaion should be applied o he values of he variable. Missing Values Choose how missing (blan) values are processed. 468-3 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis The algorihm used in his procedure canno olerae missing values since each row is assumed o represen he nex poin in a ime sequence. Hence, when missing values are found, hey mus be removed eiher by impuaion (filling in wih a reasonable value) or by sipping he row and preending i does no exis. Whenever possible, we recommend ha you replace missing values manually. Here are he available opions. Average he Adjacen Values Replace he missing value wih he average of he neares values in he fuure (below) and in he pas (above). Carry he Previous Value Forward Replace he missing value wih he firs non-missing value immediaely above (previous) his value. Omi Row from Calculaions Ignore he row in all calculaions. Analyze he daa as if he row was no on he daabase. Daa Adjusmen Opions Remove Mean Checing his opion indicaes ha he series average should be subraced from he daa. This is almos always done. Remove Trend Checing his opion indicaes ha he leas squares rend line should be subraced from he daa. This is someimes done, alhough differencing is usually used o remove rends insead. Regular Differencing This opion les you designae wheher he original series, he firs differences, or he second differences are analyzed. The firs difference series, W, is calculaed using he formula: which may be wrien using he bacshif operaor, B, as: W = X X 1 W ( 1 ) = B X The second difference series, Z, is he firs difference of he W series. The formula is: which may be wrien using he bacshif operaor, B, as: Z = W W 1 ( 1 ) Z = B X Seasonal Differencing This opion les you designae wheher he original series, he firs seasonal differences, or he second seasonal differences are analyzed. Assuming he number of seasons is s, he firs seasonal difference series, W, is calculaed using he formula: which may be wrien using he bacshif operaor, B, as: W = X X s s ( 1 ) W = B X The second seasonal difference series, Z, is he firs seasonal difference of he W series. The formula is: 468-4 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis which may be wrien using he bacshif operaor, B, as: Z = W W s s ( 1 ) Z = B X Seasonaliy Opions Seasons Specify he number of seasons, s, in he series. Use 4 for quarerly daa or 1 for monhly daa. Noe ha his opion is used only when seasonal differencing is used. Repors Tab The following opions conrol which repors are displayed. Selec Repors Fourier Repor This opion specifies wheher he indicaed repor is displayed. Periodogram / Specrum Calculaion Opions Number of Frequencies Specify he number of frequencies ha are calculaed and displayed. This conrols he resoluion of he periodogram and specrum. The frequencies are equi-spaced beween he minimum and maximum wavelenghs. Smoohing Lengh The specral densiy funcion is a moving average of he periodogram. This opion specifies he value of m, he number of periodogram erms averaged. Minimum Wavelengh The minimum wavelengh value o be used in calculaing and displaying he periodogram and specral densiy. Maximum Wavelengh The maximum wavelengh value o be used in calculaing and displaying he periodogram and specral densiy. The maximum value possible is N, he sample size. Repor Opions Precision Specify he precision of numbers in he repor. Single precision will display seven-place accuracy, while he double precision will display hireen-place accuracy. Noe ha all repors are formaed for single precision only. Variable Names Specify wheher o use variable names or (he longer) variable labels in repor headings. 468-5 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis Plos Tab This secion conrols he inclusion and he seings of he plos. Selec Plos Daa Plo - Specrum Each of hese opions specifies wheher he indicaed plo is displayed. Clic he plo forma buon o change he plo seings. Horizonal Axis Variable if here are Missing or Filered Values Horizonal Variable This opion conrols he spacing on he horizonal axis when missing or filered values occur. Your choices are Acual Row Number Use he acual row number of each row from he daase along he horizonal axis. Sequence Number Use he sequence (relaive row) number formed by ignoring any missing or filered values. 468-6 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis Example 1 Specral Analysis This secion presens an example of how o do a specral analysis of a ime series. The Spos variable in he Sunspo daase will be used. You may follow along here by maing he appropriae enries or load he compleed emplae Example 1 by clicing on Open Example Templae from he File menu of he Specral Analysis window. 1 Open he Sunspo daase. From he File menu of he NCSS Daa window, selec Open Example Daa. Clic on he file Sunspo.NCSS. Clic Open. Open he Specral Analysis window. Using he Analysis menu or he Procedure Navigaor, find and selec he Specral Analysis procedure. On he menus, selec File, hen New Templae. This will fill he procedure wih he defaul emplae. 3 Specify he variables. On he Specral Analysis window, selec he Variables ab. Double-clic in he Time Series Variable box. This will bring up he variable selecion window. Selec Spos from he lis of variables and hen clic O. 4 Run he procedure. From he Run menu, selec Run Procedure. Alernaively, jus clic he green Run buon. Fourier Plo Secion 468-7 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Specral Analysis This secion displays he periodogram and he specrum plos wih he frequency scale and he wavelengh scale. Remember ha he wavelengh is in erms of he number of observaions. Daa Plo Secion This secion displays a plo of he daa values. 468-8 NCSS, LLC. All Righs Reserved.

NCSS Saisical Sofware Fourier Analysis Secion Specral Analysis Fourier Analysis of SPOTS (0,0,1,1,0) Frequency Wavelengh Period Cosine(a's) Sine(b's) Sprecrum 0.010619 31.5 300767-75.89938-45.8151 3590384 0.764601.777 34968.6-13.48533 137.1568 618775 0.3518584 17.85714 4330590 9.67065-494.497 83749 0.47566 14.70588 3856917 33.71187-473.5963 4333876 0.506549 1.5 481410 98.3864-438.5685.997943E+07.................. This secion shows he values of he various componens of he specral analysis. The numbers in parenheses, (d,d,s,m,t), are defined as follows: d is he regular differencing order. D is he seasonal differencing order. s is he number of seasons (ignored if D is 0). M T is 1 if he mean is subraced, 0 oherwise. is 1 if he rend is subraced, 0 oherwise. Fourier Plo Secion To complee his example, we rerun he analysis wih he minimum wavelengh se o 8 and he maximum wavelengh se o 15. This appears o be porion of he periodogram and specrum ha show he mos promise. Doing his produces he following wavelengh plos. Now we can see he famous sunspo cycle of jus over eleven years. 468-9 NCSS, LLC. All Righs Reserved.