Created
          January 9, 2012 09:50 
        
      - 
      
 - 
        
Save Shreyes2010/1582235 to your computer and use it in GitHub Desktop.  
    Aggregate demand curve 
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Aggregate demand curve | |
| ad.curve <- function(c, A, b, ms, h, k ,y) # We are trying to arrive at a relation between | |
| # Prices and output. | |
| { | |
| alpha <- 1/(1-c) | |
| omega <- (k/h) - (1/alpha*b) | |
| P <- (ms/h)/(y*omega + (A/b)) # This is just basic algebra, you substitute "i" in terms of | |
| # "P" and "Y" from the IS and LM equations and find a relation between prices and output. | |
| return(P) | |
| } | |
| # Deriving the AD curve | |
| ms.ad <- 10000 | |
| ad <- ad.curve(mpc, autonomous.component , b, ms.ad, h, k ,y.is) | |
| plot(y.is, ad, type="l",xlim = c(180,205), ylim = c(37.68,38.05), | |
| main = "Aggregate demand curve", xlab = "Output(Y)", | |
| ylab = "Prices(P)", col = "royalblue") | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment