# Incomplete Beta function

**URL:** <https://forum.dynare.org/t/incomplete-beta-function/2455>\
**Category:** Dynare help (legacy posts)\
**Created:** [9 April 2012 20:58 UTC](https://forum.dynare.org/t/incomplete-beta-function/2455 "2012-04-09T20:58:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pguerron](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@pguerron](https://forum.dynare.org/u/pguerron)\
**Post date:** [9 April 2012 20:58 UTC](https://forum.dynare.org/t/incomplete-beta-function/2455/1 "2012-04-09T20:58:43Z")

</div>

Hi,

Is there a way to introduce an incomplete beta function in a model? I tried but got the error

ERROR: nke\_capital\_more.mod:193.9-22: To use an external function within the model block, you must first declare it via the external\_function() statement.

Matlab calls the function with the statement **betainc(c,alpha,beta)**.

Thanks,

Pablo

---

<div class="post-metadata">

**Author:** ![bkjecn](https://forum.dynare.org/letter_avatar_proxy/v4/letter/b/ccd318/32.png) [@bkjecn](https://forum.dynare.org/u/bkjecn)\
**Post date:** [10 April 2012 14:13 UTC](https://forum.dynare.org/t/incomplete-beta-function/2455/2 "2012-04-10T14:13:52Z")

</div>

Hi Pablo,  
I produced the smallest example I could think of that included the betainc function. It is in the mod file. You have to use the external\_function command (documented here:[http://www.dynare.org/manual/index\_13.html#index-external\_005ffunction](http://www.dynare.org/manual/index_13.html#index-external_005ffunction)).  
Best,  
Ben  
[include\_betainc.mod](https://forum.dynare.org/uploads/default/original/2X/d/d0d5cc3c66a3630eadfbaf7e59e1554ee44ac86a.mod) (285 Bytes)

---

<div class="post-metadata">

**Author:** ![pguerron](https://forum.dynare.org/letter_avatar_proxy/v4/letter/p/aeb1de/32.png) [@pguerron](https://forum.dynare.org/u/pguerron)\
**Post date:** [13 April 2012 15:13 UTC](https://forum.dynare.org/t/incomplete-beta-function/2455/3 "2012-04-13T15:13:45Z")

</div>

Hi Ben,

Thanks for your response. Yes, the key is to use the external function command.

Pablo
