I have exiting Response curve for each Media channel. I want to know if I can use the budget Optimizer class to just use those response curve coefficients along with our objective function constraints like total budget and channel level constraints to train some Scenarios? I am currently only able to see that we can only optimize if we have modeled our MMM through PyMc. If there is a possibility, would love to explore. Any help from @RavinKumar @twiecki would be great.

Hey @Abhimanyu_Agarwala,

Iâ€™m not quite sure what you mean by â€śtrain some scenarios.â€ť If you could give me a bit more context, I might be able to help you better.

That being said, you can still use the budget allocator functions even if your model hasnâ€™t been trained. Hereâ€™s an example of how to do it:

First, youâ€™ll need to import the necessary libraries:

```
from pymc_marketing.mmm.budget_optimizer import budget_allocator
from pymc_marketing.mmm.utils import (
estimate_menten_parameters,
estimate_sigmoid_parameters,
)
```

Once you have the libraries in place, you can use the information from your variables X and Y to determine the parameters that best fit your data points:

```
estimate_menten_parameters(x=df.X.to_numpy(), y=df.y.to_numpy())
estimate_sigmoid_parameters(x=df.X.to_numpy(), y=df.y.to_numpy())
```

Once you have the dictionary with the parameters, you can run the allocator function:

```
budget_allocator(
method: "michaelis-menten",
total_budget: 300000,
channels: ["x1","x2"],
parameters: estimate_menten_parameters,
budget_ranges: {"x1": [lower_limit, upper_limit]},
)
```

By doing this, you can take advantage of the allocation function without training a model. However, keep in mind that the precision of the function is not guaranteed because it depends on how well your raw data is structured and how evident the DMR relation is.

Also, remember that youâ€™ll lose the confidence intervals because the posterior is not being generated. Essentially, the function allocates without the uncertainty derived only from the model training, so here your output is more point-estimated than probabilistic.

By the way, better create new questions on our GitHub. Link here:

pymc-labs/pymc-marketing Â· Discussions Â· GitHub