Universidade Federal da Paraíba

Curso de Graduação em Economia

Análise Microeconômica I

options(OutDec=",")


# Criar sequências de 100 números ordenados de 1 a 50 (produção)
Y <- seq(1,50,length=100)

# Definir funções de custo
CMg <- function(Y) {300 - 40*Y + 1.5*Y^2}
CVMe <- function(Y) {300 - 20*Y + 0.5*Y^2}
CFMe <- function(Y) {500/Y}
CMe <- function(Y) {CFMe(Y) + CVMe(Y) }

# desenhar gráfico:
par(oma=c(0,1.8,0,0.8))
plot(Y,CMe(Y),type="o",bty="l",cex.lab=0.8,cex.axis=0.8,col="blue",lwd=2,las=1, pch=19,cex=0.7,ylim=c(0,max(CMe(Y))),
     ylab="Custos de Produção",xlab=expression(Y))
grid(col=grey(0.80))
points(Y,CVMe(Y),col="red",pch=19,type="o",cex=0.7)
points(Y,CMg(Y),col=grey(.1),pch=19,type="o",cex=0.7)
par(fig=c(0, 1, 0, 1), oma=c(0, 0, 0, 0),mar=c(0, 0, 0, 0), new=TRUE)
plot(0,axes=F,xlab="",ylab="",col="transparent")
legend("topright",c("CMe","CVMe","CMg"),bty="n",lty =c(1,1,1),
       col=c("blue","red",grey(0.1)),pch=c(19,19,19),cex=0.9)

# valores selecionados
data.frame(Y=Y,CMg=CMg(Y),CVMe=CVMe(Y),CMe=CMe(Y))[20:45,]
##           Y       CMg     CVMe      CMe
## 20 10,40404  46,20447 146,0412 194,0995
## 21 10,89899  42,22238 141,4142 187,2900
## 22 11,39394  38,97521 137,0321 180,9151
## 23 11,88889  36,46296 132,8951 174,9511
## 24 12,38384  34,68564 129,0030 169,3782
## 25 12,87879  33,64325 125,3558 164,1794
## 26 13,37374  33,33578 121,9537 159,3404
## 27 13,86869  33,76324 118,7965 154,8489
## 28 14,36364  34,92562 115,8843 150,6944
## 29 14,85859  36,82293 113,2171 146,8676
## 30 15,35354  39,45516 110,7948 143,3606
## 31 15,84848  42,82231 108,6175 140,1663
## 32 16,34343  46,92440 106,6852 137,2786
## 33 16,83838  51,76140 104,9979 134,6920
## 34 17,33333  57,33333 103,5556 132,4017
## 35 17,82828  63,64019 102,3582 130,4035
## 36 18,32323  70,68197 101,4058 128,6935
## 37 18,81818  78,45868 100,6983 127,2684
## 38 19,31313  86,97031 100,2359 126,1250
## 39 19,80808  96,21687 100,0184 125,2606
## 40 20,30303 106,19835 100,0459 124,6728
## 41 20,79798 116,91475 100,3184 124,3592
## 42 21,29293 128,36609 100,8358 124,3178
## 43 21,78788 140,55234 101,5983 124,5468
## 44 22,28283 153,47352 102,6057 125,0445
## 45 22,77778 167,12963 103,8580 125,8092