[英]how check overfitting on point pattern on a linear network using spatstat
I have been using lppm (point pattern on a linear network) on spatstat with bunch of covariates and fitting a log-linear model but I couldn't see how to check over-fitting.我一直在spatstat上使用lppm (线性网络上的点模式)与一堆协变量并拟合对数线性model,但我看不出如何检查过度拟合。 Is there a quick way to do it?
有没有快速的方法来做到这一点?
It depends on what you want.这取决于你想要什么。
What tool would you use to check overfitting in (say) a linear model?您将使用什么工具来检查(例如)线性 model 中的过度拟合?
To identify whether individual observations may have been over-fitted, you could use influence.lppm
(from the spatstat.linnet
package).要确定个别观察是否可能过度拟合,您可以使用
influence.lppm
.lppm(来自spatstat.linnet
包)。
To identify collinearity in the covariates, currently we do not provide a dedicated function in spatstat
, but you could use the following trick.为了识别协变量中的共线性,目前我们没有在 spatstat 中提供专用的
spatstat
,但您可以使用以下技巧。 If fit
is your fitted model of class lppm
, first extract the corresponding GLM using如果
fit
是您安装的 model 的 class lppm
,首先使用提取相应的 GLM
g <- getglmfit(as.ppm(fit))
Next install the package faraway
and use the vif
function to calculate the variance inflation factors接下来安装
faraway
并使用vif
function 计算方差膨胀因子
library(faraway)
vif(g)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.