MatlabStan开源项目

我要开发同款
匿名用户2021年11月23日
41阅读
所属分类、应用工具、科研计算工具
授权协议BSD-3-Clause License

作品详情

MatlabStan

AMatlabinterfacetoStan,apackageforBayesianinference.

FormoreinformationonStananditsmodelinglanguage,seetheStanUser'sGuideandReferenceManualathttps://mc-stan.org/.

Installation

DetailscanbefoundintheGettingstartedpageofthewiki.

Example

Thefollowingistheclassic'eightschools'examplefromSection5.5ofGelmanetal(2003).TheoutputcanbecomparedtothatobtainedusingtheRstanandPystaninterfaces.

schools_code={'data{''int<lower=0>J;//numberofschools''realy[J];//estimatedtreatmenteffects''real<lower=0>sigma[J];//s.e.ofeffectestimates''}''parameters{''realmu;''real<lower=0>tau;''realeta[J];''}''transformedparameters{''realtheta[J];''for(jin1:J)''theta[j]=mu+tau*eta[j];''}''model{''eta~normal(0,1);''y~normal(theta,sigma);''}'};schools_dat=struct('J',8,...'y',[288-37-111812],...'sigma',[151016119111018]);fit=stan('model_code',schools_code,'data',schools_dat);print(fit);eta=fit.extract('permuted',true).eta;mean(eta)

AcollectionofMatlab-specificexamplesisavailableinthewiki.

Needhelp?

Youmaybeabletofindasolutioninthewiki.Otherwise,openanissue.

Contributions

MatlabStanCopyright(c)2017BrianLaubrian.lau@upmc.fr,BSD-3

PSISpackageCopyright(c)2015AkiVehtari,GPL-3

Pleasefeelfreetoforkandcontribute!

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论