Basic Usage

Typical usage of the package will involve the following three steps:

1. Create a model object.

All particular AL/ALR models are instances of subtypes of AbstractAutologisticModel. Each subtype is defined by a particular choice for the parametrization of the unary and pairwise parts. At present the options are:

The first two types above are mostly for research or exploration purposes. Most users doing data analysis will use the ALRsimple model.

Each of the above types have various constructors defined. For example, ALRsimple(G, X) will create an ALRsimple model with graph G and predictor matrix X. Type, e.g., ?ALRsimple at the REPL to see the constructors.

Any of the above model types can be used with any of the supported forms of centering, and with any desired coding. Centering and coding can be set at the time of construction, or the centering and coding fields of the type can be mutated to change the default choices.

2. Set parameters.

Depending on the constructor used, the model just initialized will have either default parameter values or user-specified parameter values. Usually it will be desired to choose some appropriate values from data.

Changing the parameters directly, through the fields of the model object, is discouraged. It is preferable for safety to use the above get and set functions.

3. Inference and exploration.

After parameter estimation, one typically wants to use the fitted model to answer inference questions, make plots, and so on.

For small-graph cases:

For large-graph cases:

  • If using fit_pl!, argument nboot can be used to do inference by parametric bootstrap at the time of fitting.
  • After fitting, oneboot and addboot can be used to create and add parametric bootstrap replicates after the fact.
  • Sampling can be used to estimate desired quantities like marginal probabilities. The sample function implements Gibbs sampling as well as several perfect sampling algorithms.

Estimation by fit_ml! or fit_pl! returns an object of type ALfit, which holds the parameter estimates and other information.

Plotting can be done using standard Julia capabilities. The Examples section shows how to make a few relevant plots.

The Examples section demonstrates the usage of all of the above capabilities.