powered by
Some quasilinear demand functions. The corresponding utility functions are as follows: power: x1 + alpha * x2^beta, wherein alpha>0, 0<beta<1 log: x1 + alpha * log(x2), wherein alpha>0 quadratic1: x1 + alpha * x2 - 0.5 * beta * x2^2, wherein alpha>0, beta>0 quadratic2: x1 + beta * (alpha * x2 - 0.5 * x2^2), wherein alpha>0, beta>0 min: x1 + alpha * min(x2, beta)
QL_demand( w, p, alpha, beta, type = c("power", "log", "quadratic1", "quadratic2", "min") )
A 2-by-1 matrix indicating demands.
a scalar indicating the income.
a 2-vector indicating the prices.
a scalar.
a character string specifying the type of the function. The default type is "power". Other possible values are "log", "quadratic1", "quadratic2" and "min".
# \donttest{ QL_demand(w = 0.5, p = c(1, 1), alpha = 1, type = "log") QL_demand(w = 2, p = c(1, 1), alpha = 1, type = "log") QL_demand(w = 1, p = c(1, 5), alpha = 2, beta = 0.5) # }
Run the code above in your browser using DataLab