Learn R Programming

WordOfMouth (version 1.2.0)

computeConsumerSurplus: Computes the expected cumulative consumer surplus

Description

Computes the expected cumulative consumer surplus for a given Word-of-Mouth campaign at a given price.

Usage

computeConsumerSurplus(campaign, price)

Value

Expected cumulative consumer surplus.

Arguments

campaign

Word-of-Mouth campaign as instance of class WoMCampaign.

price

Price as number in [0; 1] where 0 is the minimal and 1 is the maximal price.

See Also

computeDemand computeProfit computeOptimalPrice

Examples

Run this code

network <- new("WoMNetwork", size = 1000, avgConnections = 5)
campaign <- new("WoMCampaign", network = network, seedingSize = 10, forwardProbability = 0.2)
surplus <- computeConsumerSurplus(campaign, price = 0.5)
print(surplus)

Run the code above in your browser using DataLab