O valor subjetivo de uma alternativa é função da magnitude do ganho e do atraso, isto é \(v = f(m, d)\), onde \(v\) corresponde ao valor subjetivo, \(m\) à magnitude do ganho e \(d\) ao atraso;
Magnitudes maiores são sempre preferÃveis a magnitudes menores, isto é, assumimos insaciabilidade;
O aumento do atrazo diminui o valor de uma alternativa de acordo com a função:
\[\begin{align} v = \frac{m}{1+kd} \tag{1} \end{align}\]Primeiramente, vamos plota o único ponto, correspondente à recompensa imediata.
png('d0.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 200), ylim = c(0, 100),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 200, by = 20), cex.axis = 1)
axis(2, at = seq(0, 100, by = 10), pos = -10, cex.axis = 1, las = 2)
m = 100 # magnitude da recompensa
k = 1 # taxa de desconto
points_to_plot = 0
for (i in 1:length(points_to_plot)) {
d = points_to_plot[i]
v = m/(1+k*d) # função do valor subjetivo
segments(d, 0, d, v, lty = 2)
points(d, v, pch = 21, cex = 2, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
}
dev.off()Agora, para observar o efeito do atraso, vamos plotar os valores de \(v\) correspondentes para \(d \in \{0, 5, 10, \ldots, 200\}\):
png('d1.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 200), ylim = c(0, 100),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 200, by = 20), cex.axis = 1)
axis(2, at = seq(0, 100, by = 10), pos = -10, cex.axis = 1, las = 2)
m = 100 # magnitude da recompensa
k = 1 # taxa de desconto
points_to_plot = seq(0, 200, by = 5)
for (i in 1:length(points_to_plot)) {
d = points_to_plot[i]
v = m/(1+k*d) # função do valor subjetivo
segments(d, 0, d, v, lty = 2)
points(d, v, pch = 21, cex = 1.25, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
}
dev.off()Vamos repetir o mesmo gráfico, mas assumindo \(k = 0.1\):
png('d1k.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 200), ylim = c(0, 100),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 200, by = 20), cex.axis = 1)
axis(2, at = seq(0, 100, by = 10), pos = -10, cex.axis = 1, las = 2)
m = 100 # magnitude da recompensa
k = .1 # taxa de desconto
points_to_plot = seq(0, 200, by = 5)
for (i in 1:length(points_to_plot)) {
d = points_to_plot[i]
v = m/(1+k*d) # função do valor subjetivo
segments(d, 0, d, v, lty = 2)
points(d, v, pch = 21, cex = 1.25, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
}
dev.off()Sabendo que \(d\) é uma variável contÃnua, vamos representar todos os infinitos números entre 0 e 200, ou seja: \(d \in [0, 200] \subset \mathbb{R}\):
png('dcurve.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 200), ylim = c(0, 100),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 200, by = 20), cex.axis = 1)
axis(2, at = seq(0, 100, by = 10), pos = -10, cex.axis = 1, las = 2)
m = 100 # magnitude da recompensa
k = .1 # taxa de desconto
curve(m/(1+k*x), add = TRUE, from = 0, to = 200, col = rgb(46, 94, 127, maxColorValue = 255), lwd = 1.5)
dev.off()Agora, vamos comparar diferentes valores de \(k\), sendo \(k \in \{0.01, 0.1, 0.5, 1\}\)
library(scales)
png('dcurvek.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 200), ylim = c(0, 100),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 200, by = 20), cex.axis = 1)
axis(2, at = seq(0, 100, by = 10), pos = -10, cex.axis = 1, las = 2)
m = 100 # magnitude da recompensa
k = c(0.01, 0.05, 0.1, 0.5) # taxa de desconto
alpha = c(1, 0.75, 0.5, 0.25) # transparências
for (i in 1:length(k)) {
curve(m/(1+k[i]*x), add = TRUE, from = 0, to = 190,
col = scales::alpha(rgb(46, 94, 127, maxColorValue = 255), alpha[i]), lwd = 1.5)
text(200, m/(1+k[i]*200), k[i], cex = 0.65)
}
cols = scales::alpha(rep(rgb(46, 94, 127, maxColorValue = 255), 4), alpha)
legend('topright', lty = 1, legend = c("k = 0.01", "k = 0.05", "k = 0.1", "k = 0.5"),
col = cols)
dev.off()Veja a comparação gráfica das alternativas hipotetizadas nos slides da aula, primeito no ponto \(t_A\):
library(scales)
png('comparisontA.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 12), ylim = c(0, 20),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 12, by = 1), cex.axis = 1)
axis(2, at = seq(0, 20, by = 5), pos = -1, cex.axis = 1, las = 2)
# Dormir
m_D = 10
# Estudar
m_E = 20
# Taxa de desconto comum
k = 1.25
# Momento t_A
d_D = 9
d_E = 12
v_D = m_D/(1+k*d_D)
v_E = m_E/(1+k*d_E)
points(d_D, v_D, pch = 21, cex = 2, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
points(d_E, v_E, cex = 2, col = "black")
text(d_D, v_D + 1.5, round(v_D, 1))
text(d_E, v_E + 1.5, round(v_E, 1))
legend('topright', pch = c(21, 1), col = "black", pt.bg = c(rgb(46, 94, 127, maxColorValue = 255), "white"),
legend = c("Dormir", "Estudar"))
# Momento t_B
# d_D = 0
# d_E = 3
#
# v_D = m_D/(1+k*d_D)
# v_E = m_E/(1+k*d_E)
dev.off()Agora, vejamos o que acontece no ponto \(t_B\):
library(scales)
png('comparisontB.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 12), ylim = c(0, 20),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 12, by = 1), cex.axis = 1)
axis(2, at = seq(0, 20, by = 5), pos = -1, cex.axis = 1, las = 2)
# Dormir
m_D = 10
# Estudar
m_E = 20
# Taxa de desconto comum
k = 1.25
# Momento t_B
d_D = 0
d_E = 3
v_D = m_D/(1+k*d_D)
v_E = m_E/(1+k*d_E)
points(d_D, v_D, pch = 21, cex = 2, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
points(d_E, v_E, cex = 2, col = "black")
text(d_D, v_D + 1.5, round(v_D, 1))
text(d_E, v_E + 1.5, round(v_E, 1))
legend('topright', pch = c(21, 1), col = "black", pt.bg = c(rgb(46, 94, 127, maxColorValue = 255), "white"),
legend = c("Dormir", "Estudar"))
dev.off()Agora, vamos examinar como a mudança de preferência se relaciona com as funções subjacentes de valor:
library(scales)
png('comparison_curve.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 12), ylim = c(0, 15),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 12, by = 1), cex.axis = 1)
axis(2, at = seq(0, 15, by = 3), pos = -1, cex.axis = 1, las = 2)
# Dormir
m_D = 10
# Estudar
m_E = 20
# Taxa de desconto comum
k = 1.25
curve(m_D/(1+k*x), add = TRUE, lwd = 2, col = rgb(46, 94, 127, maxColorValue = 255),
from = 0, to = 12) # Dormir
curve(m_E/(1+k*(x + 3)), add = TRUE, lwd = 2, col = "black", lty = 2,
from = 0, to = 12) # Estudar
legend('topright', pch = c(21, 1), col = "black", pt.bg = c(rgb(46, 94, 127, maxColorValue = 255), "white"),
legend = c("Dormir", "Estudar"))
# Momento t_A
d_D = 9
d_E = 12
v_D = m_D/(1+k*d_D)
v_E = m_E/(1+k*d_E)
points(d_D, v_D, pch = 21, cex = 2, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
points(d_E, v_E, cex = 2, pch = 21, col = "black", bg = "white")
# Momento t_B
d_D = 0
d_E = 3
v_D = m_D/(1+k*d_D)
v_E = m_E/(1+k*(d_E + 3))
points(d_D, v_D, pch = 21, cex = 2, col = "black", bg = rgb(46, 94, 127, maxColorValue = 255))
points(d_E, v_E, cex = 2, pch = 21, col = "black", bg = "white")
dev.off()Finalmente, vamos traçar o ponto de cruzamento, que corresponde à solução em WolframAlpha:
library(scales)
png('crossing.png', width = 6, height = 4, units = "in", res = 300)
par(mar = c(4.5, 4.5, 2, 1.5))
plot(NA, xlim = c(-1, 12), ylim = c(0, 15),
axes = FALSE, xlab = expression(d), ylab = expression(v),
cex.lab = 1.5)
axis(1, at = seq(0, 12, by = 1), cex.axis = 1)
axis(2, at = seq(0, 15, by = 3), pos = -1, cex.axis = 1, las = 2)
# Dormir
m_D = 10
# Estudar
m_E = 20
# Taxa de desconto comum
k = 1.25
curve(m_D/(1+k*x), add = TRUE, lwd = 2, col = rgb(46, 94, 127, maxColorValue = 255),
from = 0, to = 12) # Dormir
curve(m_E/(1+k*(x + 3)), add = TRUE, lwd = 2, col = "black", lty = 2,
from = 0, to = 12) # Estudar
legend('topright', pch = c(21, 1, 23), col = "black", pt.bg = c(rgb(46, 94, 127, maxColorValue = 255), "white", "green4"),
legend = c("Dormir", "Estudar", "Indiferença"))
x_cross = 2.2
v_cross = m_D/(1+k*x_cross)
points(x_cross, v_cross, pch = 23, cex = 1.5, col = "black", bg = "green4")
segments(x_cross, 0, x_cross, v_cross, lty = 2, col = "green4")
segments(0, v_cross, x_cross, v_cross, lty = 2, col = "green4")
dev.off()