Learn R Programming

GE (version 0.1.1)

structural_function: Structural Function

Description

A structured function is a function generated by connecting two functions through a transition region. This function calculates the value of a structured function.

Usage

structural_function(theta, transition.interval, f1, f2, ...)

Arguments

theta

the track switching parameter, which is a scalar.

transition.interval

a 2-vector.

f1

the first function (or a value).

f2

the second function (or a value).

...

parameters of f1 and f2.

Value

The value of the structural function.

Examples

Run this code
# NOT RUN {
x <- seq(1, 5, 0.1)
y <- c()
for (theta in x) y <- c(y, structural_function(theta, c(2, 3), log, sqrt, theta))
plot(x, y)
lines(x, log(x), col = "blue")
lines(x, sqrt(x), col = "red")
# }

Run the code above in your browser using DataLab