| Title: | Simulate Demand and Attributes for New Products |
|---|---|
| Description: | Simulate demand and attributes for ready to launch new products during their life cycle, or during their introduction and growth phases. You provide the number of products, attributes, time periods and/or other parameters and 'npdsim' can simulate for you the demand for each product during the considered time periods, and the attributes of each product. The simulation for the demand is based on the idea that each product has a shape and a level, where the level is the cumulative demand over the considered time periods, and the shape is the normalized demand across those time periods. |
| Authors: | Mohammed Hichame BENBITOUR [aut, cre, cph] |
| Maintainer: | Mohammed Hichame BENBITOUR <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 1.0.0 |
| Built: | 2026-05-20 06:05:57 UTC |
| Source: | https://github.com/mohammedhichame/npdsim |
Simulate the attributes for each product with the assumption that some of the attributes related to shapes are also related to some of the attributes of levels. We mean by dependence the fact that some attributes of a product are related at the same time to its shape and level.
attribute_sim_dep( product_shapes_and_levels, attributes_number, shape_attributes_number, level_attributes_number )attribute_sim_dep( product_shapes_and_levels, attributes_number, shape_attributes_number, level_attributes_number )
product_shapes_and_levels |
A numeric dateframe of three columns: product_id, assigned_shape and assigned_level |
attributes_number |
The number of attributes |
shape_attributes_number |
The number of attributes assigned to shape |
level_attributes_number |
The number of attributes assigned to level |
A numeric dateframe of the following columns: product_id, assigned_shape, assigned_level and attributes (as columns)
attribute_sim_dep(product_shapes_and_levels= data.frame(product_id=1:4,assigned_shape=c(1,1,2,2), assigned_level=c(5,3,3,3)), attributes_number=15, shape_attributes_number=7, level_attributes_number=4)attribute_sim_dep(product_shapes_and_levels= data.frame(product_id=1:4,assigned_shape=c(1,1,2,2), assigned_level=c(5,3,3,3)), attributes_number=15, shape_attributes_number=7, level_attributes_number=4)
Simulate the attributes for each product with the assumption that the attributes of shapes are independent of the attributes of levels. We mean by independence the fact that each attribute is related to one of the following: shape, level or nothing.
attribute_sim_ind( product_shapes_and_levels, attributes_number, shape_attributes_number, level_attributes_number )attribute_sim_ind( product_shapes_and_levels, attributes_number, shape_attributes_number, level_attributes_number )
product_shapes_and_levels |
A numeric dateframe of three columns: product_id, assigned_shape and assigned_level |
attributes_number |
The number of attributes |
shape_attributes_number |
The number of attributes assigned to shape |
level_attributes_number |
The number of attributes assigned to level |
A numeric dateframe of the following columns: product_id, assigned_shape, assigned_level and attributes (as columns)
attribute_sim_ind(product_shapes_and_levels= data.frame(product_id=1:4,assigned_shape=c(1,1,2,2), assigned_level=c(5,3,3,3)), attributes_number=15, shape_attributes_number=7, level_attributes_number=4)attribute_sim_ind(product_shapes_and_levels= data.frame(product_id=1:4,assigned_shape=c(1,1,2,2), assigned_level=c(5,3,3,3)), attributes_number=15, shape_attributes_number=7, level_attributes_number=4)
Simulate the demand for new products over their life cycle by specifying their shape type.
demand_sim( products_number, periods_number, shape_number, shape_type = "random", level_number, level_range = 1000:10000, noise_cv = 0.05 )demand_sim( products_number, periods_number, shape_number, shape_type = "random", level_number, level_range = 1000:10000, noise_cv = 0.05 )
products_number |
Number of products |
periods_number |
Number of periods of the introduction and growth phases |
shape_number |
Number of generic shapes |
shape_type |
Type of shape to generate. It can take the values: "triangle", "trapezoid", "bass", "random" and "intro & growth". The type "random" picks one of the types "triangle", "trapezoid", "bass" randomly for each product. The type "intro & growth" is used for the shapes of the introduction and growth phases. |
level_number |
Number of generic levels |
level_range |
Range of values from which the level is sampled |
noise_cv |
The coefficient of variation of the noise added to the simulated sales |
A date frame that contains the following columns: product_id, shape and assigned_shape, level and assigned_level, demand_wn (demand without noise, not rounded), noise and demand. demand is the rounded value of the Max between (demand_wn+noise) and 0
demand_sim(products_number=100,periods_number=20,shape_number=5, level_number=20) demand_sim(products_number=100,periods_number=20,shape_number=5, shape_type="bass", level_number=20, level_range=1000:10000,noise_cv=0.05)demand_sim(products_number=100,periods_number=20,shape_number=5, level_number=20) demand_sim(products_number=100,periods_number=20,shape_number=5, shape_type="bass", level_number=20, level_range=1000:10000,noise_cv=0.05)
Simulate the demand and attributes for new products during their life cycle by specifying their life cycle type of shape and providing information about their attributes.
npd_data_sim( products_number, periods_number, shape_number, shape_type = "random", level_number, level_range = 1000:10000, noise_cv = 0.05, attribute_type = "ind", attributes_number = 10, shape_attributes_number = 5, level_attributes_number = 3 )npd_data_sim( products_number, periods_number, shape_number, shape_type = "random", level_number, level_range = 1000:10000, noise_cv = 0.05, attribute_type = "ind", attributes_number = 10, shape_attributes_number = 5, level_attributes_number = 3 )
products_number |
Number of products |
periods_number |
Number of periods of the introduction and growth phases |
shape_number |
Number of generic shapes |
shape_type |
Type of shape to generate. It can take the values: "triangle", "trapezoid", "bass", "random" and "intro & growth". The type "random" picks one of the types "triangle", "trapezoid", "bass" randomly for each product. The type "intro & growth" is used for the shapes of the introduction and growth phases. |
level_number |
Number of generic levels |
level_range |
Range of values from which the level is sampled |
noise_cv |
The coefficient of variation of the noise added to the simulated sales |
attribute_type |
Type of relationship between attributes and shape and level. There can be independent attributes or dependent attributes. attribute_type takes one of the two values: "dep" and "ind". Check 'attribute_sim_dep' and 'attribute_sim_dep'. |
attributes_number |
The number of attributes |
shape_attributes_number |
The number of attributes assigned to shape |
level_attributes_number |
The number of attributes assigned to level |
A date frame that contains the following columns: product_id, demand and attributes.
npd_data_sim(products_number=100, periods_number=30, shape_number=5, level_number=20) npd_data_sim(products_number=100, periods_number=20, shape_number=5, shape_type="bass", level_number=20, level_range=1000:10000, noise_cv=0.05, attribute_type="ind", attributes_number=15, shape_attributes_number=7, level_attributes_number=5)npd_data_sim(products_number=100, periods_number=30, shape_number=5, level_number=20) npd_data_sim(products_number=100, periods_number=20, shape_number=5, shape_type="bass", level_number=20, level_range=1000:10000, noise_cv=0.05, attribute_type="ind", attributes_number=15, shape_attributes_number=7, level_attributes_number=5)
Calculate the Bass probability density function of purchase f(t)
npdsim_bass(p_param, q_param, t)npdsim_bass(p_param, q_param, t)
p_param |
Coefficient of innovation |
q_param |
Coefficient of imitation |
t |
A numeric vector of time periods |
A numeric vector of the probability density function of purchase at time t, f(t)
npdsim_bass(p_param=0.01,q_param=0.2, t=1:20)npdsim_bass(p_param=0.01,q_param=0.2, t=1:20)
Generate the shape of demand for new products by specifying their life cycle shape and the length of their life cycle
shape_sim(periods_number, shape_number, shape_type = "random")shape_sim(periods_number, shape_number, shape_type = "random")
periods_number |
Number of time periods of the products life cycle |
shape_number |
Number of generic shapes |
shape_type |
Type of shape to generate. It can take the values: "triangle", "trapezoid", "bass", "random" and "intro & growth". The type "random" picks one of the types "triangle", "trapezoid", "bass" randomly for each product. The type "intro & growth" is used for the shapes of the introduction and growth phases. |
A numeric dateframe of three columns: time, shape and assigned_shape
shape_sim(periods_number=20, shape_number=5) shape_sim(periods_number=20, shape_number=5,shape_type="trapezoid")shape_sim(periods_number=20, shape_number=5) shape_sim(periods_number=20, shape_number=5,shape_type="trapezoid")
Generate generic Bass shapes for the demand of new products during their life cycle
shape_sim_bass(periods_number, shape_number)shape_sim_bass(periods_number, shape_number)
periods_number |
Number of time periods of the products life cycle |
shape_number |
Number of generic shapes |
A numeric dateframe of three columns: time, shape and assigned_shape
shape_sim_bass(periods_number=20, shape_number=5)shape_sim_bass(periods_number=20, shape_number=5)
Generate piece-wise linear (4 segments) generic shapes for the introduction and growth phases
shape_sim_ig(periods_number, shape_number)shape_sim_ig(periods_number, shape_number)
periods_number |
Number of periods of the introduction and growth phases |
shape_number |
Number of generic shapes |
A numeric dateframe of three columns: time, shape and assigned_shape
shape_sim_ig(periods_number=20, shape_number=5)shape_sim_ig(periods_number=20, shape_number=5)
Generate random (Bass, Trapezoidal or Triangular) shapes for the demand of new products during their life cycle
shape_sim_random(periods_number, shape_number)shape_sim_random(periods_number, shape_number)
periods_number |
Number of time periods of the products life cycle |
shape_number |
Number of generic shapes |
A numeric dateframe of three columns: time, shape and assigned_shape
shape_sim_random(periods_number=20, shape_number=5)shape_sim_random(periods_number=20, shape_number=5)
Generate trapezoidal shapes for the demand of new products during their life cycle
shape_sim_trapezoid(periods_number, shape_number)shape_sim_trapezoid(periods_number, shape_number)
periods_number |
Number of time periods of the products life cycle |
shape_number |
Number of generic shapes |
A numeric dateframe of three columns: time, shape and assigned_shape
shape_sim_trapezoid(periods_number=20, shape_number=5)shape_sim_trapezoid(periods_number=20, shape_number=5)
Generate triangular shapes for the demand of new products during their life cycle
shape_sim_triangle(periods_number, shape_number)shape_sim_triangle(periods_number, shape_number)
periods_number |
Number of time periods of the products life cycle |
shape_number |
Number of generic shapes |
A numeric dateframe of three columns: time, shape and assigned_shape
shape_sim_triangle(periods_number=20, shape_number=5)shape_sim_triangle(periods_number=20, shape_number=5)