简体   繁体   English

R - 如何在指数衰减模型中找到 1/e?

[英]R - How to find 1/e in an exponential decay model?

I am working with daily precipitation measurements from nearly 1500 rain gauges.我正在使用近 1500 个雨量计进行每日降水测量。 I have calculated the correlation between the measurements of each station and its 20 nearest neighbors.我已经计算了每个站的测量值与其 20 个最近邻站的测量值之间的相关性。 I also have the distances between the stations.我也有车站之间的距离。

I am now trying to find the correlation decay distance (CDD) from the resulting correlation matrix.我现在试图从结果相关矩阵中找到相关衰减距离 (CDD)。 CDD is defined as the distance where the correlation between one station and all other stations decays below 1/e. CDD 定义为一个站与所有其他站之间的相关性衰减到 1/e 以下的距离。 I am following Hofstra and New 's calculation of CDD:我正在关注Hofstra 和 New对 CDD 的计算:

在此处输入图片说明

Specifically, I am attempting to reproduce their Figure 2:具体来说,我试图重现他们的图 2:

在此处输入图片说明

Based on this post, my first try was using SSasymp to fit a self-starting exponential decay function to my data.基于这篇文章,我的第一次尝试是使用SSasymp将自启动指数衰减函数拟合到我的数据中。 This is what I have so far:这是我到目前为止:

library(data.table)

# load data
dat <- fread("https://www.dropbox.com/s/jgo5b91owpllbq3/cor_vs_dist.csv?dl=1", sep=",") # ~ 465 KB

# visually inspect it
plot(correl ~ dist, data=dat)

# fit a model using SSasymp
fit <- nls(correl ~ SSasymp(dist, Asym, R0, lrc), data=dat)
summary(fit)
coef(fit)
lines(dat$correl, predict(fit), col="red")

However, the fit is terribly poor:但是,合身性非常差:

在此处输入图片说明

So my questions are:所以我的问题是:

  1. How can I fit a better我怎样才能更好地适应其他 exponential decay model to my data?我的数据的指数衰减模型?
  2. Once the model is fit, how can I determine the 1/e value like in the referenced paper?一旦模型适合,我如何确定参考论文中的1/e值?

Any input highly appreciated!任何输入高度赞赏!

Your fit isn't bad, you are just plotting the predictions in the wrong way, using correl as the x-axis instead of dist .您的拟合还不错,您只是以错误的方式绘制预测,使用correl而不是dist作为 x 轴。

Moreover, rather than predicting and plotting every unique value of dist in your dataset, it's better to predict and plot for a range of values of dist .此外,而不是预测和策划的每一个独特的价值dist在数据集中,这是更好地预测和情节的一系列价值观的dist

Here's a clean plot:这是一个干净的情节:

plot(correl ~ dist, data=dat)
lines(0:1000, predict(fit, newdata = data.frame(dist = 0:1000)), col="red")

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM