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
CFMe <- function(Y) {500/Y}
CVMe <- function(Y) {300 - 20*Y + 0.5*Y^2}
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,CFMe(Y),col=grey(.8),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","CFMe"),bty="n",lty =c(1,1,1),
col=c("blue","red",grey(0.8)),pch=c(19,19,19),cex=0.9)
# valores selecionados
data.frame(Y=Y,CFMe=CFMe(Y),CVMe=CVMe(Y),CMe=CMe(Y))[30:49,]
## Y CFMe CVMe CMe
## 30 15,35354 32,56579 110,7948 143,3606
## 31 15,84848 31,54876 108,6175 140,1663
## 32 16,34343 30,59333 106,6852 137,2786
## 33 16,83838 29,69406 104,9979 134,6920
## 34 17,33333 28,84615 103,5556 132,4017
## 35 17,82828 28,04533 102,3582 130,4035
## 36 18,32323 27,28776 101,4058 128,6935
## 37 18,81818 26,57005 100,6983 127,2684
## 38 19,31313 25,88912 100,2359 126,1250
## 39 19,80808 25,24222 100,0184 125,2606
## 40 20,30303 24,62687 100,0459 124,6728
## 41 20,79798 24,04080 100,3184 124,3592
## 42 21,29293 23,48197 100,8358 124,3178
## 43 21,78788 22,94854 101,5983 124,5468
## 44 22,28283 22,43880 102,6057 125,0445
## 45 22,77778 21,95122 103,8580 125,8092
## 46 23,27273 21,48438 105,3554 126,8397
## 47 23,76768 21,03697 107,0977 128,1347
## 48 24,26263 20,60783 109,0850 129,6928
## 49 24,75758 20,19584 111,3173 131,5131