1.7 Solutions to Exercises
Wei Time Series Analysis Solution Manual If you are looking for a ebook Wei time series analysis solution manual in pdf format, then you've come to the loyal site. We presented the full version of this book in ePub, PDF, DjVu, txt, doc formats. You may reading Wei time series analysis solution manual online either download. File Name: Introduction To Time Series And Forecasting Solution Manual.pdf Size: 6115 KB Type: PDF, ePub, eBook Category: Book Uploaded: 2020 Nov 22, 07:39 Rating: 4.6/5 from 919 votes. We have the funds for time series analysis solution manual by william wei and numerous ebook collections from fictions to scientific research in any way. Along with them is this time series analysis solution manual by william wei that can be your partner.
1.7.1 Solutions 1: Beaver temperature
- Time Series Analysis and Its Robert H. Shumway is Professor He has made seminal contributions to the analysis of categorical time series and won the 1989 Time series analysis: solutions manual Time Series Analysis: Solutions Manual By Jonathan D Cryer Solutions Manual to Accompany Introduction to Linear Solutions Manual to Accompany Introduction to.
- Series analysis. The impact of time series analysis on scienti c applications can be par-tially documented by producing an abbreviated listing of the diverse elds in which important time series problems may arise. For example, many fa-miliar time series occur in the eld of economics, where we are continually.
- Load the
beav2
data from the libraryMASS
. - Examine the data frame using
summary
,head
,tail
. Query the help with?beav2
for a description of the dataset - Transform the temperature data into a time series object and plot the latter.
- Fit a linear model using
lm
and the variableactiv
as factor, viz.lin_mod <- lm(temp~as.factor(activ), data=beav2)
. Overlay the means on your plot withlines(fitted(lin_mod))
replacinglin_mod
with yourlm
result. - Inspect the residuals (
resid(lin_mod)
) and determine whether there is any evidence of trend or seasonality. - Look at a quantile-quantile (Q-Q) plot to assess normality. You can use the command
qqnorm
if you don’t want to transform manually the residuals withqqline
or useplot(lin_mod, which=2)
. - Plot the lag-one residuals at time (t) and (t-1). Is the dependence approximately linear?
1.7.2 Solutions 2: SP500 daily returns
- Download the dataset using the following command
- Obtain the daily percent return series and plot the latter against time.
- With the help of graphs, discuss evidences of seasonality and nonstationarity. Are there seasons of returns?
- Plot the (partial) correlogram of both the raw and the return series. Try the acf with
na.action=na.pass
and without (by e.g. converting the series to a vector usingas.vector
. Comment on the impact of ignoring time stamps. - Plot the (partial) correlogram of the absolute value of the return series and of the squared return series. What do you see?
1.7.3 Solutions 3: Simulated data
The first 5 parts of the question are straightforward and left to the reader.
- Simulate 500 observations from an AR(1) process with parameter values (alpha in {0.1, 0.5, 0.9, 0.99}).
- Repeat for MA processes of different orders. There is no restriction on the coefficients of the latter for stationarity, unlike the AR process.
- Sample from an ARCH(1) process with Gaussian innovations and an ARCH(1) process with Student-(t) innovations with
df=4
. Look at the correlogram of the absolute residuals and the squared residuals. - The dataset
EuStockMarkets
contains the daily closing prices of major European stock indices. Type?EuStockMarkets
for more details andplot(EuStockMarkets)
to plot the four series (DAX, SMI, CAC and FTSE).Useplot(ftse <- EuStockMarkets[,'FTSE'])
to plot the FTSE series andplot(100*diff(log(ftse)))
to plot its daily log return. Play with the ARCH simulation functions to generate some similar processes. - Simulate a white noise series with trend (t) and (cos(t)), of the form (X_t=M_t+S_t+Z_t), where (Z_t sim mathsf{N}(0,sigma^2)) for different values of (sigma^2). Analyze the log-periodogram and the (partial) correlograms. What happens if you forget to remove the trend?
- Do the same for multiplicative model with lognormal margins, with structure (X_t=M_tS_tZ_t).
- For steps 5 and 6, plot the series and test the assumptions that they are white noise using the Ljung-Box test. Note you need to adjust the degrees of freedom when working with residuals from e.g. ARMA models.
1.7.4 Solutions 4: Mauna Loa Atmospheric CO2 Concentration
- Load and plot the CO2 dataset from NOAA. Pay special attention to the format, missing values, the handling of string and the description. Use
?read.table
for help, and look carefully at argumentsfile
,sep
,na.strings
,skip
andstringsAsFactors
. From now on, we will work with the complete series (termed interpolated in the description). - Try removing the trend using a linear model. Plot the residuals against month of the year.
- Remove the trend and the periodicity with a Fourier basis (with period 12). Be sure to include both
sin
andcos
terms together. Recall that the standard Wald tests for the coefficients is not valid in the presence of autocorrelation! You could also usepoly
orsplines::bs
to fit polynomials or splines to your series. - Plot the lagged residuals. Are there evidence of correlation?
- Use the function
filter
to smooth the series using a 12 period moving average. - Inspect the spectrum of the raw series and of the smoothed version.
- Inspect the spectrum of the detrended raw series.
- Test for stationarity of the deseasonalized and detrended residuals using the KPSS test viz.
tseries::kpss.test
. - Use the
decompose
and thestl
functions to obtain residuals. - Plot the (partial) correlogram for both decomposition and compare them with the output of the linear model.
1.7 Solutions to Exercises
1.7.1 Solutions 1: Beaver temperature
- Load the
beav2
data from the libraryMASS
. - Examine the data frame using
summary
,head
,tail
. Query the help with?beav2
for a description of the dataset - Transform the temperature data into a time series object and plot the latter.
- Fit a linear model using
lm
and the variableactiv
as factor, viz.lin_mod <- lm(temp~as.factor(activ), data=beav2)
. Overlay the means on your plot withlines(fitted(lin_mod))
replacinglin_mod
with yourlm
result. - Inspect the residuals (
resid(lin_mod)
) and determine whether there is any evidence of trend or seasonality. - Look at a quantile-quantile (Q-Q) plot to assess normality. You can use the command
qqnorm
if you don’t want to transform manually the residuals withqqline
or useplot(lin_mod, which=2)
. - Plot the lag-one residuals at time (t) and (t-1). Is the dependence approximately linear?
1.7.2 Solutions 2: SP500 daily returns
- Download the dataset using the following command
- Obtain the daily percent return series and plot the latter against time.
- With the help of graphs, discuss evidences of seasonality and nonstationarity. Are there seasons of returns?
- Plot the (partial) correlogram of both the raw and the return series. Try the acf with
na.action=na.pass
and without (by e.g. converting the series to a vector usingas.vector
. Comment on the impact of ignoring time stamps. - Plot the (partial) correlogram of the absolute value of the return series and of the squared return series. What do you see?
1.7.3 Solutions 3: Simulated data
Time Series Solution Manual
The first 5 parts of the question are straightforward and left to the reader.
- Simulate 500 observations from an AR(1) process with parameter values (alpha in {0.1, 0.5, 0.9, 0.99}).
- Repeat for MA processes of different orders. There is no restriction on the coefficients of the latter for stationarity, unlike the AR process.
- Sample from an ARCH(1) process with Gaussian innovations and an ARCH(1) process with Student-(t) innovations with
df=4
. Look at the correlogram of the absolute residuals and the squared residuals. - The dataset
EuStockMarkets
contains the daily closing prices of major European stock indices. Type?EuStockMarkets
for more details andplot(EuStockMarkets)
to plot the four series (DAX, SMI, CAC and FTSE).Useplot(ftse <- EuStockMarkets[,'FTSE'])
to plot the FTSE series andplot(100*diff(log(ftse)))
to plot its daily log return. Play with the ARCH simulation functions to generate some similar processes. - Simulate a white noise series with trend (t) and (cos(t)), of the form (X_t=M_t+S_t+Z_t), where (Z_t sim mathsf{N}(0,sigma^2)) for different values of (sigma^2). Analyze the log-periodogram and the (partial) correlograms. What happens if you forget to remove the trend?
- Do the same for multiplicative model with lognormal margins, with structure (X_t=M_tS_tZ_t).
- For steps 5 and 6, plot the series and test the assumptions that they are white noise using the Ljung-Box test. Note you need to adjust the degrees of freedom when working with residuals from e.g. ARMA models.
1.7.4 Solutions 4: Mauna Loa Atmospheric CO2 Concentration
Time Series Analysis Solution Manual Pdf
- Load and plot the CO2 dataset from NOAA. Pay special attention to the format, missing values, the handling of string and the description. Use
?read.table
for help, and look carefully at argumentsfile
,sep
,na.strings
,skip
andstringsAsFactors
. From now on, we will work with the complete series (termed interpolated in the description). - Try removing the trend using a linear model. Plot the residuals against month of the year.
- Remove the trend and the periodicity with a Fourier basis (with period 12). Be sure to include both
sin
andcos
terms together. Recall that the standard Wald tests for the coefficients is not valid in the presence of autocorrelation! You could also usepoly
orsplines::bs
to fit polynomials or splines to your series. - Plot the lagged residuals. Are there evidence of correlation?
- Use the function
filter
to smooth the series using a 12 period moving average. - Inspect the spectrum of the raw series and of the smoothed version.
- Inspect the spectrum of the detrended raw series.
- Test for stationarity of the deseasonalized and detrended residuals using the KPSS test viz.
tseries::kpss.test
. - Use the
decompose
and thestl
functions to obtain residuals. - Plot the (partial) correlogram for both decomposition and compare them with the output of the linear model.