plot_fitness {autohrf}R Documentation

plot_fitness

Description

Plots how fitness changed through iterations of autohrf. Use this to investigate whether your solution converged.

Usage

plot_fitness(autofit)

Arguments

autofit

Output of the autohrf function.

Value

A ggplot visualization of fitness through time.

Examples

# prepare model specs
model3 <- data.frame(
  event        = c("encoding", "delay", "response"),
  start_time   = c(0,          2.65,     12.5),
  end_time     = c(3,          12.5,     16)
)

model4 <- data.frame(
  event        = c("fixation", "target", "delay", "response"),
  start_time   = c(0,          2.5,      2.65,    12.5),
  end_time     = c(2.5,        3,        12.5,    15.5)
)

model_constraints <- list(model3, model4)

# run autohrf
df <- flanker
autofit <- autohrf(df, model_constraints, tr = 2.5,
                   population = 2, iter = 2, cores = 1)

# plot fitness
plot_fitness(autofit)


[Package autohrf version 1.1.3 Index]