SlopeStoppingCriteria | R Documentation |
Class which send a stop signal when a time series stay constant.
Test the slope.
minit
[integer] Minimal number of iterations. At least 3.
maxit
[integer] Maximal number of iterations.
nit
[integer] Number of iterations.
tol
[float] Tolerance to control if slope is close to zero
stop
[bool] If we stop
criteria
[vector] State of criteria
slope
[vector] Values of slope
new()
Create a new SlopeStoppingCriteria object.
SlopeStoppingCriteria$new(minit, maxit, tol)
minit
[integer] Minimal number of iterations. At least 3.
maxit
[integer] Maximal number of iterations.
tol
[float] Tolerance to control if slope is close to zero
A new 'SlopeStoppingCriteria' object.
reset()
Reset the class
SlopeStoppingCriteria$reset()
NULL
append()
Add a new value
SlopeStoppingCriteria$append(value)
value
[double] New metrics
NULL
clone()
The objects of this class are cloneable with this method.
SlopeStoppingCriteria$clone(deep = FALSE)
deep
Whether to make a deep clone.
stop_slope = SlopeStoppingCriteria$new( 20 , 500 , 1e-3 )
x = 0
while(!stop_slope$stop)
{
stop_slope$append(base::exp(-x))
x = x + 0.1
}
print(stop_slope$nit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.