类 GWRGeneralized
继承关系
基类
public gwm::GWRBase
(类 GWRBase)public gwm::IBandwidthSelectable
(结构体 IBandwidthSelectable)public gwm::IParallelizable
(结构体 IParallelizable)public gwm::IParallelOpenmpEnabled
(结构体 IParallelOpenmpEnabled)
类文档
-
class GWRGeneralized : public gwm::GWRBase, public gwm::IBandwidthSelectable, public gwm::IParallelizable, public gwm::IParallelOpenmpEnabled
广义地理加权模型。
公有类型
-
enum BandwidthSelectionCriterionType
获取带宽自动优选指标值类型。
- Return
带宽自动优选指标值类型
Values:
-
enumerator AIC
AIC
-
enumerator CV
CV
-
typedef double (GWRGeneralized::* BandwidthSelectCriterionFunction)(BandwidthWeight*)
带宽优选指标值计算函数
-
typedef arma::mat (GWRGeneralized::* GGWRfitFunction)(const arma::mat &x, const arma::vec &y)
拟合函数
-
typedef arma::vec (GWRGeneralized::* CalWtFunction)(const arma::mat &x, const arma::vec &y, arma::mat w)
加权函数
公有方法
-
inline GWRGeneralized()
构造一个新的 GWRGeneralized 对象
-
inline ~GWRGeneralized()
销毁一个 GWRGeneralized 对象
-
inline virtual double getCriterion(BandwidthWeight *bandwidthWeight) override
根据指定的带宽计算带宽优选的指标值。
- 参数
weight – 指定的带宽。
- 返回
double 带宽优选的指标值。
-
virtual arma::mat predict(const arma::mat &locations) override
在指定位置处进行回归系数预测。
- 参数
locations – 指定位置。
- 返回
mat 回归系数预测值。
-
virtual arma::mat fit() override
拟合回归系数估计值。
- 返回
mat 回归系数估计值。
-
arma::mat fit(const arma::mat &x, const arma::vec &y, arma::mat &betasSE, arma::vec &shat, arma::vec &qdiag, arma::mat &S)
-
inline virtual int parallelAbility() const override
返回该算法的并行能力。
- 返回
当前算法并行能力的按位或运算结果。
-
inline virtual ParallelType parallelType() const override
返回当前算法的并行类型。
- 返回
当前算法的并行类型。
-
virtual void setParallelType(const ParallelType &type) override
设置当前算法的并行类型。
- 参数
type – 当前算法的并行类型。
-
inline virtual void setOmpThreadNum(const int threadNum) override
设置并行线程数。
- 参数
threadNum – 并行线程数。
-
inline double getTol() const
获取容忍值。
- 返回
Family 容忍值
-
inline void setTol(double tol)
获取容忍值。
- 参数
tol – 容忍值
-
inline size_t getMaxiter() const
获取最大迭代次数。
- 返回
Family 最大迭代次数
-
inline void setMaxiter(std::size_t maxiter)
获取最大迭代次数。
- 参数
maxiter – 最大迭代次数
-
inline arma::mat getWtMat1() const
-
inline arma::mat getWtMat2() const
-
inline GWRGeneralizedDiagnostic getDiagnostic() const
获取诊断信息。
- 返回
-
inline GLMDiagnostic getGLMDiagnostic() const
获取广义线性模型的诊断信息。
- 返回
GLMDiagnostic 诊断信息
-
void setBandwidthSelectionCriterionType(const BandwidthSelectionCriterionType &bandwidthSelectionCriterionType)
-
inline BandwidthCriterionList bandwidthSelectorCriterions() const
-
inline BandwidthSelectionCriterionType bandwidthSelectionCriterionType() const
-
inline bool autoselectBandwidth() const
获取是否进行带宽优选。
- 返回
true 是
- 返回
false 否
-
inline void setIsAutoselectBandwidth(bool value)
设置是否进行带宽优选。
- 参数
flag – 是否进行带宽优选
-
inline arma::mat regressionData() const
-
inline void setRegressionData(const arma::mat &locations)
-
inline bool hasHatMatrix() const
获取是否有帽子矩阵。
- 返回
true 是
- 返回
false 否
-
inline void setHasHatMatrix(bool value)
设置是否有帽子矩阵。
- 参数
flag – 是否有帽子矩阵。
-
inline bool hasRegressionData() const
-
inline void setHasRegressionData(bool value)
公有成员
-
BandwidthCriterionList mBandwidthSelectionCriterionList
公有静态方法
-
static arma::vec gwPredict(const arma::mat &x, const arma::vec &y, const arma::vec &w)
地理加权预测函数
- 参数
x – 自变量
y – 因变量
w – 权重
- 返回
arma::vec 回归系数估计值
-
static arma::vec gwFit(const arma::mat &x, const arma::vec &y, const arma::vec &w, arma::uword focus, arma::mat &ci, arma::mat &s_ri)
地理加权拟合函数
- 参数
x – 自变量
y – 因变量
w – 权重
focus – 目标样本的索引值
ci –
s_ri –
- 返回
arma::vec 回归系数估计值
-
static arma::mat dpois(arma::mat y, arma::mat mu)
-
static arma::mat dbinom(arma::mat y, arma::mat m, arma::mat mu)
-
static arma::mat lchoose(arma::mat n, arma::mat k)
-
static arma::mat lgammafn(arma::mat x)
-
static arma::mat CiMat(const arma::mat &x, const arma::vec &w)
保护方法
-
arma::mat fitPoissonSerial(const arma::mat &x, const arma::vec &y)
泊松模型拟合的单线程实现。
- 参数
x – 自变量
y – 因变量
- 返回
arma::vec 回归系数估计值
-
arma::mat fitBinomialSerial(const arma::mat &x, const arma::vec &y)
二项模型拟合的单线程实现。
- 参数
x – 自变量
y – 因变量
- 返回
arma::vec 回归系数估计值
-
arma::mat diag(arma::mat a)
-
arma::vec PoissonWtSerial(const arma::mat &x, const arma::vec &y, arma::mat w)
泊松加权模型拟合的单线程实现。
- 参数
x – 自变量
y – 因变量
w – 权重
- 返回
arma::vec 回归系数估计值
-
arma::vec BinomialWtSerial(const arma::mat &x, const arma::vec &y, arma::mat w)
二项加权模型拟合的单线程实现。
- 参数
x –
y –
w –
- 返回
arma::vec
-
void CalGLMModel(const arma::mat &x, const arma::vec &y)
保护属性
-
double mTol = 1e-5
容忍值
-
std::size_t mMaxiter = 20
最大迭代次数
-
bool mHasHatMatrix = true
是否有帽子矩阵。
-
bool mHasRegressionData = false
-
arma::mat mBetasSE
//!< 回归系数估计值标准误差。
-
arma::vec mShat
//!< 一个包含 \(S\) 和 \(S'S\) 矩阵迹的向量
-
arma::mat mS
//!< 帽子矩阵 \(S\)
-
double mGwDev
-
arma::mat mRegressionData
-
arma::mat mWtMat1
-
arma::mat mWtMat2
-
GWRGeneralizedDiagnostic mDiagnostic
诊断信息
-
GLMDiagnostic mGLMDiagnostic
GLM模型的诊断信息
-
arma::mat mWt2
-
arma::mat myAdj
-
double mLLik = 0
对数似然函数值
-
GGWRfitFunction mGGWRfitFunction = &GWRGeneralized::fitPoissonSerial
拟合函数
-
CalWtFunction mCalWtFunction = &GWRGeneralized::PoissonWtSerial
加权函数
-
bool mIsAutoselectBandwidth = false
是否进行带宽优选
-
BandwidthSelectionCriterionType mBandwidthSelectionCriterionType = BandwidthSelectionCriterionType::AIC
带宽优选指标类型
-
BandwidthSelectCriterionFunction mBandwidthSelectCriterionFunction = &GWRGeneralized::bandwidthSizeGGWRCriterionCVSerial
用于根据给定带宽值计算指标值的函数
-
BandwidthSelector mBandwidthSizeSelector
带宽选择器
-
ParallelType mParallelType = ParallelType::SerialOnly
并行方法类型
-
int mOmpThreadNum = 8
多线程所使用的线程数
-
enum BandwidthSelectionCriterionType