Dear Dr. Matzke,
Good day. I am YH.
I am currently using BioGeoBEARS to study the historical biogeography of insects, with a focus on quantifying dispersal rates across seven biogeographic regions under time-stratified DEC+J models.
I am writing to seek your advice on an issue I encountered when performing Biogeographic Stochastic Mapping (BSM) under a time-stratified model that includes dispersal multipliers but no area submergence.
**My setup:**
- Six regions (A–F), all present throughout the entire evolutionary history of the clade (root age ~2.3Ga).
- Time-stratified analysis with five time bins (0–0.15, 0.15–0.4, 0.4–0.65, 0.65–1.1, 1.1–2.5 Ga).
- Dispersal multipliers were provided via `dispersal_multipliers.txt`, with each time bin having its own 6×6 matrix (no area is ever removed, only connectivity changes).
- The model runs fine for ML estimation (`bears_optim_run`), and I obtained convergent results.
**The problem:**
When I proceed to BSM using `get_inputs_for_stochastic_mapping (res = resDECj)`, the returned list (`stochastic_mapping_inputs_list`) has `NULL` for all elements (e.g., `phy2`, `COO_weights_columnar`, `unconstr`). Consequently, `runBSM` fails because the required `stochastic_mapping_inputs_list` argument is missing or invalid.

I have carefully read your example script for BSM with island disappearance (http://phylo.wikidot.com/biogeographical-stochastic-mapping-example-script#BSM_script). In that example, `lists_of_states_lists_0based` is explicitly constructed by progressively removing islands that become submerged over time.
**My question:**
For my system, where no area ever disappears (areas are only sometimes connected/disconnected), should I still construct a separate `lists_of_states_lists_0based` for each time bin?
If yes, would it be correct to set all time bins to the **same** full state list (all 2^6 − 1 ranges) rather than removing any areas? Or is there a simpler way to handle such a "connectivity-only" time-stratified BSM?
I also noticed that in the absence of time-stratification (`timesfn` and `dispersal_multipliers_fn` commented out), `get_inputs_for_stochastic_mapping` works as expected and returns a valid list. This suggests that the problem is specifically related to how `get_inputs_for_stochastic_mapping` handles a stratified model where no area ever goes extinct.
When I run a non-time-stratified model wothout the“dispersal_multipliers.txt”,the two elements ‘phy2’, ‘COO_weights_columnar’ received feedback, the element ‘unconstr’ returned “NULL”


**My current workaround:** I am manually aggregating dispersal events from BSM runs without time-stratification to calculate average emigration/immigration rates, but this does not allow me to examine rate changes through time. Any guidance you could provide would be greatly appreciated.
**System information:**
- R version: [4.1.2]
- BioGeoBEARS version: [1.1.3]
- OS: [Windows 11]
Thank you very much for your time and for developing such a powerful and widely used tool.
Best regards,
YH
--
You received this message because you are subscribed to the Google Groups "BioGeoBEARS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to biogeobears...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/biogeobears/cd681262-79cc-41b6-9d7c-7a1814e44584n%40googlegroups.com.