ga_fsm-class {datafsm}R Documentation

An S4 class to return the results of using a GA to estimate a FSM with evolve_model.

Description

An S4 class to return the results of using a GA to estimate a FSM with evolve_model.

Turns ga_fsm S4 object into list of summaries for printing and then prints it.

Plots ga_fsm S4 object's state transition matrix

Plots ga_fsm S4 object's variable importances

Plots ga_fsm S4 object's variable importances

Extracts slot relevant to estimating the fsm

Extracts performance

Extracts slot of variable importances

Extracts slot of action_vec

Extracts number of states

Predicts new data with estimated model

Usage

## S4 method for signature 'ga_fsm'
print(x, ...)

## S4 method for signature 'ga_fsm'
show(object)

## S4 method for signature 'ga_fsm'
summary(object, digits = 3)

## S4 method for signature 'ga_fsm,ANY'
plot(x, y, maintitle = "Transition Diagram",
          action_label = NULL, transition_label = NULL, 
          curvature = c(0.3, 0.6, 0.8))

## S4 method for signature 'ga_fsm'
barplot(height, ...)

## S4 method for signature 'ga_fsm'
dotchart(x, labels)

## S4 method for signature 'ga_fsm'
estimation_details(x)

## S4 method for signature 'ga_fsm'
best_performance(x)

## S4 method for signature 'ga_fsm'
varImp(x)

## S4 method for signature 'ga_fsm'
action_vec(x)

## S4 method for signature 'ga_fsm'
states(x)

## S4 method for signature 'ga_fsm'
predict(object, data, type = "prob", na.action = stats::na.omit, ...)

Arguments

x

S4 ga_fsm object. @export

...

arguments to be passed to/from other methods.

object

S4 ga_fsm object

digits

Optional numeric vector length one for how many significant digits to print, default is 3.

@export

y

not used.

maintitle

optional character vector

action_label

optional character vector same length as action vector, where each ith element corresponds to what that ith element in the action vector represents. This will be used to fill in the states (circles) of the state transition matrix to be plotted.

transition_label

optional character vector same length as number of columns of state transition matrix.

curvature

optional numeric vector specifying the curvature of the lines for a diagram of 2 or more states.

height

ga_fsm S4 object

labels

vector of labels for each point. For vectors the default is to use names(x) and for matrices the row labels dimnames(x)[[1]].

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().

type

Not currently used.

na.action

Optional function.

Methods (by generic)

Slots

call

Language from the call of the function evolve_model.

actions

Numeric vector with the number of actions.

states

Numeric vector with the number of states.

GA

S4 object created by ga() from the GA package.

state_mat

Numeric matrix with rows as states and columns as predictors.

action_vec

Numeric vector indicating what action to take for each state.

predictive

Numeric vector of length one with test data accuracy if test data was supplied; otherwise, a character vector with a message that the user should provide test data for better estimate of performance.

varImp

Numeric vector same length as number of columns of state matrix with relative importance scores for each predictor.

varImp2

Numeric matrix same size as state matrix with relative importance scores for each transition.

timing

Numeric vector length one with the total elapsed seconds it took evolve_model to execute.

diagnostics

Character vector length one, to be printed with base::cat().


[Package datafsm version 0.2.4 Index]