# Divide and conquer with two endogenous states

**URL:** <https://discourse.vfitoolkit.com/t/divide-and-conquer-with-two-endogenous-states/384>\
**Category:** Uncategorized\
**Created:** [May 14, 2025, 1:06am UTC](https://discourse.vfitoolkit.com/t/divide-and-conquer-with-two-endogenous-states/384 "2025-05-14T01:06:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aledinola](https://discourse.vfitoolkit.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@aledinola](https://discourse.vfitoolkit.com/u/aledinola)\
**Post date:** [May 14, 2025, 1:06am UTC](https://discourse.vfitoolkit.com/t/divide-and-conquer-with-two-endogenous-states/384/1 "2025-05-14T01:06:02Z")

</div>

I have an infinite horizon model with 2 endogenous states: the first is a continuous variable (assets), the second has only three points.

To use divide and conquer, can I just set

`vfoptions.divideandconquer=1`

Or do I also have to set

`vfoptions.level1n = [11,??]`  
?

Thanks!

---

<div class="post-metadata">

**Author:** ![robertdkirkby](https://discourse.vfitoolkit.com/user_avatar/discourse.vfitoolkit.com/robertdkirkby/32/287_2.png) [@robertdkirkby](https://discourse.vfitoolkit.com/u/robertdkirkby)\
**Post date:** [May 14, 2025, 6:15am UTC](https://discourse.vfitoolkit.com/t/divide-and-conquer-with-two-endogenous-states/384/2 "2025-05-14T06:15:41Z")

</div>

Just  
`vfoptions.divideandconquer=1`  
which will be applied only to the first of the two endogenous states.  
You can optionally set  
`vfoptions.level1n=9`  
which will be understood to apply to the first endogenous state (9 is just an example, the default is `max(ceil(n_a(1)/50),5)` but this is very rough, I haven’t really figured out a good default, just a half decent one)

[If you do set, e.g., `vfoptions.level1n = [11,3]`, internally it will anyway do `vfoptions.level1n=vfoptions.level1n(1);`. Although if you set _vfoptions.level1n(2)\<n\_a(2)_ it will throw an error that it cannot divide-and-conquer both of them.]

---

<div class="post-metadata">

**Author:** ![aledinola](https://discourse.vfitoolkit.com/letter_avatar_proxy/v4/letter/a/3ec8ea/32.png) [@aledinola](https://discourse.vfitoolkit.com/u/aledinola)\
**Post date:** [May 14, 2025, 8:54am UTC](https://discourse.vfitoolkit.com/t/divide-and-conquer-with-two-endogenous-states/384/3 "2025-05-14T08:54:24Z")

</div>

Thanks for the explanation!
