Workflow Overview

This ‘Building Blocks’ introduction workflow shows how a simple monopoly market can be created and simulated using the Market Simulation tools running on KNIME.

The workflow first defines a single ‘Sprockets’ Product, then creates a set of Customers who all have a different Willingness To Pay (WTP) for Sprockets. The ‘Profit Engine’ node predicts how many Customers would buy Sprockets.

The ‘Profit Engine’ node generates a Demand Curve (Quantity vs Price) and sets the Price of Sprockets to the Profit Maximizing Price.

This Building Blocks example assumes you have already downloaded the open-source KNIME analytics platform and installed the free Market Simulation (Community Edition) plugin. If not, start by returning to Getting Started.


Define Products

The list of Products in the Market can be defined in the Table Creator node.

Product Details

Products need to have a ‘Product’ name and a Price. An optional Cost field can be added to help a downstream Market Simulation node calculate the ‘Profit Maximizing Price’.

Generate WTP

The Willingness To Pay (WTP) of Customers for the Product can be generated using the ‘Customer Distributions’ node.

WTP Details

Double-click on the node to open the Configuration Dialog. The Customer Distributions node has been configured to generate 10,000 Customers having a Mean WTP of $100 and a Standard Deviation (SD) WTP of $50.

Product Array

The Output Product Array adds the Type of Distribution (Normal) with Mean and SD to the Product description.

WTP Matrix

The Output Customer Distribution has 10,000 rows for Customers C00001 to C10000 each with a randomly generated WTP.

WTP Histogram

The Customer Willingness To Pay (WTP) Matrix can be visualized as a histogram.


The Sprockets Product has been selected to be included in the histogram chart.


Customers have a Mean WTP of $100 with a Standard Deviation (SD) of $50.

Profit Engine

The ‘Profit Engine’ node predicts which Customers will buy the Sprockets Product.


The Demand Curve is also calculated for the Sprockets Product. This slows down the node and should only be used when the Demand Curve is needed.

Product Array

The Output Product Array shows the prediction that 1,602 Customers will buy Sprockets at $150, while the other 8,398 Customers are ‘No Sale’.

Purchase Matrix

The Output Purchased Matrix shows the details of each Customer’s decision making criteria and whether or not they purchased a Product.

Profit Engine

The Demand Curve calculated by the Profit Engine node can be seen by right-clicking the node and selecting ‘View: Demand Curve’.

Demand Curve

The Profit Maximizing Price (red curve) is at $105. This would lift profitability by 160% from the Current Price of $150.

Market Share

A bar chart can show the Market Share of those Customers who purchased Sprockets versus the ‘No Sale’ Customers.


Configured to compare the Quantity sold of each Product.


Most Customers prefer not to buy Sprockets as the Price is greater than their Willingness To Pay (WTP).

More Analysis

A ‘Row Filter’ node can be used to filter out those Customers who purchased Sprockets for further analysis.


The ‘Row Filter’ has been set up to exclude ‘No Sale’ Customers from the Output Purchased Products Matrix.

Filtered Results

The 1,602 Customers who purchased are included in the filtered table. The first Customer who purchased Sprockets is C00015.

Consumer Surplus

The ‘Consumer Surplus’ is the difference between the Customer’s Willingness To Pay (WTP) and the actual Price they do pay.


The ‘Purchased Benefit’ column contains the amount of Consumer Surplus for each Customer.


Some Customers would have paid up to $140 more for the Sprockets.

Quantity vs Price

The Demand Curve can also be viewed in a Scatter Plot node.


Price and Quantity are selected as X-Axis and Y-Axis respectively.

Scatter Plot

The Scatter Plot shows the predicted change in Quantity given a change in Price.

Optimize Price

A second ‘Profit Engine’ node (lower down in the workflow) has been configured to automatically set the Profit Maximizing Price.


When ‘Output Profit Optimization Results’ is checked (and ‘Calculate Demand Curve’ is checked) then the output Price of the selected Product (Sprockets) will be set to the Profit Maximizing Price.

Final Results

The optimized Price of $105 increases the number of Customers who purchase Sprockets to 4,660 (up from 1,602). The profitability of Sprockets also increases to $256,300 (up from $160,200).

Economic Theory

Linear: Demand Curve

Micro-economics typically introduces the Demand Curve as a linear function between Price and Quantity.

Wikipedia: The demand curve is often graphed as a straight line of the form Q = a − bP where a and b are parameters. The constant “a” embodies the effects of all factors other than price that affect demand. If income were to change, for example, the effect of the change would be represented by a change in the value of “a” and be reflected graphically as a shift of the demand curve. The constant “b” is the slope of the demand curve and shows how the price of the good affects the quantity demanded.

Normal Distribution: Demand Curve

Market Simulation does not assume the Demand Curve is linear. Instead, Market Simulation calculates the Willingness To Pay (WTP) of each individual Customer. Together, these WTP values form a ‘Customer Distribution’ or WTP Matrix’.

And yet, the results from a Market Simulation are closely aligned with traditional micro-economic models.

The fitted-green linear function from this BB-101 Market Simulation closely follows the blue Demand Curve over the majority of Price vs Quantity.

Profit Maximizing Price

The Profit Maximizing Price occurs when Marginal Revenue (MR) equals Marginal Cost (MC).

For the Linear Demand Curve, this Profit Maximizing Price can be calculated using the formula to the right.

Plugging in the y-intercept (a) and the slope (b) from the green linear curve fitted to the Normal Customer Distribution results above, we would predict that the Profit Maximizing Price would occur at $110.

The Market Simulation from above predicts the Profit Maximizing Price to be $105.

The closeness of the two predictions shows how Market Simulation is aligned with traditional micro-economic theory.


This first ‘Building Blocks’ workflow used a bell-shaped Normal Distribution to generate the Willingness To Pay (WTP) matrix for Customers. The results were generally very good, with the Market Simulation closely aligned with introductory micro-economic theory.

But other Customer Distribution shapes may be more appropriate depending upon the type of market being simulated.

The next ‘Building Blocks’ workflow (BB-102 Monopoly Distributions) shows how other Customer Distributions can be used to generate a WTP Matrix to simulate a simple monopoly market.