<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          pystan貝葉斯推理的軟件包

          聯(lián)合創(chuàng)作 · 2023-09-30 16:07

          PyStan 為 Stan 提供了一個(gè) Python 接口,這是一個(gè)使用 No-U-Turn 采樣器進(jìn)行貝葉斯推理的軟件包,這是Hamiltonian Monte Carlo 的一種變體。

          PyStan具有以下依賴項(xiàng):

          • Python:2.7,> = 3.3

          • Cython:> = 0.22

          • NumPy:> = 1.7

          PyStan還要求在安裝和運(yùn)行時(shí)可以使用C ++編譯器。 在基于Debian的系統(tǒng)上,這是通過發(fā)出命令apt-get install build-essential來完成的。

          例子:

          import pystan
          
          schools_code = """
          data {
              int<lower=0> J; // number of schools
              vector[J] y; // estimated treatment effects
              vector<lower=0>[J] sigma; // s.e. of effect estimates
          }
          parameters {
              real mu;
              real<lower=0> tau;
              vector[J] eta;
          }
          transformed parameters {
              vector[J] theta;
              theta = mu + tau * eta;
          }
          model {
              eta ~ normal(0, 1);
              y ~ normal(theta, sigma);
          }
          """
          
          schools_dat = {'J': 8,
                         'y': [28,  8, -3,  7, -1,  1, 18, 12],
                         'sigma': [15, 10, 16, 11,  9, 11, 10, 18]}
          
          sm = pystan.StanModel(model_code=schools_code)
          fit = sm.sampling(data=schools_dat, iter=1000, chains=4)


           

          瀏覽 25
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  欧美大香蕉在线观看免费一区二区三区 | 一本久道激情淫乱视频 | chaopeng97 | 亚洲高清视频在线观看 | 国产激情视频在线播放 |