You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your efforts in this repo, it's been very helpful.
I would like to get your thoughts on adding additional media variables that
a) don't require an adstock transformation
b) require no restriction on the coefficients
For example, Average SEO Position, which requires no adstock transformation and intuitively has an inverse relationship with Sales.
These could be included in the control model, however it might be useful to see its individual contribution to sales.
In the STAN code (model_code2) i created two input matrices X1 and X2. X1 contains mdip variables and control variables/baseline sales (as in the original example). X2 contains SEO positioning. The model logic is the same as in the control model.
model {
decay ~ beta(3,3);
peak ~ uniform(0, ceil(max_lag/2));
tau ~ normal(0, 5);
for (i in 1 : num_adstock_media+num_ctrl) {
beta1[i] ~ normal(0, 1);
}
for (i in 1 : num_media) {
beta2[i] ~ normal(0, 0.5);
}
noise_var ~ inv_gamma(0.05, 0.05 * 0.01);
y ~ normal(tau + X1*beta1 + X2*beta2, sqrt(noise_var));
}
X2 is mean-centred, log1p transformed only:
// mean-center, log1p transformation for media variables requiring no adstock
for (nn in 1:N) {
for (media in 1 : num_media) {
X2[nn, media] <- log1p(X_media[nn, media]/mu_mdnip[media]);
}
}
And there is no lower bound on X2's coefficients:
parameters {
// residual variance
real<lower=0> noise_var;
// the intercept
real tau;
// the (positive) coefficients for adstocked media variables and base sales
vector<lower=0>[num_adstock_media+num_ctrl] beta1;
// the (positive or negative) coefficients for non-adstocked media variables
vector[num_media] beta2;
// the decay and peak parameter for the adstock transformation of
// each media
vector<lower=0,upper=1>[num_adstock_media] decay;
vector<lower=0,upper=ceil(max_lag/2)>[num_adstock_media] peak;
}
The code looks good.
One concern is endogeneity. To me, it seems seo position and seo clicks are not independent. Click is (partially) influenced by position, because top-ranking items get clicked more often. And probably, if an item is more frequently clicked, it will be ranked higher by the search engine. If that endogeneity exists, it should be removed to see their individual contributions to sales. Perhaps use seo position as an instrumental variable. Please research endogeneity/instrumental variable/latent instrumental variable in econometric modeling if you're interested in that approach. (I don't have any experience using instrumental variables, so unable to provide instructions.)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi Sibyl,
Thank you for your efforts in this repo, it's been very helpful.
I would like to get your thoughts on adding additional media variables that
a) don't require an adstock transformation
b) require no restriction on the coefficients
For example, Average SEO Position, which requires no adstock transformation and intuitively has an inverse relationship with Sales.
These could be included in the control model, however it might be useful to see its individual contribution to sales.
In the STAN code (model_code2) i created two input matrices X1 and X2. X1 contains mdip variables and control variables/baseline sales (as in the original example). X2 contains SEO positioning. The model logic is the same as in the control model.
X2 is mean-centred, log1p transformed only:
And there is no lower bound on X2's coefficients:
Does this seem to be a sensible approach to you?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions