Instrumental Variables in Python: Estimating Price Elasticity

  Рет қаралды 4,228

Matt Birch

Matt Birch

Күн бұрын

I use data from the Kathryn Graddy's analysis of the Fulton Fish Market to estimate the price elasticity of demand in that market. I explain, on a theoretical/graphical level, why standard OLS regression cannot satisfactorily estimate the demand curve or its elasticity, and explain why IV can help us to estimate the elasticity of demand.
Kathryn Graddy's paper: www.aeaweb.org...
My Jupyter Notebook and the data are posted on GitHub: github.com/Mat...

Пікірлер: 14
@maximus8988
@maximus8988 2 жыл бұрын
Thanks for sharing! The code and explanations helped me a lot!
@MattBirch
@MattBirch 2 жыл бұрын
Glad to hear it! Good luck!
@redwings02
@redwings02 7 ай бұрын
@MattBirch, love the video. Very useful for what I'm working on. Question though: since the R-Squared for the IV model is so low, are we still able to trust the slope coefficient and thus PED? How high of an R-Squared do we need to have a reliable demand curve?
@MattBirch
@MattBirch 7 ай бұрын
Totally depends on context. The r squared can be higher than my little toy example of course! You can construct proper confidence intervals in an IV framework,and from there it just depends on what you need. But if you have confounding or endogeneity in your model and do normal OLS, it won't usually matter what the r squared or CI is. Because the model will give you an estimate that is biased, even with large data sets.
@AhmedThahir2002
@AhmedThahir2002 Ай бұрын
I still didn't quite catch why we cannot directly run OLS ... I get we can't do, but I'm not able to pin down exact the concept - What is the concept called? - Do you have any reference videos?
@MattBirch
@MattBirch Ай бұрын
An economist will usually call it endogeneity or some form of bias. A data scientist will offer refer to confounding factors. The issue is that the assumptions on the error terms being random and iid is false, which means the betas are literally asymptotically biased. No matter how much data you get, the actual estimate of the beta can be wrong if the errors are screwy.
@spammytrashy3710
@spammytrashy3710 2 жыл бұрын
Great explanation!
@MattBirch
@MattBirch 2 жыл бұрын
Glad it helped! Good luck!!
Жыл бұрын
Awesome explanation and code! Please do more problems with Python code! Cheers
@MattBirch
@MattBirch Жыл бұрын
I'm glad you liked it. You'll probably want to look elsewhere for Python videos, though. Mine will be coming very slowly :)
@Hecticam
@Hecticam 10 ай бұрын
you mentioned the linear regression model is bad - accounting for just 8% of the observations, but the IV model's R2 is far worse....
@MattBirch
@MattBirch 10 ай бұрын
It is, and it always will be. Casual inference models with observational data will always be weaker than pure prediction models. The reason is that the CI goal, getting an unbiased estimate of a beta, is not the same as the prediction goal of minimizing so.e sort of error term. In this case, we used the weather to predict price variation,and the used predicted prices in the quantity equation. The weather only predicts some of price and introduces more noise, and so the main equation has more noise in it. On top of that, error terms in CI models can also be greatly complicated depending on the endogenous behavior on the error term, so this video really only scratches the surface. But it is a start. Cheers!
@parthshrivastava2548
@parthshrivastava2548 Жыл бұрын
Hey I had a question (slightly detailed). Was wondering if I could send you an email or something?
@MattBirch
@MattBirch Жыл бұрын
Can't promise much, but feel free to ask. Connect and message me on LinkedIn www.linkedin.com/in/matt-birch-phd-332a0b186
Price Elasticity of Demand using Machine Learning in googlecolab
30:59
the outlier 73
Рет қаралды 4,7 М.
FULL TUTORIAL: Price Elasticity and Optimization in Python (feat. pyGAM)
2:07:34
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
Synyptas 4 | Жігіттер сынып қалды| 3 Bolim
19:27
kak budto
Рет қаралды 1,3 МЛН
Cool Parenting Gadget Against Mosquitos! 🦟👶
00:21
TheSoul Music Family
Рет қаралды 16 МЛН
Predict The Stock Market With Machine Learning And Python
35:55
Dataquest
Рет қаралды 701 М.
How to Create a Beautiful Python Visualization Dashboard With Panel/Hvplot
10:57
Thu Vu data analytics
Рет қаралды 547 М.
Pricing Analytics: Estimating Demand Curves Without Price Elasticity
5:34
The New Frontier of Data-Driven Price Optimization
1:07:48
Georgia Tech Supply Chain and Logistics Institute
Рет қаралды 14 М.
Price Elasticity - Learn Customer Analytics
9:34
365 Data Science
Рет қаралды 15 М.
Pricing Analytics: Creating Linear & Power Demand Curves
11:48
Michael Lamont
Рет қаралды 84 М.
Parallel Computing in R
11:34
Matt Birch
Рет қаралды 4,2 М.
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34