6
.pdf
keyboard_arrow_up
School
University of Toronto *
*We aren’t endorsed by this school
Course
374
Subject
Economics
Date
Jan 9, 2024
Type
Pages
6
Uploaded by SargentSquidPerson1009
Case Study 1
ECO374
Install and load required R packages
if
(!require(
"quantmod"
)) install.packages(
"quantmod"
)
if
(!require(
"ggplot2"
)) install.packages(
"ggplot2"
)
if
(!require(
"stats"
)) install.packages(
"stats"
)
if
(!require(
"tsDyn"
)) install.packages(
"tsDyn"
)
if
(!require(
"forecast"
)) install.packages(
"forecast"
)
if
(!require(
"urca"
)) install.packages(
"urca"
)
library(quantmod)
# functions: getSymbols
library(ggplot2)
# functions: ggplot
library(stats)
# functions: arima
library(tsDyn)
# functions: SETAR
library(forecast)
# functions: auto.arima, nnetar
library(urca)
# functions: ur.kpss
1. Data
Data: iShares Core S&P Total U.S. Stock Market ETF (
Source
)
ITOT
<-
getSymbols(
"ITOT"
,
src=
"yahoo"
,
return.class=
"xts"
,
auto.assign=
F)
ITOT
<-
window(ITOT,
start=
as.Date(
"2022-11-01"
),
end=
as.Date(
"2023-09-01"
))
ITOT.c
<-
ITOT$ITOT.Close
# extract close price
seed
<-
2345
Plot data
ggplot(ITOT.c, aes(
x=
index(ITOT.c),
y=
ITOT.Close)) + geom_line(
color=
"springgreen4"
) +
labs(
x=
""
,
y=
""
,
title=
"Core S&P Total U.S. Stock Market, Close"
) +
theme_minimal() + theme(
plot.title =
element_text(
size=
10
)) +
scale_x_date(
date_breaks=
"1 months"
,
date_labels =
"%Y-%m"
)
85
90
95
100
2022-11 2022-12
2023-01
2023-02 2023-03
2023-04 2023-05
2023-06 2023-07
2023-08
2023-09
Core S&P Total U.S. Stock Market, Close
1
Difference data and plot
D_ITOT.c
<-
na.omit(diff(ITOT.c,
lag=
1
,
differences=
1
))
ggplot(D_ITOT.c, aes(
x=
index(D_ITOT.c),
y=
ITOT.Close)) + geom_line(
color=
"darkblue"
) +
labs(
x=
""
,
y=
""
,
title=
"Differenced Core S&P Total U.S. Stock Market, Close"
) +
theme_minimal() + theme(
plot.title =
element_text(
size=
10
)) +
scale_x_date(
date_breaks=
"3 months"
,
date_labels =
"%Y-%m"
)
-2.5
0.0
2.5
5.0
2023-01
2023-04
2023-07
Differenced Core S&P Total U.S. Stock Market, Close
2. Stationarity (unit root) test
ur.test
<-
ur.kpss(ITOT.c)
summary(ur.test)
##
## #######################
## # KPSS Unit Root Test #
## #######################
##
## Test is of type: mu with 4 lags.
##
## Value of test-statistic is: 3.4622
##
## Critical value for a significance level of:
##
10pct
5pct 2.5pct
1pct
## critical values 0.347 0.463
0.574 0.739
We reject at 5% level the null hypothesis that the data is stationary. Let’s test the differenced data.
ur.test.d
<-
ur.kpss(D_ITOT.c)
summary(ur.test.d)
##
## #######################
## # KPSS Unit Root Test #
## #######################
##
2
## Test is of type: mu with 4 lags.
##
## Value of test-statistic is: 0.05
##
## Critical value for a significance level of:
##
10pct
5pct 2.5pct
1pct
## critical values 0.347 0.463
0.574 0.739
We do not reject at 5% the null of stationarity and conclude that the differenced data is stationary.
3. ACF and PACF
Plot ACF of differenced data
par(
mar=
c(
4
,
4
,
0.5
,
0
))
# set margin sizes
ACF
<-
acf(D_ITOT.c,
lag.max=
20
,
plot=
FALSE,
demean=
TRUE)
plot(ACF[
1
:
20
],
main=
""
,
cex.lab=
0.75
,
cex.axis=
0.75
,
xaxt=
"n"
)
axis(
1
,
at=
ACF$lag,
cex.axis=
0.75
)
# put a label at each lag value
-0.10
0.00
0.05
0.10
Lag
ACF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Plot PACF of differenced data
par(
mar=
c(
4
,
4
,
0.5
,
0
))
# set margin sizes
PACF
<-
pacf(D_ITOT.c,
lag.max=
20
,
plot=
FALSE,
demean=
TRUE)
plot(PACF[
1
:
20
],
main=
""
,
cex.lab=
0.75
,
cex.axis=
0.75
,
xaxt=
"n"
)
axis(
1
,
at=
PACF$lag,
cex.axis=
0.75
)
# put a label at each lag value
3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
Related Questions
Which command is used to list the contents of the current working directory including the hidden files?
A) Ls-a
B) Ls-t
C) Ls-r
D) Ls-l
arrow_forward
how was EVwSample info calculated for this problem?
arrow_forward
6 Assignment Saved to this PC ✓
Design Layout References Mailings
ctions: On
O Search (Alt+Q)
You
Review View Help
In a one-shot game, if you advertise and your rival advertises, you will each earn $5
million in profits. If neither of you advertises, your rival will make $4 million and
you will make $2 million. If you advertise and your rival does not, you will make
$10 million and your rival will make $3 million. If your rival advertises and you do
not, you will make $1 million and your rival will make $3 million. The profits in
each cell are shown as (your profit, your rival's profit).
a) Fill in the payoffs in the following table.
Advertise
Do Not Advertise
Your Rival
H
Advertise
monica faggett
b) Do you have a dominant strategy? Why or why not?
c) Does your rival have a dominant strategy? Why or why not?
d) What is the Nash equilibrium in this game?
Accessibility: Investigate
Do Not Advertise
Focus
arrow_forward
Type out the correct answer ASAP with proper explanation of the each option given in the attachment.will give you thumbs up only for the correct answer within 40 50 minutes.thank you
arrow_forward
question attached!
arrow_forward
Storage management over the
cloud is known as:
Infrastructure as a service
Platform as a service
Software as a service
None of the answers
arrow_forward
Design a process chart for printing a short documenton a laser printer at an office. Unknown to you, the printerin the hallway is out of paper. The paper is located in a supplyroom at the other end of the hall. You wish to make five stapledcopies of the document once it is prin ted. The copier, located nextto the printer, has a sorter but no stapler. How could you makethe task more efficient with the existing equipment?
arrow_forward
4-5 Processing Insurance Claims Your insurance firm processes claims through its newer, larger, high-tech facility and its older, smaller, low-tech facility. Each month, the high-tech facility handles 10,000 claims, incurs $100,000 in fixed costs and $100,000 in variable costs. Each month, the low-tech facility handles 2,000 claims, incurs $16,000 in fixed costs and $24,000 in variable costs. If you anticipate a decrease in the number of claims, where will you lay off workers?
arrow_forward
which 2 tools/concepts wil help to become better manager/decision maker
arrow_forward
Additional: Get solutions in details
arrow_forward
Utilities
Some rental units have certain expenses included with the
rent. Water, electricity, and heating are often referred to as
utilities. Some tenancy agreements require the tenant to pay
for utilities.
7. a) Bianca and Sarah rent a semi-detached house. They
pay for utilities as well as rent. Complete the chart to
determine their estimated annual cost for utilities.
Average
Billing
Frequency
Estimated
Amount Billed Annual Cost
Item
Natural gas
Monthly
$118
Electricity
Bi-monthly
$140
Water
Quarterly
$120
Estimated
Total Annual
Cost
b) A news report claimed that utility costs would rise by
an average of 10% next year. Estimate how much
Bianca and Sarah can expect to pay for utilities
next year.
0
arrow_forward
A Homework (Ch 08)
* Mind Tap - Cengage Learning
catic/nb/ui/evo/index.html?deploymentld=58830023220612202193347127562&elSBN=97813376223498&id=9084911198&snapshotld=1937530&
Q Search
CENGAGE MINDTAP
lomework (Ch 08)
5. Deriving the short-run supply curve
Consider the perfectly competitive market for halogen lamps. The following graph shows the marginal cost (MC), average total cost (ATC), and
average variable cost (AVC) curves for a typical firm in the industry.
80
72
64
56
48
ATCA
40
32
24
16
AVC
MCO
8 16
QUANTITY OF OUTPUT (Thousands of lamps)
24
32
40
48 56
64
72
80
14
5 go
19 194
ho. pll
fg
DII
DDI
delete
home
enc
$.
&
*
5
7.
8.
9.
num
%3D
backspace
lock
{
R.
V
D.
PER UNT (Dollars)
arrow_forward
None
arrow_forward
An advertisement has two 2 liter bottles and a 12 pack of "Bubbly-Cola".
The top says "Speedy Supermarket."
Moving down are the 2 liter bottles. Text around them is as follows.
Sale
4/$5
2 Liter Bubbly-Cola Products
Below the bottles is the 12 pack. Text around it is as follows.
Sale $13/3
12 Pack Bubbly-Cola Products
(a) If 2 liter Bubbly-Cola products cost Speedy $16.20 per case of 24 bottles, what is the amount of the markup (in $) and what is the percent markup on selling price per case?
amount of the markup$
percent markup on selling price %?
(b) If 12 pack Bubbly-Cola products have a markup of $8.55 per case of six 12 packs at Speedy, what are the cost (in $) and the percent markup on selling price per case?
cost$?
percent markup on selling price %?
(c) Why has Speedy Supermarket chosen to use markup based on selling price?
__ Speedy Supermarket is a manufacturer and therefore uses markup based on selling price.
__The markup based on selling price is…
arrow_forward
How do you find t, w, x, y, and z?
arrow_forward
There is value in evaluating the products you buy out of habit because you may find that you have been (a) paying more than you need to pay (b) buying goods that are not useful to you (c) buying products that are of lower quality (d) buying products that are obsolete
arrow_forward
Explain unsolicited mails and communication with children (Ecommerce) in brief. I need to prepare 5-10 minutes presentation for it.
arrow_forward
Typed plz and Asap
Please give me a quality solution thanks
arrow_forward
Make a list of products you use at home (at
least 6). List down the 5 things that you like
and dislike about these products.
Write a short report on features and
characteristics that you would want to see in
the future (innovations) for these products.
arrow_forward
I need help with questions 7 and 9
thank you.
arrow_forward
Typed and correct answer please. I ll rate
arrow_forward
Discuss how your priorities would affect the underlying interests ofbothyour team and the other team.
arrow_forward
if the cost of a computer componet falls then
arrow_forward
What is the 4p ( Product, price, place, promotion) of caribou coffee ?
arrow_forward
Please no written by hand solutions
Bill goes to the market to buy some apples. The cost of the apples that he likes is $1.25 per pound. If he has $5 to spend on apples, how many pounds (x) can he buy?
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
Economics Today and Tomorrow, Student Edition
Economics
ISBN:9780078747663
Author:McGraw-Hill
Publisher:Glencoe/McGraw-Hill School Pub Co
Related Questions
- Which command is used to list the contents of the current working directory including the hidden files? A) Ls-a B) Ls-t C) Ls-r D) Ls-larrow_forwardhow was EVwSample info calculated for this problem?arrow_forward6 Assignment Saved to this PC ✓ Design Layout References Mailings ctions: On O Search (Alt+Q) You Review View Help In a one-shot game, if you advertise and your rival advertises, you will each earn $5 million in profits. If neither of you advertises, your rival will make $4 million and you will make $2 million. If you advertise and your rival does not, you will make $10 million and your rival will make $3 million. If your rival advertises and you do not, you will make $1 million and your rival will make $3 million. The profits in each cell are shown as (your profit, your rival's profit). a) Fill in the payoffs in the following table. Advertise Do Not Advertise Your Rival H Advertise monica faggett b) Do you have a dominant strategy? Why or why not? c) Does your rival have a dominant strategy? Why or why not? d) What is the Nash equilibrium in this game? Accessibility: Investigate Do Not Advertise Focusarrow_forward
- Type out the correct answer ASAP with proper explanation of the each option given in the attachment.will give you thumbs up only for the correct answer within 40 50 minutes.thank youarrow_forwardquestion attached!arrow_forwardStorage management over the cloud is known as: Infrastructure as a service Platform as a service Software as a service None of the answersarrow_forward
- Design a process chart for printing a short documenton a laser printer at an office. Unknown to you, the printerin the hallway is out of paper. The paper is located in a supplyroom at the other end of the hall. You wish to make five stapledcopies of the document once it is prin ted. The copier, located nextto the printer, has a sorter but no stapler. How could you makethe task more efficient with the existing equipment?arrow_forward4-5 Processing Insurance Claims Your insurance firm processes claims through its newer, larger, high-tech facility and its older, smaller, low-tech facility. Each month, the high-tech facility handles 10,000 claims, incurs $100,000 in fixed costs and $100,000 in variable costs. Each month, the low-tech facility handles 2,000 claims, incurs $16,000 in fixed costs and $24,000 in variable costs. If you anticipate a decrease in the number of claims, where will you lay off workers?arrow_forwardwhich 2 tools/concepts wil help to become better manager/decision makerarrow_forward
- Additional: Get solutions in detailsarrow_forwardUtilities Some rental units have certain expenses included with the rent. Water, electricity, and heating are often referred to as utilities. Some tenancy agreements require the tenant to pay for utilities. 7. a) Bianca and Sarah rent a semi-detached house. They pay for utilities as well as rent. Complete the chart to determine their estimated annual cost for utilities. Average Billing Frequency Estimated Amount Billed Annual Cost Item Natural gas Monthly $118 Electricity Bi-monthly $140 Water Quarterly $120 Estimated Total Annual Cost b) A news report claimed that utility costs would rise by an average of 10% next year. Estimate how much Bianca and Sarah can expect to pay for utilities next year. 0arrow_forwardA Homework (Ch 08) * Mind Tap - Cengage Learning catic/nb/ui/evo/index.html?deploymentld=58830023220612202193347127562&elSBN=97813376223498&id=9084911198&snapshotld=1937530& Q Search CENGAGE MINDTAP lomework (Ch 08) 5. Deriving the short-run supply curve Consider the perfectly competitive market for halogen lamps. The following graph shows the marginal cost (MC), average total cost (ATC), and average variable cost (AVC) curves for a typical firm in the industry. 80 72 64 56 48 ATCA 40 32 24 16 AVC MCO 8 16 QUANTITY OF OUTPUT (Thousands of lamps) 24 32 40 48 56 64 72 80 14 5 go 19 194 ho. pll fg DII DDI delete home enc $. & * 5 7. 8. 9. num %3D backspace lock { R. V D. PER UNT (Dollars)arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Economics Today and Tomorrow, Student EditionEconomicsISBN:9780078747663Author:McGraw-HillPublisher:Glencoe/McGraw-Hill School Pub Co
Economics Today and Tomorrow, Student Edition
Economics
ISBN:9780078747663
Author:McGraw-Hill
Publisher:Glencoe/McGraw-Hill School Pub Co