类 GWRBase

继承关系

基类

派生类

类文档

class GWRBase : public gwm::SpatialMonoscaleAlgorithm, public gwm::IRegressionAnalysis

地理加权回归算法基类。 该类提供一些地理加权回归算法的常用接口,不能被构造。

Subclassed by gwm::GWRBasic, gwm::GWRGeneralized, gwm::GWRLocalCollinearity, gwm::GWRScalable

公有方法

inline GWRBase()

构造 CGwmGWRBase 对象。

inline GWRBase(const arma::mat &x, const arma::vec &y, const SpatialWeight &spatialWeight, const arma::mat &coords)

构造 CGwmGWRBase 对象。

参数
  • x – 自变量矩阵。

  • y – 因变量。

  • spatialWeight – 空间权重配置。

  • coords – 坐标矩阵。

inline ~GWRBase()
inline arma::mat betas() const

获取回归系数估计值。

返回

arma::mat 回归系数估计值。

inline virtual arma::vec dependentVariable() const override

获取因变量。

返回

arma::vec 因变量。

inline virtual void setDependentVariable(const arma::vec &y) override

设置因变量。

参数

y – 因变量。

inline virtual arma::mat independentVariables() const override

获取自变量。

返回

arma::mat 自变量。

inline virtual void setIndependentVariables(const arma::mat &x) override

设置自变量。

参数

x – 自变量。

inline virtual bool hasIntercept() const override

获取是否具有截距。

返回

true 如果有截距。

返回

false 如果没有截距。

inline virtual void setHasIntercept(const bool has) override

Set the Has Intercept object.

参数

has – 如果有截距则传入 true ,否则传入 false 。

inline virtual RegressionDiagnostic diagnostic() const override

获取诊断信息。

返回

RegressionDiagnostic 诊断信息。

virtual bool isValid() override

检查算法配置是否合法。

返回

true 如果算法配置是合法的。

返回

false 如果算法配置不合法。

公有静态方法

static inline arma::vec Fitted(const arma::mat &x, const arma::mat &betas)

根据给定的 \(X\)\(\beta\) 计算拟合的因变量的值。

参数
  • x – 自变量矩阵 \(X\)

  • betas – 回归系数估计值 \(\beta\)

返回

vec 拟合的因变量的值。

static inline double RSS(const arma::mat &x, const arma::mat &y, const arma::mat &betas)

根据给定的 \(X\), \(y\)\(\beta\) 计算残差平方和。

参数
  • x – 自变量矩阵 \(X\)

  • y – 因变量 \(y\)

  • betas – 回归系数估计值 \(\beta\)

返回

double 残差平方和。

static inline double AICc(const arma::mat &x, const arma::mat &y, const arma::mat &betas, const arma::vec &shat)

根据给定的 \(X\), \(y\), \(\beta\), \(tr(S)\)\(tr(SS^T)\) 计算 AICc 值。

参数
  • x – 自变量矩阵 \(X\)

  • y – 因变量 \(y\)

  • betas – 回归系数估计值 \(\beta\)

  • shat – 一个包含两个元素的向量,两个元素分别是 \(tr(S)\)\(tr(SS^T)\)

返回

double AICc 值。

保护属性

arma::mat mX

自变量 \(X\)

arma::vec mY

因变量 \(y\)

arma::mat mBetas

回归系数估计值 \(\beta\)

bool mHasIntercept = true

指示是否具有截距

RegressionDiagnostic mDiagnostic

诊断信息