output | R Documentation |
Given a demand structural tree and an input vector, this function computes the utility of a consumer or the output of a firm. If the demand structural tree has a FUNC-type node, the node should has an attribute named fun that is a function computing the output.
output(node, input)
node |
a demand structural tree. |
input |
an input vector with names of commodities. |
A scalar.
dst <- node_new("output",
type = "SCES", es = 0, alpha = 1, beta = c(0.5, 0.5),
"cc1", "cc2"
)
node_set(dst, "cc1",
type = "Leontief", a = c(0.6, 0.4),
"wheat", "iron"
)
node_set(dst, "cc2",
type = "SCES", sigma = -1, alpha = 1, beta = c(0.5, 0.5),
"labor", "capital"
)
node_plot(dst, TRUE)
p <- c(wheat = 1, iron = 3, labor = 2, capital = 4)
x <-demand_coefficient(dst, p)
output(dst, x)
output(dst, c(wheat = 3, iron = 3, labor = 3, capital = 3))
SCES(
es = 0, alpha = 1, beta = c(0.5, 0.5),
x = c(
min(3 / 0.6, 3 / 0.4),
SCES(es = 0.5, alpha = 1, beta = c(0.5, 0.5), x = c(3, 3))
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.