How to generate data from normal distribution to reflect a pre aassigned score to a variable?

I have a set of customers with some score assigned to them. Eg.-
C1 - 10
C2 - 8
C3 - 7
C4 - 3
C5 - 1
I want to simulate the spending power of customers, si from a normal distribution, si ~ N(100,20).
For 1000 iterations, the score assigned to them should reflect on their average spending power. What transformation can achieve this result? Using the example above, C1 and C5 should have the highest and lowest average spending respectively.

6 Comments

Yes, I get your point. I will choose mean and variance in a way that overall mean and s.d. can be kept to 100 and 20 resp.
I guess I don't understand what you're trying to simulate or what the "spending power" factor is intended to represent -- it doesn't seem at all realistic that someone with 10X the resources of another would still have the same mean and variance over a sample population of those individuals. I'm at a loss as to how to try to fit the two statements together.
Lets us assume that a factory has 1000 workers. Their income follows a normal distribution with mean 400 and s.d. 30. They buy stuff from my bakery. Based on their past purchases I know, who have spent more in my shop than others. For my convenience, I have even assigned a score to them to keep track of their past spending. This further helps me in understanding the priority level for each customer in my system. Now, I want to simulate their spending on a given day in my shop. I know the distribution of their spending from my past experience which is ~ N(100,20) and I have their priority score as well. Now, how should I go about it? Does the explanation reconciles the two statements for you?
But even if the population of your customers is N(100,20), that isn't the distribution for the spending habits of the specific customer or even the class of customers of a given priority level.
Glad to try to help...don't know that I was, much, but trying to clarify the problem description more fully may be what's needed to understand the sampling logic well enough to eventually write the simulation...
The Q? may be whether you're trying to sample for the specific client or stratum of clients of a given classification or from the overall distribution of all clients at this point? It seems the latter once you've determined the classification from the former based on the description but then it appears you need a conditional distribution function representative of those classes for that given transaction...then again, I may be totally missing the whole idea given the limited familiarity with your problem/intent. :)

Answers (1)

Adjust the mean by some function of the weight--there's no information on by how much, specifically, you might think the difference between 1 and 10 is in real spending, though, nor whether that's a linear or log weighting or any such thing. In the most trivial
s(:,i)=20*randn(1000,1) + 100+C(i);

2 Comments

I want all the data to come from a distribution with same mean and sd. Also, please treat scores as ratio scale.
"I want all the data to come from a distribution with same mean and sd."
Well, in that case, how can they possibly be any different other than by random sampling variations?

This question is closed.

Asked:

on 21 Aug 2018

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!