PURPOSE: Curve matching can predict the height trajectories of children by analyzing longitudinal growth data. We extended the method to improve the prediction of response to long-acting growth hormone treatment in children with growth hormone deficiency (GHD). METHODS: We analyzed data from a previous real-world study with a 36-month treatment of PEGylated recombinant human growth hormone (PEG-rhGH). The matching database comprises height measures imputed using the broken stick method. For curve matching, we proposed a flexible hyperparameter selection approach to determining the number of similar patients. RESULTS: The matching database included 681 patients, with an average of 12.20 ± 2.09 height measurements per patient. Our approach demonstrated significantly improved prediction accuracy compared with the previous approach using a fixed number of similar patients (mean squared errors of 0.0412 ± 0.1156 vs. 0.564 ± 0.1639, 0.851 ± 0.2627, and 0.1077 ± 0.2960 for 5, 10, and 15 similar patients, respectively, all P <
0.05). The optimal prediction scenario was having four height measurements within the first six months and predicting height trajectories from there on. CONCLUSION: By extending curve matching with flexible hyperparameter selection, we accurately predicted the response to long-acting PEG-rhGH in the GHD children included in this study.