Reputation: 339
I am getting this error and this post telling me that I should decrease the sigma but here is the thing this code was working fine a couple of months ago. Nothing change based on the data and the code. I was wondering why this error out of blue.
And the second point, when I lower the sigma such as 13.1
, it looks running (but I have been waiting for an hour).
sigma=203.9057
dimyx1=1024
A22den=density(Lnetwork,sigma,distance="path",continuous=TRUE,dimyx=dimyx1) #
About Lnetwork
Point pattern on linear network
69436 points
Linear network with 8417 vertices and 8563 lines
Enclosing window: rectangle = [143516.42, 213981.05] x [3353367, 3399153] units
Error: Required number of iterations = 1087633109 exceeds iterMax = 1e+06 ; either increase iterMax, dx, dt or reduce sigma
Upvotes: 0
Views: 109
Reputation: 2963
This is a question about the spatstat
package.
The code for handling data on a linear network is still under active development. It has changed in recent public releases of spatstat
, and has changed again in the development version. You need to specify exactly which version you are using.
The error report says that the required number of iterations of the algorithm is too large. This occurs because either the smoothing bandwidth sigma
is too large, or the spacing dx
between sample points along the network is too small. The number of iterations is proportional to (sigma/dx)^2
in most cases.
First, check that the value of sigma
is physically reasonable.
Normally you shouldn't have to worry about the algorithm parameter dx
because it is determined automatically by default. However, it's possible that your data are causing the code to choose a very small value of dx
.
The internal code which automatically determines the spacing dx
of sample points along the network has been changed recently, in order to fix several bugs.
I suggest that you specify the algorithm parameters manually. See the help file for densityHeat
for information on how to control the spacings. Setting the parameters manually will also ensure greater consistency of the results between different versions of the software.
The quickest solution is to set finespacing=FALSE
. This is not the best solution because it still uses some of the automatic rules which may be giving problems. Please read the help file to understand what that does.
Upvotes: 2
Reputation: 4507
Did you update spatstat since this last worked? Probably the internal code for determining spacing on the network etc. changed a bit. The actual computations are done by the function densityHeat()
, and you can see how to manually set spacing etc. in its help file.
Upvotes: 0