I am estimating 225 price semi-elasticities in Stata 17 using cross-fit partialing-out lasso Poisson regression like this:
The data is a balanced panel of 225 products and 50 days of data, so N = 11,250.
The model runs on a single fold without any issues, and the elasticities all look consistent with the quant marketing lit. However, when I increase the folds to X it always fails on the 225th elasticity in the Xth fold after working on it for a very long time.
Attempted Fixes:
1) Recoding the product id to have different coding (but same value labels). It's always the last one.
2) Dropping the last product does not seem to do it either.
3) technique(dml2) also gets stuck
The error message is
There do not seem to be any options to pass on to GMM to aid convergence.
Any ideas on how to diagnose what is going wrong and fix it?
Code:
xpopoisson quantity c.price#i.prod_id , vce(cluster prod_id) controls(i.dow i.month i.prod_id i.category) selection(plugin) coef xfolds(2) resample(1) technique(dml2) verbose rseed(13032024);
The model runs on a single fold without any issues, and the elasticities all look consistent with the quant marketing lit. However, when I increase the folds to X it always fails on the 225th elasticity in the Xth fold after working on it for a very long time.
Attempted Fixes:
1) Recoding the product id to have different coding (but same value labels). It's always the last one.
2) Dropping the last product does not seem to do it either.
3) technique(dml2) also gets stuck
The error message is
Code:
Estimating lasso for 225bn.prod_id#c.price using plugin Iteration 1: lambda = .128347 no. of nonzero coef. = 1 Iteration 2: lambda = .128347 no. of nonzero coef. = 1 convergence not achieved gmm step failed to converge r(498);
Any ideas on how to diagnose what is going wrong and fix it?