Learn R Programming

ICAFF (version 1.0.1)

plot.ICA: Methods for ICA objects.

Description

Provide standard methods for manipulating ICA objects, namely printing, plotting, summarising and extracting the position of the minimum.

Usage

"plot"(x, ..., xlab = "Iteration", ylab = "Value", main = "ICA History", col = "red") "print"(x, ...) "summary"(object, ...) "coef"(object, ...)

Arguments

x, object
An object of class "ICA".
xlab, ylab, main, col
Graphics parameters.
...
Additional arguments passed on to the method.

Value

print method: the value is printed and returned invisibly.summary method: dummy. Returns the object unchanged.plot method: a plot of the history of the process is produced with a NULL return value.coef method: extract the location vector for the minimum value.

Details

Methods for standard generic functions when dealing with objects of class "ICA"

Examples

Run this code

## --------cost function: f(x,y) = x * sin(4 * x) + 1.1 * y * sin(2 * y)
## --------search region: -10 <= x, y <= 10

cost <- function(x) {
  x[1] * sin(4 * x[1]) + 1.1 * x[2] * sin(2 * x[2])
}

ICAout <- ICA(cost, nvar = 2, ncountries = 80, nimp = 10,
              maxiter = 100, lb = -10, ub = 10, 
              beta = 2, P_revolve = 0.3, zeta = 0.02)

summary(ICAout)     ## same as the print method
coef(ICAout)        ## get the position of the minimum
cost(coef(ICAout))  ## cost at the minimum
plot(ICAout)        ## show the history of the process

Run the code above in your browser using DataLab