Error(s) in re-building vignettes:
--- re-building ‘datafsm_introduction.Rmd’ using rmarkdown
Iter = 1 | Mean = 0.4856247 | Best = 0.951
Iter = 2 | Mean = 0.5155727 | Best = 0.984
Iter = 3 | Mean = 0.509588 | Best = 0.98995
Iter = 4 | Mean = 0.568762 | Best = 0.98995
Iter = 5 | Mean = 0.6015787 | Best = 0.98995
Iter = 6 | Mean = 0.6241193 | Best = 0.98995
Iter = 7 | Mean = 0.583012 | Best = 0.98995
Iter = 8 | Mean = 0.6065533 | Best = 0.98995
Iter = 9 | Mean = 0.561408 | Best = 0.98995
Iter = 10 | Mean = 0.5821287 | Best = 0.98995
Iter = 11 | Mean = 0.5594113 | Best = 0.98995
Iter = 12 | Mean = 0.553268 | Best = 0.98995
Iter = 13 | Mean = 0.60407 | Best = 0.98995
Iter = 14 | Mean = 0.635282 | Best = 0.98995
Iter = 15 | Mean = 0.6144573 | Best = 0.98995
Iter = 16 | Mean = 0.66433 | Best = 0.98995
Iter = 17 | Mean = 0.6253147 | Best = 0.98995
Iter = 18 | Mean = 0.58982 | Best = 0.98995
Iter = 19 | Mean = 0.6463013 | Best = 0.98995
Iter = 20 | Mean = 0.6647493 | Best = 0.98995
Iter = 21 | Mean = 0.6945667 | Best = 0.98995
Iter = 22 | Mean = 0.6661833 | Best = 0.98995
Iter = 23 | Mean = 0.707916 | Best = 0.98995
Iter = 24 | Mean = 0.6992913 | Best = 0.98995
Iter = 25 | Mean = 0.719242 | Best = 0.98995
Iter = 26 | Mean = 0.7375747 | Best = 0.98995
Iter = 27 | Mean = 0.7913473 | Best = 0.98995
evolve_model              package:datafsm              R Documentation

_U_s_e _a _G_e_n_e_t_i_c _A_l_g_o_r_i_t_h_m _t_o _E_s_t_i_m_a_t_e _a _F_i_n_i_t_e-_s_t_a_t_e _M_a_c_h_i_n_e _M_o_d_e_l

_D_e_s_c_r_i_p_t_i_o_n:

     'evolve_model' uses a genetic algorithm to estimate a finite-state
     machine model, primarily for understanding and predicting
     decision-making.

_U_s_a_g_e:

     evolve_model(data, test_data = NULL, drop_nzv = FALSE,
             measure = c("accuracy", "sens", "spec", "ppv"),
             states = NULL, cv = FALSE, max_states = NULL, k = 2,
             actions = NULL, seed = NULL, popSize = 75,
             pcrossover = 0.8, pmutation = 0.1, maxiter = 50,
             run = 25, parallel = FALSE, priors = NULL,
             verbose = TRUE, return_best = TRUE, ntimes = 1)
     
_A_r_g_u_m_e_n_t_s:

    data: A 'data.frame' that has columns named "period" and "outcome"
          (period is the time period that the outcome action was
          taken), and one to three additional columns, containing
          predictors. All of the 3-5 columns should be named. The
          period and outcome columns should be integer vectors and the
          columns with the predictor variable data should be logical
          vectors ('TRUE, FALSE'). If the predictor variable data is
          not logical, it will coerced to logical with
          'base::as.logical()'.

test_data: Optional 'data.frame' that has "period" and "outcome"
          columns, with one to three additional columns containing
          predictors. All of the (3-5 columns) should be named. The
          outcome variable is the decision the decision-maker took for
          that period. This 'data.frame' should be in the same format
          and have the same order of columns as the data.frame passed
          to the required 'data' argument.

drop_nzv: Optional logical vector length one specifying whether
          predictors variables with variance in provided data near zero
          should be dropped before model building. Default is 'FALSE'.
          See 'caret::nearZeroVar()', which calls:
          'caret::nzv()'.

 measure: Optional length one character vector that is either:
          "accuracy", "sens", "spec", or "ppv". This specifies what
          measure of predictive performance to use for training and
          evaluating the model. The default measure is '"accuracy"'.
          However, accuracy can be a problematic measure when the
          classes are imbalanced in the samples, i.e. if a class the
          model is trying to predict is very rare. Alternatives to
          accuracy are available that illuminate different aspects of
          predictive power. Sensitivity answers the question, `` given
          that a result is truly an event, what is the probability that
          the model will predict an event?'' Specificity answers the
          question, ``given that a result is truly not an event, what
          is the probability that the model will predict a negative?''
          Positive predictive value answers, ``what is the percent of
          predicted positives that are actually positive?''

  states: Optional numeric vector with the number of states. If not
          provided, will be set to 'max(data$outcome)'.

      cv: Optional logical vector length one for whether
          cross-validation should be conducted on training data to
          select optimal number of states. This can drastically
          increase computation time because if 'TRUE', it will run
          'evolve_model' 'k*max_states' times to estimate optimal value
          for states. Ties are broken by choosing the smaller number of
          states. Default is 'FALSE'.

max_states: Optional numeric vector length one only relevant if
          'cv==TRUE'. It specifies how up to how many states that
          cross-validation should search through. If not provided, will
          be set to 'states + 1'.

       k: Optional numeric vector length one only relevant if cv==TRUE,
          specifying number of folds for cross-validation.

 actions: Optional numeric vector with the number of actions. If not
          provided, then actions will be set as the number of unique
          values in the outcome vector.

    seed: Optional numeric vector length one.

 popSize: Optional numeric vector length one specifying the size of the
          GA population. A larger number will increase the probability
          of finding a very good solution but will also increase the
          computation time. This is passed to the GA::ga() function of
          the *GA* package.

pcrossover: Optional numeric vector length one specifying probability
          of crossover for GA. This is passed to the GA::ga() function
          of the *GA* package.

pmutation: Optional numeric vector length one specifying probability of
          mutation for GA. This is passed to the GA::ga() function of
          the *GA* package.

 maxiter: Optional numeric vector length one specifying max number of
          iterations for stopping the GA evolution. A larger number
          will increase the probability of finding a very good solution
          but will also increase the computation time. This is passed
          to the GA::ga() function of the *GA* package. 'maxiter' is
          scaled by how many parameters are in the model:
          'maxiter <- maxiter + ((maxiter*(nBits^2)) / maxiter)'.

     run: Optional numeric vector length one specifying max number of
          consecutive iterations without improvement in best fitness
          score for stopping the GA evolution. A larger number will
          increase the probability of finding a very good solution but
          will also increase the computation time. This is passed to
          the GA::ga() function of the *GA* package.

parallel: Optional logical vector length one. For running the GA
          evolution in parallel. Depending on the number of cores
          registered and the memory on your machine, this can make the
          process much faster, but only works for Unix-based machines
          that can fork the processes.

  priors: Optional numeric matrix of solutions strings to be included
          in the initialization. User needs to use a decoder function
          to translate prior decision models into bits and then provide
          them. If this is not specified, then random priors are
          automatically created.

 verbose: Optional logical vector length one specifying whether helpful
          messages should be displayed on the user's console or not.

return_best: Optional logical vector length one specifying whether to
          return just the best model or all models. Only relevant if
          ntimes > 1. Default is TRUE.

  ntimes: Optional integer vector length one specifying the number of
          times to estimate model. Default is 1 time.

_D_e_t_a_i_l_s:

     This is the main function of the *datafsm* package. It relies on
     the *GA* package for genetic algorithm optimization.
     'evolve_model' takes data on predictors and data on the outcome.
     It automatically creates a fitness function that takes the data,
     an action vector 'evolve_model' generates, and a state matrix
     'evolve_model' generates as input and returns numeric vector of
     the same length as the 'outcome'. 'evolve_model' then computes a
     fitness score for that potential solution FSM by comparing it to
     the provided 'outcome'. This is repeated for every FSM in the
     population and then the probability of selection for the next
     generation is proportional to the fitness scores. The default is
     also for the function to call itself recursively while varying the
     number of states inside a cross-validation loop in order to
     estimate the optimal number of states.

     If parallel is set to TRUE, then these evaluations are distributed
     across the available processors of the computer using the
     *doParallel* package, otherwise, the evaluations of fitness are
     conducted sequentially. Because this fitness function that
     'evolve_model' creates must loop through all the data every time
     it is evaluated and we need to evaluate many possible solution
     FSMs, the fitness function is implemented in C++ so it is very
     fast.

     'evolve_model' uses a stochastic meta-heuristic optimization
     routine to estimate the parameters that define a FSM model.
     Generalized simulated annealing, or tabu search could work, but
     they are more difficult to parallelize. The current version uses
     the *GA* package's genetic algorithm because GAs perform well in
     rugged search spaces to solve integer optimization problems, are a
     natural complement to our binary string representation of FSMs,
     and are easily parallelized.

     This function evolves the models on training data and then, if a
     test set is provided, uses the best solution to make predictions
     on test data. Finally, the function returns the GA object and the
     decoded version of the best string in the population. See ga_fsm
     for the details of the slots (objects) that this type of object
     will have.

_V_a_l_u_e:

     Returns an S4 object of class ga_fsm. See ga_fsm for the details
     of the slots (objects) that this type of object will have and for
     information on the methods that can be used to summarize the
     calling and execution of 'evolve_model()', including 'summary',
     'print', and 'plot'. Timing measurement is in seconds.

_R_e_f_e_r_e_n_c_e_s:

     Luca Scrucca (2013). GA: A Package for Genetic Algorithms in R.
     Journal of Statistical Software, 53(4), 1-37. URL <URL:
     http://www.jstatsoft.org/v53/i04/>.

_E_x_a_m_p_l_e_s:

     ## Not run:
     
     # Create data:
     cdata <- data.frame(period = rep(1:10, 1000),
                        outcome = rep(1:2, 5000),
                        my.decision1 = sample(1:0, 10000, TRUE),
                        other.decision1 = sample(1:0, 10000, TRUE))
     (res <- evolve_model(cdata, cv=FALSE))
     summary(res)
     plot(res, action_label = c("C", "D"))
     library(GA)
     plot(estimation_details(res))
     ## End(Not run)
     
     
     # In scripts, it can makes sense to set parallel to
     # 'as.logical(Sys.info()['sysname'] != 'Windows')'.
     

dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
  Referenced from: /usr/local/bin/pandoc (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin
  Referenced from: /usr/local/bin/pandoc (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib

Error: processing vignette 'datafsm_introduction.Rmd' failed with diagnostics:
pandoc document conversion failed with error 6
--- failed re-building ‘datafsm_introduction.Rmd’

--- re-building ‘FRD_vignette.Rmd’ using rmarkdown_notangle
dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
  Referenced from: /usr/local/bin/pandoc (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin
  Referenced from: /usr/local/bin/pandoc (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib

Error: processing vignette 'FRD_vignette.Rmd' failed with diagnostics:
pandoc document conversion failed with error 6
--- failed re-building ‘FRD_vignette.Rmd’

SUMMARY: processing the following files failed:
  ‘datafsm_introduction.Rmd’ ‘FRD_vignette.Rmd’

Error: Vignette re-building failed.
Execution halted