[chronojump] RaceAnalyzer. When the step size is too small in nls it works
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] RaceAnalyzer. When the step size is too small in nls it works
- Date: Tue, 15 Jun 2021 14:11:18 +0000 (UTC)
commit 223749387116ce54a16eb82807f289a79c8276d5
Author: Xavier Padullés <x padulles gmail com>
Date: Tue Jun 15 16:05:39 2021 +0200
RaceAnalyzer. When the step size is too small in nls it works
r-scripts/sprintEncoder.R | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/r-scripts/sprintEncoder.R b/r-scripts/sprintEncoder.R
index c1e4c2eff..f34227f13 100644
--- a/r-scripts/sprintEncoder.R
+++ b/r-scripts/sprintEncoder.R
@@ -721,9 +721,12 @@ tryNLS <- function(data){
# start = list(Vmax = max(data[,"speed"]), K = 1, T0 = 0.2),
control=nls.control(warnOnly=TRUE))
model = nls(position ~ Vmax*(time + T0 + (1/K)*exp(-K*(time + T0))) -Vmax/K + P0,
data
, start = list(K = 0.81, Vmax = 10, T0 = 0.2, P0 = 0.1),
control=nls.control(warnOnly=TRUE))
- # print("model:")
- # print(model)
- if (! model$convInfo$isConv){
+ print("model:")
+ print(model)
+ print(model$convInfo)
+ print(model$convInfo$inConv)
+ print(model$convInfo$stopCode)
+ if (! model$convInfo$isConv && (model$convInfo$stopCode != 2)){
return(list(regressionDone = FALSE, model = model))
} else {
return(list(regressionDone = TRUE, model = model))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]