Learn R Programming

SBCK (version 1.0.0)

SlopeStoppingCriteria: Slope stopping criteria

Description

Class which send a stop signal when a time series stay constant.

Arguments

Public fields

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

Methods


Method new()

Create a new SlopeStoppingCriteria object.

Usage

SlopeStoppingCriteria$new(minit, maxit, tol)

Arguments

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

Returns

A new `SlopeStoppingCriteria` object.


Method reset()

Reset the class

Usage

SlopeStoppingCriteria$reset()

Returns

NULL


Method append()

Add a new value

Usage

SlopeStoppingCriteria$append(value)

Arguments

value

[double] New metrics

Returns

NULL


Method clone()

The objects of this class are cloneable with this method.

Usage

SlopeStoppingCriteria$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Details

Test the slope.

Examples

Run this code
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)

Run the code above in your browser using DataLab