Learn R Programming

GE (version 0.3.8)

QL_demand: Quasilinear Demand Functions

Description

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)

Usage

QL_demand(
  w,
  p,
  alpha,
  beta,
  type = c("power", "log", "quadratic1", "quadratic2", "min")
)

Value

A 2-by-1 matrix indicating demands.

Arguments

w

a scalar indicating the income.

p

a 2-vector indicating the prices.

alpha

a scalar.

beta

a scalar.

type

a character string specifying the type of the function. The default type is "power". Other possible values are "log", "quadratic1", "quadratic2" and "min".

Examples

Run this code
# \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