lo spostamento medio media dei dati temporali (osservazioni equidistanti nel tempo) da diversi periodi consecutivi. Chiamato in movimento perché è continuamente ricalcolato come rendono disponibili nuovi dati, si procede facendo cadere il primo valore e aggiungendo il valore più recente. Ad esempio, la media mobile delle vendite di sei mesi può essere calcolata prendendo la media delle vendite da gennaio a giugno, poi la media delle vendite da febbraio a luglio, poi di marzo ad agosto, e così via. Medie mobili (1) ridurre l'effetto delle variazioni temporanee dei dati, (2) migliorare l'adattamento dei dati ad una linea (un processo chiamato smoothing) che mostra l'andamento dati più chiaramente, e (3) evidenziare qualsiasi valore sopra o sotto la tendenza. Se si sta calcolando qualcosa con molto elevata varianza il meglio che si può essere in grado di fare è capire la media mobile. Volevo sapere che cosa la media mobile era dei dati, quindi vorrei avere una migliore comprensione di come stavamo facendo. Quando si sta cercando di capire alcuni numeri che cambiano spesso il meglio che puoi fare è calcolare i media mobile .2.1 modello a media mobile (modelli MA) modelli di serie tempo noti come modelli ARIMA possono includere termini autoregressivi eo movimento termini medi. In settimana 1, abbiamo imparato un termine autoregressivo in un modello di serie temporale per la variabile x t è un valore ritardato di x t. Per esempio, un ritardo 1 termine autoregressivo è x t-1 (moltiplicato per un coefficiente). Questa lezione definisce lo spostamento termini medi. Un termine media mobile in un modello di serie storica è un errore di passato (moltiplicata per un coefficiente). Sia (wt Overset N (0, sigma2w)), il che significa che la w t sono identicamente, indipendentemente distribuite, ciascuna con una distribuzione normale con media 0 e la stessa varianza. Il modello a media mobile 1 ° ordine, indicato con MA (1) è (xt mu peso theta1w) L'ordine di 2 ° modello a media mobile, indicato con MA (2) è (mu XT peso theta1w theta2w) La q ° ordine modello a media mobile , indicato con MA (q) è (MU XT WT theta1w theta2w punti thetaqw) Nota. Molti libri di testo e programmi software definiscono il modello con segni negativi prima dei termini. Ciò non modificare le proprietà teoriche generali del modello, anche se non capovolgere i segni algebrici di valori dei coefficienti stimati ei termini (unsquared) nelle formule per ACFS e varianze. È necessario controllare il software per verificare se vi siano segni negativi o positivi sono stati utilizzati al fine di scrivere correttamente il modello stimato. R utilizza segnali positivi nel suo modello di base, come facciamo qui. Proprietà teoriche di una serie storica con un MA (1) Modello nota che l'unico valore diverso da zero nella ACF teorico è di lag 1. Tutti gli altri autocorrelazioni sono 0. Quindi un ACF campione con un autocorrelazione significativa solo in ritardo 1 è un indicatore di un possibile MA (1) modello. Per gli studenti interessati, prove di queste proprietà sono in appendice a questo volantino. Esempio 1 Supponiamo che un MA (1) modello è x t 10 w t 0,7 w t-1. dove (WT overset N (0,1)). Così il coefficiente 1 0.7. L'ACF teorica è data da una trama di questa ACF segue. La trama appena mostrato è l'ACF teorico per un MA (1) con 1 0.7. In pratica, un campione abituato di solito forniscono un modello così chiara. Utilizzando R, abbiamo simulato n 100 valori di esempio utilizzando il modello x t 10 w t 0,7 w t-1 dove w t IID N (0,1). Per questa simulazione, un appezzamento serie storica dei dati di esempio segue. Non possiamo dire molto da questa trama. L'ACF campione per i dati simulati segue. Vediamo un picco in ritardo 1 seguito da valori generalmente non significativi per ritardi passato 1. Si noti che il campione ACF non corrisponde al modello teorico della MA sottostante (1), vale a dire che tutte le autocorrelazioni per i ritardi del passato 1 saranno 0 . un campione diverso avrebbe un po 'diverso ACF esempio riportato di seguito, ma probabilmente hanno le stesse caratteristiche generali. Theroretical proprietà di una serie storica con un modello MA (2) Per la (2) il modello MA, proprietà teoriche sono i seguenti: Si noti che gli unici valori diversi da zero nel ACF teorica sono per ritardi 1 e 2. Autocorrelazioni per ritardi superiori sono 0 . Così, un ACF campione con autocorrelazioni significativi a ritardi 1 e 2, ma autocorrelazioni non significative per ritardi più elevato indica una possibile mA (2) modello. iid N (0,1). I coefficienti sono 1 0,5 e 2 0.3. Poiché si tratta di un MA (2), l'ACF teorica avrà valori diversi da zero solo in caso di ritardi 1 e 2. I valori delle due autocorrelazioni diversi da zero sono un grafico della ACF teorica segue. è come quasi sempre accade, i dati di esempio solito si comportano abbastanza così perfettamente come teoria. Abbiamo simulato n 150 valori di esempio per il modello x t 10 w t 0,5 w t-1 .3 w t-2. dove w t iid N (0,1). La trama serie storica dei dati segue. Come con la trama serie per la MA (1) i dati di esempio, non puoi dire molto da esso. L'ACF campione per i dati simulati segue. Il modello è tipico per le situazioni in cui un modello MA (2) può essere utile. Ci sono due picchi statisticamente significative a ritardi 1 e 2 seguiti da valori non significativi per altri ritardi. Si noti che a causa di errore di campionamento, l'ACF campione non corrisponde al modello teorico esattamente. ACF per General MA (q) Models Una proprietà di modelli MA (q), in generale, è che ci sono autocorrelazioni diversi da zero per i primi ritardi Q e autocorrelazioni 0 per tutti i GAL gt q. Non unicità di collegamento tra i valori di 1 e (rho1) in MA (1) Modello. Nella (1) Modello MA, per qualsiasi valore di 1. il reciproco 1 1 dà lo stesso valore per esempio, utilizzare 0,5 per 1. e quindi utilizzare 1 (0,5) 2 per 1. Youll ottenere (rho1) 0,4 in entrambi i casi. Per soddisfare una limitazione teorica chiamato invertibilità. abbiamo limitare MA (1) modelli di avere valori con valore assoluto inferiore 1. Nell'esempio appena dato, 1 0.5 sarà un valore di parametro ammissibile, che non sarà 1 10.5 2. Invertibilità dei modelli MA Un modello MA si dice che sia invertibile se è algebricamente equivalente a un modello AR ordine infinito convergenti. Facendo convergere, si intende che i coefficienti AR diminuiscono a 0 mentre ci muoviamo indietro nel tempo. Invertibilità è una limitazione programmata nel software di serie storiche utilizzate per stimare i coefficienti dei modelli con i termini MA. La sua non è una cosa che controlliamo per l'analisi dei dati. Ulteriori informazioni sul restrizione invertibilit'a per MA (1) modelli è riportato in appendice. Avanzate teoria Note. Per un modello MA (q) con un determinato ACF, vi è un solo modello invertibile. La condizione necessaria per invertibilità è che i coefficienti hanno valori tali che l'equazione 1- 1 y-. - Q q y 0 ha soluzioni per y che non rientrano nel cerchio unitario. R Codice per gli esempi in Esempio 1, abbiamo tracciato l'ACF teorica del modello x t 10 w t. 7W t-1. e poi simulato n 150 valori di questo modello e tracciato le serie temporali del campione e l'ACF campione per i dati simulati. I comandi R utilizzati per tracciare la ACF teoriche sono state: acfma1ARMAacf (Mac (0,7), lag. max10) 10 ritardi di ACF per MA (1) con theta1 0,7 lags0: 10 crea una variabile denominata ritardi che va da 0 a 10. trama (ritardi, acfma1, xlimc (1,10), ylabr, typeh, principale ACF per MA (1) con theta1 0,7) abline (H0) aggiunge un asse orizzontale per la trama il primo comando determina l'ACF e lo memorizza in un oggetto chiamato acfma1 (la nostra scelta del nome). Il comando plot (il 3 ° comando) trame in ritardo rispetto ai valori ACF per ritardi da 1 a 10. Il parametro ylab Contrassegni l'asse Y e il parametro principale mette un titolo sul terreno. Per visualizzare i valori numerici della ACF è sufficiente utilizzare il comando acfma1. La simulazione e le trame sono state fatte con i seguenti comandi. xcarima. sim (N150, elenco (Mac (0,7))) Simula n 150 valori da MA (1) xxc10 aggiunge 10 per rendere medi default 10. simulazione a significare 0. plot (x, TypeB, mainSimulated MA (1) i dati) ACF (x, xlimc (1,10), mainACF per dati campione simulati) nell'Esempio 2, abbiamo tracciato l'ACF teorica del modello xt 10 wt .5 w t-1 .3 w t-2. e poi simulato n 150 valori di questo modello e tracciato le serie temporali del campione e l'ACF campione per i dati simulati. I comandi R utilizzati sono stati acfma2ARMAacf (Mac (0.5,0.3), lag. max10) acfma2 lags0: 10 plot (ritardi, acfma2, xlimc (1,10), ylabr, typeh, principale ACF per MA (2) con theta1 0.5, theta20.3) abline (H0) xcarima. sim (N150, l'elenco (Mac (0,5, 0,3))) xxc10 plot (x, TypeB, principale simulato MA (2) Serie) ACF (x, xlimc (1,10), mainACF per simulato MA (2) dati) Appendice: prova di proprietà di MA (1) per gli studenti interessati, qui ci sono prove per le proprietà teoriche del (1) modello MA. Varianza: (testo (xt) testo (mu peso theta1 w) 0 di testo (in peso) di testo (theta1w) sigma2w theta21sigma2w (1theta21) sigma2w) Quando h 1, l'espressione precedente 1 w 2. Per ogni h 2, l'espressione precedente 0 . il motivo è che, per definizione di indipendenza della wt. E (w k w j) 0 per ogni k j. Inoltre, perché la w t hanno media 0, E (w j w j) E (w j 2) w 2. Per una serie temporale, applicare questo risultato per ottenere l'ACF cui sopra. Un modello MA invertibile è uno che può essere scritta come modello AR ordine infinito che converge in modo che i coefficienti AR convergono a 0, mentre ci muoviamo infinitamente indietro nel tempo. Bene dimostrare invertibilità per la (1) Modello MA. Abbiamo poi sostituto relazione (2) per w t-1 nell'equazione (1) (3) (ZT WT theta1 (z - theta1w) peso theta1z - theta2w) Al tempo t-2. l'equazione (2) diventa Abbiamo poi rapporto sostituto (4) per w t-2 nell'equazione (3) (ZT peso theta1 z - theta21w WT theta1z - theta21 (z - theta1w) WT theta1z - theta12z theta31w) Se dovessimo continuare a ( infinitamente), otterremmo il modello AR ordine infinito (ZT peso theta1 z - theta21z theta31z - theta41z punti) Nota però, che se 1 1, i coefficienti moltiplicando i ritardi di z aumenterà (infinitamente) in termini di dimensioni, come ci muoviamo nel tempo. Per evitare questo, abbiamo bisogno di 1 LT1. Questa è la condizione per un MA (1) Modello invertibile. Infinite Modello di ordine MA In settimana 3, e vedere che un AR (1) modello può essere convertito in un modello di ordine MA infinite: (xt - mu peso phi1w phi21w punti phik1 w punti riassumono phij1w) Questa somma dei termini di rumore bianco del passato è conosciuto come la rappresentazione causale di un AR (1). In altre parole, x t è un tipo speciale di MA con un numero infinito di termini che vanno indietro nel tempo. Questo è chiamato un ordine infinito MA o MA (). Un ordine MA finito è un AR ordine infinito ed ogni AR ordine finito è un ordine MA infinita. Ricordiamo a settimana 1, abbiamo notato che un requisito per un AR fisso (1) è che 1 LT1. Consente di calcolare il Var (x t) utilizzando la rappresentazione causale. Questo ultimo passo utilizza un fatto di base sulla serie geometrica che richiede (phi1lt1) altrimenti i diverge serie. NavigationStructural Equazione Modellazione Un concettuale Panoramica Modellazione di Equazioni Strutturali è un molto generale molto potente tecnica di analisi, multivariata che include versioni specializzate di un certo numero di altri metodi di analisi come casi particolari. Si suppone che si ha familiarità con la logica di base del ragionamento statistico, come descritto nella Concetti elementari. Inoltre, ci sarà anche per scontato che si ha familiarità con i concetti di varianza, covarianza e correlazione, se non, vi consigliamo di leggere la sezione statistiche di base, a questo punto. Anche se non è assolutamente necessario, è altamente auspicabile che avete qualche esperienza in analisi fattoriale prima di utilizzare la modellazione strutturale. Le principali applicazioni dei modelli di equazioni strutturali includono: modellazione causale. o percorso di analisi. che ipotizza relazioni causali tra le variabili e le prove dei modelli causali con un sistema di equazioni lineari. modelli causali possono coinvolgere sia variabili manifeste, variabili latenti, o entrambi conferma l'analisi fattoriale. un'estensione dell'analisi fattoriale in cui specifiche ipotesi circa la struttura del fattore carichi e intercorrelazioni sono testati secondo analisi fattoriale ordine. una variazione di analisi fattoriale in cui la matrice di correlazione dei fattori comuni è esso stesso fattore analizzato per fornire secondo ordine fattori modelli di regressione. un'estensione di analisi di regressione lineare in cui possono essere vincolati pesi regressione essere uguali tra loro, o modelli di struttura di covarianza valori numerici specificati. che ipotizzare che una matrice di covarianza ha una forma particolare. Ad esempio, è possibile verificare l'ipotesi che un insieme di variabili hanno tutte le varianze uguali con questa procedura modelli di struttura di correlazione. che ipotizzare che una matrice di correlazione ha una forma particolare. Un esempio classico è l'ipotesi che la matrice di correlazione ha la struttura di un circomplesso (Guttman 1954 Wiggins, Steiger, Gaelick, 1981). Molti diversi tipi di modelli rientrano in ciascuna delle categorie di cui sopra, in modo modellazione strutturale come un'impresa è molto difficile da caratterizzare. La maggior parte dei modelli di equazioni strutturali possono essere espresse come diagrammi di flusso. Di conseguenza, anche ai principianti di modellazione strutturale in grado di eseguire analisi complesse con un minimo di allenamento. L'idea alla base modellazione strutturale Una delle idee fondamentali insegnati in intermedi corsi di Statistica Applicata è l'effetto di additivo e le trasformazioni moltiplicativi su un elenco di numeri. Agli studenti viene insegnato che, se si moltiplica ogni numero in un elenco da qualche costante K, si moltiplica la media dei numeri di K. Allo stesso modo, si moltiplica la deviazione standard per il valore assoluto di K. Per esempio, si supponga di avere la lista dei numeri 1,2,3. Questi numeri hanno una media di 2 e una deviazione standard di 1. Ora, supponiamo che si dovesse prendere questi 3 numeri e moltiplicare per 4. Quindi la media diverrebbe 8, e la deviazione standard diventerebbero 4, la varianza in tal modo 16. il punto è, se si dispone di un insieme di numeri X relativi a un'altra serie di numeri Y dall'equazione Y 4X, allora la varianza di Y deve essere di 16 volte superiore a quello di X, in modo da poter verificare l'ipotesi che Y e X sono connessi dall'equazione Y 4X indirettamente confrontando le varianze delle variabili X e Y. Questa idea generalizza, in vari modi, a diverse variabili interconnesse da un gruppo di equazioni lineari. Le regole diventano più complessi, i calcoli più difficile, ma il messaggio di base rimane la stessa - è possibile verificare se le variabili sono interconnessi attraverso una serie di relazioni lineari esaminando le varianze e covarianze delle variabili. Gli statistici hanno sviluppato procedure per verificare se un insieme di varianze e covarianze in una matrice di covarianza si inserisce una struttura specificata. Il modo in cui funziona la modellazione strutturale è il seguente: Lei afferma il modo in cui si crede le variabili sono collegati tra loro, spesso con l'uso di un diagramma di percorso. Si lavora, attraverso alcune regole interne complesse, quali sono le implicazioni di questo sono per le varianze e covarianze delle variabili. È verificare se le varianze e covarianze si adattano questo modello di loro. Sono riportati i risultati del test statistico, ma anche stime dei parametri e degli errori standard per i coefficienti numerici nelle equazioni lineari. Sulla base di queste informazioni, si decide se il modello sembra una buona misura ai vostri dati. Ci sono alcuni punti importanti logici, e molto semplici da ricordare su questo processo. In primo luogo, anche se la macchina matematica necessaria per eseguire equazioni strutturali modellazione è estremamente complicata, la logica di base è incorporata nei suddetti 5 passi. Di seguito, il processo di diagramma. In secondo luogo, dobbiamo ricordare che non è ragionevole aspettarsi un modello strutturale per adattarsi perfettamente per una serie di motivi. Un modello strutturale con relazioni lineari è solo un'approssimazione. Il mondo è improbabile che sia lineare. Infatti, i veri rapporti tra variabili sono probabilmente non lineare. Inoltre, molte delle ipotesi statistiche sono alquanto discutibile pure. La vera questione non è tanto, fa il modello si adatta perfettamente, ma piuttosto, si adatta bene abbastanza bene per essere una utile approssimazione alla realtà, e una spiegazione ragionevole delle tendenze nel nostro terzo di dati, dobbiamo ricordare che semplicemente perché un modello si adatta il pozzo di dati non significa che il modello è necessariamente corretto. Non si può dimostrare che un modello è vero per affermare questa è la fallacia di affermare il conseguente. Ad esempio, potremmo dire se Joe è un gatto, Joe ha i capelli. Tuttavia, Joe ha i capelli non implica Joe è un gatto. Allo stesso modo, si può dire che se un certo modello causale è vero, si adatta ai dati. Tuttavia, il modello di montaggio dei dati non implica necessariamente il modello è quello corretto. Ci può essere un altro modello che si adatta ai dati ugualmente bene. Modellazione di Equazioni Strutturali e gli schemi Path diagramma di percorso giocano un ruolo fondamentale nella modellazione strutturale. diagrammi percorso sono come diagrammi di flusso. Essi mostrano variabili interconnesse con linee che vengono utilizzati per indicare flusso causale. Si può pensare ad un diagramma di percorso come un dispositivo per la mostra quali variabili causano cambiamenti nelle altre variabili. Tuttavia, diagrammi di flusso non devono essere considerati strettamente in questo modo. Possono anche essere dato un ristretto interpretazione più specifica. Si consideri l'equazione di regressione lineare classico Tale equazione può essere rappresentato in un diagramma percorso come segue: Tali schemi di stabilire un semplice isomorfismo. Tutte le variabili del sistema di equazioni vengono inseriti nello schema, sia in scatole o ovali. Ogni equazione è rappresentato nel diagramma come segue: tutte le variabili indipendenti (le variabili sul lato destro di un'equazione) hanno frecce che indicano la variabile dipendente. Il coefficiente di ponderazione è posto sopra la freccia. Il diagramma mostra un semplice sistema di equazioni lineari e la sua rappresentazione diagramma del percorso. Si noti che, oltre a rappresentare i rapporti equazione lineare con le frecce, i diagrammi contengono anche alcuni aspetti aggiuntivi. In primo luogo, le varianze delle variabili indipendenti, che dobbiamo sapere, al fine di testare il modello di relazioni strutturali, sono mostrati i diagrammi utilizzando linee curve, senza punte di freccia allegati. Ci riferiamo a tali linee come fili. In secondo luogo, alcune variabili sono rappresentate in ovali, altri in scatole rettangolari. variabili manifeste vengono sistemati in scatole nel diagramma del percorso. variabili latenti sono collocati in un ovale o un cerchio. Ad esempio, la variabile E nel diagramma sopra può essere pensato come una regressione lineare residua quando Y è previsto da X. Tale residuo non è osservata direttamente, ma calcolata da Y e X, in modo da trattare come variabile latente e posizionarlo in un ovale. L'esempio discusso sopra è estremamente semplice. In generale, siamo interessati a testare modelli che sono molto più complicato di questi. Mentre i sistemi di equazioni esaminiamo sempre più complicata, così fanno le strutture di covarianza essi implicano. In definitiva, la complessità può diventare così sconcertante che perdiamo di vista di alcuni principi basilari. Per prima cosa il treno di ragionamento che supporta modelli causali di test con i test equazioni strutturali lineari ha diversi punti deboli. Le variabili possono essere non-lineare. Essi possono essere correlata linearmente per motivi estranei a ciò che comunemente consideriamo causalità. L'antico adagio, correlazione non è causalità rimane vero, anche se la correlazione è complessa e multivariata. Quali modelli causali fa ci permettono di fare è esaminare la misura in cui i dati non riescono a concordare con una conseguenza ragionevolmente praticabile di un modello di causalità. Se il sistema di equazioni lineari isomorfo al diagramma del percorso si adatta bene ai dati, è incoraggiante, ma difficilmente la prova della verità del modello causale. Sebbene diagrammi di flusso possono essere utilizzati per rappresentare flusso causale in un sistema di variabili, non dovrebbero significare un tale flusso causale. Tali schemi possono essere visti come semplicemente una rappresentazione isomorfa di un sistema di equazioni lineari. Come tali, essi possono trasmettere relazioni lineari quando non relazioni causali sono assunti. Quindi, anche se si potrebbe interpretare lo schema nella figura sopra nel senso che X causa Y, il diagramma può anche essere interpretato come una rappresentazione visiva della relazione regressione lineare tra X e Y. Questa argomento utile feedback esposti. SurvivalFailure informazioni in tempo Analisi generale Queste tecniche sono state sviluppate principalmente nel campo delle scienze mediche e biologiche, ma sono anche ampiamente usati nelle scienze sociali ed economiche, così come in ingegneria (affidabilità e l'analisi in tempo guasti). Immaginate di essere un ricercatore in un ospedale che sta studiando l'efficacia di un nuovo trattamento per una malattia generalmente terminale. Il principale variabile di interesse è il numero di giorni che i rispettivi pazienti sopravvivono. In linea di principio, si potrebbe utilizzare le statistiche parametrici e non parametrici standard per descrivere la sopravvivenza media, e per confrontare il nuovo trattamento con i metodi tradizionali (Vedi le statistiche di base e Nonparametrics e Distribuzione Fitting). Tuttavia, al termine dello studio ci sarà pazienti sopravvissuti per tutto il periodo di studio, in particolare tra i pazienti che sono entrati in ospedale (e il progetto di ricerca) ritardo nello studio ci saranno altri pazienti con cui avremo perso contatto. Sicuramente, non si vorrebbe escludere tutti quei pazienti dello studio dichiarandoli da dati mancanti (poiché la maggior parte di loro sono sopravvissuti e, quindi, riflettono sul successo del nuovo metodo di trattamento). Tali osservazioni, che contengono solo informazioni parziali sono chiamati osservazioni censurate (ad esempio paziente Un sopravvissuti almeno 4 mesi prima che si allontanò e abbiamo perso il contatto il termine censura è stata la prima volta da Hald, 1949). Osservazioni censurato in, osservazioni generali censurate sorgono quando la variabile dipendente di interesse rappresenta il tempo di un evento terminale, e la durata dello studio è limitato nel tempo. osservazioni censurate possono verificarsi in diverse aree di ricerca. Ad esempio, nelle scienze sociali possiamo studiare la sopravvivenza dei matrimoni, delle scuole superiori tassi di abbandono (tempo di drop-out), il fatturato nelle organizzazioni, ecc In ogni caso, entro la fine del periodo di studio, alcuni soggetti sarà ancora essere sposati, non hanno abbandonato, o stanno ancora lavorando presso la stessa azienda in tal modo, i soggetti rappresentano censurati osservazioni. In economia si può studiare la sopravvivenza delle nuove imprese o dei tempi di sopravvivenza di prodotti come le automobili. Nella ricerca di controllo della qualità, è pratica comune per studiare la sopravvivenza delle parti sotto stress (analisi tempo di guasto). Tecniche analitiche In sostanza, i metodi offerti in Analisi di sopravvivenza affrontano le stesse domande di ricerca, come molte delle altre procedure tuttavia, tutti i metodi di analisi di sopravvivenza Tratteremo censurati dati. La tabella di vita, la distribuzione di sopravvivenza. e Kaplan-Meier stima funzione di sopravvivenza sono tutti i metodi descrittivi per stimare la distribuzione dei tempi di sopravvivenza da un campione. Diverse tecniche sono disponibili per confrontare la sopravvivenza in due o più gruppi. Infine, l'analisi di sopravvivenza offre diversi modelli di regressione per stimare il rapporto di (multipla) variabili continue a tempi di sopravvivenza. La vita di analisi tabelle Il modo più semplice per descrivere la sopravvivenza in un campione è quello di calcolare la tavola di mortalità. La tecnica tavolo vita è uno dei metodi più antichi per l'analisi di sopravvivenza (tempo di fallimento) dei dati (ad esempio vedi Berkson Gage 1950 Cutler Ederer 1958 Gehan, 1969). Questa tabella può essere pensato come una tabella di distribuzione di frequenza maggiore. La distribuzione dei tempi di sopravvivenza è suddiviso in un certo numero di intervalli. Per ogni intervallo possiamo quindi calcolare il numero e la proporzione di casi o oggetti che è entrato nel rispettivo intervallo di vivo, il numero e la proporzione di casi che fallì nel rispettivo intervallo (cioè il numero di eventi terminali, o il numero di casi che morto), e il numero di casi che sono stati persi o censurati nella rispettiva dell'intervallo. Sulla base di questi numeri e proporzioni, diverse statistiche aggiuntive possono essere calcolate: numero di casi a rischio. Questo è il numero di casi che sono entrate rispettivo intervallo di vivo, meno della metà del numero di casi persi o troncati in rispettivi intervalli. Proporzione mancanza. Questa percentuale è calcolata come il rapporto tra il numero di casi fallimento nel rispettivo intervallo, diviso per il numero di casi a rischio nell'intervallo. Proporzione Sopravvivere. Questa percentuale è calcolata come 1 meno la proporzione fallendo. Percentuale cumulativa Surviving (sopravvivenza Function). Questa è la proporzione cumulativa di casi sopravvissuti fino al rispettivo intervallo. Poiché le probabilità di sopravvivenza sono assunti essere indipendenti attraverso gli intervalli, questa probabilità è calcolata moltiplicando le probabilità di sopravvivenza in tutti gli intervalli precedenti. La funzione risultante è chiamata anche la sopravvivenza o la funzione di sopravvivenza. Densità di probabilità. Questa è la probabilità stimata di guasto nel rispettivo intervallo, calcolato per unità di tempo, cioè: In questa formula, F i è la rispettiva densità di probabilità nell'intervallo esimo, P i è la proporzione cumulativa stimata superstite all'inizio della intervallo esimo (alla fine dell'intervallo i-1), P i1 è la proporzione cumulativa sopravvissuto alla fine dell'intervallo esimo e hi è la larghezza del rispettivo intervallo. Hazard Rate. Il tasso di pericolo (il termine fu usato da Barlow, 1963) è definita come la probabilità per unità di tempo che un caso che è sopravvissuto all'inizio del rispettivo intervallo di fallirà in quell'intervallo. In particolare, viene calcolato il numero di guasti per unità di tempo nel rispettivo intervallo, diviso per il numero medio di casi sopravvissuti al punto medio dell'intervallo. Mediana tempo di sopravvivenza. Questo è il tempo di sopravvivenza in cui la funzione di sopravvivenza cumulativa è pari a 0,5. Altri percentile (25 ° e 75 ° percentile) della funzione di sopravvivenza cumulativa possono essere calcolate di conseguenza. Si noti che il 50 ° percentile (mediana) per la funzione di sopravvivenza cumulativa di solito non è lo stesso del punto nel tempo fino al quale 50 del campione sopravvissuto. (Questo sarebbe solo il caso se non ci sono stati censurati osservazioni prima di questa volta). Misure Campione richiesto. Al fine di giungere a stime attendibili delle tre funzioni principali (sopravvivenza, di densità di probabilità, e di pericolo) e le loro errori standard ad ogni intervallo di tempo la dimensione minima del campione consigliata è 30 Distribution Fitting Introduzione generale. In sintesi, la tabella vita ci dà una buona indicazione della distribuzione dei guasti nel tempo. Tuttavia, a fini predittivi è spesso desiderabile per comprendere la forma della funzione di sopravvivenza sottostante nella popolazione. Le principali distribuzioni che sono state proposte per la modellazione di tempi di sopravvivenza o di fallimento sono la (esponenziale e lineare) distribuzione esponenziale, la distribuzione di Weibull di eventi estremi, e la distribuzione Gompertz. Stima. La procedura di stima dei parametri (per la stima dei parametri delle funzioni di sopravvivenza teoriche) è essenzialmente un algoritmo di regressione ai minimi quadrati lineare (cfr Gehan Siddiqui, 1973). Un algoritmo di regressione lineare può essere utilizzato perché tutti i quattro distribuzioni teoriche possono essere effettuate lineare da trasformazioni appropriate. Tali trasformazioni volte producono varianze diverse per i residui in tempi diversi, portando a stime distorte. La bontà di adattamento. Dati i parametri per le diverse funzioni di distribuzione e il rispettivo modello, possiamo calcolare la probabilità dei dati. Si può anche calcolare la probabilità dei dati sotto il modello nullo, cioè, un modello che permette differenti tassi di rischio in ciascun intervallo. Senza entrare nei dettagli, questi due verosimiglianze possono essere confrontati attraverso un incrementale statistica test chi-quadrato. Se questa Chi-quadrato è statisticamente significativa, allora possiamo concludere che la rispettiva distribuzione teorica si adatta ai dati significativamente peggiore rispetto al modello nullo Cioè, noi rifiutiamo la rispettiva distribuzione come modello per i nostri dati. Terreni. È possibile produrre trame della funzione di sopravvivenza, di rischio, e la densità di probabilità per i dati osservati e le rispettive distribuzioni teoriche. Questi grafici forniscono un rapido controllo visivo della bontà dell'adattamento-della distribuzione teorica. La trama esempio seguente mostra una funzione di sopravvivenza osservata e la distribuzione di Weibull montato. In particolare, le tre linee in questa trama indicano le distribuzioni teoriche che hanno portato da tre diverse procedure di stima (minimi quadrati e due metodi di minimi quadrati ponderati). Kaplan-Meier prodotto-Limit Estimator Invece di classificare i tempi di sopravvivenza osservati in una tabella di vita, siamo in grado di stimare la funzione di sopravvivenza direttamente dai tempi di sopravvivenza o il fallimento continuo. Intuitivamente, immaginiamo che creiamo una tabella di vita in modo che ogni intervallo di tempo contiene esattamente un caso. Moltiplicando le probabilità di sopravvivenza di tutti gli intervalli (cioè per ogni singola osservazione) otterremmo per la funzione di sopravvivenza: In questa equazione, S (t) è la funzione di sopravvivenza stimata, n è il numero totale dei casi, e denota la moltiplicazione ( geometrico sum) in tutti i casi inferiori o uguali a t (j) è una costante che è o 1 se il j-esimo caso è incensurato (completo), e 0 se è censurato. Questa stima della funzione di sopravvivenza è chiamato anche il prodotto-limite stimatore. e per la prima volta proposta da Kaplan e Meier (1958). Una trama esempio di questa funzione è mostrato sotto. Il vantaggio del metodo prodotto-Limit Kaplan-Meier rispetto al metodo tavolo vita per l'analisi dei dati di sopravvivenza e fallimento volta è che le stime risultanti non dipendono il raggruppamento dei dati (in un certo numero di intervalli di tempo). In realtà, il metodo prodotto-Limit e il metodo della tabella vita sono identici se gli intervalli della tabella vita contengono al massimo una osservazione. Confrontando i campioni Introduzione generale. Si può confrontare i tempi di sopravvivenza o il fallimento in due o più campioni. In linea di principio, perché i tempi di sopravvivenza non sono distribuiti normalmente, test non parametrici che si basano su l'ordinamento rango di tempi di sopravvivenza devono essere applicate. Una vasta gamma di test non parametrici può essere usato per comparare tempi di sopravvivenza Tuttavia, le prove non possono gestire osservazioni censurate. Test disponibili. I seguenti cinque diverse (per lo più non parametrici) test per dati censurati sono disponibili: Gehans generalizzati test di Wilcoxon, il test di Cox-Mantel, il test Coxs F. il log-rank test, e Peto e Petos generalizzato test di Wilcoxon. Un test non parametrico per il confronto di più gruppi è inoltre disponibile. La maggior parte di questi test sono accompagnati da opportuni z - valori (valori della distribuzione normale standard) questi z - Valori possono essere utilizzati per verificare la significatività statistica delle eventuali differenze tra i gruppi. Tuttavia, si noti che la maggior parte di questi test si produrrà risultati affidabili con abbastanza grandi campioni dimensioni il piccolo comportamento campione viene meno ben compreso. La scelta di un test due campioni. Non ci sono linee guida largamente accettate in materia, che prova da utilizzare in una situazione particolare. Test Coxs F tende ad essere più potente di Gehans generalizzato test di Wilcoxon quando: Le dimensioni dei campioni sono di piccole dimensioni (cioè n per gruppo a meno di 50) Se i campioni provengono da un esponenziale o Weibull Se non ci sono osservazioni censurate (vedi Gehan Thomas, 1969). Lee, Desu, e Gehan (1975) di prova rispetto Gehans di diverse alternative e ha dimostrato che il test di Cox-Mantel e il log-rank test sono più potenti (a prescindere dalla censura) quando i campioni sono tratti da una popolazione che segue un esponenziale o distribuzione di Weibull in queste condizioni c'è poca differenza tra il test di Cox-Mantel e il log-rank test. Lee (1980) discute il potere di prove differenti in maggior dettaglio. Prova campione multiplo. C'è un test a risposta multipla di esempio che è un'estensione (o generalizzazione) del Gehans generalizzati test di Wilcoxon test di Wilcoxon, Peto e Petos generalizzati, e il log-rank test. In primo luogo, un punteggio viene assegnato a ogni tempo di sopravvivenza usando Mantels procedura (Mantel, 1967) accanto un valore chi-quadro è calcolata sulla base delle somme (per ogni gruppo) di questo punteggio. Se vengono specificati solo due gruppi, questo test è equivalente al test di Wilcoxon Gehans generalizzata, ei calcoli imposterà che prova in questo caso. Criteri di proporzionalità di Censored dati. Quando si confrontano due o più gruppi, è molto importante esaminare il numero di osservazioni censurate in ciascun gruppo. Particolarmente nella ricerca medica, censurare può essere il risultato di, per esempio, l'applicazione di trattamenti diversi: pazienti che ricevono meglio più veloce o peggiorano come il risultato di un trattamento può essere più probabilità di abbandono dello studio, con conseguente numeri diversi di censurato osservazioni in ciascun gruppo. Tale censura sistematica può notevolmente Bias dei risultati del confronto. I modelli di regressione generale Introduzione Una domanda di ricerca comune in campo medico, biologico, o ingegneria (tempo di guasto) ricerca è quello di determinare se certe variabili (indipendenti) continui sono correlati con i tempi di sopravvivenza o il fallimento. Ci sono due ragioni principali per cui questo tema di ricerca non può essere affrontata attraverso molteplici tecniche di regressione semplici (come disponibile in regressione multipla): In primo luogo, la variabile dipendente di interesse (tempo survivalfailure) è più probabile che normalmente non distribuito - una grave violazione di un presupposto per i minimi quadrati ordinari di regressione multipla. I tempi di sopravvivenza di solito seguono una distribuzione esponenziale o Weibull. In secondo luogo, c'è il problema della censura. cioè, alcune osservazioni saranno incompleti. Coxs proporzionale Hazard Modello Il modello di rischio proporzionale è la più generale dei modelli di regressione, perché non si basa su alcuna ipotesi circa la natura o la forma della distribuzione di sopravvivenza sottostante. Il modello assume che il tasso di rischio sottostante (piuttosto che il tempo di sopravvivenza) è una funzione delle variabili indipendenti (covariate) non le assunzioni sono fatte sulla natura o la forma della funzione di rischio. Così, in un certo senso, modello di regressione Coxs può essere considerato un metodo non parametrico. Il modello può essere scritto come: dove h (. T) indica il pericolo risultante, dati i valori delle m covariate per il caso corrispondente e il rispettivo tempo di sopravvivenza (t) (z 1 z 2 z m..). Il termine h 0 (t) è detta rischio di base è il pericolo per il rispettivo specifico quando tutti i valori delle variabili indipendenti sono uguali a zero. Possiamo linearizzare questo modello dividendo entrambi i lati dell'equazione da h 0 (t) e poi con il logaritmo naturale di entrambi i lati: Ora abbiamo un modello lineare piuttosto semplice che può essere facilmente stimato. Assunzioni. Anche se non le assunzioni sono fatte circa la forma della funzione di rischio sottostante, le equazioni del modello sopra riportati implicano due ipotesi. In primo luogo, essi specificano un rapporto moltiplicativo tra la funzione di rischio sottostante e la funzione di log-lineare delle covariate. Questa ipotesi è anche chiamato la proporzionalità ipotesi. In termini pratici, si presume che, in due osservazioni con valori diversi per le variabili indipendenti, il rapporto delle funzioni di rischio per questi due osservazioni non dipende dal tempo. Il secondo assunto naturalmente, è che esiste una relazione log-lineare tra le variabili indipendenti e la funzione di rischio sottostante. Coxs proporzionale Hazard Modello con covariate dipendenti dal tempo L'assunzione del modello di rischio proporzionale è che la funzione di rischio per un individuo (cioè osservazione nell'analisi) dipende dai valori delle covariate e il valore del rischio di base. Dati due individui con valori particolari per covariate, il rapporto tra i rischi stimati lungo tempo sarà costante - da qui il nome del metodo: il modello di rischio proporzionale. La validità di questa ipotesi può essere spesso discutibile. Ad esempio, l'età è spesso inclusa negli studi di salute fisica. Supponiamo che hai studiato la sopravvivenza dopo l'intervento chirurgico. E 'probabile che l'età è un predittore più importante di rischio immediatamente dopo l'intervento chirurgico, di qualche tempo dopo l'intervento (dopo il recupero iniziale). Nella vita accelerata test a volte si utilizza una covariata di stress (ad esempio quantità di tensione) che viene lentamente aumentata nel corso del tempo fino a quando si verifica un errore (ad esempio, fino a quando l'isolamento elettrico non vedere Lawless, 1982, pag 393). In questo caso, l'impatto del covariate dipende chiaramente tempo. L'utente può specificare espressioni aritmetiche per definire covariate come funzioni di più variabili e il tempo di sopravvivenza. Test della proporzionalità dell'Assunzione. Come indicato dagli esempi precedenti, ci sono molte applicazioni in cui è probabile che l'assunzione proporzionalità non regge. In tal caso, si può definire esplicitamente covariate in funzione del tempo. Ad esempio, l'analisi di un insieme di dati presentato da Pike (1966) consiste di tempi di sopravvivenza per due gruppi di ratti che erano stati esposti a cancerogeno (vedi anche Lawless 1982, pagina 393 per un esempio simile). Supponiamo che z è una variabile di raggruppamento con codici 1 e 0 per indicare se il rispettivo ratto è stato esposto. Si potrebbe quindi montare il modello di rischio proporzionale: Così, in questo modello il pericolo condizionale al tempo t è una funzione di (1) la linea di base di pericolosità h 0. (2) z covariate. e (3) di volte z il logaritmo del tempo. Si noti che la costante 5.4 è qui utilizzato solo per scopi scalatura: la media del logaritmo dei tempi di sopravvivenza in questo insieme di dati è uguale a 5,4. In altre parole, il pericolo condizionale in ogni punto nel tempo è una funzione del tempo covariate e pertanto, l'effetto della covariate sulla sopravvivenza dipende tempo da cui il nome dipendente dal tempo covariata. Questo modello permette di testare specificamente l'assunzione proporzionalità. Se il parametro b 2 è statisticamente significativo (ad esempio se è almeno due volte più grande come il suo errore standard), allora si può concludere che, in effetti, l'effetto della z covariate sulla sopravvivenza dipende da tempo, e, quindi, che la proporzionalità ipotesi non regge. Regressione esponenziale Fondamentalmente, questo modello assume che la distribuzione del tempo di sopravvivenza è esponenziale, e contingente sui valori di un insieme di variabili indipendenti (z i). Il parametro di velocità della distribuzione esponenziale può quindi essere espressa come: S (z) indica i tempi di sopravvivenza, a è una costante, e b i s sono i parametri di regressione. La bontà di adattamento. Il valore di Chi-quadro di bontà di adattamento è calcolato in funzione del log-verosimiglianza per il modello con tutte le stime dei parametri (L 1), e la log-verosimiglianza del modello in cui tutte le covariate sono costretti a 0 (zero L 0). Se questo valore chi-quadro è significativo, rifiutiamo l'ipotesi nulla e supponiamo che le variabili indipendenti sono significativamente correlate a tempi di sopravvivenza. Standard statistica d'ordine esponenziale. Un modo per verificare l'ipotesi exponentiality di questo modello è quello di tracciare i tempi di sopravvivenza residue contro l'ordine esponenziale statistica theta standard. Se l'assunzione exponentiality è soddisfatta, allora tutti i punti in questo diagramma saranno disposti approssimativamente in linea retta. Normale e Log-Normal Regressione In questo modello, si assume che i tempi di sopravvivenza (o log tempi di sopravvivenza) provengono da una distribuzione normale il modello risultante è sostanzialmente identico al modello di regressione multipla ordinaria, e possono essere indicate come: dove t i tempi di sopravvivenza. Per la regressione log-normale, t è sostituito dal suo logaritmo naturale. Il modello di regressione normale è particolarmente utile perché molti insiemi di dati possono essere trasformati per produrre approssimazioni della distribuzione normale. Così, in un certo senso questo è il modello parametrico più generale (al contrario di Coxs modello di rischio proporzionale che è non parametrica), e le stime può essere ottenuto per una varietà di diverse distribuzioni di sopravvivenza sottostanti. La bontà di adattamento. Il valore di chi-quadrato è calcolato in funzione del log-verosimiglianza per il modello con tutte le variabili indipendenti (L1), e la log-verosimiglianza del modello in cui tutte le variabili indipendenti sono costretti a 0 (zero, L0). Stratified Analyses The purpose of a stratified analysis is to test the hypothesis whether identical regression models are appropriate for different groups, that is, whether the relationships between the independent variables and survival are identical in different groups. To perform a stratified analysis, one must first fit the respective regression model separately within each group. The sum of the log-likelihoods from these analyses represents the log-likelihood of the model with different regression coefficients (and intercepts where appropriate) in different groups. The next step is to fit the requested regression model to all data in the usual manner (i. e. ignoring group membership), and compute the log-likelihood for the overall fit. The difference between the log-likelihoods can then be tested for statistical significance (via the Chi-square statistic). Was this topic helpful Feedback Submitted. Text Mining (Big Data, Unstructured Data) Text Mining Introductory Overview The purpose of Text Mining is to process unstructured (textual) information, extract meaningful numeric indices from the text, and, thus, make the information contained in the text accessible to the various data mining (statistical and machine learning) algorithms. Information can be extracted to derive summaries for the words contained in the documents or to compute summaries for the documents based on the words contained in them. Hence, you can analyze words, clusters of words used in documents, etc. or you could analyze documents and determine similarities between them or how they are related to other variables of interest in the data mining project. In the most general terms, text mining will turn text into numbers (meaningful indices), which can then be incorporated in other analyses such as predictive data mining projects, the application of unsupervised learning methods (clustering), etc. These methods are described and discussed in great detail in the comprehensive overview work by Manning and Schtze (2002), and for an in-depth treatment of these and related topics as well as the history of this approach to text mining, we highly recommend that source. Typical Applications for Text Mining Unstructured text is very common, and in fact may represent the majority of information available to a particular research or data mining project. Analyzing open-ended survey responses. In survey research (e. g. marketing), it is not uncommon to include various open-ended questions pertaining to the topic under investigation. The idea is to permit respondents to express their views or opinions without constraining them to particular dimensions or a particular response format. This may yield insights into customers views and opinions that might otherwise not be discovered when relying solely on structured questionnaires designed by experts. For example, you may discover a certain set of words or terms that are commonly used by respondents to describe the pros and cons of a product or service (under investigation), suggesting common misconceptions or confusion regarding the items in the study. Automatic processing of messages, emails, etc. Another common application for text mining is to aid in the automatic classification of texts. For example, it is possible to filter out automatically most undesirable junk email based on certain terms or words that are not likely to appear in legitimate messages, but instead identify undesirable electronic mail. In this manner, such messages can automatically be discarded. Such automatic systems for classifying electronic messages can also be useful in applications where messages need to be routed (automatically) to the most appropriate department or agency e. g. email messages with complaints or petitions to a municipal authority are automatically routed to the appropriate departments at the same time, the emails are screened for inappropriate or obscene messages, which are automatically returned to the sender with a request to remove the offending words or content. Analyzing warranty or insurance claims, diagnostic interviews, etc. In some business domains, the majority of information is collected in open-ended, textual form. For example, warranty claims or initial medical (patient) interviews can be summarized in brief narratives, or when you take your automobile to a service station for repairs, typically, the attendant will write some notes about the problems that you report and what you believe needs to be fixed. Increasingly, those notes are collected electronically, so those types of narratives are readily available for input into text mining algorithms. This information can then be usefully exploited to, for example, identify common clusters of problems and complaints on certain automobiles, etc. Likewise, in the medical field, open-ended descriptions by patients of their own symptoms might yield useful clues for the actual medical diagnosis. Investigating competitors by crawling their web sites. Another type of potentially very useful application is to automatically process the contents of Web pages in a particular domain. For example, you could go to a Web page, and begin crawling the links you find there to process all Web pages that are referenced. In this manner, you could automatically derive a list of terms and documents available at that site, and hence quickly determine the most important terms and features that are described. It is easy to see how these capabilities could efficiently deliver valuable business intelligence about the activities of competitors. Approaches to Text Mining To reiterate, text mining can be summarized as a process of numericizing text. At the simplest level, all words found in the input documents will be indexed and counted in order to compute a table of documents and words, i. e. a matrix of frequencies that enumerates the number of times that each word occurs in each document. This basic process can be further refined to exclude certain common words such as the and a (stop word lists) and to combine different grammatical forms of the same words such as traveling, traveled, travel, etc. (stemming ). However, once a table of (unique) words (terms) by documents has been derived, all standard statistical and data mining techniques can be applied to derive dimensions or clusters of words or documents, or to identify important words or terms that best predict another outcome variable of interest. Using well-tested methods and understanding the results of text mining. Once a data matrix has been computed from the input documents and words found in those documents, various well-known analytic techniques can be used for further processing those data including methods for clustering, factoring, or predictive data mining (see, for example, Manning and Schtze, 2002). Black-box approaches to text mining and extraction of concepts. There are text mining applications which offer black-box methods to extract deep meaning from documents with little human effort (to first read and understand those documents). These text mining applications rely on proprietary algorithms for presumably extracting concepts from text, and may even claim to be able to summarize large numbers of text documents automatically, retaining the core and most important meaning of those documents. While there are numerous algorithmic approaches to extracting meaning from documents, this type of technology is very much still in its infancy, and the aspiration to provide meaningful automated summaries of large numbers of documents may forever remain elusive. We urge skepticism when using such algorithms because 1) if it is not clear to the user how those algorithms work, it cannot possibly be clear how to interpret the results of those algorithms, and 2) the methods used in those programs are not open to scrutiny, for example by the academic community and peer review and, hence, we simply dont know how well they might perform in different domains. As a final thought on this subject, you may consider this concrete example: Try the various automated translation services available via the Web that can translate entire paragraphs of text from one language into another. Then translate some text, even simple text, from your native language to some other language and back, and review the results. Almost every time, the attempt to translate even short sentences to other languages and back while retaining the original meaning of the sentence produces humorous rather than accurate results. This illustrates the difficulty of automatically interpreting the meaning of text. Text mining as document search. There is another type of application that is often described and referred to as text mining - the automatic search of large numbers of documents based on key words or key phrases. This is the domain of, for example, the popular internet search engines that have been developed over the last decade to provide efficient access to Web pages with certain content. While this is obviously an important type of application with many uses in any organization that needs to search very large document repositories based on varying criteria, it is very different from what has been described here. Issues and Considerations for Numericizing Text Large numbers of small documents vs. small numbers of large documents. Examples of scenarios using large numbers of small or moderate sized documents were given earlier (e. g. analyzing warranty or insurance claims, diagnostic interviews, etc.). On the other hand, if your intent is to extract concepts from only a few documents that are very large (e. g. two lengthy books), then statistical analyses are generally less powerful because the number of cases (documents) in this case is very small while the number of variables (extracted words) is very large. Excluding certain characters, short words, numbers, etc. Excluding numbers, certain characters, or sequences of characters, or words that are shorter or longer than a certain number of letters can be done before the indexing of the input documents starts. You may also want to exclude rare words, defined as those that only occur in a small percentage of the processed documents. Include lists, exclude lists (stop-words). Specific list of words to be indexed can be defined this is useful when you want to search explicitly for particular words, and classify the input documents based on the frequencies with which those words occur. Also, stop-words, i. e. terms that are to be excluded from the indexing can be defined. Typically, a default list of English stop words includes the, a, of, since, etc, i. e. words that are used in the respective language very frequently, but communicate very little unique information about the contents of the document. Synonyms and phrases. Synonyms, such as sick or ill, or words that are used in particular phrases where they denote unique meaning can be combined for indexing. For example, Microsoft Windows might be such a phrase, which is a specific reference to the computer operating system, but has nothing to do with the common use of the term Windows as it might, for example, be used in descriptions of home improvement projects. Stemming algorithms. An important pre-processing step before indexing of input documents begins is the stemming of words. The term stemming refers to the reduction of words to their roots so that, for example, different grammatical forms or declinations of verbs are identified and indexed (counted) as the same word. For example, stemming will ensure that both traveling and traveled will be recognized by the text mining program as the same word. Support for different languages. Stemming, synonyms, the letters that are permitted in words, etc. are highly language dependent operations. Therefore, support for different languages is important. Transforming Word Frequencies Once the input documents have been indexed and the initial word frequencies (by document) computed, a number of additional transformations can be performed to summarize and aggregate the information that was extracted. Log-frequencies. First, various transformations of the frequency counts can be performed. The raw word or term frequencies generally reflect on how salient or important a word is in each document. Specifically, words that occur with greater frequency in a document are better descriptors of the contents of that document. However, it is not reasonable to assume that the word counts themselves are proportional to their importance as descriptors of the documents. For example, if a word occurs 1 time in document A, but 3 times in document B, then it is not necessarily reasonable to conclude that this word is 3 times as important a descriptor of document B as compared to document A. Thus, a common transformation of the raw word frequency counts (wf) is to compute: f(wf) 1 log(wf), for wf 0 This transformation will dampen the raw frequencies and how they will affect the results of subsequent computations. Binary frequencies. Likewise, an even simpler transformation can be used that enumerates whether a term is used in a document i. e.: f(wf) 1, for wf 0 The resulting documents-by-words matrix will contain only 1s and 0s to indicate the presence or absence of the respective words. Again, this transformation will dampen the effect of the raw frequency counts on subsequent computations and analyses. Inverse document frequencies. Another issue that you may want to consider more carefully and reflect in the indices used in further analyses are the relative document frequencies (df) of different words. For example, a term such as guess may occur frequently in all documents, while another term such as software may only occur in a few. The reason is that we might make guesses in various contexts, regardless of the specific topic, while software is a more semantically focused term that is only likely to occur in documents that deal with computer software. A common and very useful transformation that reflects both the specificity of words (document frequencies) as well as the overall frequencies of their occurrences (word frequencies) is the so-called inverse document frequency (for the ith word and jth document): In this formula (see also formula 15.5 in Manning and Schtze, 2002), N is the total number of documents, and dfi is the document frequency for the i th word (the number of documents that include this word). Hence, it can be seen that this formula includes both the dampening of the simple word frequencies via the log function (described above), and also includes a weighting factor that evaluates to 0 if the word occurs in all documents (log(NN1)0) . and to the maximum value when a word only occurs in a single document (log(N1)log(N)) . It can easily be seen how this transformation will create indices that both reflect the relative frequencies of occurrences of words, as well as their semantic specificities over the documents included in the analysis. Latent Semantic Indexing via Singular Value Decomposition As described above, the most basic result of the initial indexing of words found in the input documents is a frequency table with simple counts, i. e. the number of times that different words occur in each input document. Usually, we would transform those raw counts to indices that better reflect the (relative) importance of words andor their semantic specificity in the context of the set of input documents (see the discussion of inverse document frequencies, above). A common analytic tool for interpreting the meaning or semantic space described by the words that were extracted, and hence by the documents that were analyzed, is to create a mapping of the word and documents into a common space, computed from the word frequencies or transformed word frequencies (e. g. inverse document frequencies). In general, here is how it works: Suppose you indexed a collection of customer reviews of their new automobiles (e. g. for different makes and models). You may find that every time a review includes the word gas-mileage, it also includes the term economy. Further, when reports include the word reliability they also include the term defects (e. g. make reference to no defects). However, there is no consistent pattern regarding the use of the terms economy and reliability, i. e. some documents include either one or both. In other words, these four words gas-mileage and economy, and reliability and defects, describe two independent dimensions - the first having to do with the overall operating cost of the vehicle, the other with the quality and workmanship. The idea of latent semantic indexing is to identify such underlying dimensions (of meaning), into which the words and documents can be mapped. As a result, we may identify the underlying (latent) themes described or discussed in the input documents, and also identify the documents that mostly deal with economy, reliability, or both. Hence, we want to map the extracted words or terms and input documents into a common latent semantic space. Singular value decomposition. The use of singular value decomposition in order to extract a common space for the variables and cases (observations) is used in various statistical techniques, most notably in Correspondence Analysis . The technique is also closely related to Principal Components Analysis and Factor Analysis . In general, the purpose of this technique is to reduce the overall dimensionality of the input matrix (number of input documents by number of extracted words) to a lower-dimensional space, where each consecutive dimension represents the largest degree of variability (between words and documents) possible. Ideally, you might identify the two or three most salient dimensions, accounting for most of the variability (differences) between the words and documents and, hence, identify the latent semantic space that organizes the words and documents in the analysis. In some way, once such dimensions can be identified, you have extracted the underlying meaning of what is contained (discussed, described) in the documents. Incorporating Text Mining Results in Data Mining Projects After significant (e. g. frequent) words have been extracted from a set of input documents, andor after singular value decomposition has been applied to extract salient semantic dimensions, typically the next and most important step is to use the extracted information in a data mining project. Graphics (visual data mining methods). Depending on the purpose of the analyses, in some instances the extraction of semantic dimensions alone can be a useful outcome if it clarifies the underlying structure of what is contained in the input documents. For example, a study of new car owners comments about their vehicles may uncover the salient dimensions in the minds of those drivers when they think about or consider their automobile (or how they feel about it). For marketing research purposes, that in itself can be a useful and significant result. You can use the graphics (e. g. 2D scatterplots or 3D scatterplots ) to help you visualize and identify the semantic space extracted from the input documents. Clustering and factoring. You can use cluster analysis methods to identify groups of documents (e. g. vehicle owners who described their new cars), to identify groups of similar input texts. This type of analysis also could be extremely useful in the context of market research studies, for example of new car owners. You can also use Factor Analysis and Principal Components and Classification Analysis (to factor analyze words or documents). Predictive data mining. Another possibility is to use the raw or transformed word counts as predictor variables in predictive data mining projects. Was this topic helpful Thank you. We appreciate your feedback Time Series Analysis How To Identify Patterns in Time Series Data: Time Series Analysis In the following topics, we will first review techniques used to identify patterns in time series data (such as smoothing and curve fitting techniques and autocorrelations), then we will introduce a general class of models that can be used to represent time series data and generate predictions (autoregressive and moving average models). Finally, we will review some simple but commonly used modeling and forecasting techniques based on linear regression. For more information see the topics below. General Introduction In the following topics, we will review techniques that are useful for analyzing time series data, that is, sequences of measurements that follow non-random orders. Unlike the analyses of random samples of observations that are discussed in the context of most other statistics, the analysis of time series is based on the assumption that successive values in the data file represent consecutive measurements taken at equally spaced time intervals. Detailed discussions of the methods described in this section can be found in Anderson (1976), Box and Jenkins (1976), Kendall (1984), Kendall and Ord (1990), Montgomery, Johnson, and Gardiner (1990), Pankratz (1983), Shumway (1988), Vandaele (1983), Walker (1991), and Wei (1989). Two Main Goals There are two main goals of time series analysis: (a) identifying the nature of the phenomenon represented by the sequence of observations, and (b) forecasting (predicting future values of the time series variable). Both of these goals require that the pattern of observed time series data is identified and more or less formally described. Once the pattern is established, we can interpret and integrate it with other data (i. e. use it in our theory of the investigated phenomenon, e. g. seasonal commodity prices). Regardless of the depth of our understanding and the validity of our interpretation (theory) of the phenomenon, we can extrapolate the identified pattern to predict future events. Identifying Patterns in Time Series Data For more information on simple autocorrelations (introduced in this section) and other auto correlations, see Anderson (1976), Box and Jenkins (1976), Kendall (1984), Pankratz (1983), and Vandaele (1983). See also: Systematic Pattern and Random Noise As in most other analyses, in time series analysis it is assumed that the data consist of a systematic pattern (usually a set of identifiable components) and random noise (error) which usually makes the pattern difficult to identify. Most time series analysis techniques involve some form of filtering out noise in order to make the pattern more salient. Two General Aspects of Time Series Patterns Most time series patterns can be described in terms of two basic classes of components: trend and seasonality. The former represents a general systematic linear or (most often) nonlinear component that changes over time and does not repeat or at least does not repeat within the time range captured by our data (e. g. a plateau followed by a period of exponential growth). The latter may have a formally similar nature (e. g. a plateau followed by a period of exponential growth), however, it repeats itself in systematic intervals over time. Those two general classes of time series components may coexist in real-life data. For example, sales of a company can rapidly grow over years but they still follow consistent seasonal patterns (e. g. as much as 25 of yearly sales each year are made in December, whereas only 4 in August). This general pattern is well illustrated in a classic Series G data set (Box and Jenkins, 1976, p. 531) representing monthly international airline passenger totals (measured in thousands) in twelve consecutive years from 1949 to 1960 (see example data file G. sta and graph above). If you plot the successive observations (months) of airline passenger totals, a clear, almost linear trend emerges, indicating that the airline industry enjoyed a steady growth over the years (approximately 4 times more passengers traveled in 1960 than in 1949). At the same time, the monthly figures will follow an almost identical pattern each year (e. g. more people travel during holidays than during any other time of the year). This example data file also illustrates a very common general type of pattern in time series data, where the amplitude of the seasonal changes increases with the overall trend (i. e. the variance is correlated with the mean over the segments of the series). This pattern which is called multiplicative seasonality indicates that the relative amplitude of seasonal changes is constant over time, thus it is related to the trend. Trend Analysis There are no proven automatic techniques to identify trend components in the time series data however, as long as the trend is monotonous (consistently increasing or decreasing) that part of data analysis is typically not very difficult. If the time series data contain considerable error, then the first step in the process of trend identification is smoothing. Smoothing. Smoothing always involves some form of local averaging of data such that the nonsystematic components of individual observations cancel each other out. The most common technique is moving average smoothing which replaces each element of the series by either the simple or weighted average of n surrounding elements, where n is the width of the smoothing window (see Box Jenkins, 1976 Velleman Hoaglin, 1981). Medians can be used instead of means. The main advantage of median as compared to moving average smoothing is that its results are less biased by outliers (within the smoothing window). Thus, if there are outliers in the data (e. g. due to measurement errors), median smoothing typically produces smoother or at least more reliable curves than moving average based on the same window width. The main disadvantage of median smoothing is that in the absence of clear outliers it may produce more jagged curves than moving average and it does not allow for weighting. In the relatively less common cases (in time series data), when the measurement error is very large, the distance weighted least squares smoothing or negative exponentially weighted smoothing techniques can be used. All those methods will filter out the noise and convert the data into a smooth curve that is relatively unbiased by outliers (see the respective sections on each of those methods for more details). Series with relatively few and systematically distributed points can be smoothed with bicubic splines . Fitting a function. Many monotonous time series data can be adequately approximated by a linear function if there is a clear monotonous nonlinear component, the data first need to be transformed to remove the nonlinearity. Usually a logarithmic, exponential, or (less often) polynomial function can be used. Analysis of Seasonality Seasonal dependency (seasonality) is another general component of the time series pattern. The concept was illustrated in the example of the airline passengers data above. It is formally defined as correlational dependency of order k between each i th element of the series and the ( i-k )th element (Kendall, 1976) and measured by autocorrelation (i. e. a correlation between the two terms) k is usually called the lag . If the measurement error is not too large, seasonality can be visually identified in the series as a pattern that repeats every k elements. Autocorrelation correlogram. Seasonal patterns of time series can be examined via correlograms. The correlogram (autocorrelogram) displays graphically and numerically the autocorrelation function ( ACF ), that is, serial correlation coefficients (and their standard errors) for consecutive lags in a specified range of lags (e. g. 1 through 30). Ranges of two standard errors for each lag are usually marked in correlograms but typically the size of auto correlation is of more interest than its reliability (see Elementary Concepts ) because we are usually interested only in very strong (and thus highly significant) autocorrelations. Examining correlograms. While examining correlograms, you should keep in mind that autocorrelations for consecutive lags are formally dependent. Consider the following example. If the first element is closely related to the second, and the second to the third, then the first element must also be somewhat related to the third one, etc. This implies that the pattern of serial dependencies can change considerably after removing the first order auto correlation (i. e. after differencing the series with a lag of 1). Partial autocorrelations. Another useful method to examine serial dependencies is to examine the partial autocorrelation function ( PACF ) - an extension of autocorrelation, where the dependence on the intermediate elements (those within the lag) is removed. In other words the partial autocorrelation is similar to autocorrelation, except that when calculating it, the (auto) correlations with all the elements within the lag are partialled out (Box Jenkins, 1976 see also McDowall, McCleary, Meidinger, Hay, 1980). If a lag of 1 is specified (i. e. there are no intermediate elements within the lag), then the partial autocorrelation is equivalent to auto correlation. In a sense, the partial autocorrelation provides a cleaner picture of serial dependencies for individual lags (not confounded by other serial dependencies). Removing serial dependency. Serial dependency for a particular lag of k can be removed by differencing the series, that is converting each i th element of the series into its difference from the ( i-k )th element. There are two major reasons for such transformations. First, we can identify the hidden nature of seasonal dependencies in the series. Remember that, as mentioned in the previous paragraph, autocorrelations for consecutive lags are interdependent. Therefore, removing some of the autocorrelations will change other auto correlations, that is, it may eliminate them or it may make some other seasonalities more apparent. The other reason for removing seasonal dependencies is to make the series stationary which is necessary for ARIMA and other techniques. For more information on Time Series methods, see also: General Introduction The modeling and forecasting procedures discussed in Identifying Patterns in Time Series Data involved knowledge about the mathematical model of the process. However, in real-life research and practice, patterns of the data are unclear, individual observations involve considerable error, and we still need not only to uncover the hidden patterns in the data but also generate forecasts. The ARIMA methodology developed by Box and Jenkins (1976) allows us to do just that it has gained enormous popularity in many areas and research practice confirms its power and flexibility (Hoff, 1983 Pankratz, 1983 Vandaele, 1983). However, because of its power and flexibility, ARIMA is a complex technique it is not easy to use, it requires a great deal of experience, and although it often produces satisfactory results, those results depend on the researchers level of expertise (Bails Peppers, 1982). The following sections will introduce the basic ideas of this methodology. For those interested in a brief, applications-oriented (non - mathematical), introduction to ARIMA methods, we recommend McDowall, McCleary, Meidinger, and Hay (1980). Two Common Processes Autoregressive process. Most time series consist of elements that are serially dependent in the sense that you can estimate a coefficient or a set of coefficients that describe consecutive elements of the series from specific, time-lagged (previous) elements. This can be summarized in the equation: x t 1 x (t-1) 2 x (t-2) 3 x (t-3) . is a constant (intercept), and 1 . 2. 3 are the autoregressive model parameters. Put into words, each observation is made up of a random error component (random shock, ) and a linear combination of prior observations. Stationarity requirement. Note that an autoregressive process will only be stable if the parameters are within a certain range for example, if there is only one autoregressive parameter then is must fall within the interval of -1 x t s would move towards infinity, that is, the series would not be stationary. If there is more than one autoregressive parameter, similar (general) restrictions on the parameter values can be defined (e. g. see Box Jenkins, 1976 Montgomery, 1990). Moving average process. Independent from the autoregressive process, each element in the series can also be affected by the past error (or random shock) that cannot be accounted for by the autoregressive component, that is: Where: is a constant, and 1 . 2. 3 are the moving average model parameters. Put into words, each observation is made up of a random error component (random shock, ) and a linear combination of prior random shocks. Invertibility requirement. Without going into too much detail, there is a duality between the moving average process and the autoregressive process (e. g. see Box Jenkins, 1976 Montgomery, Johnson, Gardiner, 1990), that is, the moving average equation above can be rewritten ( inverted ) into an autoregressive form (of infinite order). However, analogous to the stationarity condition described above, this can only be done if the moving average parameters follow certain conditions, that is, if the model is invertible . Otherwise, the series will not be stationary. ARIMA Methodology Autoregressive moving average model. The general model introduced by Box and Jenkins (1976) includes autoregressive as well as moving average parameters, and explicitly includes differencing in the formulation of the model. Specifically, the three types of parameters in the model are: the autoregressive parameters ( p ), the number of differencing passes ( d ), and moving average parameters ( q ). In the notation introduced by Box and Jenkins, models are summarized as ARIMA ( p, d, q ) so, for example, a model described as (0, 1, 2) means that it contains 0 (zero) autoregressive ( p ) parameters and 2 moving average ( q ) parameters which were computed for the series after it was differenced once. Identification. As mentioned earlier, the input series for ARIMA needs to be stationary. that is, it should have a constant mean, variance, and autocorrelation through time. Therefore, usually the series first needs to be differenced until it is stationary (this also often requires log transforming the data to stabilize the variance). The number of times the series needs to be differenced to achieve stationarity is reflected in the d parameter (see the previous paragraph). In order to determine the necessary level of differencing, you should examine the plot of the data and autocorrelogram. Significant changes in level (strong upward or downward changes) usually require first order non seasonal (lag1) differencing strong changes of slope usually require second order non seasonal differencing. Seasonal patterns require respective seasonal differencing (see below). If the estimated autocorrelation coefficients decline slowly at longer lags, first order differencing is usually needed. However, you should keep in mind that some time series may require little or no differencing, and that over differenced series produce less stable coefficient estimates. At this stage (which is usually called Identification phase, see below) we also need to decide how many autoregressive ( p ) and moving average ( q ) parameters are necessary to yield an effective but still parsimonious model of the process ( parsimonious means that it has the fewest parameters and greatest number of degrees of freedom among all models that fit the data). In practice, the numbers of the p or q parameters very rarely need to be greater than 2 (see below for more specific recommendations). Estimation and Forecasting. At the next step ( Estimation ), the parameters are estimated (using function minimization procedures, see below for more information on minimization procedures see also Nonlinear Estimation ), so that the sum of squared residuals is minimized. The estimates of the parameters are used in the last stage ( Forecasting ) to calculate new values of the series (beyond those included in the input data set) and confidence intervals for those predicted values. The estimation process is performed on transformed (differenced) data before the forecasts are generated, the series needs to be integrated (integration is the inverse of differencing) so that the forecasts are expressed in values compatible with the input data. This automatic integration feature is represented by the letter I in the name of the methodology (ARIMA Auto-Regressive Integrated Moving Average). The constant in ARIMA models. In addition to the standard autoregressive and moving average parameters, ARIMA models may also include a constant, as described above. The interpretation of a (statistically significant) constant depends on the model that is fit. Specifically, (1) if there are no autoregressive parameters in the model, then the expected value of the constant is , the mean of the series (2) if there are autoregressive parameters in the series, then the constant represents the intercept. If the series is differenced, then the constant represents the mean or intercept of the differenced series For example, if the series is differenced once, and there are no autoregressive parameters in the model, then the constant represents the mean of the differenced series, and therefore the linear trend slope of the un-differenced series. Identification Phase Number of parameters to be estimated. Before the estimation can begin, we need to decide on (identify) the specific number and type of ARIMA parameters to be estimated. The major tools used in the identification phase are plots of the series, correlograms of auto correlation (ACF), and partial autocorrelation (PACF). The decision is not straightforward and in less typical cases requires not only experience but also a good deal of experimentation with alternative models (as well as the technical parameters of ARIMA). However, a majority of empirical time series patterns can be sufficiently approximated using one of the 5 basic models that can be identified based on the shape of the autocorrelogram (ACF) and partial auto correlogram (PACF). The following brief summary is based on practical recommendations of Pankratz (1983) for additional practical advice, see also Hoff (1983), McCleary and Hay (1980), McDowall, McCleary, Meidinger, and Hay (1980), and Vandaele (1983). Also, note that since the number of parameters (to be estimated) of each kind is almost never greater than 2, it is often practical to try alternative models on the same data. One autoregressive (p) parameter . ACF - exponential decay PACF - spike at lag 1, no correlation for other lags. Two autoregressive (p) parameters . ACF - a sine-wave shape pattern or a set of exponential decays PACF - spikes at lags 1 and 2, no correlation for other lags. One moving average (q) parameter . ACF - spike at lag 1, no correlation for other lags PACF - damps out exponentially. Two moving average (q) parameters . ACF - spikes at lags 1 and 2, no correlation for other lags PACF - a sine-wave shape pattern or a set of exponential decays. One autoregressive (p) and one moving average (q) parameter . ACF - exponential decay starting at lag 1 PACF - exponential decay starting at lag 1. Seasonal models. Multiplicative seasonal ARIMA is a generalization and extension of the method introduced in the previous paragraphs to series in which a pattern repeats seasonally over time. In addition to the non-seasonal parameters, seasonal parameters for a specified lag (established in the identification phase) need to be estimated. Analogous to the simple ARIMA parameters, these are: seasonal autoregressive ( ps ), seasonal differencing ( ds ), and seasonal moving average parameters ( qs ). For example, the model ( 0,1,2 )( 0,1,1 ) describes a model that includes no autoregressive parameters, 2 regular moving average parameters and 1 seasonal moving average parameter, and these parameters were computed for the series after it was differenced once with lag 1, and once seasonally differenced. The seasonal lag used for the seasonal parameters is usually determined during the identification phase and must be explicitly specified. The general recommendations concerning the selection of parameters to be estimated (based on ACF and PACF) also apply to seasonal models. The main difference is that in seasonal series, ACF and PACF will show sizable coefficients at multiples of the seasonal lag (in addition to their overall patterns reflecting the non seasonal components of the series). Parameter Estimation There are several different methods for estimating the parameters. All of them should produce very similar estimates, but may be more or less efficient for any given model. In general, during the parameter estimation phase a function minimization algorithm is used (the so-called quasi-Newton method refer to the description of the Nonlinear Estimation method) to maximize the likelihood (probability) of the observed series, given the parameter values. In practice, this requires the calculation of the (conditional) sums of squares (SS) of the residuals, given the respective parameters. Different methods have been proposed to compute the SS for the residuals: (1) the approximate maximum likelihood method according to McLeod and Sales (1983), (2) the approximate maximum likelihood method with backcasting, and (3) the exact maximum likelihood method according to Melard (1984). Comparison of methods. In general, all methods should yield very similar parameter estimates. Also, all methods are about equally efficient in most real-world time series applications. However, method 1 above, (approximate maximum likelihood, no backcasts) is the fastest, and should be used in particular for very long time series (e. g. with more than 30,000 observations). Melards exact maximum likelihood method (number 3 above) may also become inefficient when used to estimate parameters for seasonal models with long seasonal lags (e. g. with yearly lags of 365 days). On the other hand, you should always use the approximate maximum likelihood method first in order to establish initial parameter estimates that are very close to the actual final values thus, usually only a few iterations with the exact maximum likelihood method ( 3 . above) are necessary to finalize the parameter estimates. Parameter standard errors. For all parameter estimates, you will compute so-called asymptotic standard errors . These are computed from the matrix of second-order partial derivatives that is approximated via finite differencing (see also the respective discussion in Nonlinear Estimation ). Penalty value. As mentioned above, the estimation procedure requires that the (conditional) sums of squares of the ARIMA residuals be minimized. If the model is inappropriate, it may happen during the iterative estimation process that the parameter estimates become very large, and, in fact, invalid. In that case, it will assign a very large value (a so-called penalty value ) to the SS. This usually entices the iteration process to move the parameters away from invalid ranges. However, in some cases even this strategy fails, and you may see on the screen (during the Estimation procedure ) very large values for the SS in consecutive iterations. In that case, carefully evaluate the appropriateness of your model. If your model contains many parameters, and perhaps an intervention component (see below), you may try again with different parameter start values. Evaluation of the Model Parameter estimates. You will report approximate t values, computed from the parameter standard errors (see above). If not significant, the respective parameter can in most cases be dropped from the model without affecting substantially the overall fit of the model. Other quality criteria. Another straightforward and common measure of the reliability of the model is the accuracy of its forecasts generated based on partial data so that the forecasts can be compared with known (original) observations. However, a good model should not only provide sufficiently accurate forecasts, it should also be parsimonious and produce statistically independent residuals that contain only noise and no systematic components (e. g. the correlogram of residuals should not reveal any serial dependencies). A good test of the model is (a) to plot the residuals and inspect them for any systematic trends, and (b) to examine the autocorrelogram of residuals (there should be no serial dependency between residuals). Analysis of residuals. The major concern here is that the residuals are systematically distributed across the series (e. g. they could be negative in the first part of the series and approach zero in the second part) or that they contain some serial dependency which may suggest that the ARIMA model is inadequate. The analysis of ARIMA residuals constitutes an important test of the model. The estimation procedure assumes that the residual are not (auto-) correlated and that they are normally distributed. Limitations. The ARIMA method is appropriate only for a time series that is stationary (i. e. its mean, variance, and autocorrelation should be approximately constant through time) and it is recommended that there are at least 50 observations in the input data. It is also assumed that the values of the estimated parameters are constant throughout the series. Interrupted Time Series ARIMA A common research questions in time series analysis is whether an outside event affected subsequent observations. For example, did the implementation of a new economic policy improve economic performance did a new anti-crime law affect subsequent crime rates and so on. In general, we would like to evaluate the impact of one or more discrete events on the values in the time series. This type of interrupted time series analysis is described in detail in McDowall, McCleary, Meidinger, Hay (1980). McDowall, et. al. distinguish between three major types of impacts that are possible: (1) permanent abrupt, (2) permanent gradual, and (3) abrupt temporary. See also: Exponential Smoothing General Introduction Exponential smoothing has become very popular as a forecasting method for a wide variety of time series data. Historically, the method was independently developed by Brown and Holt. Brown worked for the US Navy during World War II, where his assignment was to design a tracking system for fire-control information to compute the location of submarines. Later, he applied this technique to the forecasting of demand for spare parts (an inventory control problem). He described those ideas in his 1959 book on inventory control. Holts research was sponsored by the Office of Naval Research independently, he developed exponential smoothing models for constant processes, processes with linear trends, and for seasonal data. Gardner (1985) proposed a unified classification of exponential smoothing methods. Excellent introductions can also be found in Makridakis, Wheelwright, and McGee (1983), Makridakis and Wheelwright (1989), Montgomery, Johnson, Gardiner (1990). Simple Exponential Smoothing A simple and pragmatic model for a time series would be to consider each observation as consisting of a constant ( b ) and an error component (epsilon), that is: X t b t . The constant b is relatively stable in each segment of the series, but may change slowly over time. If appropriate, then one way to isolate the true value of b . and thus the systematic or predictable part of the series, is to compute a kind of moving average, where the current and immediately preceding (younger) observations are assigned greater weight than the respective older observations. Simple exponential smoothing accomplishes exactly such weighting, where exponentially smaller weights are assigned to older observations. The specific formula for simple exponential smoothing is: When applied recursively to each successive observation in the series, each new smoothed value (forecast) is computed as the weighted average of the current observation and the previous smoothed observation the previous smoothed observation was computed in turn from the previous observed value and the smoothed value before the previous observation, and so on. Thus, in effect, each smoothed value is the weighted average of the previous observations, where the weights decrease exponentially depending on the value of parameter (alpha). If is equal to 1 (one) then the previous observations are ignored entirely if is equal to 0 (zero), then the current observation is ignored entirely, and the smoothed value consists entirely of the previous smoothed value (which in turn is computed from the smoothed observation before it, and so on thus all smoothed values will be equal to the initial smoothed value S 0 ). Values of in-between will produce intermediate results. Even though significant work has been done to study the theoretical properties of (simple and complex) exponential smoothing (e. g. see Gardner, 1985 Muth, 1960 see also McKenzie, 1984, 1985), the method has gained popularity mostly because of its usefulness as a forecasting tool. For example, empirical research by Makridakis et al . (1982, Makridakis, 1983), has shown simple exponential smoothing to be the best choice for one-period-ahead forecasting, from among 24 other time series methods and using a variety of accuracy measures (see also Gross and Craig, 1974, for additional empirical evidence). Thus, regardless of the theoretical model for the process underlying the observed time series, simple exponential smoothing will often produce quite accurate forecasts. Choosing the Best Value for Parameter (alpha) Gardner (1985) discusses various theoretical and empirical arguments for selecting an appropriate smoothing parameter. Obviously, looking at the formula presented above, should fall into the interval between 0 (zero) and 1 (although, see Brenner et al. . 1968, for an ARIMA perspective, implying 0 smaller than .30 is usually recommended. However, in the study by Makridakis et al . (1982), values above .30 frequently yielded the best forecasts. After reviewing the literature on this topic, Gardner (1985) concludes that it is best to estimate an optimum from the data (see below), rather than to guess and set an artificially low value. Estimating the best value from the data. In practice, the smoothing parameter is often chosen by a grid search of the parameter space that is, different solutions for are tried starting, for example, with 0.1 to 0.9, with increments of 0.1. Then is chosen so as to produce the smallest sums of squares (or mean squares) for the residuals (i. e. observed values minus one-step-ahead forecasts this mean squared error is also referred to as ex post mean squared error, ex post MSE for short). Indices of Lack of Fit (Error) The most straightforward way of evaluating the accuracy of the forecasts based on a particular value is to simply plot the observed values and the one-step-ahead forecasts. This plot can also include the residuals (scaled against the right Y - axis), so that regions of better or worst fit can also easily be identified. This visual check of the accuracy of forecasts is often the most powerful method for determining whether or not the current exponential smoothing model fits the data. In addition, besides the ex post MSE criterion (see previous paragraph), there are other statistical measures of error that can be used to determine the optimum parameter (see Makridakis, Wheelwright, and McGee, 1983): Mean error: The mean error (ME) value is simply computed as the average error value (average of observed minus one-step-ahead forecast). Obviously, a drawback of this measure is that positive and negative error values can cancel each other out, so this measure is not a very good indicator of overall fit. Mean absolute error: The mean absolute error (MAE) value is computed as the average absolute error value. If this value is 0 (zero), the fit (forecast) is perfect. As compared to the mean squared error value, this measure of fit will de-emphasize outliers, that is, unique or rare large error values will affect the MAE less than the MSE value. Sum of squared error (SSE), Mean squared error. These values are computed as the sum (or average) of the squared error values. This is the most commonly used lack-of-fit indicator in statistical fitting procedures. Percentage error (PE). All the above measures rely on the actual error value. It may seem reasonable to rather express the lack of fit in terms of the relative deviation of the one-step-ahead forecasts from the observed values, that is, relative to the magnitude of the observed values. For example, when trying to predict monthly sales that may fluctuate widely (e. g. seasonally) from month to month, we may be satisfied if our prediction hits the target with about 10 accuracy. In other words, the absolute errors may be not so much of interest as are the relative errors in the forecasts. To assess the relative error, various indices have been proposed (see Makridakis, Wheelwright, and McGee, 1983). The first one, the percentage error value, is computed as: where X t is the observed value at time t . and F t is the forecasts (smoothed values). Mean percentage error (MPE). This value is computed as the average of the PE values. Mean absolute percentage error (MAPE). As is the case with the mean error value (ME, see above), a mean percentage error near 0 (zero) can be produced by large positive and negative percentage errors that cancel each other out. Thus, a better measure of relative overall fit is the mean absolute percentage error. Also, this measure is usually more meaningful than the mean squared error. For example, knowing that the average forecast is off by 5 is a useful result in and of itself, whereas a mean squared error of 30.8 is not immediately interpretable. Automatic search for best parameter. A quasi-Newton function minimization procedure (the same as in ARIMA is used to minimize either the mean squared error, mean absolute error, or mean absolute percentage error. In most cases, this procedure is more efficient than the grid search (particularly when more than one parameter must be determined), and the optimum parameter can quickly be identified. The first smoothed value S 0 . A final issue that we have neglected up to this point is the problem of the initial value, or how to start the smoothing process. If you look back at the formula above, it is evident that you need an S 0 value in order to compute the smoothed value (forecast) for the first observation in the series. Depending on the choice of the parameter (i. e. when is close to zero), the initial value for the smoothing process can affect the quality of the forecasts for many observations. As with most other aspects of exponential smoothing it is recommended to choose the initial value that produces the best forecasts. On the other hand, in practice, when there are many leading observations prior to a crucial actual forecast, the initial value will not affect that forecast by much, since its effect will have long faded from the smoothed series (due to the exponentially decreasing weights, the older an observation the less it will influence the forecast). Seasonal and Non-Seasonal Models With or Without Trend The discussion above in the context of simple exponential smoothing introduced the basic procedure for identifying a smoothing parameter, and for evaluating the goodness-of-fit of a model. In addition to simple exponential smoothing, more complex models have been developed to accommodate time series with seasonal and trend components. The general idea here is that forecasts are not only computed from consecutive previous observations (as in simple exponential smoothing), but an independent (smoothed) trend and seasonal component can be added. Gardner (1985) discusses the different models in terms of seasonality (none, additive, or multiplicative) and trend (none, linear, exponential, or damped). Additive and multiplicative seasonality. Many time series data follow recurring seasonal patterns. For example, annual sales of toys will probably peak in the months of November and December, and perhaps during the summer (with a much smaller peak) when children are on their summer break. This pattern will likely repeat every year, however, the relative amount of increase in sales during December may slowly change from year to year. Thus, it may be useful to smooth the seasonal component independently with an extra parameter, usually denoted as ( delta ). Seasonal components can be additive in nature or multiplicative. For example, during the month of December the sales for a particular toy may increase by 1 million dollars every year. Thus, we could add to our forecasts for every December the amount of 1 million dollars (over the respective annual average) to account for this seasonal fluctuation. In this case, the seasonality is additive . Alternatively, during the month of December the sales for a particular toy may increase by 40, that is, increase by a factor of 1.4. Thus, when the sales for the toy are generally weak, than the absolute (dollar) increase in sales during December will be relatively weak (but the percentage will be constant) if the sales of the toy are strong, than the absolute (dollar) increase in sales will be proportionately greater. Again, in this case the sales increase by a certain factor . and the seasonal component is thus multiplicative in nature (i. e. the multiplicative seasonal component in this case would be 1.4). In plots of the series, the distinguishing characteristic between these two types of seasonal components is that in the additive case, the series shows steady seasonal fluctuations, regardless of the overall level of the series in the multiplicative case, the size of the seasonal fluctuations vary, depending on the overall level of the series. The seasonal smoothing parameter . In general the one-step-ahead forecasts are computed as (for no trend models, for linear and exponential trend models a trend component is added to the model see below): In this formula, S t stands for the (simple) exponentially smoothed value of the series at time t . and I t-p stands for the smoothed seasonal factor at time t minus p (the length of the season). Thus, compared to simple exponential smoothing, the forecast is enhanced by adding or multiplying the simple smoothed value by the predicted seasonal component. This seasonal component is derived analogous to the S t value from simple exponential smoothing as: Put into words, the predicted seasonal component at time t is computed as the respective seasonal component in the last seasonal cycle plus a portion of the error ( e t the observed minus the forecast value at time t ). Considering the formulas above, it is clear that parameter can assume values between 0 and 1. If it is zero, then the seasonal component for a particular point in time is predicted to be identical to the predicted seasonal component for the respective time during the previous seasonal cycle, which in turn is predicted to be identical to that from the previous cycle, and so on. Thus, if is zero, a constant unchanging seasonal component is used to generate the one-step-ahead forecasts. If the parameter is equal to 1, then the seasonal component is modified maximally at every step by the respective forecast error (times (1- ). which we will ignore for the purpose of this brief introduction). In most cases, when seasonality is present in the time series, the optimum parameter will fall somewhere between 0 (zero) and 1(one). Linear, exponential, and damped trend. To remain with the toy example above, the sales for a toy can show a linear upward trend (e. g. each year, sales increase by 1 million dollars), exponential growth (e. g. each year, sales increase by a factor of 1.3), or a damped trend (during the first year sales increase by 1 million dollars during the second year the increase is only 80 over the previous year, i. e. 800,000 during the next year it is again 80 less than the previous year, i. e. 800,000 .8 640,000 etc.). Each type of trend leaves a clear signature that can usually be identified in the series shown below in the brief discussion of the different models are icons that illustrate the general patterns. In general, the trend factor may change slowly over time, and, again, it may make sense to smooth the trend component with a separate parameter (denoted gamma for linear and exponential trend models, and phi for damped trend models). The trend smoothing parameters (linear and exponential trend) and (damped trend). Analogous to the seasonal component, when a trend component is included in the exponential smoothing process, an independent trend component is computed for each time, and modified as a function of the forecast error and the respective parameter. If the parameter is 0 (zero), than the trend component is constant across all values of the time series (and for all forecasts). If the parameter is 1, then the trend component is modified maximally from observation to observation by the respective forecast error. Parameter values that fall in-between represent mixtures of those two extremes. Parameter is a trend modification parameter, and affects how strongly changes in the trend will affect estimates of the trend for subsequent forecasts, that is, how quickly the trend will be damped or increased. Classical Seasonal Decomposition (Census Method 1) General Introduction Suppose you recorded the monthly passenger load on international flights for a period of 12 years ( see Box Jenkins, 1976). If you plot those data, it is apparent that (1) there appears to be a linear upwards trend in the passenger loads over the years, and (2) there is a recurring pattern or seasonality within each year (i. e. most travel occurs during the summer months, and a minor peak occurs during the December holidays). The purpose of the seasonal decomposition method is to isolate those components, that is, to de-compose the series into the trend effect, seasonal effects, and remaining variability. The classic technique designed to accomplish this decomposition is known as the Census I method. This technique is described and discussed in detail in Makridakis, Wheelwright, and McGee (1983), and Makridakis and Wheelwright (1989). General model. The general idea of seasonal decomposition is straightforward. In general, a time series like the one described above can be thought of as consisting of four different components: (1) A seasonal component (denoted as S t . where t stands for the particular point in time) (2) a trend component ( T t ), (3) a cyclical component ( C t ), and (4) a random, error, or irregular component ( I t ). The difference between a cyclical and a seasonal component is that the latter occurs at regular (seasonal) intervals, while cyclical factors have usually a longer duration that varies from cycle to cycle. In the Census I method, the trend and cyclical components are customarily combined into a trend-cycle component ( TC t ). The specific functional relationship between these components can assume different forms. However, two straightforward possibilities are that they combine in an additive or a multiplicative fashion: Here X t stands for the observed value of the time series at time t . Given some a priori knowledge about the cyclical factors affecting the series (e. g. business cycles), the estimates for the different components can be used to compute forecasts for future observations. (However, the Exponential smoothing method, which can also incorporate seasonality and trend components, is the preferred technique for forecasting purposes.) Additive and multiplicative seasonality . Lets consider the difference between an additive and multiplicative seasonal component in an example: The annual sales of toys will probably peak in the months of November and December, and perhaps during the summer (with a much smaller peak) when children are on their summer break. This seasonal pattern will likely repeat every year. Seasonal components can be additive or multiplicative in nature. For example, during the month of December the sales for a particular toy may increase by 3 million dollars every year. Thus, we could add to our forecasts for every December the amount of 3 million to account for this seasonal fluctuation. In this case, the seasonality is additive . Alternatively, during the month of December the sales for a particular toy may increase by 40, that is, increase by a factor of 1.4. Thus, when the sales for the toy are generally weak, then the absolute (dollar) increase in sales during December will be relatively weak (but the percentage will be constant) if the sales of the toy are strong, then the absolute (dollar) increase in sales will be proportionately greater. Again, in this case the sales increase by a certain factor . and the seasonal component is thus multiplicative in nature (i. e. the multiplicative seasonal component in this case would be 1.4). In plots of series, the distinguishing characteristic between these two types of seasonal components is that in the additive case, the series shows steady seasonal fluctuations, regardless of the overall level of the series in the multiplicative case, the size of the seasonal fluctuations vary, depending on the overall level of the series. Additive and multiplicative trend-cycle. We can extend the previous example to illustrate the additive and multiplicative trend-cycle components. In terms of our toy example, a fashion trend may produce a steady increase in sales (e. g. a trend towards more educational toys in general) as with the seasonal component, this trend may be additive (sales increase by 3 million dollars per year) or multiplicative (sales increase by 30, or by a factor of 1.3, annually) in nature. In addition, cyclical components may impact sales to reiterate, a cyclical component is different from a seasonal component in that it usually is of longer duration, and that it occurs at irregular intervals. For example, a particular toy may be particularly hot during a summer season (e. g. a particular doll which is tied to the release of a major childrens movie, and is promoted with extensive advertising). Again such a cyclical component can effect sales in an additive manner or multiplicative manner. Computations The Seasonal Decomposition (Census I) standard formulas are shown in Makridakis, Wheelwright, and McGee (1983), and Makridakis and Wheelwright (1989). media mobile. First a moving average is computed for the series, with the moving average window width equal to the length of one season. If the length of the season is even, then the user can choose to use either equal weights for the moving average or unequal weights can be used, where the first and last observation in the moving average window are averaged. Ratios or differences. In the moving average series, all seasonal (within-season) variability will be eliminated thus, the differences (in additive models) or ratios (in multiplicative models) of the observed and smoothed series will isolate the seasonal component (plus irregular component). Specifically, the moving average is subtracted from the observed series (for additive models) or the observed series is divided by the moving average values (for multiplicative models). Seasonal components. The seasonal component is then computed as the average (for additive models) or medial average (for multiplicative models) for each point in the season. (The medial average of a set of values is the mean after the smallest and largest values are excluded). The resulting values represent the (average) seasonal component of the series. Seasonally adjusted series. The original series can be adjusted by subtracting from it (additive models) or dividing it by (multiplicative models) the seasonal component. The resulting series is the seasonally adjusted series (i. e. the seasonal component will be removed). Trend-cycle component. Remember that the cyclical component is different from the seasonal component in that it is usually longer than one season, and different cycles can be of different lengths. The combined trend and cyclical component can be approximated by applying to the seasonally adjusted series a 5 point (centered) weighed moving average smoothing transformation with the weights of 1, 2, 3, 2, 1. Random or irregular component. Finally, the random or irregular (error) component can be isolated by subtracting from the seasonally adjusted series (additive models) or dividing the adjusted series by (multiplicative models) the trend-cycle component. X-11 Census Method II Seasonal Adjustment The general ideas of seasonal decomposition and adjustment are discussed in the context of the Census I seasonal adjustment method ( Seasonal Decomposition (Census I) ). The Census method II (2) is an extension and refinement of the simple adjustment method. Over the years, different versions of the Census method II evolved at the Census Bureau the method that has become most popular and is used most widely in government and business is the so-called X-11 variant of the Census method II (see Hiskin, Young, Musgrave, 1967). Subsequently, the term X-11 has become synonymous with this refined version of the Census method II. In addition to the documentation that can be obtained from the Census Bureau, a detailed summary of this method is also provided in Makridakis, Wheelwright, and McGee (1983) and Makridakis and Wheelwright (1989). For more information on this method, see the following topics: For more information on other Time Series methods, see Time Series Analysis - Index and the following topics: Seasonal Adjustment: Basic Ideas and Terms Suppose you recorded the monthly passenger load on international flights for a period of 12 years ( see Box Jenkins, 1976). If you plot those data, it is apparent that (1) there appears to be an upwards linear trend in the passenger loads over the years, and (2) there is a recurring pattern or seasonality within each year (i. e. most travel occurs during the summer months, and a minor peak occurs during the December holidays). The purpose of seasonal decomposition and adjustment is to isolate those components, that is, to de-compose the series into the trend effect, seasonal effects, and remaining variability. The classic technique designed to accomplish this decomposition was developed in the 1920s and is also known as the Census I method (see the Census I overview section). This technique is also described and discussed in detail in Makridakis, Wheelwright, and McGee (1983), and Makridakis and Wheelwright (1989). General model. The general idea of seasonal decomposition is straightforward. In general, a time series like the one described above can be thought of as consisting of four different components: (1) A seasonal component (denoted as S t . where t stands for the particular point in time) (2) a trend component ( T t ), (3) a cyclical component ( C t ), and (4) a random, error, or irregular component ( I t ). The difference between a cyclical and a seasonal component is that the latter occurs at regular (seasonal) intervals, while cyclical factors usually have a longer duration that varies from cycle to cycle. The trend and cyclical components are customarily combined into a trend-cycle component ( TC t ). The specific functional relationship between these components can assume different forms. However, two straightforward possibilities are that they combine in an additive or a multiplicative fashion: X t represents the observed value of the time series at time t . Given some a priori knowledge about the cyclical factors affecting the series (e. g. business cycles), the estimates for the different components can be used to compute forecasts for future observations. (However, the Exponential smoothing method, which can also incorporate seasonality and trend components, is the preferred technique for forecasting purposes.) Additive and multiplicative seasonality. Consider the difference between an additive and multiplicative seasonal component in an example: The annual sales of toys will probably peak in the months of November and December, and perhaps during the summer (with a much smaller peak) when children are on their summer break. This seasonal pattern will likely repeat every year. Seasonal components can be additive or multiplicative in nature. For example, during the month of December the sales for a particular toy may increase by 3 million dollars every year. Thus, you could add to your forecasts for every December the amount of 3 million to account for this seasonal fluctuation. In this case, the seasonality is additive . Alternatively, during the month of December the sales for a particular toy may increase by 40, that is, increase by a factor of 1.4. Thus, when the sales for the toy are generally weak, then the absolute (dollar) increase in sales during December will be relatively weak (but the percentage will be constant) if the sales of the toy are strong, then the absolute (dollar) increase in sales will be proportionately greater. Again, in this case the sales increase by a certain factor . and the seasonal component is thus multiplicative in nature (i. e. the multiplicative seasonal component in this case would be 1.4). In plots of series, the distinguishing characteristic between these two types of seasonal components is that in the additive case, the series shows steady seasonal fluctuations, regardless of the overall level of the series in the multiplicative case, the size of the seasonal fluctuations vary, depending on the overall level of the series. Additive and multiplicative trend-cycle. The previous example can be extended to illustrate the additive and multiplicative trend-cycle components. In terms of the toy example, a fashion trend may produce a steady increase in sales (e. g. a trend towards more educational toys in general) as with the seasonal component, this trend may be additive (sales increase by 3 million dollars per year) or multiplicative (sales increase by 30, or by a factor of 1.3, annually) in nature. In addition, cyclical components may impact sales. To reiterate, a cyclical component is different from a seasonal component in that it usually is of longer duration, and that it occurs at irregular intervals. For example, a particular toy may be particularly hot during a summer season (e. g. a particular doll which is tied to the release of a major childrens movie, and is promoted with extensive advertising). Again such a cyclical component can effect sales in an additive manner or multiplicative manner. The Census II Method The basic method for seasonal decomposition and adjustment outlined in the Basic Ideas and Terms topic can be refined in several ways. In fact, unlike many other time-series modeling techniques (e. g. ARIMA ) which are grounded in some theoretical model of an underlying process, the X-11 variant of the Census II method simply contains many ad hoc features and refinements, that over the years have proven to provide excellent estimates for many real-world applications (see Burman, 1979, Kendal Ord, 1990, Makridakis Wheelwright, 1989 Wallis, 1974). Some of the major refinements are listed below. Trading-day adjustment. Different months have different numbers of days, and different numbers of trading-days (i. e. Mondays, Tuesdays, etc.). When analyzing, for example, monthly revenue figures for an amusement park, the fluctuation in the different numbers of Saturdays and Sundays (peak days) in the different months will surely contribute significantly to the variability in monthly revenues. The X-11 variant of the Census II method allows the user to test whether such trading-day variability exists in the series, and, if so, to adjust the series accordingly. Extreme values. Most real-world time series contain outliers, that is, extreme fluctuations due to rare events. For example, a strike may affect production in a particular month of one year. Such extreme outliers may bias the estimates of the seasonal and trend components. The X-11 procedure includes provisions to deal with extreme values through the use of statistical control principles, that is, values that are above or below a certain range (expressed in terms of multiples of sigma . the standard deviation) can be modified or dropped before final estimates for the seasonality are computed. Multiple refinements. The refinement for outliers, extreme values, and different numbers of trading-days can be applied more than once, in order to obtain successively improved estimates of the components. The X-11 method applies a series of successive refinements of the estimates to arrive at the final trend-cycle, seasonal, and irregular components, and the seasonally adjusted series. Tests and summary statistics. In addition to estimating the major components of the series, various summary statistics can be computed. For example, analysis of variance tables can be prepared to test the significance of seasonal variability and trading-day variability (see above) in the series the X-11 procedure will also compute the percentage change from month to month in the random and trend-cycle components. As the duration or span in terms of months (or quarters for quarterly X-11 ) increases, the change in the trend-cycle component will likely also increase, while the change in the random component should remain about the same. The width of the average span at which the changes in the random component are about equal to the changes in the trend-cycle component is called the month (quarter) for cyclical dominance . or MCD (QCD) for short. For example, if the MCD is equal to 2, then you can infer that over a 2-month span the trend-cycle will dominate the fluctuations of the irregular (random) component. These and various other results are discussed in greater detail below. Result Tables Computed by the X-11 Method The computations performed by the X-11 procedure are best discussed in the context of the results tables that are reported. The adjustment process is divided into seven major steps, which are customarily labeled with consecutive letters A through G. Prior adjustment (monthly seasonal adjustment only). Before any seasonal adjustment is performed on the monthly time series, various prior user - defined adjustments can be incorporated. The user can specify a second series that contains prior adjustment factors the values in that series will either be subtracted (additive model) from the original series, or the original series will be divided by these values (multiplicative model). For multiplicative models, user-specified trading-day adjustment weights can also be specified. These weights will be used to adjust the monthly observations depending on the number of respective trading-days represented by the observation. Preliminary estimation of trading-day variation (monthly X-11) and weights. Next, preliminary trading-day adjustment factors (monthly X-11 only) and weights for reducing the effect of extreme observations are computed. Final estimation of trading-day variation and irregular weights (monthly X - 11 ). The adjustments and weights computed in B above are then used to derive improved trend-cycle and seasonal estimates. These improved estimates are used to compute the final trading-day factors (monthly X-11 only) and weights. Final estimation of seasonal factors, trend-cycle, irregular, and seasonally adjusted series. The final trading-day factors and weights computed in C above are used to compute the final estimates of the components. Modified original, seasonally adjusted, and irregular series. The original and final seasonally adjusted series, and the irregular component are modified for extremes. The resulting modified series allow the user to examine the stability of the seasonal adjustment. Month (quarter) for cyclical dominance (MCD, QCD), moving average, and summary measures. In this part of the computations, various summary measures (see below) are computed to allow the user to examine the relative importance of the different components, the average fluctuation from month-to-month (quarter-to-quarter), the average number of consecutive changes in the same direction (average number of runs), etc. Charts. Finally, you will compute various charts (graphs) to summarize the results. For example, the final seasonally adjusted series will be plotted, in chronological order, or by month (see below). Specific Description of all Result Tables Computed by the X-11 Method In each part A through G of the analysis (see Results Tables Computed by the X-11 Method ), different result tables are computed. Customarily, these tables are numbered, and also identified by a letter to indicate the respective part of the analysis. For example, table B 11 shows the initial seasonally adjusted series C 11 is the refined seasonally adjusted series, and D 11 is the final seasonally adjusted series. Shown below is a list of all available tables. Those tables identified by an asterisk () are not available (applicable) when analyzing quarterly series. (Also, for quarterly adjustment, some of the computations outlined below are slightly different for example instead of a 12-term monthly moving average, a 4-term quarterly moving average is applied to compute the seasonal factors the initial trend-cycle estimate is computed via a centered 4-term moving average, the final trend-cycle estimate in each part is computed by a 5-term Henderson average.) Following the convention of the Bureau of the Census version of the X-11 method, three levels of printout detail are offered: Standard (17 to 27 tables), Long (27 to 39 tables), and Full (44 to 59 tables). In the description of each table below, the letters S, L, and F are used next to each title to indicate, which tables will be displayed andor printed at the respective setting of the output option. (For the charts, two levels of detail are available: Standard and All .) See the table name below, to obtain more information about that table. A 2. Prior Monthly Adjustment (S) Factors Tables B 14 through B 16, B18, and B19: Adjustment for trading-day variation. These tables are only available when analyzing monthly series. Different months contain different numbers of days of the week (i. e. Mondays, Tuesdays, etc.). In some series, the variation in the different numbers of trading-days may contribute significantly to monthly fluctuations (e. g. the monthly revenues of an amusement park will be greatly influenced by the number of SaturdaysSundays in each month). The user can specify initial weights for each trading-day (see A 4 ), andor these weights can be estimated from the data (the user can also choose to apply those weights conditionally, i. e. only if they explain a significant proportion of variance). B 14. Extreme Irregular Values Excluded from Trading-day Regression (L) B 15. Preliminary Trading-day Regression (L) B 16. Trading-day Adjustment Factors Derived from Regression Coefficients (F) B 17. Preliminary Weights for Irregular Component (L) B 18. Trading-day Factors Derived from Combined Daily Weights (F) B 19. Original Series Adjusted for Trading-day and Prior Variation (F) C 1. Original Series Modified by Preliminary Weights and Adjusted for Trading-day and Prior Variation (L) Tables C 14 through C 16, C 18, and C 19: Adjustment for trading-day variation. These tables are only available when analyzing monthly series, and when adjustment for trading-day variation is requested. In that case, the trading-day adjustment factors are computed from the refined adjusted series, analogous to the adjustment performed in part B ( B 14 through B 16, B 18 and B 19 ). C 14. Extreme Irregular Values Excluded from Trading-day Regression (S) C 15. Final Trading-day Regression (S) C 16. Final Trading-day Adjustment Factors Derived from Regression X11 output: Coefficients (S) C 17. Final Weights for Irregular Component (S) C 18. Final Trading-day Factors Derived From Combined Daily Weights (S) C 19. Original Series Adjusted for Trading-day and Prior Variation (S) D 1. Original Series Modified by Final Weights and Adjusted for Trading-day and Prior Variation (L) Distributed Lags Analysis For more information on other Time Series methods, see Time Series Analysis - Index and the following topics: General Purpose Distributed lags analysis is a specialized technique for examining the relationships between variables that involve some delay. For example, suppose that you are a manufacturer of computer software, and you want to determine the relationship between the number of inquiries that are received, and the number of orders that are placed by your customers. You could record those numbers monthly for a one-year period, and then correlate the two variables. However, obviously inquiries will precede actual orders, and you can expect that the number of orders will follow the number of inquiries with some delay. Put another way, there will be a (time) lagged correlation between the number of inquiries and the number of orders that are received. Time-lagged correlations are particularly common in econometrics. For example, the benefits of investments in new machinery usually only become evident after some time. Higher income will change peoples choice of rental apartments, however, this relationship will be lagged because it will take some time for people to terminate their current leases, find new apartments, and move. In general, the relationship between capital appropriations and capital expenditures will be lagged, because it will require some time before investment decisions are actually acted upon. In all of these cases, we have an independent or explanatory variable that affects the dependent variables with some lag. The distributed lags method allows you to investigate those lags. Detailed discussions of distributed lags correlation can be found in most econometrics textbooks, for example, in Judge, Griffith, Hill, Luetkepohl, and Lee (1985), Maddala (1977), and Fomby, Hill, and Johnson (1984). In the following paragraphs we will present a brief description of these methods. We will assume that you are familiar with the concept of correlation (see Basic Statistics ), and the basic ideas of multiple regression (see Multiple Regression ). General Model Suppose we have a dependent variable y and an independent or explanatory variable x which are both measured repeatedly over time. In some textbooks, the dependent variable is also referred to as the endogenous variable, and the independent or explanatory variable the exogenous variable. The simplest way to describe the relationship between the two would be in a simple linear relationship: In this equation, the value of the dependent variable at time t is expressed as a linear function of x measured at times t. t-1. t-2 , etc. Thus, the dependent variable is a linear function of x. and x is lagged by 1, 2, etc. time periods. The beta weights ( i ) can be considered slope parameters in this equation. You may recognize this equation as a special case of the general linear regression equation (see the Multiple Regression overview). If the weights for the lagged time periods are statistically significant, we can conclude that the y variable is predicted (or explained) with the respective lag. Almon Distributed Lag A common problem that often arises when computing the weights for the multiple linear regression model shown above is that the values of adjacent (in time) values in the x variable are highly correlated. In extreme cases, their independent contributions to the prediction of y may become so redundant that the correlation matrix of measures can no longer be inverted, and thus, the beta weights cannot be computed. In less extreme cases, the computation of the beta weights and their standard errors can become very imprecise, due to round-off error. In the context of Multiple Regression this general computational problem is discussed as the multicollinearity or matrix ill-conditioning issue. Almon (1965) proposed a procedure that will reduce the multicollinearity in this case. Specifically, suppose we express each weight in the linear regression equation in the following manner: Almon could show that in many cases it is easier (i. e. it avoids the multicollinearity problem) to estimate the alpha values than the beta weights directly. Note that with this method, the precision of the beta weight estimates is dependent on the degree or order of the polynomial approximation . Misspecifications. A general problem with this technique is that, of course, the lag length and correct polynomial degree are not known a priori . The effects of misspecifications of these parameters are potentially serious (in terms of biased estimation). This issue is discussed in greater detail in Frost (1975), Schmidt and Waud (1973), Schmidt and Sickles (1975), and Trivedi and Pagan (1979). Single Spectrum (Fourier) Analysis Spectrum analysis is concerned with the exploration of cyclical patterns of data. The purpose of the analysis is to decompose a complex time series with cyclical components into a few underlying sinusoidal (sine and cosine) functions of particular wavelengths. The term spectrum provides an appropriate metaphor for the nature of this analysis: Suppose you study a beam of white sun light, which at first looks like a random (white noise) accumulation of light of different wavelengths. However, when put through a prism, we can separate the different wave lengths or cyclical components that make up white sun light. In fact, via this technique we can now identify and distinguish between different sources of light. Thus, by identifying the important underlying cyclical components, we have learned something about the phenomenon of interest. In essence, performing spectrum analysis on a time series is like putting the series through a prism in order to identify the wave lengths and importance of underlying cyclical components. As a result of a successful analysis, you might uncover just a few recurring cycles of different lengths in the time series of interest, which at first looked more or less like random noise. A much cited example for spectrum analysis is the cyclical nature of sun spot activity (e. g. see Bloomfield, 1976, or Shumway, 1988). It turns out that sun spot activity varies over 11 year cycles. Other examples of celestial phenomena, weather patterns, fluctuations in commodity prices, economic activity, etc. are also often used in the literature to demonstrate this technique. To contrast this technique with ARIMA or Exponential Smoothing. the purpose of spectrum analysis is to identify the seasonal fluctuations of different lengths, while in the former types of analysis, the length of the seasonal component is usually known (or guessed) a priori and then included in some theoretical model of moving averages or autocorrelations. The classic text on spectrum analysis is Bloomfield (1976) however, other detailed discussions can be found in Jenkins and Watts (1968), Brillinger (1975), Brigham (1974), Elliott and Rao (1982), Priestley (1981), Shumway (1988), or Wei (1989). For more information, see Time Series Analysis - Index and the following topics: Cross-Spectrum Analysis For more information, see Time Series Analysis - Index and the following topics: General Introduction Cross-spectrum analysis is an extension of Single Spectrum (Fourier) Analysis to the simultaneous analysis of two series. In the following paragraphs, we will assume that you have already read the introduction to single spectrum analysis. Detailed discussions of this technique can be found in Bloomfield (1976), Jenkins and Watts (1968), Brillinger (1975), Brigham (1974), Elliott and Rao (1982), Priestley (1981), Shumway (1988), or Wei (1989). Strong periodicity in the series at the respective frequency. A much cited example for spectrum analysis is the cyclical nature of sun spot activity (e. g. see Bloomfield, 1976, or Shumway, 1988). It turns out that sun spot activity varies over 11 year cycles. Other examples of celestial phenomena, weather patterns, fluctuations in commodity prices, economic activity, etc. are also often used in the literature to demonstrate this technique. The purpose of cross-spectrum analysis is to uncover the correlations between two series at different frequencies. For example, sun spot activity may be related to weather phenomena here on earth. If so, then if we were to record those phenomena (e. g. yearly average temperature) and submit the resulting series to a cross-spectrum analysis together with the sun spot data, we may find that the weather indeed correlates with the sunspot activity at the 11 year cycle. That is, we may find a periodicity in the weather data that is in-sync with the sun spot cycles. We can easily think of other areas of research where such knowledge could be very useful for example, various economic indicators may show similar (correlated) cyclical behavior various physiological measures likely will also display coordinated (i. e. correlated) cyclical behavior, and so on. Basic Notation and Principles A simple example Consider the following two series with 16 cases: Results for Each Variable The complete summary contains all spectrum statistics computed for each variable, as described in the Single Spectrum (Fourier) Analysis overview section. Looking at the results shown above, it is clear that both variables show strong periodicities at the frequencies .0625 and .1875. Cross-Periodogram, Cross-Density, Quadrature-Density, Cross-Amplitude Analogous to the results for the single variables, the complete summary will also display periodogram values for the cross periodogram. However, the cross-spectrum consists of complex numbers that can be divided into a real and an imaginary part. These can be smoothed to obtain the cross-density and quadrature density (quad density for short) estimates, respectively. (The reasons for smoothing, and the different common weight functions for smoothing are discussed in the Single Spectrum (Fourier) Analysis .) The square root of the sum of the squared cross-density and quad-density values is called the cross - amplitude . The cross-amplitude can be interpreted as a measure of covariance between the respective frequency components in the two series. Thus we can conclude from the results shown in the table above that the .0625 and .1875 frequency components in the two series covary. Squared Coherency, Gain, and Phase Shift There are additional statistics that can be displayed in the complete summary. Squared coherency. You can standardize the cross-amplitude values by squaring them and dividing by the product of the spectrum density estimates for each series. The result is called the squared coherency . which can be interpreted similar to the squared correlation coefficient (see Correlations - Overview ), that is, the coherency value is the squared correlation between the cyclical components in the two series at the respective frequency. However, the coherency values should not be interpreted by themselves for example, when the spectral density estimates in both series are very small, large coherency values may result (the divisor in the computation of the coherency values will be very small), even though there are no strong cyclical components in either series at the respective frequencies. Gain. The gain value is computed by dividing the cross-amplitude value by the spectrum density estimates for one of the two series in the analysis. Consequently, two gain values are computed, which can be interpreted as the standard least squares regression coefficients for the respective frequencies. Phase shift. Finally, the phase shift estimates are computed as tan-1 of the ratio of the quad density estimates over the cross-density estimate. The phase shift estimates (usually denoted by the Greek letter ) are measures of the extent to which each frequency component of one series leads the other. How the Example Data were Created Now, lets return to the example data set presented above. The large spectral density estimates for both series, and the cross-amplitude values at frequencies 0.0625 and .1875 suggest two strong synchronized periodicities in both series at those frequencies. In fact, the two series were created as: v1 cos(2 .0625(v0-1)) .75sin(2 .2(v0-1)) v2 cos(2 .0625(v02)) .75sin(2 .2(v02)) (where v0 is the case number). Indeed, the analysis presented in this overview reproduced the periodicity inserted into the data very well. Spectrum Analysis - Basic Notation and Principles For more information, see Time Series Analysis - Index and the following topics: Frequency and Period The wave length of a sine or cosine function is typically expressed in terms of the number of cycles per unit time ( Frequency ), often denoted by the Greek letter nu ( some textbooks also use f ). For example, the number of letters handled in a post office may show 12 cycles per year: On the first of every month a large amount of mail is sent (many bills come due on the first of the month), then the amount of mail decreases in the middle of the month, then it increases again towards the end of the month. Therefore, every month the fluctuation in the amount of mail handled by the post office will go through a full cycle. Thus, if the unit of analysis is one year, then n would be equal to 12, as there would be 12 cycles per year. Of course, there will likely be other cycles with different frequencies. For example, there might be annual cycles ( 1), and perhaps weekly cycles 52 weeks per year). The period T of a sine or cosine function is defined as the length of time required for one full cycle. Thus, it is the reciprocal of the frequency, or: T 1 . To return to the mail example in the previous paragraph, the monthly cycle, expressed in yearly terms, would be equal to 112 0.0833. Put into words, there is a period in the series of length 0.0833 years. The General Structural Model As mentioned before, the purpose of spectrum analysis is to decompose the original series into underlying sine and cosine functions of different frequencies, in order to determine those that appear particularly strong or important. One way to do so would be to cast the issue as a linear Multiple Regression problem, where the dependent variable is the observed time series, and the independent variables are the sine functions of all possible (discrete) frequencies. Such a linear multiple regression model can be written as: Following the common notation from classical harmonic analysis, in this equation (lambda) is the frequency expressed in terms of radians per unit time, that is: 2 k . where is the constant pi 3.14. and k kq. What is important here is to recognize that the computational problem of fitting sine and cosine functions of different lengths to the data can be considered in terms of multiple linear regression. Note that the cosine parameters a k and sine parameters b k are regression coefficients that tell us the degree to which the respective functions are correlated with the data. Overall there are q different sine and cosine functions intuitively (as also discussed in Multiple Regression ), it should be clear that we cannot have more sine and cosine functions than there are data points in the series. Without going into detail, if there are N data points in the series, then there will be N21 cosine functions and N2-1 sine functions. In other words, there will be as many different sinusoidal waves as there are data points, and we will be able to completely reproduce the series from the underlying functions. (Note that if the number of cases in the series is odd, then the last data point will usually be ignored in order for a sinusoidal function to be identified, you need at least two points: the high peak and the low peak.) To summarize, spectrum analysis will identify the correlation of sine and cosine functions of different frequency with the observed data. If a large correlation (sine or cosine coefficient) is identified, you can conclude that there is a strong periodicity of the respective frequency (or period) in the data. Complex numbers (real and imaginary numbers). In many textbooks on spectrum analysis, the structural model shown above is presented in terms of complex numbers, that is, the parameter estimation process is described in terms of the Fourier transform of a series into real and imaginary parts. Complex numbers are the superset that includes all real and imaginary numbers. Imaginary numbers, by definition, are numbers that are multiplied by the constant i . where i is defined as the square root of -1. Obviously, the square root of -1 does not exist, hence the term imaginary number however, meaningful arithmetic operations on imaginary numbers can still be performed (e. g. i22 -4). It is useful to think of real and imaginary numbers as forming a two dimensional plane, where the horizontal or X - axis represents all real numbers, and the vertical or Y - axis represents all imaginary numbers. Complex numbers can then be represented as points in the two - dimensional plane. For example, the complex number 3i2 can be represented by a point with coordinates in this plane. You can also think of complex numbers as angles, for example, you can connect the point representing a complex number in the plane with the origin (complex number 0i0), and measure the angle of that vector to the horizontal line. Thus, intuitively you can see how the spectrum decomposition formula shown above, consisting of sine and cosine functions, can be rewritten in terms of operations on complex numbers. In fact, in this manner the mathematical discussion and required computations are often more elegant and easier to perform which is why many textbooks prefer the presentation of spectrum analysis in terms of complex numbers. A Simple Example Shumway (1988) presents a simple example to clarify the underlying mechanics of spectrum analysis. Lets create a series with 16 cases following the equation shown above, and then see how we may extract the information that was put in it. First, create a variable and define it as: x 1cos(2 .0625(v0-1)) .75sin(2 .2(v0-1)) This variable is made up of two underlying periodicities: The first at the frequency of .0625 (or period 1 16 one observation completes 116th of a full cycle, and a full cycle is completed every 16 observations) and the second at the frequency of .2 (or period of 5). The cosine coefficient (1.0) is larger than the sine coefficient (.75). The spectrum analysis summary is shown below. Lets now review the columns. Clearly, the largest cosine coefficient can be found for the .0625 frequency. A smaller sine coefficient can be found at frequency .1875. Thus, clearly the two sinecosine frequencies which were inserted into the example data file are reflected in the above table. Periodogram The sine and cosine functions are mutually independent (or orthogonal) thus we may sum the squared coefficients for each frequency to obtain the periodogram . Specifically, the periodogram values above are computed as: P k sine coefficient k 2 cosine coefficient k 2 N2 where P k is the periodogram value at frequency k and N is the overall length of the series. The periodogram values can be interpreted in terms of variance (sums of squares) of the data at the respective frequency or period. Customarily, the periodogram values are plotted against the frequencies or periods. The Problem of Leakage In the example above, a sine function with a frequency of 0.2 was inserted into the series. However, because of the length of the series (16), none of the frequencies reported exactly hits on that frequency. In practice, what often happens in those cases is that the respective frequency will leak into adjacent frequencies. For example, you may find large periodogram values for two adjacent frequencies, when, in fact, there is only one strong underlying sine or cosine function at a frequency that falls in-between those implied by the length of the series. There are three ways in which we can approach the problem of leakage: By padding the series, we may apply a finer frequency roster to the data, By tapering the series prior to the analysis, we may reduce leakage, or By smoothing the periodogram, we may identify the general frequency regions or ( spectral densities ) that significantly contribute to the cyclical behavior of the series. See below for descriptions of each of these approaches. Padding the Time Series Because the frequency values are computed as Nt (the number of units of times), we can simply pad the series with a constant (e. g. zeros) and thereby introduce smaller increments in the frequency values. In a sense, padding allows us to apply a finer roster to the data. In fact, if we padded the example data file described in the example above with ten zeros, the results would not change, that is, the largest periodogram peaks would still occur at the frequency values closest to .0625 and .2. (Padding is also often desirable for computational efficiency reasons see below.) The so-called process of split-cosine-bell tapering is a recommended transformation of the series prior to the spectrum analysis. It usually leads to a reduction of leakage in the periodogram. The rationale for this transformation is explained in detail in Bloomfield (1976, p. 80-94). In essence, a proportion ( p ) of the data at the beginning and at the end of the series is transformed via multiplication by the weights: where m is chosen so that 2 mN is equal to the proportion of data to be tapered ( p ). Data Windows and Spectral Density Estimates In practice, when analyzing actual data, it is usually not of crucial importance to identify exactly the frequencies for particular underlying sine or cosine functions. Rather, because the periodogram values are subject to substantial random fluctuation, we are faced with the problem of very many chaotic periodogram spikes. In that case, we want to find the frequencies with the greatest spectral densities . that is, the frequency regions, consisting of many adjacent frequencies, that contribute most to the overall periodic behavior of the series. This can be accomplished by smoothing the periodogram values via a weighted moving average transformation. Suppose the moving average window is of width m (which must be an odd number) the following are the most commonly used smoothers (note: p (m-1)2 ). Daniell (or equal weight) window. The Daniell window (Daniell 1946) amounts to a simple (equal weight) moving average transformation of the periodogram values, that is, each spectral density estimate is computed as the mean of the m2 preceding and subsequent periodogram values. Tukey window. In the Tukey (Blackman and Tukey, 1958) or Tukey-Hanning window (named after Julius Von Hann), for each frequency, the weights for the weighted moving average of the periodogram values are computed as: Hamming window. In the Hamming (named after R. W. Hamming) window or Tukey-Hamming window (Blackman and Tukey, 1958), for each frequency, the weights for the weighted moving average of the periodogram values are computed as: Parzen window. In the Parzen window (Parzen, 1961), for each frequency, the weights for the weighted moving average of the periodogram values are computed as: Bartlett window. In the Bartlett window (Bartlett, 1950) the weights are computed as: With the exception of the Daniell window, all weight functions will assign the greatest weight to the observation being smoothed in the center of the window, and increasingly smaller weights to values that are further away from the center. In many cases, all of these data windows will produce very similar results. Preparing the Data for Analysis Lets now consider a few other practical points in spectrum analysis. Usually, we want to subtract the mean from the series, and detrend the series (so that it is stationary ) prior to the analysis. Otherwise the periodogram and density spectrum will mostly be overwhelmed by a very large value for the first cosine coefficient (for frequency 0.0). In a sense, the mean is a cycle of frequency 0 (zero) per unit time that is, it is a constant. Similarly, a trend is also of little interest when we want to uncover the periodicities in the series. In fact, both of those potentially strong effects may mask the more interesting periodicities in the data, and thus both the mean and the trend (linear) should be removed from the series prior to the analysis. Sometimes, it is also useful to smooth the data prior to the analysis, in order to tame the random noise that may obscure meaningful periodic cycles in the periodogram. Results when No Periodicity in the Series Exists Finally, what if there are no recurring cycles in the data, that is, if each observation is completely independent of all other observations If the distribution of the observations follows the normal distribution, such a time series is also referred to as a white noise series (like the white noise you hear on the radio when tuned in-between stations). A white noise input series will result in periodogram values that follow an exponential distribution. Thus, by testing the distribution of periodogram values against the exponential distribution, you can test whether the input series is different from a white noise series. In addition, then you can also request to compute the Kolmogorov-Smirnov one-sample d statistic (see also Nonparametrics and Distributions for more details). Testing for white noise in certain frequency bands. Note that you can also plot the periodogram values for a particular frequency range only. Again, if the input is a white noise series with respect to those frequencies (i. e. it there are no significant periodic cycles of those frequencies), then the distribution of the periodogram values should again follow an exponential distribution . Fast Fourier Transforms (FFT) For more information, see Time Series Analysis - Index and the following topics: General Introduction The interpretation of the results of spectrum analysis is discussed in the Basic Notation and Principles topic, however, we have not described how it is done computationally. Up until the mid-1960s the standard way of performing the spectrum decomposition was to use explicit formulae to solve for the sine and cosine parameters. The computations involved required at least N2 (complex) multiplications. Thus, even with todays high-speed computers. it would be very time consuming to analyze even small time series (e. g. 8,000 observations would result in at least 64 million multiplications). The time requirements changed drastically with the development of the so-called fast Fourier transform algorithm. or FFT for short. In the mid-1960s, J. W. Cooley and J. W. Tukey (1965) popularized this algorithm which, in retrospect, had in fact been discovered independently by various individuals. Various refinements and improvements of this algorithm can be found in Monro (1975) and Monro and Branch (1976). Readers interested in the computational details of this algorithm may refer to any of the texts cited in the overview. Suffice it to say that via the FFT algorithm, the time to perform a spectral analysis is proportional to N log2( N ) - a huge improvement. However, a draw-back of the standard FFT algorithm is that the number of cases in the series must be equal to a power of 2 (i. e. 16, 64, 128, 256. ). Usually, this necessitated padding of the series, which, as described above, will in most cases not change the characteristic peaks of the periodogram or the spectral density estimates. In cases, however, where the time units are meaningful, such padding may make the interpretation of results more cumbersome. Computation of FFT in Time Series The implementation of the FFT algorithm allows you to take full advantage of the savings afforded by this algorithm. On most standard computers, series with over 100,000 cases can easily be analyzed. However, there are a few things to remember when analyzing series of that size. As mentioned above, the standard (and most efficient) FFT algorithm requires that the length of the input series is equal to a power of 2. If this is not the case, additional computations have to be performed. It will use the simple explicit computational formulas as long as the input series is relatively small, and the number of computations can be performed in a relatively short amount of time. For long time series, in order to still utilize the FFT algorithm, an implementation of the general approach described by Monro and Branch (1976) is used. This method requires significantly more storage space, however, series of considerable length can still be analyzed very quickly, even if the number of observations is not equal to a power of 2. For time series of lengths not equal to a power of 2, we would like to make the following recommendations: If the input series is small to moderately sized (e. g. only a few thousand cases), then do not worry. The analysis will typically only take a few seconds anyway. In order to analyze moderately large and large series (e. g. over 100,000 cases), pad the series to a power of 2 and then taper the series during the exploratory part of your data analysis. Was this topic helpfulmoving average Mean of time series data (observations equally spaced in time) from several consecutive periods. Called moving because it is continually recomputed as new data becomes available, it progresses by dropping the earliest value and adding the latest value. For example, the moving average of six-month sales may be computed by taking the average of sales from January to June, then the average of sales from February to July, then of March to August, and so on. Moving averages (1) reduce the effect of temporary variations in data, (2) improve the fit of data to a line (a process called smoothing) to show the datas trend more clearly, and (3) highlight any value above or below the trend. If you are calculating something with very high variance the best you may be able to do is figure out the moving average . I wanted to know what the moving average was of the data, so I would have a better understanding of how we were doing. When you are trying to figure out some numbers that change often the best you can do is calculate the moving average .
No comments:
Post a Comment