类 GWRBase
定义于 文件 GWRBase.h
继承关系
基类
public gwm::SpatialMonoscaleAlgorithm(类 SpatialMonoscaleAlgorithm)public gwm::IRegressionAnalysis(结构体 IRegressionAnalysis)
派生类
public gwm::GTWR(类 GTWR)public gwm::GWRBasic(类 GWRBasic)public gwm::GWRGeneralized(类 GWRGeneralized)public gwm::GWRLocalCollinearity(类 GWRLocalCollinearity)public gwm::GWRScalable(类 GWRScalable)
类文档
-
class GWRBase : public gwm::SpatialMonoscaleAlgorithm, public gwm::IRegressionAnalysis
地理加权回归算法基类。 该类提供一些地理加权回归算法的常用接口,不能被构造。
Subclassed by gwm::GTWR, 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()
析构 CGwmGWRBase 对象。
-
inline const arma::mat &betas() const
获取回归系数估计值。
- 返回:
arma::mat 回归系数估计值。
-
inline virtual const arma::vec &dependentVariable() const override
获取因变量。
- 返回:
arma::vec 因变量。
-
inline virtual void setDependentVariable(const arma::vec &y) override
设置因变量。
- 参数:
y -- 因变量。
-
inline virtual const 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 值。
-
inline GWRBase()