Python

95 views
Skip to first unread message

Saang-Yoon Hyun

unread,
May 2, 2023, 10:45:41 PM5/2/23
to TMB Users
Hi. 
As you know, TMB, a R package, evolved from ADMB, whose hard cores include the auto differentiation algorithm and Laplace approximation for the joint likelihood of random effects and parameters.   How can we call those hard cores in Python?  In other words, if you use the TMB or ADMB functions *in Python*, can you share the ways? 
Saang-Yoon

John Sibert

unread,
May 8, 2023, 5:07:12 PM5/8/23
to Saang-Yoon Hyun, TMB Users
Saang-Yoon,

I think this idea is worth exploring. Python has a number of ways to invoke C/C++ land Fortran libraries, but I have never tried any of them. And I have no idea of what the speed problems might be. Python is more strictly object- oriented, the Pandas package provides easier manipulation of data structures, and the graphics seem nicer to my eye. So, I hope someone gives it a try.

John
Contact me on Signal at +1 808 294 3842 (text, voice, or video; UTC-8)
--
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 on the web visit https://groups.google.com/d/msgid/tmb-users/CAFh292OyUn3zFLSggiC6q8o5c_8JE1moOWi07C-sosbrMaKKOQ%40mail.gmail.com.

Ben Bolker

unread,
May 8, 2023, 6:14:01 PM5/8/23
to tmb-...@googlegroups.com
This wasn't hard to find:

https://github.com/kforeman/PyMB

I took a brief swing at testing it but ran into Python environment
problems that I didn't feel like troubleshooting ...


The README says

## Current

PyMB is currently just a light wrapper around Template Model Builder,
allowing users to run TMB models directly from Python by transparently
passing numpy and other numeric data into an embedded rpy2 instance. TMB
models are specified using C++ templates, requiring the user to be at
least somewhat familiar with C++.

## Future

We intend to make a fully Pythonic modeling library that closely mirrors
PyMC2 in syntax and ease of model specification, but uses either CppAD
mixed or TensorFlow under the hood.
"

It doesn't look active, I don't know if any effort would
>> https://groups.google.com/d/msgid/tmb-users/CAFh292OyUn3zFLSggiC6q8o5c_8JE1moOWi07C-sosbrMaKKOQ%40mail.gmail.com <https://groups.google.com/d/msgid/tmb-users/CAFh292OyUn3zFLSggiC6q8o5c_8JE1moOWi07C-sosbrMaKKOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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/ <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
> <mailto:tmb-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tmb-users/58129530-abf3-5ede-1f94-08021e784a41%40gmail.com <https://groups.google.com/d/msgid/tmb-users/58129530-abf3-5ede-1f94-08021e784a41%40gmail.com?utm_medium=email&utm_source=footer>.

--
Dr. Benjamin Bolker
Professor, Mathematics & Statistics and Biology, McMaster University
Director, School of Computational Science and Engineering
(Acting) Graduate chair, Mathematics & Statistics
> E-mail is sent at my convenience; I don't expect replies outside of
working hours.

Saang-Yoon Hyun

unread,
May 8, 2023, 6:58:28 PM5/8/23
to Ben Bolker, John Sibert, tmb-...@googlegroups.com
Dear John and Ben. 
Thank you for your information.
Saang-Yoon 

Reply all
Reply to author
Forward
0 new messages