apollo_insertOLList function

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

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

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

apollo_insertOLList(f)

Arguments

  • f: Function. Usually apollo_probabilities, apollo_randCoeff, or apollo_lcPars.

Returns

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

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.

  • Maintainer: Stephane Hess
  • License: GPL-2
  • Last published: 2025-03-12