Two interest rates and money-market equilibrium
- Fisher equation: the nominal rate is the real rate plus expected inflation, \[i = r + \pi^e.\]
- Real money demand falls with \(i\) (holding cash costs forgone interest). Here \((M/P)^d = \dfrac{Y}{2i}\).
- Equilibrium: the price level \(P\) adjusts so real supply meets real demand, \(M/P = \dfrac{Y}{2i}\).
- Velocity follows: \(V = \dfrac{PY}{M} = 2i\).
- Ex ante real rate \(= i - \pi^e\) (expected); ex post \(= i - \pi\) (realized).
Try it. Raise expected inflation: \(i\) rises, people hold less real money, so \(P\) jumps more than the money stock. Watch velocity rise too.
#| standalone: true
#| viewerHeight: 540
library(shiny)
ui <- fluidPage(
tags$head(tags$style(HTML("body{font-family:'Inter',system-ui,sans-serif;}
.sb{background:#f0f4f8;border-radius:6px;padding:12px 14px;margin-top:10px;font-size:14px;line-height:1.85;} .sb b{color:#1f3b73;}"))),
sidebarLayout(
sidebarPanel(width=4,
sliderInput("M","Money supply M:",min=500,max=2500,value=1000,step=50),
sliderInput("r","Real rate r (%):",min=0,max=6,value=2,step=1),
sliderInput("pe","Expected inflation pi_e (%):",min=0,max=12,value=3,step=1),
sliderInput("Y","Real output Y:",min=500,max=2000,value=1000,step=50),
uiOutput("sb")),
mainPanel(width=8, plotOutput("plot",height="460px"))))
server <- function(input,output,session){
output$plot <- renderPlot({
i <- input$r+input$pe; Ld <- function(ii) input$Y/(2*ii)
ig <- seq(1,16,length.out=200); Lg <- Ld(ig); Lstar <- Ld(i)
par(mar=c(4.2,4.6,1,1))
plot(Lg,ig,type="l",col="#1f3b73",lwd=3,xlab="Real money balances M/P",ylab="Nominal rate i (%)",
xlim=c(0,max(Lg)),ylim=c(0,16),las=1,bty="l",cex.lab=1.1)
points(Lstar,i,pch=19,col="#1c6b4a",cex=1.7)
segments(0,i,Lstar,i,lty=3,col="#5a6472"); segments(Lstar,0,Lstar,i,lty=3,col="#5a6472")
legend("topright",c("Money demand Y/2i","Equilibrium (i = r + pi_e)"),
col=c("#1f3b73","#1c6b4a"),lwd=c(3,NA),pch=c(NA,19),bty="n")
})
output$sb <- renderUI({ i<-input$r+input$pe; MP<-input$Y/(2*i); P<-input$M/MP; V<-2*i
HTML(sprintf("<div class='sb'>Nominal rate <b>i = %d%%</b><br>Real balances M/P = <b>%.1f</b><br>Price level <b>P = %.2f</b><br>Velocity <b>V = 2i = %d</b></div>",i,MP,P,V)) })
}
shinyApp(ui,server)
What to notice
- Defaults (M=1000, r=2, \(\pi^e\)=3, Y=1000) give i=5, P=10, V=10 — the exam’s short-answer baseline.
- Raise \(\pi^e\): i and V rise, desired real balances fall, and P rises more than M did.
- The real rate r is set by the real economy; inflation just adds on top (Fisher).