When it happens that the lag-1 autocorrelation (either horizontal or vertical) estimated within estimateTrenchDecorrelation() is < 0, the user gets an uninformative warning produced from taking the log of a negative number when attempting to calculate the corresponding decorrelation length.
Rather, the code should set the decorrelation length to NA when the a1 is < 0, to that the output decorrelation length is also NA, together with a warning why it is NA.
The current behaviour can be reproduced with the T15 trench2 data in the package:
x <- dplyr::filter(t15.trench2, depth <= 175.5)
estimateTrenchDecorrelation(x)
where, by chance, this depth subset of the trench data produces a negative a1 in horizontal direction.
When it happens that the lag-1 autocorrelation (either horizontal or vertical) estimated within
estimateTrenchDecorrelation()
is < 0, the user gets an uninformative warning produced from taking the log of a negative number when attempting to calculate the corresponding decorrelation length.Rather, the code should set the decorrelation length to
NA
when thea1
is < 0, to that the output decorrelation length is alsoNA
, together with a warning why it isNA
.The current behaviour can be reproduced with the T15 trench2 data in the package:
where, by chance, this depth subset of the trench data produces a negative
a1
in horizontal direction.