CUHK- Shenzhen STOR 556 - Prelims: Time Series and Their Models

Unformatted text preview:

Time series (TS) dataExamplesTS databasesObjectives of TS analysisTS modelsExamplesCalculations for the modelPurposes of the modelReadingReferencesPrelims: Time Series and Their ModelsVladas Pipiras, STOR @ UNC-CHJanuary 11, 2022Time series (TS) dataUnivariate time series data are dataxt,t= 1, . . . , T, wherextis a real-valued observation at timetandTisthe sample size. We may also write {xt}t=1,...,T.We shall focus on the situations where there is some dependence across timest. Typically, there should besome “physical” reason for such temporal dependence. We shall also be interested in the situations where thedata appear “irregular.”Examples of time series arise in numerous fields.ExamplesSocial SciencesEconomics: Monthly money supply M1 in the US, January 1951 - February 1992.m1 <- scan("usm1.dat")# as time series objectm1 <- ts(data = m1, start = 1959, end = 1992, frequency = 12)m1## Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec## 1959 143.1 140.3 139.4 140.7 139.6 140.4 141.2 140.9 141.3 141.7 142.8 144.7## 1960 144.4 140.9 139.5 140.8 138.7 139.0 140.0 140.4 141.6 142.3 143.4 145.7## 1961 145.7 142.8 141.8 143.5 141.8 142.4 142.8 142.7 144.3 145.7 147.6 150.5## 1962 150.2 146.9 146.0 148.0 145.8 146.2 146.4 145.8 146.9 148.4 150.2 153.3## 1963 153.6 150.1 149.3 151.5 149.3 151.4 151.3 150.9 152.5 154.4 156.7 159.0## 1964 159.4 155.4 154.6 156.8 154.2 155.5 157.1 157.0 159.4 161.3 163.1 166.4## 1965 166.9 161.9 161.5 164.2 160.3 162.2 163.5 162.8 165.6 168.2 169.9 174.4## 1966 175.6 170.3 170.4 174.1 169.6 171.7 171.0 170.0 172.7 173.4 174.6 178.6## 1967 178.4 173.4 174.6 176.6 174.1 177.4 179.1 179.0 181.7 183.9 185.7 190.3## 1968 189.0 184.9 185.4 189.3 186.5 190.2 191.9 191.4 193.9 196.3 199.6 204.8## 1969 205.9 199.3 199.8 203.6 199.4 202.3 203.3 201.5 203.2 205.0 207.0 211.4## 1970 212.9 204.0 205.5 210.1 206.2 208.9 210.1 210.0 212.8 214.4 216.7 222.2## 1971 222.6 216.6 218.6 223.7 221.1 225.2 227.5 225.9 227.7 229.1 231.2 236.9## 1972 237.5 231.4 234.2 239.5 234.7 238.8 241.8 241.3 244.5 247.0 250.5 258.9## 1973 259.4 251.2 251.6 257.0 253.6 259.3 261.1 258.6 259.5 261.4 265.6 273.3## 1974 271.8 264.1 266.5 271.6 266.3 271.5 273.5 271.0 272.6 274.8 278.8 285.2## 1975 281.8 273.3 276.4 281.4 278.1 286.0 288.0 286.3 287.8 288.5 293.5 299.0## 1976 296.8 289.0 291.4 299.9 295.1 299.4 302.3 301.0 302.5 307.0 309.7 318.6## 1977 317.7 309.0 312.2 322.7 315.6 321.7 326.3 324.3 327.7 332.0 335.4 344.1## 1978 343.4 332.0 334.9 347.5 342.4 349.4 353.9 351.7 357.0 359.4 362.9 372.5## 1979 367.8 356.4 360.8 376.2 367.1 376.7 383.3 381.9 385.6 387.7 389.8 398.61## 1980 390.7 380.9 382.4 387.1 377.8 387.6 394.8 398.5 404.9 411.0 416.1 419.8## 1981 416.5 405.7 412.5 431.3 418.6 423.0 427.9 426.1 427.3 429.8 435.2 447.2## 1982 448.7 432.6 435.8 451.3 441.1 446.5 449.6 450.0 456.4 466.0 474.5 486.0## 1983 483.0 474.2 482.9 498.7 494.1 503.7 510.7 508.5 511.5 517.4 522.1 533.4## 1984 530.4 517.6 524.2 539.2 530.8 541.4 543.3 539.0 542.5 542.1 549.6 564.5## 1985 561.1 551.9 558.3 575.0 569.4 585.2 592.0 594.8 602.2 605.5 615.1 633.5## 1986 626.8 613.1 624.6 647.2 645.7 663.5 674.0 679.1 685.2 692.8 709.5 740.6## 1987 737.5 717.1 723.5 752.5 739.9 744.4 746.8 745.0 745.2 753.7 756.0 765.9## 1988 764.7 745.0 752.1 778.3 763.8 778.8 785.6 781.3 780.0 780.8 787.1 803.2## 1989 793.0 772.3 775.2 791.3 767.2 773.8 781.7 777.4 778.5 784.5 791.4 811.9## 1990 802.4 788.3 796.2 818.0 797.3 810.8 812.9 814.5 818.9 817.6 826.1 844.3## 1991 833.2 823.4 835.0 852.9 841.9 857.8 861.9 864.2 867.3 875.0 893.4 916.8## 1992 918.1# time plotplot.ts(m1,ylab = 'M1',xlab='Month')MonthM11960 1965 1970 1975 1980 1985 1990200 400 600 800Finance: Daily detrended logarithmic changes in the S&P index, 1925 - 1987.ts <- read.table("sppri.dat")plot.ts(ts,ylab = 'x_t',xlab='t')2tx_t0 5000 10000 15000−15 −10 −5 0 5 10Sales/Marketing: Monthly sales of red wine in Australia (in thousands of liters), January 1980 - July 1995.ts <- read.table("redwine.dat")plot.ts(ts,ylab = 'x_t',xlab='t')tx_t0 50 100 150500 1500 2500 3500Physical SciencesPhysics/Astronomy: Monthly number of sunspots, 1749 - 1983.ts <- scan("sunsptmo.dat")plot.ts(ts,ylab = 'x_t',xlab='t')3tx_t0 500 1000 1500 2000 25000 50 100 150 200 250Hydrology/Geophysics: Annual minima of the Nile River in Egypt, 520 - 1280.ts <- scan("nile.dat")plot.ts(ts,ylab = 'x_t',xlab='t')tx_t0 100 200 300 400 500 6001000 1200 1400Environment/Climatology: Sizes of annual tree rings of a tree in Utah, 286 - 1985.ts <- scan("ut.dat")plot.ts(ts,ylab = 'x_t',xlab='t')4tx_t0 500 1000 15000.0 0.5 1.0 1.5 2.0TS databasesE.g. see Time Series Data at CRAN Task View: Time Series AnalysisE.g. tsdl: Time Series Data Library with an introductionH Homework 1 will ask you to find a few time series and produce their time plots.Objectives of TS analysis• Description (trend, seasonality, etc.)• Modeling• Prediction/Forecasting• Simulation/Generation• Explaining one TS by another TS• Hypothesis testing• Clustering• Control• . . .TS modelsA time series model is a collection of random variables{Xt}t∈ZorXt,t ∈ Z, modeling the data. Sometimesthe models is taken as {Xt}t=1,...,T, {Xt}t=1,2,..., etc.ExamplesIID noise:This is the model whereXt’s are independent random variables following the same (identical)probability distribution, for example,5• Xt∼ Bernoulli(p) withp ∈(0,1), that is,P(Xt= 1) =pandP(Xt= 0) = 1− p(discrete distribution);• Xt∼ N(µ, σ2) with meanµ ∈ Rand standard deviationσ >0, that is,P(Xt∈ B) =RB1√2πσ2e−(x−µ)2/2σ2dx (continuous distribution);• Xtfollows a Gamma distribution with parameters . . . , and so on.For IID noise, the model is specified by the same distribution that Xtfollows for every t.The following presents tworealizationsof lengthT= 50 of IID noise model withBernoulli(0.4) =Binomial(1, 0.4) distribution.TT <- 50p <- .4set.seed(1)ts1 <- rbinom(TT,1,p)ts2 <- rbinom(TT,1,p)par(mfrow = c(1, 2))plot.ts(ts1,ylab = 'x_t',xlab='t')plot.ts(ts2,ylab = 'x_t',xlab='t')tx_t0 10 20 30 40 500.0 0.2 0.4 0.6 0.8 1.0tx_t0 10 20 30 40 500.0 0.2 0.4 0.6 0.8 1.0# proportion of 1'sc(sum(ts1==1)/TT,sum(ts2==1)/TT)## [1] 0.46 0.40The following presents two realizations of length T = 100 of IID noise model with N (1, 22) distribution.TT <- 100set.seed(5)ts1 <- rnorm(TT,1,2)ts2 <- rnorm(TT,1,2)par(mfrow = c(1, 2))6plot.ts(ts1,ylab = 'x_t',xlab='t')abline(h=1)plot.ts(ts2,ylab = 'x_t',xlab='t')abline(h=1)tx_t0 20 40 60 80 100−2 0 2


View Full Document

CUHK- Shenzhen STOR 556 - Prelims: Time Series and Their Models

Download Prelims: Time Series and Their Models
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Prelims: Time Series and Their Models and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Prelims: Time Series and Their Models 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?