share_calc: Market share calculations

View source: R/share_calc.R

share_calcR Documentation

Market share calculations

Description

Calculates choice probabilities based on logit or generalized nested logit demand parameters

Usage

share_calc(
  price,
  delta,
  alpha,
  nest_allocation = NA,
  mu = NA,
  returnLogsum = FALSE,
  outsideOption = TRUE
)

Arguments

price

Price

delta

Mean values

alpha

Price coefficient

nest_allocation

For generalized nested logit demand, a J-by-K matrix where each element (j,k) designates the membership of good j in nest k. Rows should sum to 1.

mu

Nesting parameters for each nest

returnLogsum

logical; whether to return the denominator of the choice probabilities (also known as the log-sum term). Defaults to FALSE, in which case the function returns a vector with each product's choice probability.

outsideOption

logical; whether to include an outside option in choice set. Default is TRUE.

Details

This function calculates choice probabilities based on demand parameters for a logit or generalized nested logit demand system

Value

Returns vector of choice probabilities for each good

Examples

share_calc(price=c(2.1,2.4,2.1),delta=c(.81,.93,.82),alpha=-0.9)


mergersim documentation built on July 21, 2026, 5:09 p.m.