Hi all,
I am wondering anyone has been able to replicate manually the values for the Root Mean Squared Prediction Error as calculated by Hainmuller's Synth package. I have not been able to do so. If I compute the pre-period RMSPE by hand, using only the values output by the program (Y_treated and Y_controlled, the time series used to generate the plots) and calculating, for the pre-period only, the sum of the difference between the treated outcome and the synthetic control outcome (then that difference squared), divided by the number of pre-treatment periods (then the square root of that).
But based on the below, it should match the program's output. Below is an excerpt from the ado file -- the code that generates the RMSPE:
I believe these are as follows:
Any ideas about what is going on?
I am wondering anyone has been able to replicate manually the values for the Root Mean Squared Prediction Error as calculated by Hainmuller's Synth package. I have not been able to do so. If I compute the pre-period RMSPE by hand, using only the values output by the program (Y_treated and Y_controlled, the time series used to generate the plots) and calculating, for the pre-period only, the sum of the difference between the treated outcome and the synthetic control outcome (then that difference squared), divided by the number of pre-treatment periods (then the square root of that).
But based on the below, it should match the program's output. Below is an excerpt from the ado file -- the code that generates the RMSPE:
Code:
/* Compute loss and transform to RMSPE */ mat `loss' = (`Ztr' - `Zco' * `wsol')' * ( `Ztr' - `Zco' * `wsol' ) mat `loss' = `loss' / rowsof(`Ztr') mata: roottaker("`loss'") mat rowname `loss' = "RMSPE"
- Ztr -- the matrix of pre-treatment characteristics for the treated unit
- Zco * wsol, the pre-treatment characteristics of the control units times the weights that come from the optimization section of the program
- rows of Ztr -- the number of pre-treatment period
Any ideas about what is going on?
Comment