read_pars: Read in parameters from an AD Model Builder run

read_parsR Documentation

Read in parameters from an AD Model Builder run


Reads coefficients, standard errors, log-likelihoods, maximum gradients, correlation and variance-covariance matrices from AD Model Builder output files


read_pars(fn, drop_phase = TRUE, covfn = "admodel.cov",
  warn_nonstd_rep = TRUE)

read_psv(fn, names = NULL)

read_rep(fn, names = NULL, warn_nonstd_rep = TRUE)



(character) Base name of AD Model Builder


(logical) drop negative-phase (fixed) parameters from results?


(character) file name for covariance matrix information


warn if report file is in nonstandard format?


(character) Names of variables


Given the output from an ADMB run on FOO.tpl, read_pars reads the files FOO.par (parameters, log-likelihood, max gradient); FOO.std (standard deviations); FOO.cor (correlations); FOO.rep (report variables); admodel.hes for hessian; and admodel.cov for covariance matrix. read_psv reads the output of MCMC runs.

read_rep (called by read_admb to read the .rep file) first checks if the report file is in a standard format: first line starts with a comment character (#); thereafter, each block starts with a single commented line containing the name of the parameter (possibly ending with a colon), followed by a block of all-numeric lines, which are read as a single vector. If the report file is in a standard format, the values are added to the end of the coefficients list. Otherwise, the numeric values from the report file are included in the results as a single, concantenated numeric vector.


List containing the following elements

  • coefficientsparameter estimates

  • coeflistparameter estimates in list format, with proper shape (vectors, matrices, etc.)

  • seestimated standard errors of coefficients

  • logliklog-likelihood

  • maxgradmaximum gradient of log-likelihood surface

  • corcorrelation matrix

  • vcovvariance-covariance matrix

  • nparnumber of parameters

  • heshessian matrix (only if no vcov matrix)

  • reportvalues from report file (if non-standard report file)


  • The coeflist component is untested for data structures more complicated than scalars, vectors or matrices (i.e. higher-dimensional or ragged arrays)

  • Because ADMB hard-codes the file name for covariance matrix information (admodel.cov), care is necessary when running different models in the same directory; users may want to rename this file by hand and use the covfn argument

See Also

write_pin, write_dat

R2admb documentation built on Nov. 10, 2022, 5:59 p.m.