# New example based on toolkit: Aiyagari with taxes

**URL:** https://discourse.vfitoolkit.com/t/new-example-based-on-toolkit-aiyagari-with-taxes/277
**Category:** Uncategorized
**Created:** [May 11, 2024, 9:00pm UTC](https://discourse.vfitoolkit.com/t/new-example-based-on-toolkit-aiyagari-with-taxes/277 "2024-05-11T21:00:11Z")
**Posts on this page:** 1
**Showing post:** 4

<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 12, 2024, 10:45pm UTC](https://discourse.vfitoolkit.com/t/new-example-based-on-toolkit-aiyagari-with-taxes/277/4 "2024-05-12T22:45:33Z")

</div>

Fixed the bug (was because currdist was sparse when using Tan improvement, and cannot use sparse matrix as input to fprintf).

And you can now set the tolerance using:

> heteroagentoptions.toleranceGEprices=10^(-4); % Accuracy of general eqm prices  
> heteroagentoptions.toleranceGEcondns=10^(-4); % Accuracy of general eqm eqns

[These show the default values.] By default, the stationary general equilbirium is computed using matlab fminsearch(), and these control what fminsearch() options call TolX and TolFun, respectively.

---

_[View the full topic](https://discourse.vfitoolkit.com/t/new-example-based-on-toolkit-aiyagari-with-taxes/277)._
