100% Guaranteed Results


STAT596 – hw5 Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

Yaniv Bronshtein
Import the necessary libraries
library(forecast)#Source of gold dataset
## Registered S3 method overwritten by ‘quantmod’:
## method from
## as.zoo.data.frame zoo
library(tryCatchLog)
## futile.logger not found. Using tryCatchLog-internal functions for logging…
library(attempt) library(TTR)
data(“gold”)
The classic Box & Jenkins airline data. Monthly totals of international airline passengers, 1949 to 1960 from base-R datasets. Monthly data.
data(AirPassengers)
A time series object containing average air temperatures at Nottingham Castle in degrees Fahrenheit for 20 years.(1920-1939)
data(nottem)
Create time series objects from data
Plot gold time series
plot.ts(gold_ts)

Time
Plot Air Passengers time series
plot.ts(air_pass_ts)

1950 1952
Plot nottem time series 1954 1956 1958 1960
Time
plot.ts(nottem_ts)

Time De-
composing Gold time series.Impossible, so there is no seasonal component try_catch(decomposed_gold_additive <- decompose(gold_ts, type=’additive’), .e=~print(“Cannot decompose a
## [1] “Cannot decompose additive agold” try_catch(decomposed_gold_mult <- decompose(gold_ts, type=’multiplicative’), .e=~print(“Cannot decompose
## [1] “Cannot decompose multiplicative gold”
Instead, let us try to use SMA for Gold data.
try_catch(sma_gold <- SMA(gold_ts), .e=~print(“Cannot get moving average gold”))
## [1] “Cannot get moving average gold”
We can now try exponential smoothing on gold data
log_gold <- log(gold_ts)
#Now that we have taken the log, let’s try to fit a linear model
plot.ts(log_gold)

Time
Decomposing Airpassenger time series.Successful
try_catch(decomposed_air_pass_additive <- decompose(air_pass_ts, type=’additive’), .e= try_catch(decomposed_air_pass_mult <- decompose(air_pass_ts, type=’multiplicative’), .e=
~print(“Cannot dec ~print(“Cannot d
Since Airpassenger decomposition was successful, let us plot the decomposed version. We see that both plots are successful.
plot(decomposed_air_pass_additive)
Decomposition of additive time series

Time
plot(decomposed_air_pass_mult)
Decomposition of multiplicative time series

Time Let
us now try seasonal adjustment for AirPassengers
air_pass_seasonal_adj <- air_pass_ts – decomposed_air_pass_additive$seasonal plot(air_pass_seasonal_adj)

Time
Decomposing Nottem time series.Impossible
try_catch(decomposed_nottem_additive <- decompose(nottem_ts, type=’additive’), .e=~print(“Cannot decompo
## [1] “Cannot decompose additive nottem”
try_catch(decomposed_nottem_mult <- decompose(nottem_ts, type=’multiplicative’), .e=~print(“Cannot decom
## [1] “Cannot decompose multiplicative nottem”
Instead, let us try to use SMA for Nottem data
try_catch(sma_nottem <- SMA(nottem_ts), .e=~print(“Cannot get moving average SMA”))
Since no error was generated, we can plot sma_nottem
plot.ts(sma_nottem)

Time
Observations and Conclusions
In the subset of data taken from the gold prices dataset, the price of Gold is increasing. That is not the case for the entire dataset. Neither Gold nor nottem data are additive models which is why decompose() does not
work for them.
However, Air passengers is additive and multiplicative as both decompositions are possible There is a clear upward trend; As time increases, the number of passengers increases For nottem data, we were able to compute the moving average using SMA().

2 NEWELLWts WE and Zt are iid
POWE O pWe I
PIZE 1 PLZEL L
A process is white if the followinghold
MEO Jt Ow forall EET and 8sto for all stt
C ELIF ELWELLWE1 ZEFETWIEILLWEDIETZE
LOE E ELIWEIL I Et AI
2 11 0 3 1 3 o O
VartXEf EEXE CENTRE 0 EEXEFETCWELIWE.DZ IF ELWELLWETZE
ETWE ELI WEDJ ELZEY
022 12 2 1 022 5 2 452 1152 E E 14 4 It tow
KEEN
Corks FETISH ETHELITO
EIWSH Ws 1 Zs WELLWENZEL
EEZJHEIWSGWS.DZ WtLIWt2D
To show Xt is not I I D
PIXt.EC TEC PXE EC PIXEL
suppose Xt EL
Xt I WEILLWE2ZE I
1 WEILL WE2 Zts
WE 2 0 and Wt Ed and ZE EL PWE2 0 E PCWt 2 1 E PZt 1 1 E
Let usnowexamine Xt Theus PCE1 278
NEWELLWE 2 ZE
From before WE 1 1 so Xt D
PIXELXt5110 suppose that Xt is ii d Then we should have
PIXELE EL PHE EL PIXEL EY
Butinstead 0 4 Hence we proveby contradiction

Cov Xs IF ELITES EEK ELVES O HEEM
EIUS Ws3 WEWE3 ELISETTI
EtWsWt Ws3WE WsWt3 Ws3Wt3 EEWSWES EEWS WI EIUSWESTEINSWE3
We will now show that this is a function of
Is tl and is consequently a stationary process Using indicator functions we can rewrite as
I s t I s t33115343 I 5 37 3
2111sHo 2414st133
This is in fact a function ofIstl and stationary
bYEWS
EEXEFETWJ.IO
CovXsXt ETW3W EINHEIT TO
043 1 0 D We have a constantvariance gadmean sotheprocess is stationary
D JettWas
A EEXEFETEWFEELS ELUTE
since the expectation is notconstant this process is not stationary
d XEWE
EITI ETWEFT
Coulis FELTSXI EEK ELTE
ELISXI EETs
ETWEWE EEWS
If set
COVXs EEWIT EEWE 3 2 2
It set
Covers ETWEHETWEEETWIO
Thus wehave a stationary process
I EWEWE2
ELVES ETWEWEFEIWIETWE23 0
Coutts FETISH EEXSTETE
EtWsWs2WEWED ETWSWSPETWEWED
I Let
Thus we have a stationary process

Reviews

There are no reviews yet.

Be the first to review “STAT596 – hw5 Solved”

Your email address will not be published. Required fields are marked *

Related products