Function to apply `map`

5 views
Skip to first unread message

James Thorson

unread,
Feb 24, 2026, 5:50:04 PM (2 days ago) Feb 24
to TMB Users
Hi all,

Does anyone have code sitting around for a function of the form:

```R
par_list = relist( last.par, map, skeleton_list )
```

where `map` is the conventional tagged list supplied to `MakeADFun`, `skeleton_list` is the original parameter-list (i.e., starting values), `last.par` is the `obj$env$last.par` vector, and `par_list` is the parameter-list (same dimensions as skeleton_list) but with values from `last.par` injected in (and original values from `skeleton_list` when appropriate given `map`)?

This arises because RTMB `MakeTape` does not have a `map` argument, and so it would simplify the process of using RTMB to tape a function that includes fixed values without using a call to `MakeADFun` itself (which does not have as much flexibility e.g., in constructing taping a Jacobian of a derived quantity). 

Jim

Timothy Miller - NOAA Federal

unread,
8:21 AM (5 hours ago) 8:21 AM
to James Thorson, TMB Users
Hi Jim,

I think the TMB parList function that can be called from a fitted model (e.g., fit$env$parList()) does what you describe with different arguments, but could be modified for your needs?

Tim


--
To post to this group, send email to us...@tmb-project.org. Before posting, please check the wiki and issuetracker at https://github.com/kaskr/adcomp/. Please try to create a simple repeatable example to go with your question (e.g issues 154, 134, 51). Use the issuetracker to report bugs.
---
You received this message because you are subscribed to the Google Groups "TMB Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmb-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/tmb-users/CAMDbYvZLde-SOYN_U65JuhQ9nLkLmyGjEnZ%3DQCnq0JN_xRto0A%40mail.gmail.com.


--

Timothy J. Miller, PhD

Research Fishery Biologist, Northeast Fisheries Science Center

NOAA Fisheries | U.S. Department of Commerce

Office: (508) 495-2365

www.fisheries.noaa.gov


Reply all
Reply to author
Forward
0 new messages