<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">I am getting the error message down below in running MCMC on PyMC on Apple M1. I am posting it here because I see a runtime warning originating in Scipy. I was wondering if v 1.8.0 has addressed this issue. Currently I am using v.1.7.3. The code is running well however, it is just I keep getting this error message and so two of students who have M1 machines too.</p>
<p dir="auto">here info on my system:</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Python implementation: CPython
Python version       : 3.9.10
IPython version      : 8.0.1

Compiler    : Clang 11.1.0 
OS          : Darwin
Release     : 21.4.0
Machine     : arm64
Processor   : arm
CPU cores   : 10
Architecture: 64bit

pymc      : 4.0.0b3
aesara    : 2.4.0
pandas    : 1.4.1
matplotlib: 3.5.1
arviz     : 0.11.4
numpy     : 1.21.5
seaborn   : 0.11.2
"><pre class="notranslate"><span class="pl-v">Python</span> <span class="pl-s1">implementation</span>: <span class="pl-v">CPython</span>
<span class="pl-v">Python</span> <span class="pl-s1">version</span>       : <span class="pl-c1">3.9</span>.<span class="pl-c1">10</span>
<span class="pl-v">IPython</span> <span class="pl-s1">version</span>      : <span class="pl-c1">8.0</span>.<span class="pl-c1">1</span>

<span class="pl-v">Compiler</span>    : <span class="pl-v">Clang</span> <span class="pl-c1">11.1</span><span class="pl-c1">.0</span> 
<span class="pl-v">OS</span>          : <span class="pl-v">Darwin</span>
<span class="pl-v">Release</span>     : <span class="pl-c1">21.4</span>.<span class="pl-c1">0</span>
<span class="pl-v">Machine</span>     : <span class="pl-s1">arm64</span>
<span class="pl-v">Processor</span>   : <span class="pl-s1">arm</span>
<span class="pl-v">CPU</span> <span class="pl-s1">cores</span>   : <span class="pl-c1">10</span>
<span class="pl-v">Architecture</span>: <span class="pl-c1">64</span><span class="pl-s1">bit</span>

<span class="pl-s1">pymc</span>      : <span class="pl-c1">4.0</span>.<span class="pl-c1">0</span><span class="pl-s1">b3</span>
<span class="pl-s1">aesara</span>    : <span class="pl-c1">2.4</span>.<span class="pl-c1">0</span>
<span class="pl-s1">pandas</span>    : <span class="pl-c1">1.4</span>.<span class="pl-c1">1</span>
<span class="pl-s1">matplotlib</span>: <span class="pl-c1">3.5</span>.<span class="pl-c1">1</span>
<span class="pl-s1">arviz</span>     : <span class="pl-c1">0.11</span>.<span class="pl-c1">4</span>
<span class="pl-s1">numpy</span>     : <span class="pl-c1">1.21</span>.<span class="pl-c1">5</span>
<span class="pl-s1">seaborn</span>   : <span class="pl-c1">0.11</span>.<span class="pl-c1">2</span></pre></div>
<p dir="auto">Thank you for any help or clarification.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
/opt/homebrew/Caskroom/miniforge/base/envs/pymc-dev-py39/lib/python3.9/site-packages/scipy/stats/_continuous_distns.py:624: RuntimeWarning: overflow encountered in _beta_ppf
  return _boost._beta_ppf(q, a, b)
"><pre class="notranslate"><span class="pl-c1">/</span><span class="pl-s1">opt</span><span class="pl-c1">/</span><span class="pl-s1">homebrew</span><span class="pl-c1">/</span><span class="pl-v">Caskroom</span><span class="pl-c1">/</span><span class="pl-s1">miniforge</span><span class="pl-c1">/</span><span class="pl-s1">base</span><span class="pl-c1">/</span><span class="pl-s1">envs</span><span class="pl-c1">/</span><span class="pl-s1">pymc</span><span class="pl-c1">-</span><span class="pl-s1">dev</span><span class="pl-c1">-</span><span class="pl-s1">py39</span><span class="pl-c1">/</span><span class="pl-s1">lib</span><span class="pl-c1">/</span><span class="pl-s1">python3</span>.<span class="pl-c1">9</span><span class="pl-c1">/</span><span class="pl-s1">site</span><span class="pl-c1">-</span><span class="pl-s1">packages</span><span class="pl-c1">/</span><span class="pl-s1">scipy</span><span class="pl-c1">/</span><span class="pl-s1">stats</span><span class="pl-c1">/</span><span class="pl-s1">_continuous_distns</span>.<span class="pl-s1">py</span>:<span class="pl-c1">624</span>: <span class="pl-v">RuntimeWarning</span>: <span class="pl-s1">overflow</span> <span class="pl-s1">encountered</span> <span class="pl-c1">in</span> <span class="pl-s1">_beta_ppf</span>
  <span class="pl-k">return</span> <span class="pl-s1">_boost</span>.<span class="pl-en">_beta_ppf</span>(<span class="pl-s1">q</span>, <span class="pl-s1">a</span>, <span class="pl-s1">b</span>)</pre></div>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=""><pre class="notranslate"></pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="/opt/homebrew/Caskroom/miniforge/base/envs/pymc-dev-py39/lib/python3.9/site-packages/scipy/stats/_continuous_distns.py:624: RuntimeWarning: overflow encountered in _beta_ppf
  return _boost._beta_ppf(q, a, b)"><pre class="notranslate">/opt/homebrew/Caskroom/miniforge/base/envs/pymc-dev-py39/lib/python3.9/site-packages/scipy/stats/_continuous_distns.py:624: RuntimeWarning: overflow encountered <span class="pl-k">in</span> _beta_ppf
  <span class="pl-k">return</span> _boost._beta_ppf(q, a, b)</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">1.7.3 1.21.5 sys.version_info(major=3, minor=9, micro=10, releaselevel='final', serial=0)</p>
<h3 dir="auto">Describe your issue</h3>
<p dir="auto">Several statistical distribution methods emit warnings stemming from Boost. This issue tracks the status of all of them.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">beta.ppf</code> as reported here; should be fixed by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1393910253" data-permission-text="Title is private" data-url="https://github.com/boostorg/math/issues/827" data-hovercard-type="pull_request" data-hovercard-url="/boostorg/math/pull/827/hovercard" href="https://github.com/boostorg/math/pull/827">boostorg/math#827</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">ncf</code> as reported in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1388256302" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/17101" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/17101/hovercard" href="https://github.com/scipy/scipy/issues/17101">gh-17101</a>, should be fixed by <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1410540033" data-permission-text="Title is private" data-url="https://github.com/boostorg/math/issues/846" data-hovercard-type="pull_request" data-hovercard-url="/boostorg/math/pull/846/hovercard" href="https://github.com/boostorg/math/pull/846">boostorg/math#846</a></li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">nct</code> - I'm not sure that this has been reported separately yet. Is it caused by the same sort of thing?</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> <code class="notranslate">ncx2</code> - Ditto.</li>
</ul>
<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1418900239" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/17272" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/17272/hovercard" href="https://github.com/scipy/scipy/pull/17272">gh-17272</a> will silence <a href="https://github.com/scipy/scipy/issues/14901#issuecomment-1272504168" data-hovercard-type="issue" data-hovercard-url="/scipy/scipy/issues/14901/hovercard">the failures in SciPy's tests</a> temporarily, but as many of these marks as possible should be removed when <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="1405303062" data-permission-text="Title is private" data-url="https://github.com/scipy/scipy/issues/17207" data-hovercard-type="pull_request" data-hovercard-url="/scipy/scipy/pull/17207/hovercard" href="https://github.com/scipy/scipy/pull/17207">gh-17207</a> merges.</p>
<hr>
<p dir="auto"><em>Original Post</em></p>
<h3 dir="auto">Describe your issue.</h3>
<p dir="auto">macOS CI is failing due to an overflow. I am still trying to reproduce locally.</p>
<p dir="auto">NumPy was updated to 1.21.3, could be this or another dependency.</p>
<p dir="auto"><a href="https://github.com/scipy/scipy/runs/3960228039">https://github.com/scipy/scipy/runs/3960228039</a></p>
<h3 dir="auto">Reproducing Code Example</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# from scipy/stats/tests/test_distributions.py:2878: in test_issue_12796
import numpy as np
from scipy import stats
q = 0.999995
a = np.array([ 2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20])
b = np.array([99999, 99998, 99997, 99996, 99995, 99994, 99993, 99992, 99991, 99990, 99989, 99988, 99987, 99986, 99985, 99984, 99983, 99982, 99981])
stats.beta.ppf(q, a, b)"><pre class="notranslate"><span class="pl-c"># from scipy/stats/tests/test_distributions.py:2878: in test_issue_12796</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>
<span class="pl-k">from</span> <span class="pl-s1">scipy</span> <span class="pl-k">import</span> <span class="pl-s1">stats</span>
<span class="pl-s1">q</span> <span class="pl-c1">=</span> <span class="pl-c1">0.999995</span>
<span class="pl-s1">a</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([ <span class="pl-c1">2</span>,  <span class="pl-c1">3</span>,  <span class="pl-c1">4</span>,  <span class="pl-c1">5</span>,  <span class="pl-c1">6</span>,  <span class="pl-c1">7</span>,  <span class="pl-c1">8</span>,  <span class="pl-c1">9</span>, <span class="pl-c1">10</span>, <span class="pl-c1">11</span>, <span class="pl-c1">12</span>, <span class="pl-c1">13</span>, <span class="pl-c1">14</span>, <span class="pl-c1">15</span>, <span class="pl-c1">16</span>, <span class="pl-c1">17</span>, <span class="pl-c1">18</span>, <span class="pl-c1">19</span>, <span class="pl-c1">20</span>])
<span class="pl-s1">b</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">99999</span>, <span class="pl-c1">99998</span>, <span class="pl-c1">99997</span>, <span class="pl-c1">99996</span>, <span class="pl-c1">99995</span>, <span class="pl-c1">99994</span>, <span class="pl-c1">99993</span>, <span class="pl-c1">99992</span>, <span class="pl-c1">99991</span>, <span class="pl-c1">99990</span>, <span class="pl-c1">99989</span>, <span class="pl-c1">99988</span>, <span class="pl-c1">99987</span>, <span class="pl-c1">99986</span>, <span class="pl-c1">99985</span>, <span class="pl-c1">99984</span>, <span class="pl-c1">99983</span>, <span class="pl-c1">99982</span>, <span class="pl-c1">99981</span>])
<span class="pl-s1">stats</span>.<span class="pl-s1">beta</span>.<span class="pl-en">ppf</span>(<span class="pl-s1">q</span>, <span class="pl-s1">a</span>, <span class="pl-s1">b</span>)</pre></div>
<h3 dir="auto">Error message</h3>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12635 - ...
927
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12794 - ...
928
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12796 - ...
...
scipy/stats/_continuous_distns.py:626: in _ppf
916
    return _boost._beta_ppf(q, a, b)
917
E   RuntimeWarning: overflow encountered in _beta_ppf"><pre class="notranslate">FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12635 - ...
927
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12794 - ...
928
FAILED scipy/stats/tests/test_distributions.py::TestBeta::test_issue_12796 - ...
...
scipy/stats/_continuous_distns.py:626: <span class="pl-k">in</span> _ppf
916
    <span class="pl-k">return</span> _boost._beta_ppf(q, a, b)
917
E   RuntimeWarning: overflow encountered <span class="pl-k">in</span> _beta_ppf</pre></div>
<h3 dir="auto">SciPy/NumPy/Python version information</h3>
<p dir="auto">master on macOS/CI</p>