# Build model for daily probability of meeting a certain end of period goal

I was hoping for some consultation with how to go about the following:

To give context, I work for an agency that manages advertisements on social media for general motors - specifically their car sharing branch called "Maven". We run ads to get people to register (make an account) on their Maven mobile App, and subsequently to get them to rent a vehicle. One of our key performance metrics is called the rental rate = rentals/registrations.

I have daily performance metrics data in terms of daily registrations and rentals that occur for various ads (lets call them x, y z). What I would like to do is build three models that will give me a daily probability that a given ad will meet a specified rental rate at the end of t days after launch of the ad. I want to build a model for t = 60, t = 90, and t = 180 days after launch. For example, I want to be able to look at maybe day 10 of 180 days, and know the probability that the rental rate after 180 days will be 0.05.

After building the model, I hope to use this model to predict these probabilities for future advertisements we choose to roll out so that we can measure their performance.

I was thinking a logistic regression model would be of use here, but I can't wrap my head around how to go about building the proper model to achieve my goal. Any advice would be greatly appreciated!!!!

I have daily data for these advertisements. I have computed a cumulative registration and cumulative rental variable, as well as a cumulative rental rate variable. I have used a binary variable putting 1 to indicate days where the rental rate goal was met and 0 where it was not. I built a logistic regression using cumulative rental rate and day index to predict the binary variable but I really don't think this is the proper model I am looking for!

• Why don't you post one of your time series in a csv format and I will try to be of help. We routinely develop useful models and generate monte-carlo based forecasts for future periods. These probability density functions can then be used to determine the probability of exceed user-specified critical values. stats.stackexchange.com/questions/410806/… might be helpful for you. – IrishStat Jun 11 at 21:48
• @IrishStat thank you so much for posting that link! That was a very detailed answer and I am going to use that approach. I do have a question about your response there which i will ask here since I cannot comment there: after building the ARIMA model and producing the forecasts, in order to sample using montecarlo, are you using the forecast for the next period as the mean and the models estimated variance as the variance? – Keith Jun 12 at 18:19
• no. the forecast is generated from the model. The forecast realizations are computed based upon the distribution (cumulative density function) of the model's residuals and the psi weights of the model. Statistics such as the variance are computed from the realizations. If you want to know more perhaps you can contact me offline. – IrishStat Jun 12 at 19:06
• @IrishStat. Thank you for your response! Your knowledge is far beyond my own here, so let me try to clarify. The model is built using ARIMA and a forecast is produced from the ARIMA model. The model produces an estimated variance or mean square error and also a variance covariance matrix of the model parameters. Is the montecarlo sampling then re-estimating those model parameters 1000 times using the variance covariance then producing 1000 forecasts and thus a density from which the probability is estimated? Sorry, I'm new on this forum and don't know how to contact you directly! – Keith Jun 12 at 20:35
• The variance-covariance matrix is not used .100 random numbers are mapped to the model residuals one at a time . The perturbation that is added to the the expected value is based upon an inflation factor derived from the psi weights to compute a perturbation to the baseline forecast for each forecast period. if you can't call try SKYPING DAVID REILLY – IrishStat Jun 12 at 20:49

If you think in terms of rates (rentals per registrations) and not probabilities, you are led to Poisson rate regression, see for instance Regression for a Rate variable in R. Assuming your data have the format

Ad     day    registrations    rentals    <other covariables>
A       0       90               10        .....
A       1        .                .         .....
A
.
.
.
B        0       .
.
.
.


where Ad is the ad campaign, day is the day number after start of campaign, and so on is the daily data. Then you can calculate the cumulative variables cregistrations and crentals. Then build a Poisson generalized linear model with log link function, and log of cregistrations as an offset.

In R this could look like

mod0  <-  glm(crentals ~ offset(log(cregistrations))+factor(Ad)+day+<other variables>, data=your_data_frame, family=poisson)


as a starting point. The assumption used above of linearity in day is maybe not realistic.

• thank you so much! Now, as I understand it, subtracting the log(cregistration) from both sides then exponentiating both sides will give me the expected rate. What I would like to do now is use this model for a future advertisement to monitor it's performance in real time. So as it nears the 30 day or t day mark, I want the probability that it will hit the target rate at the end of the t days. How would you suggest I do that? I'm thinking building a forecasting model for cregistration, forecasting out to end of period, feeding into the poisson model to get crentals.... – Keith Jun 12 at 15:19
• But then how do I get the probability of meeting the end target rate at any given day? – Keith Jun 12 at 15:21