predict.ahn: predict

Description Usage Arguments Value Examples

Description

Function to simulate a trained Artificial Hydrocarbon Network.

Usage

1
2
## S3 method for class 'ahn'
predict(object, ...)

Arguments

object

an object of class "ahn" produced from the fit function.

...

further arguments passed to or from other methods.

Value

predicted output values for inputs in newdata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
# Create data
x <- 2 * runif(1000) - 1;
x <- sort(x)

y <- (x < 0.1) * (0.05 * runif(100) + atan(pi*x)) +
    (x >= 0.1 & x < 0.6) * (0.05 * runif(1000) + sin(pi*x)) +
    (x >= 0.6) * (0.05 * runif(1000) + cos(pi*x))

# Create Sigma list
Sigma <- list(X = data.frame(x = x), Y = data.frame(y = y))

# Train AHN
ahn <- fit(Sigma, 5, 0.01, 500)

# Test AHN
X <- data.frame(x = x)
ysim <- predict(ahn, X)

## End(Not run)

ahnr documentation built on May 2, 2019, 2:29 p.m.