Description
Organize notes based on PPT and make them as concise as possible
Unformatted Attachment Preview
BU.450.740
Retail Analytics
Week 6
Planning a Merchandising Strategy
Prof. Mitsukuni Nishida
Johns Hopkins Carey Business School
1
Today’s Agenda
PLANNING A
MERCHANDISING
STRATEGY
2
RECAP: Promotion Campaign of Camper
• Assume you are a consultant to Meiers Home Furnishing, a familyowned retail furniture firm in Chicago
• Retail expansion strategy of Meiers has not been successful
– Firm’s first store (“Lombard”) is doing well; $3.1M
– Firm’s second store (“Pulaski”) is struggling in sales, despite the
seemingly similar demographics: $2.4M
• Our task: Design a merchandising strategy for Meiers’ second store
3
Issues We Encountered in Last Week’s Exercise
• When comparing demographic variables between two stores, we
relied on geographical distribution on the maps (eye-ball exercise)
• Although intuitive, we did not have solid numbers to compare the
demographic variables
• Important quantitative questions remain
– Is overall income (i.e., not just average) higher in Lombard
location than Pulaski for the trade area?
– What about house values? If so, how much?
• How can we construct demographic variables at trade area, such as
1-mile ring for each store?
4
EXPLORE DEMOGRAPHIC
CHARACTERISTICS IN DETAIL
5
In This Analysis, We Will
1. Define & display a simple one-mile ring market area
2. Compare the demographic characteristics of the market areas of
the two stores
https://gisanddata.maps.arcgis.com/home/index.html
6
Define Market Areas for Two Stores
Create a buffer layer
• Choose “Perform Analysis” icon
• Choose “Feature Analysis – Use Proximity” – “Create Buffers”
7
Define Market Areas for Two Stores
To Create a buffer layer
• For 1, select “Meiers”
as Input layer
• For 2, Choose 1
miles
• For 3, Name “Meiers
Market Areas”
• Hit RUN ANALYSIS
8
Define Market Areas for Two Stores
9
Change Layer’s Symbology
Next, let’s change the
color of these two 1mile rings to
transparent color with
an orange edge
• Click “Change
Style” on Meiers
Market Areas layer
• Choose Option
• Choose Symbols
• Choose No color
for FILL & Orange
for OUTLINE
10
Change Layer’s Symbology
CONSTRUCT DEMOGRAPHIC
VARIABLES AT 1-MILE RING
12
Select Lombard Store’s “Ring”
To explore market areas
• Click on attribute table
on “Meiers Store
Market Areas” layer
• Select the top row,
Lombard store, as a
feature
• The one-mile ring
for Lombard store
is now highlighted
in blue
• Select Perform
Analysis on “Meiers
Market Areas” layer
• Click Feature Analysis
– Find Locations- Find
Existing Locations
Select Lombard Store’s “Ring”
• For 1, choose “Average Family Income by Census Tracts”
• For 2, choose Add Expression & set parameters as shown below
• For 3, name “Census Tracts within 1mile from Lombard Store”
• Hit RUN ANALYSIS
Census Tracts Under Lombard Store’s “Ring”
EXPORT THE SELECTED
OBSERVATIONS TO
SPREADSHEET
16
Export Selected Census Tracts’ Information
on ArcGIS Desktop
• Right click on
“Average Home
Value” and choose
“Selection > Open
Table Showing
Selected Features”
ANALYSIS ON SPREADSHEET
18
Analysis on Excel Spreadsheet
• Open Lombard.csv
• Generate a row providing means for “AVGFINC_CY” and
“AVGVAL_CY”
• Construct two columns on
• Total family income, 2004 = FAMHH_CY * AVGFINC_CY
• Total value of home, 2004 = FAMHH_CY * AVGVAL_CY
• Generate a row summing up these two variables
Lombard Store
Pulaski Store
Create “Dashboard” For Comparison
At Glance
• The quantity aspect– total number of family household– favors Pulaski
• The quality of the segments looks better for Lombard in average income
and value of home, hinting both locations belong to different segments
• Remark: If we take all census tracts that intersect with the rings, the
conclusion for total income and home value is reversed in favor of
Lombard (so it is sensitive to the definition of market areas)
• Next step: You may now want to access market segmentation data
(end of slides)
BU.450.740
Retail Analytics
Week 6
Omni-channel & AI in Retailing
Prof. Mitsukuni Nishida
Johns Hopkins Carey Business School
1
Announcements
• Homework 5 is due now
• Next week: Presentation & course evaluation
2
Week 7: Presentation
• Each group is given 10 minutes slot in total (8 minutes
presentation + 2 minutes Q&A)
• Each group submits slides & a research report
– Slide format: 8 slides max. Would recommend 5-6 slides
• You can add appendix slides beyond 8th slide
– Report format: 12-point Times New Roman font, single
spacing, 8 pages max in total
• You can add extra figures and tables beyond 8 page limit
• In week 7, each member submits peer review. The format will be
notified later and uploaded to Canvas
3
RECAP: Group project Retail
1. Proposing a new business startup project in retailing
– Goal: to come up with an entrepreneurship plan in retailing that
the group can pitch to venture capitalists
– Identify potential business needs in retailing and propose a feasible
plan to address the needs given the current state of the business
environment.
– Presentation includes an analysis of the market, description of
products or services, an implementation timeline & budget
– The analytical tools will include market analysis
• Porter’s five-forces model and competitive advantage
• Please do not use SWOT or PEST in the interest of time
– Be creative & innovative. Please avoid choosing business models
that already exist.
– Extra points (3%) if the project applies data analytics skills (i.e.,
regression, machine learning) to the data set the group acquires
4
RECAP: Group project Analytics
2. Conducting a data project in retailing
– Collecting, cleaning, and conducting data analysis in retailing
– Goal: each group identifies and addresses an existing
marketing (& operational) issues in pricing, entry, location,
promotion, products, and logistics via the use of analytics
– You can choose the data set to work with
• The original data set you have access to obtained from network (e.g.,
previous employer)
• Dominick’s scanner data: Most time-consuming to clean up &
understand, but probably most rewarding in terms of experience
• Market-level aggregated store count and revenues for conveniencestore chains in Japan
– Extra points (3%) if the group (1) finds out and utilize its original
data set or utilize Dominick’s or (2) use beyond linear regressions
– Be sure to be clear what the group want to do with the data before
absorbed in the data.
5
Rubric for Presentation
Rate the presentation 1 (worst) – 10 (best) based on the following
1. Tools
Has the group appropriately incorporated the analytical and
empirical tools introduced in this course?
2. Goal
Did the presentation achieve the goal of the presentation?
– For retail track: whether the group has come up with an
innovative entrepreneurship plan in retailing such that the
group is likely to be funded by venture capitalists
– For analytics track: whether the group has identified and
addressed an existing marketing (& operational) issues in the
use of analytics such that the profitability may increase
3.
Presentation skills
Were presentation and communication effective to achieve the 6
goal?
Today’s Agenda: Omnichannel,
AI, and Advanced Topics from
Game Theory
• Pillar 1: Omnichannel in retailing
• Pillar 2: Advanced analytical models in retailing
– Most Favored Customer Clause
– Tacit collusion in AI pricing
– Equilibrium in space: Application in retailers’ location choice
– Negotiation in retailing
• Pillar 3: Advanced empirical topics in retailing
– AI and neural network models in R
– Trade area analysis in ArcGIS
7
RETAIL NEWS: Walmart to
acquire Vizio in $2.3 billion
deal (Feb 20,2024)
8
Walmart to acquire Vizio in $2.3
billion deal (Feb 20,2024)
• Walmart announced an agreement to buy Vizio, California-based firm
known for manufacturing lower-priced TVs
• Intentions behind acquisition?
– Advertising business: Vizio makes money by selling ads, including
those shown on the Vizio SmartCast OS and on free content available
on its TVs with ads. Walmart can boost its Walmart Connect
• Walmart Connect: It sells various types of ads, including adverts that
appear on Walmart’s website and app
• Retail as media (RMN): Walmart Connect wants to be a top-10 advertising
business. Alphabet, Amazon, and Meta are among the world’s biggest
advertising companies today
– Access to user data: Data gathered from Vizio TVs will be combined
with data on shoppers that Walmart already gets. Walmart plans to use
this customer data to sell targeted ad space, such as banners above
Walmart.com search results
– Why Vizio?
• 500 direct advertiser partnership
9
• 18 million users = 12% of connected TV OS market share
PILLAR 1: OMNICHANNEL IN
RETAILING
10
Single, Multi, and Omni-Channel
Omnichannel: flexible combination of a store, website, and app channels
Facts from Harvard Business Review (2017) study of 46,000 shoppers
• 73% used multiple touchpoints (7% online-only, 20% store-only)
• Customers who used 4+ channels spent 9% more in the store and 23%
more repeated purchase trips
• “Webrooming” (vs. Showrooming): Conducting prior online research led
to 13% greater in-store spending
• Although these facts are correlation (i.e., causality is unknown)
11
omnichannel strategy offers product differentiation over online retailers
Strengths of Channels
Integration as Omnichannel
Case 3, 4, 5
Sephora, IKEA, Walmart
Case 1: Bass Pro
Case 2: AVON
Direct Selling
Delivery is instant
Can reach customers without transportation or internet
12
Case 1: Stimulating Experience
by Offline Retailing
More than 116 million people visit Bass Pro Shops annually “…the excitement
generated in Bass Pro Shops cannot be equaled by other channels.” (Levy, 2019)
Q: How many people visit Disney World in Orlando annually?
A. 20.5 million
13
Case 2: Direct Selling Channel
Still Exists
Avon– 5th largest beauty company from UK– applies direct selling
channel in developing countries, such as Brazil
Avon’s sales force sells door-to-door, whether the customer live in city
slums, the Amazon rainforest, or remote towns… more than 50% of
Avon’s revenues were generated in emerging markets
14
Case 3: Successful Integration
For Sephora, France-based multinational cosmetic retailer, marketing strategy is to
blend online and in-store experiences to
(1) Provide Augmented Reality to try on makeup products
(2) Offer shopping assistance: recommendation, reviews, pricing
15
(3) Promote products via social, mobile, and web platforms
Case 4: Expand Presence by
Adding Online Channels
For retailers with strong brand names and unique products, they face
issues in (1) limited locations, (2) limited assortments, (3) safety
For them, adding an online channel is attractive because they
expand the market without having to build new stores
16
Case 5: Omnichannel Offers BM Retailers
Competitive Advantage
“…store pickups accounted for nearly a third of U.S. online sales last November and
December… Shoppers, on their part, avoid shipping costs and the agony of waiting for
the delivery and can get help from store staff if any issues come up…Retailers save on
packaging and delivery costs as they have items on sale in their in-store backrooms
rather than a distant warehouse.” (Balu et al., 2019)
17
Three Challenges for Omnichannel
Challenge 1: Supply chains and information systems needs complex
operations
• The operations and organizations for logistics need to meet
different demand from various channels (internet, mobile, catalog,
offline), which require skills and resources for fulfillment
Walmart’s distribution center
18
Challenge 2: Consistent Brand Images
Patagonia, outdoor equipment retailing: Their channels
emphasize function (high quality & environmentally friendly), not
fashion, in the descriptions of Patagonia’s products in all of its
channels
19
Challenge 3: Channel Migration
• Consumers often visit a store to learn about brands and products
– After the visit, they search internet for the same product sold
at a lower price (Channel Migration or “showrooming”)
Warby Parker (WP), eyeglass
retailer, ships five dummy frames
for free so customers can try on
before purchase
While the promise has been well
received, shipment also created
very high shipping costs
Having store locations allow WP
to save expensive shipping costs
while preventing showrooming
20
PILLAR 2: Advanced
Analytical Models in
Retailing (1) STRATEGIC
MOVES THAT SOFTEN
RIVALRY
21
Best Price Guarantee Is Everywhere
22
Is this “price guarantee” a marketing strategy to please customers?
Most Favored Customer Clause (MFCC)
The Ford Price Promise
•
•
•
In1999, UK customers were
“unsettled” by rumors of
future price reductions
Ford launched the £400,000
“Price Promise” national
advertising campaign
Under the “Price Promise”,
Ford will reimburse any
reduction in the
recommended retail price
difference
– a.k.a. “Most Favored
Customer Clause”
23
MFCC: Interpretation via Game Theory
Ford price promise in 1999
1 – Pricing Rivalry Game.
Unique NE is both firms with
low price
2 – Ford makes a move that
increases its costs in the event
of lowering prices; same NE,
Ford worse off
Competitor Price
Low
Low
3
Ford
Price
6
High
5.5
7
6
6
3.5
Ford
Price
5.5
5.5
6
High
High
3
3
Low
3.5
Ford
Price
High
3.5
3
Low
7
7
Low
High
5
Low
5
Competitor Price
Competitor Price
High
5
3 – GM understands and copies
Ford move; New NE – both firms
with high price!!!
3
6
3
6
After introducing MFCC, both firms are worse off by
unilaterally choosing low prices, thus they are able to
credibly commit to high prices
24
PILLAR 2: Advanced
Analytical Models in
Retailing (2) TACIT
COLLUSION IN AI PRICING
25
“Economics of AI” at NBER Meeting, 2018
“Q-Learning to Cooperate” by Calvano et al.
• Theoretical simulations by two AI agents
• AI agents perform reinforcement learning (“Q-Learning”)
• These two AI agents learned to cooperate in prices
• Implication: AI pricing can sustain tacit collusion while avoiding
26
being investigated by antitrust authorities
PILLAR 2: Advanced Analytical
Models in Retailing (3) LOCATION
CHOICE IN SIMULTANEOUSMOVE GAMES
27
Retail Colocation Is Everywhere
28
Application: Ice Cream Stands’ Location
What if we cannot represent a game by a game matrix because the choice variable is
a continuous variable?
• Suppose two ice cream stands, A, and B, both operated by
different firms, are considering to locate between location 0 and 1
• 100 customers uniformly exist on this a mile long beach
A
B
0
1
Buy at stand A
(40 people)
0.4Buy at stand A0.6
(20 people)
0.8
Buy at stand B Buy at stand B
(20 people)
(20 people)
• Assumptions 60 people for stand A
– Same price, quality, and variety, no collusion
– Consumers will buy from the closest stand
•
Q1: How many people would buy at stand A if A and B locate 0.4 & 0.8?
– Ans. 60 people
29
Ice Cream Stands’ Location
A
B
0
1
0.4
0.8
• Suppose that stand B’s location is given at 0.8
• Q2. What would stand A, currently at 0.4, do to maximize its sales?
a.
Move left and locate 0.2
b.
Move right and locate 0.6
c.
Move right and locate 0.79999
d.
Move right and locate 0.8
e.
Move right and locate 1
f.
Do nothing
g.
None of the above
31
Ice Cream Stands’ Location
A
B
0
1
0.4
0.8
• Q3. At which location would you expect these two ice cream
stands would not relocate given its competitor’s location? (i.e.,
Nash equilibrium in location?)
a.
(Stand A, Stand B) = (0,1) or (1,0)
b.
(Stand A, Stand B) = (0.4,0.8)
c.
Both stands are in the middle: (0.5, 0.5)
d.
None of the above
33
34
Ice Cream Stands’ Location
A
A
B
0
1
0.4
0.5
Buy at stand ABuy at stand A Buy at stand B
(40 people) (5 people)
(5 people)
45 people for stand A
Buy at stand B
(50 people)
55 people for stand A
• Why is (stand A, stand B) = (0.5, 0,5) a NE?
– At (stand A, stand B) = (0.5, 0,5), no stand is interested in
relocating, and each earns 50 customers
– To see why, consider if stand A has an incentive to relocate
from the middle (i.e., deviate from 0.5)
– If stand A chooses 0.4, for instance, stand A will now have 45
customers– worse off by 5 customers!
Ice Cream Stands’ Location
A
B
0
1
0.4
• Why doesn’t another location, such as (0.4, 0,4) qualify as a NE?
– If (0.4, 0.4), stand A has an incentive to move slightly right from
0.4 (say 0.401), to capture 60 people (check by yourself)
• NE is both locate at the middle, as neither station wants to deviate
• Implication (1) retail outlets tend to cluster, (2) median voter
theorem: Two parties often offer similar package of policies
Left
wing
Right
wing
PILLAR 2: Advanced Analytical
Models in Retailing (4)
BUSINESS NEGOTIATIONS IN
RETAILING
37
Negotiation with deadline
• A seller and a tourist are sharing $100. They both
know the negotiation will take place as following
• Day 1
– A tourist (T) proposes T’s and seller (S)’s share
– If the seller accepts the proposal, game finishes
– If the seller declines, the game continues to day 2
• Day 2
– The total amount decreases from $100 to $90
– S proposes S’s and T’s share
– If T accepts the proposal, the game is finished
Otherwise, both obtain nothing
• Q: If you were the tourist, which share should you
propose to the seller in day 1? (i.e., minimum share
that the seller accepts)
38
Negotiation with deadline
Payoff = (S, T)
T proposes
$s for S,
$100-s for T
S accepts
“I (T) will set s = 90.”
S declines
(90,10)
(90,0)
(s, 100-s)
S proposes
$t step
for T,2
To
$90-t for S
“I (S) will set t = 0.”
T accepts
T declines
(90-t, t)
(0, 0)
The last player (S) to offer a deal captures surplus from a transaction
Lesson: Be the last player to make an offer before deadline
Ultimatum Game: Examples
• Foreign relationships
– The United Kingdom issued an ultimatum to Germany,
requiring German troops to evacuate Polish territory in 1939
– President Bush gives the final ultimatum to Saddam Hussein
in 2003. His conditions are that Saddam and his sons must
leave Iraq in 48 hours
• Business strategies
– Debt collection agencies, land owners, car dealers, issuing
take-it-or-leave-it offers
40
(end of slides)
BU.450.740
Retail Analytics
Week 6
AI and Deep Learning in Retailing:
Implementation in R
Prof. Mitsukuni Nishida
Johns Hopkins Carey Business School
1
Today: Deep Leaning Methods
• Introduction to Deep Learning in Retailing
• Implementation in R using retail data
– Shallow Neural Network
– Deep Neural Network
2
WHAT IS DEEP LEARNING AND
WHAT DL ACCOMPLISHES
3
Recap: DL Is a Subset of ML
e.g., Yes/No judgement
4
Recap: DL Is a Subset of ML
Deep Learning
REINFORCEMENT
LEARNING
(no input or
output data)
Today
Today: Classification
From data, we predict and
choose category/label
Xs: Data (image, text, ..)
Y: “Correct” Label,
provided by researchers
REINFORCEMENT
LEARNING
6
Machine Leaning (ML)
Machine Learning: Letting computers to automatically find out the
set of rules by itself
Classical ML (i.e., not Deep Learning) (1) human defines features
(2) algorithm extracts data patterns using features (= “learn”) (3)
applies to unknown data to predict and classify
• Example: Which image is apple? Why? (=What is apple?)
• To classify one from another, programmers define two features
(1) Color and (2) Shape
Apples are…
Red (Feature 1: Color)
Circle (Feature 2: Shape)
Desks are…
Brown (Feature 1: Color)
Square (Feature 2: Shape)
7
Classification: Iris Dataset
Petal length
Sepal length
To classify observations into three groups, we
draw boundary lines using two features: Sepal
length & petal length
Versicolor Basic methods
1. Logistics regression
2. K-nearest neighbors
Setosa
Advanced methods
1. Random forests
2. Support vector machines (SVM)
8
Deep Leaning (DL)
• A class of machine-learning algorithm based on artificial neural
network
– DL model mimics human brain’s structure
• DL automatically learns which features to extract for recognition
– NO need for complicated programming
Car is an object
with wheels,
windshield, …
Images
provided to
computers
(Classical)
Computers
output if
car or not
9
Reinforcement Learning
• Strongest Go player in the world in 2017
• Software agents play against each other without
data on humans’ past plays (i.e., No “Xs” and “Y”)
• Often combined with deep leaning
Deep learning
REINFORCEMENT
LEARNING
(no input or
output data)
e.g., Waymo
Through trials and errors, an
software agent
(1) Observes environment
(2) Takes actions to maximize
cumulative reward
What Deep Leaning Has
Accomplished
• Image recognition
– Object detection &
recognition
• Learning human motions
– Combines image recognition,
robotics, & enforcement
leaning
• Speech & text recognition
– DeepL/Google translation
– Hand-writing
– Image to text
11
What Deep Leaning Has
Accomplished (Cont’d)
• Natural Language Processing
– ChatGPT: Open AI’s 2020 release of high-precision linguistic
AI with 175 billion parameters
12
What Deep Leaning Has
Accomplished (Cont’d)
• Generative AI in Image and Video
– DALL E2 and Sora
• “Draw a dog playing with X in oil paint.”
13
Breakthrough in 2012: Image Recognition
At ILSVRC (ImageNet Large Scale Visual Recognition Challenge)
Automatically learns features
5.1%
Only one hidden layer
More than one hidden layer
14
Breakthrough in 2018: Natural Language
Processing
GLUE (General Language Understanding Evaluation)
15
Image Recognition in Agriculture: Agrobot
Strawberry harvester that harvests only ripe & grown strawberries
16
Image Recognition in Retail
“GIANT Food Stores says ‘Marty’ the
grocery robot will be checking for spills
at all 172 of its stores.” (Stamm, Jan
2019)
“In October 2017, Walmart announced it
had deployed 50 of Bossa Nova’s robots
(Johnson, June 2018)
Ended contract & opts for human
workers (Nov 2020)
17
Reservations to DL
•
Lack of causal relationship expressed by Dr. Yoshua Bengio
(Interview to Turing Award winner by Williams, 2019)
– “…but deep learning is fundamentally blind to cause and
effect. Deep learning is good at finding patterns in reams of
data, but can’t explain how they’re connected.”
– “Causality has long been studied in other areas, and
mathematical techniques have emerged in recent decades for
exploring causal relationships, helping to revolutionize the
study of fields including social science, economics, and
epidemiology. A small group of researchers is working to
combine causality and machine learning.”
• Integration of Machine Learning & Causal inference in
Economics is on the way: See Athey (2018)
18
HOW DEEP LEARNING
MODELS RESEMBLE HUMAN
BRAIN
19
Image Recognition: Human & Machine
Retina: receive light, convert into neural signals, & send these to brain
Visual cortex: receives, integrates, &
processes visual information
20
How Brain Works: Neural Networks
21
Mimicking How Brain Works: Neural Networks
22
What Is “Deep” and Why Now?
Brain’s network of neurons in 3D
Construct single (i.e., “shallow”) layer
Construct multiple (i.e., “deep”) layers
• Idea of mimicking human neural network has been around since ‘50s
• Unfortunately, implementation has been technically infeasible
• Number of parameters to estimate: 10 thousands to millions
• Now, (1) Increase in computing power and (2) presence of big data
allow us to perform this model to data
23
• We do not know perfectly why deep learning works
Number of Neurons
Today’s R exercise: Approximately 200 neurons
24
Large Language Models
1.76 trillion
25
NEURAL NETWORK:
SIMPLE MODEL
26
Neural Network Model
• Y: output variables
– Binominal (“binary”):
e.g., Buy or not buy
– Multinominal: e.g., Buy
brand 1,2,3, or 4
u1 Z1
w11
X1
w21 w31
u2 Z2
Y1
u3 Z3
Y2
X2
• X: inputs or explanatory
variables
– Examples: Prices,
promotion, location, ..
• u: hidden variables
=X3 + + +
= ( )
u4 Z 4
where =
: sigmoid-type activation function
+ −
27
Neural Network Model
• Y: output variables
– Binominal (“binary”):
e.g., Buy or not buy
– Multinominal: e.g., Buy
brand 1,2,3, or 4
u1 Z1
w11
X1
c11
w21 w31
u2 Z2
X2
c21
Y1
c31
u3 Z3
Y2
c41
• X: inputs or explanatory
variables
– Examples: Prices,
promotion, location, ..
• u: hidden variables
=X3 + + + +
= ( )
u4 Z 4
where =
: sigmoid-type activation function
+ −
28
Neural Network Model
Back propagation
u1
w11
X1
X: images
w21 w31
u2
X2
Y: Prob.
of dog
vs. cat
c11
c21
Y1
Training
data
Dog
0.05
0.55
0.0
Cat
0.95
0.45
1.0
c31
u3
Y2
c41
X3
u4
We will be minimizing the gap
between the prediction and the
training data’s Y
We do so by choosing the
weights: ws and cs
29
Example of NN: Image Recognition
Each Xi takes either 0, 92, 178, 255
28px x 28px
black/white
image
784 (=28 x 28) nodes
(784 neurons)
Activation function converts yi into probability
30
Neural Network Model
We find parameters (bi, wii,
cii) to minimize the prediction
error regarding output (Y)
u1
w11
X1
w21 w31
u2
X2
c11
c21
Y1
We adopt the following
criteria (“loss function”) to
minimize:
c31
Prediction error
u3
Y2
2
[ − (
+
+ + + )]
X3
=1
c41
Prediction error
+ [ − ( +u 4 + + + ]2 + 2
=1
31
Regularization term to prevent overfitting
How Does ChatGPT Work
32
NEURAL NETWORK:
IMPLEMENTATION IN R
33
Ketchup Data (“Catsup”)
• Point Of Sales (POS) data on four kinds
– Heinz 41 oz
– Heinz 32 oz
– Heinz 28 oz
– Hunts 32 oz
• Variables
– “id”: Customer id
– “choice”: a product consumers purchased
– “price”: transaction price
– “disp”: Store promotion
– “feat”: Flyer promotion
• Number of observations: 2,798
• We decompose the data into training data (2,000
obs.) and testing data (798 obs.)
34
Neural Network (NN): Data
p < $1 = 3 obs
p < $1 = 1 obs
p < $1 = 3 obs
These 7 obs. (=3+1+3) may be some data entry errors and are potentially concerning,
35
but we just go with as is, because the number of total obs. Is large enough
Neural Network (NN): Setup
We install packages for neural network (“nnet”)
• # Install required packages for neural network
• install.packages(c("RCurl","scales","nnet","rtools"))
36
NN: Implementation via “nnet”
### 2-0 Prepare training data
• set.seed(1)
• tr = sample(1:nrow(Catsup),2000)
### 2-1 Neural net with 5 hidden variables
• set.seed(1)
Number of hidden variables
Use training data
Include all variables except id
• n.net H5
39
Estimated NN: Weights Are Automatically Tuned
Note: No Standard Errors Provided, because (1) we do not care much about
each parameter (2) we are interested in performance in prediction
40
Confusion Matrix and Accuracy
When Number of Hidden Layers is 5
What if the number of hidden layers is higher, say 20?
41
NEURAL NETWORK WITH 20
HIDDEN VARIABLES
42
NN with 20 hidden variables
### 2-1 Neural net with 20 hidden variables
• set.seed(1)
Number of hidden variables
Use training data
Include all variables except id
• n.net2
Purchase answer to see full
attachment