2
$\begingroup$

So, I'm making a probability of a sales person achieving his/her goal by the end of a month. The thing is, I'm using the sales history and Bayes Theorem to do it.

By using Bayes theorem, I was calculating P(A) as the probability of achieving the goal and P(B) the probability that they had a percentage X in relation to the goal by the time I did the analysis. For example:

  • If by the time I did the analysis, the sales person had reached 80% of their goal, I would take all the observations that had a percentage lower or equal to 80% and divide by the total observations, resulting in P(B). Then I would apply Bayes Theorem using P(A) and P(B).

But doing it this way, it throws the probability of reaching the goal to the bottom, because I'm taking records of people that did not only had 80%, but 10%, 5%. Is there a more efficient way for me to calculate P(B)?

$\endgroup$
3
  • $\begingroup$ How are sales goals measured? In dollars, in counts, etc? $\endgroup$ Jul 14, 2020 at 22:21
  • $\begingroup$ Yep, dollars. But the main problem is the percentage, because that's what I'm using as a condition to result in P(B). $\endgroup$
    – Caldass_
    Jul 14, 2020 at 23:45
  • $\begingroup$ I've updated my solution. If you're using R to compute these quantities, I think you will find it helpful. $\endgroup$ Jul 15, 2020 at 3:57

1 Answer 1

1
$\begingroup$

Let me start off by stating two things. First, I love this question. However, I think it could benefit from some rethinking. Secondly, this is not a full fledged answer more than it is some thinking about your problem.

You're interested in computing $ P(\mbox{meet sales goal} \vert x\mbox{% of the way there})$. Because the goals are in dollars, we can express this in terms of money

$$P( \mbox{sell atleast \$1000} \vert \mbox{Presently sold \$} 1000\times p) $$

Here $p$ is proportion of the way you are to your goal. Bayes theorem requires you compute

$$P( \mbox{Presently sold \$} 1000\times p) \vert \mbox{sell atleast \$1000}) \times P(\mbox{sell atleast \$1000}) $$

in addition to the denominator, which we will ignore for now. But something seems strange. The first term asks me for the probability I sell what would be less than my goal conditioned on the fact that I have already met it. This term is 0 when $p<1$ or equivalently whenever I have sold less than my goal. If I have understood your question correctly, this seems problematic. And the reason I think it is problematic is because your statements about meeting sales goals are not about parameters, they are about the likelihood.

The reason I ask how goals are measured is because I still think this can be done, but it requires asking a different question. Instead of asking what is the probability the sales person reaches their goal conditioned on how much they've already sold, why not just ask what is the probability the sales person sells more than x dollars, conditioned on the sales person and perhaps their prior sales history? (which I assume is known and informs their sales goals). This seems more tractable to me and is more amenable to Bayesian analysis.

EDIT: Here is a small example to my approach. Let's say I have one sales person, and her previous weekly sales numbers for the past 6 weeks.

Let's set this person's monthly goal to 30. If we had a Bayesian model for this person's average weekly sales + a likelihood, we could use the posterior predictive distribution to estimate each week the probability she surpasses her goal. Here is an example in code. I'm using a negative binomial for ease, but you should think about what your problem requires.


library(tidyverse)
library(brms)

dgp = function(n) rnbinom(n, mu = 5, size = 100)

last_six = dgp(6)
d = tibble(y = last_six)

#Probably a bad prior, you do better
prior_intercept = set_prior("normal(log(4),0.5)", class = 'Intercept')
model = brm(y~1, 
            data = d,
            prior = prior_intercept,
            family = negbinomial(),
            control = list(adapt_delta = 0.9)
            )


#Begining of month
predictions = posterior_predict(model)
monthly_sales = apply(predictions[,1:4], 1, sum)
prob_meet = mean(monthly_sales>30)
prob_meet

#after week 1
y1 = dgp(1)
d = tibble(y = c(last_six,y1))
model = update(model, newdata = d)
predictions = posterior_predict(model)
monthly_sales = apply(predictions[,1:3], 1, sum)
prob_meet = mean(monthly_sales>(30-y1))
prob_meet

#after week 2
y2 = dgp(1)
d = tibble(y = c(last_six,y1, y2))
model = update(model, newdata = d)
predictions = posterior_predict(model)
monthly_sales = apply(predictions[,1:2], 1, sum)
prob_meet = mean(monthly_sales>(30-y1-y2))
prob_meet

#and so on...

Each week, you are subtracting what this person already sold from their monthly goal and also conditioning (i.e. using the sales to inform the model) on the future probability of making the goal.

This is essentially what you're looking for, except it is happening on the raw scale rather than the unit interval.

$\endgroup$
6
  • $\begingroup$ What a great answer!. The thing is, I haven't mentioned, I'm breaking this logic by week. So considering the sales history, there are weeks that the accumulated in sales represents x% of the goal, however, in the end of that week's month, the goal was not hit. So when you say "The first term asks me for the probability I sell what would be less than my goal conditioned on the fact that I have already met it." becomes "The first term asks me for the probability I sell what would be less than or equal to x % of the goal conditioned on the fact that, by the end of that month, the goal was hit." $\endgroup$
    – Caldass_
    Jul 15, 2020 at 2:03
  • $\begingroup$ Because my goal here is, for example: I have an information about a sales person that he is at 50% of his goal, and we're on the second week of the month. What's the probability of that person achieving his goal, given that he already reached 50%? That's what I'm looking to answer. $\endgroup$
    – Caldass_
    Jul 15, 2020 at 2:09
  • $\begingroup$ Hmm, what you could do is model sales by week and then make probabilistic statements about the sums of those weekly sales. So If the goal is \$1000, and your sales person sells \$200 in the first week, the second week you could compute the probability they sell at least $800 in the next three weeks. That's my preference and how I would approach it. $\endgroup$ Jul 15, 2020 at 3:25
  • $\begingroup$ Hey @DemetriPananos , I used your suggestion, taking the probability they sell x amount of money in the weeks left of the month. The only difference is that instead of using money, I'm converting it to % left of the goal because there are people that sell over 1kk and people that sell nothing compared to them, like 50k, but their goals are proportional to their sales. Not gonna try using the posterior predictive distribution right now because I don't have the skills needed to apply. Is this approach still ok? (for a simple project) $\endgroup$
    – Caldass_
    Jul 15, 2020 at 17:47
  • 1
    $\begingroup$ @Caldass_ The approach is OK in so far as it can be implemented. The only reason I used the data on the raw scale was because it was simpler to implement. If you can conceive of a likelihood which gives you what you want, and the process works, then the approach is "ok" in my mind. $\endgroup$ Jul 15, 2020 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.