Learn R Programming

apollo (version 0.3.4)

apollo_insertOLList: Replaces tau=c(...) by tau=list(...) in calls to apollo_ol

Description

Takes a function, looks for calls to apollo_ol, identifies the corresponding ol_settings, then goes inside the definition of ol_settings and replaces tau=c(...) for tau=list(...).

Usage

apollo_insertOLList(f)

Value

Function f with tau=c(...) replaced by

tau=list(...).

Arguments

f

Function. Usually apollo_probabilities, apollo_randCoeff, or apollo_lcPars.

Details

This only goes one level deep in definitions. For example, it will work correctly in the following cases: ol_settings = list(outcomeOrdered = y1, V = b1*x1, tau = c(tau11, tau12)) P[["OL1"]] = apollo_ol(ol_settings, functionality) P[["OL2"]] = apollo_ol(list(outcomeOrdered=y2, V=b2*x2, tau=c(tau21, tau22)), functionality) But it will not work on the following cases: Tau = c(tau1, tau2, tau3) ol_settings = list(outcomeOrdered = y2, V = b2*x2, tau = Tau) P[["OL1"]] = apollo_ol(ol_settings, functionality) P[["OL2"]] = apollo_ol(list(outcomeOrdered=y1, V=b1*x1, tau=Tau), functionality)

This function is called by apollo_modifyUserDefFunc to allow for analytical gradients when using apollo_ol.