-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
34 lines (34 loc) · 1001 Bytes
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
library(fpp3)
library(tidyverse)
library(dplyr)
sp <- read.csv("SP500.csv")
sp <- sp |> filter(SP500 != ".") |>
mutate(trading_day = row_number(), SP500 = as.numeric(SP500)) |>
as_tsibble(index=trading_day, regular=TRUE)
sp <- sp |> mutate(log = log(SP500),
log_diff = difference(log(SP500))) |>
drop_na()
T <- nrow(sp)
train <- sp |>
filter(trading_day <= floor(nrow(sp)*.6))
R <- nrow(train)
test <- sp |>
filter(trading_day > floor(nrow(sp)*.6))
P <- nrow(test)
fit_4 <- train |> model(ETS(log_diff))
fit_4
summary(ETS)
report(ETS)
View(fit_4)
coef(fit_4)
library(readxl)
library(fpp3)
library(tidyverse)
library(dplyr)
# https://www.abs.gov.au/statistics/labour/employment-and-unemployment/labour-force-australia-detailed/latest-release
Quarter <- read_xlsx("EMPL.xlsx", range = "Data1!A12:A164", col_names = "Quarter")
Total <- read_xlsx("EMPL.xlsx", range = "Data1!BI12:BI164", col_names = "Total")
EMPL <- cbind(Quarter, Total)
# 1978 Feb - 2023 Feb
EMPL <- EMPL |>
mutate(Quarter = yearquarte