Last data update: 2014.03.03
R: Step functions
Step functions
Description
Step functions for relaxation methods
Usage
purestep(k)
decrstep(k, param)
decrstep5(k)
decrstep10(k)
decrstep20(k)
Arguments
k
iteration number.
param
parameter for the decreasing step function after which the step decreases.
Details
The decrstep
function is a decreasing step serie such that decrstep(k)
equals to 1/2/(k - param) when k>param , 1/2, otherwise.
Functions decrstep5, decrstep10, decrstep20
are just wrappers of
decrstep
.
The purestep
function implements a constant step serie equaled to 1.
Value
A numeric.
Author(s)
Christophe Dutang
See Also
See also GNE
and GNE.fpeq
.
Examples
cbind(
purestep(1:20),
decrstep(1:20, 7),
decrstep5(1:20),
decrstep10(1:20),
decrstep20(1:20)
)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(GNE)
Loading required package: alabama
Loading required package: numDeriv
Loading required package: nleqslv
Loading required package: BB
Loading required package: SQUAREM
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GNE/util-stepfunc.Rd_%03d_medium.png", width=480, height=480)
> ### Name: stepfunc
> ### Title: Step functions
> ### Aliases: stepfunc purestep decrstep decrstep5 decrstep10 decrstep20
> ### Keywords: math
>
> ### ** Examples
>
>
> cbind(
+ purestep(1:20),
+ decrstep(1:20, 7),
+ decrstep5(1:20),
+ decrstep10(1:20),
+ decrstep20(1:20)
+ )
[,1] [,2] [,3] [,4] [,5]
[1,] 1 0.50000000 0.50000000 0.50000000 0.5
[2,] 1 0.50000000 0.50000000 0.50000000 0.5
[3,] 1 0.50000000 0.50000000 0.50000000 0.5
[4,] 1 0.50000000 0.50000000 0.50000000 0.5
[5,] 1 0.50000000 0.50000000 0.50000000 0.5
[6,] 1 0.50000000 0.50000000 0.50000000 0.5
[7,] 1 0.50000000 0.25000000 0.50000000 0.5
[8,] 1 0.50000000 0.16666667 0.50000000 0.5
[9,] 1 0.25000000 0.12500000 0.50000000 0.5
[10,] 1 0.16666667 0.10000000 0.50000000 0.5
[11,] 1 0.12500000 0.08333333 0.50000000 0.5
[12,] 1 0.10000000 0.07142857 0.25000000 0.5
[13,] 1 0.08333333 0.06250000 0.16666667 0.5
[14,] 1 0.07142857 0.05555556 0.12500000 0.5
[15,] 1 0.06250000 0.05000000 0.10000000 0.5
[16,] 1 0.05555556 0.04545455 0.08333333 0.5
[17,] 1 0.05000000 0.04166667 0.07142857 0.5
[18,] 1 0.04545455 0.03846154 0.06250000 0.5
[19,] 1 0.04166667 0.03571429 0.05555556 0.5
[20,] 1 0.03846154 0.03333333 0.05000000 0.5
>
>
>
>
>
>
> dev.off()
null device
1
>