apollo_attach {apollo} | R Documentation |
Attaches parameters and data to allow users to refer to individual variables by name without reference to the object they are contained in.
apollo_attach(apollo_beta, apollo_inputs)
apollo_beta |
Named numeric vector. Names and values for parameters. |
apollo_inputs |
List grouping most common inputs. Created by function apollo_validateInputs. |
This function should be called at the beginning of apollo_probabilities
to make writing the log-likelihood more user-friendly. If used, then apollo_detach should
be called at the end apollo_probabilities
, or more conveniently, using
on.exit.
apollo_attach
attaches apollo_beta
, database
, draws
,
and the output of apollo_randCoeff
and apollo_lcPars
, if they are
defined by the user.
Nothing.
apollo_beta <- c(b1=0.3, b2=-0.5) apollo_fixed <- c() apollo_control <- list(indivID="id", mixing = FALSE, panelData = FALSE) database <- data.frame(id=1:100, x1=stats::runif(100), x2=stats::runif(100)) apollo_inputs <- apollo_validateInputs() apollo_attach(apollo_beta, apollo_inputs) V = b1*x1 + b2*x2 apollo_detach(apollo_beta, apollo_inputs)