cran / BLPestimatoR

:exclamation: This is a read-only mirror of the CRAN R package repository. BLPestimatoR — Performs a BLP Demand Estimation
7 stars 4 forks source link

error in starting values (Error in .prepare_theta2) #1

Open xyy-711 opened 9 months ago

xyy-711 commented 9 months ago

hi there, when I was running the estimateBLP, it gives the following error message: Error in .prepare_theta2(par_theta2, final_col_names_par = c("unobs_sd", : Colnames of par_theta2 do not match with names of obs. and unobs. heterogeneity. Remember to name column of unobs. heterogeneity "unobs_sd" .

But I am pretty sure that I have named the first column of my par_theta2 matrix with "unobs_sd", I do not know what is wrong with my code; I will paste my code down here, could someone offer some help? Thanks a lot.

model_test <- as.formula("share ~ price + mixed + toxicity_dummy1 + toxicity_dummy2| mixed + toxicity_dummy1 + toxicity_dummy2| 0 + price + mixed + toxicity_dummy1 + toxicity_dummy2| IV_price_b_1 +IV_price_b_2+IV_price_b_3+IV_price_b_4+ IV_price_b_5+IV_price_b_6+IV_price_b_7");

theta_guesses <- matrix(c( 0.05,0.49, 0.004, 0.49, 0.004, 0.49, 0.004, 0.49), nrow = 4, byrow = TRUE);

colnames(theta_guesses) <- c("unobs_sd", "area"); # there is only one demo variable "area" rownames(theta_guesses) <- c("price", "mixed", "toxicity_dummy1","toxicity_dummy2");

blp_data <- BLP_data(model = model_test, market_identifier="mkt_id", product_id = "good_id", productData = dataset, demographic_draws = demodata_list, integration_method = "MLHS" , integration_accuracy = 50, integration_seed = 3, blp_inner_tol = 1e-16, blp_inner_maxit = 10000) my_est_test <- estimateBLP(blp_data = blp_data, par_theta2 = theta_guesses, extremumCheck = TRUE , printLevel = 1 , solver_method = "BFGS", solver_maxit = 10000, standardError = "homoskedastic") summary(my_est_test)

gaborcsardi commented 9 months ago

Hi, this is a read only mirror of CRAN, please see the package authors in the DESCRIPTION file. Look for Maintainer, BugReports and URL. Thanks!

xyy-711 commented 9 months ago

Noted. Thanks!