From fdd1abf0378e468c34a4bdb5a5c71846082f03bc Mon Sep 17 00:00:00 2001 From: Nianshuo Wen <1565408369@qq.com> Date: Sat, 17 Jan 2026 20:58:55 +0800 Subject: [PATCH 1/2] test modification --- src/gwmodelpp/GTDR.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gwmodelpp/GTDR.cpp b/src/gwmodelpp/GTDR.cpp index b82ac21a..fed96e44 100644 --- a/src/gwmodelpp/GTDR.cpp +++ b/src/gwmodelpp/GTDR.cpp @@ -16,6 +16,7 @@ using namespace gwm; RegressionDiagnostic GTDR::CalcDiagnostic(const mat& x, const vec& y, const mat& betas, const vec& shat) { + // this line is a test line. vec r = y - sum(betas % x, 1); double rss = sum(r % r); double n = (double)x.n_rows; From bed6e9e8e3e0773570d2de2ec78f4cc2c7bf366e Mon Sep 17 00:00:00 2001 From: Nianshuo Wen <1565408369@qq.com> Date: Tue, 7 Apr 2026 20:41:40 +0800 Subject: [PATCH 2/2] add getter for betas, betasSE, s and sHat --- include/gwmodelpp/GWRGeneralized.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/gwmodelpp/GWRGeneralized.h b/include/gwmodelpp/GWRGeneralized.h index f73cf090..f3773852 100644 --- a/include/gwmodelpp/GWRGeneralized.h +++ b/include/gwmodelpp/GWRGeneralized.h @@ -404,6 +404,34 @@ class GWRGeneralized : public GWRBase, public IBandwidthSelectable, public IPara bool hasRegressionData() const; void setHasRegressionData(bool value); + /* + * @brief \~english Get the beta estimates. \~chinese 获取回归系数估计值。 + * + * @return arma::mat \~english Beta estimates \~chinese 回归系数估计值 + */ + arma::mat betas() { return mBetas; } + + /* + * @brief \~english Get standard errors of the beta estimates. \~chinese 获取回归系数估计值的标准差。 + * + * @return arma::mat \~english Standard errors of beta estimates \~chinese 回归系数估计值的标准差 + */ + arma::mat betasSE() { return mBetasSE; } + + /** + * @brief \~english Get a vector of trace of \f$S\f$ and \f$S'S\f$. \~chinese 获取一个包含 \f$S\f$ 和 \f$S'S\f$ 矩阵迹的向量。 + * + * @return arma::vec \~english A vector of trace of \f$S\f$ and \f$S'S\f$ \~chinese 一个包含 \f$S\f$ 和 \f$S'S\f$ 矩阵迹的向量 + */ + arma::vec sHat() { return mShat; } + + /** + * @brief \~english Get the hat matrix \f$S\f$. \~chinese 获取帽子矩阵 \f$S\f$。 + * + * @return arma::mat \~english The hat matrix \f$S\f$ \~chinese 帽子矩阵 \f$S\f$ + */ + arma::vec s() {return mS;} + private: /**