Learn R Programming

Dark (version 0.9.9)

H: This is a simple switch function.

Description

This function is used to transition from 'off' to 'on'.

Usage

H(x, k = 100, t)

Value

For times before 't' the output is less than or equal to 0.5, after this time the the output is greater than 0.5. As 'k' grows larger the rate of transition from 0 to 1 increases.

Arguments

x

is the measured time.

k

is the transition constant, set arbitrarily high.

t

is the time at which the transition occurs.

Author

Jeremiah MF Kelly

Mumac Ltd, SK7 6NR, GB

Details

This helper function used in P5c and P7c enables the optim function to find parameters three times as quickly than if the transitions between the phases are modelled by a logical function e.g. a step function.

References

The logistic function: https://en.wikipedia.org/wiki/Logistic_function

The step function: https://en.wikipedia.org/wiki/Heaviside_step_function

See Also

P5c, P7c

Examples

Run this code

x <- seq(0, 20, by=0.1)
k <- 10
t <- 10
op <- par(las=1, bty='n')
if (FALSE) plot(x,H(x,k,t), 'l')
par(op)

Run the code above in your browser using DataLab