1. UNIVERSIDAD CUAUHTÉMOC
PLANTEL AGUASCALIENTES
EDUCACIÓN A DISTANCIA
Maestría en Ciencia de los Datos y
Procesamiento de Datos Masivos
(Big-Data)
Segundo Cuatrimestre
Sergio Andrés Fonseca Chitiva
MODELOS ESTADÍSTICOS DINÁMICOS
Nombre del profesor
Jonás Velasco Alvares
Fecha de entrega
Noviembre 01 2015
“EXCELENTES PROFESIONISTAS, MEJORES SERES HUMANOS”
2. Descripción de la Actividad(es):
El alumno deberá realizar el ejercicio 1 y 7 del capítulo 3 dentro del MATERIAL
II 1. Para realizar los ejercicios, los datos se encuentran en el recurso DATOS
III 2. Enviar en un archivo PDF el desarrollo de los ejercicios.
Desarrollo de la actividad(es):
3.6 Exercises
1. a) Describe the association and calculate the ccf between x and y for k equal
to 1, 10, and 100.
> w <- 1:100
> x <- w + k * rnorm(100)
> y <- w + k * rnorm(100)
> ccf(x, y)
Nombre de la Unidad.
Ejercicio de la unidad 3
Objetivo de la Unidad.
Realizar los ejercicios indicados para este
capitulo.
3. Respecto a x,y están relacionadas de una forma lineal puesto que respeto al
tiempo esta sustrayendo
el t, donde la variable de correlación disminuye a medida que aumenta la
variable k
b) Describe the association between x and y, and calculate the ccf.
> Time <- 1:370
> x <- sin(2 * pi * Time / 37)
> y <- sin(2 * pi * (Time + 4) / 37)
Investigate the effect of adding independent random variation to x
and y.
4. Las variables x y ondas sinusoidales Y tanto seguir de período de 37 veces
unidades, con x la zaga y por 4 unidades de tiempo. La relación entre las
variables se pueden ver usando plot (x, y) que muestra x,y tienen una relación
no lineal dispersa sobre una elíptica camino.
7. Continue the following exploratory time series analysis using the global
temperature series from §1.4.5.
5. a) Produce a time plot of the data. Plot the aggregated annual mean series
and a boxplot that summarises the observed values for each season,
and comment on the plots.
www <- "C:/global.dat"
Global <- scan(www)
Global.ts <- ts(Global, st = c(1856, 1), end = c(2005, 12),fr = 12)
plot(Global.ts)
plot(aggregate(Global.ts))
boxplot(Global.ts ~ cycle(Global.ts))
7. b) Decompose the series into the components trend, seasonal effect, and
residuals, and plot the decomposed series. Produce a plot of the trend with a
superimposed seasonal effect.
plot(decompose(Global.ts))
Global.decom <- decompose(Global.ts, type = "mult")
plot(Global.decom)
Trend <- Global.decom$trend
Seasonal <- Global.decom$seasonal
ts.plot(cbind(Trend, Trend * Seasonal), lty = 1:2)
8. b) Plot the correlogram of the residuals from question 7b. Comment on the
plot, explaining any ‘significant’ correlations at significant lags.
acf(Global.ts, xlab = 'lag (months)', main="")
9. c) Fit an appropriate Holt-Winters model to the monthly data. Explain why
you chose that particular Holt-Winters model, and give the parameter
estimates.
www <- "C:/global.dat"
Global.dat <- read.table(www, header = T); attach(Global.dat)
Global.ts <- ts(Global, st = c(1856, 1), end = c(2005, 12),fr = 12)
plot(Global.ts, xlab = "Time / months", ylab = "Complaints")
> Comp.hw1 <- HoltWinters(Global.ts, beta = 0, gamma = 0) ; Comp.hw1
Holt-Winters exponential smoothing with trend and additive seasonal component.
10. Call:
HoltWinters(x = Global.ts, beta = 0, gamma = 0)
Smoothing parameters:
alpha: 0.2739402
beta : 0
gamma: 0
Coefficients:
[,1]
a 0.455717898
b -0.011593386
s1 0.005628472
s2 0.301878472
s3 -0.067454861
s4 -0.217163194
s5 -0.141163194
s6 0.117961806
s7 0.146878472
s8 0.147295139
s9 -0.016538194
s10 -0.046079861
s11 -0.270329861
s12 0.039086806
>
d) Using the fitted model, forecast values for the years 2005–2010. Add
these forecasts to a time plot of the original series. Under what
circumstances would these forecasts be valid? What comments of
caution would you make to an economist or politician who wanted to use
these forecasts to make statements about the potential impact of global
warming on the world economy?