The most common answer I got from the list was:
***************************************************
You may look up p.214 of the article by Meyer and Yu
"BUGS for a Bayesian analysis of stochastic volatility
models,"
Econometrics Journal, 2000, volume 3, pp. 198-215.
***************************************************
I received also the following code which is a slightly
modified version of Meyer and Yu (2000) (with
t-distributed returns equation error instead of
normal):
model volatility;
{
#y_t = exp( h_t / 2) * eps_t,
eps_t ~ N(0,1)
#h_{t+1} = mu + phi * (h_t - mu) + eta_t,
eta_t~N(0,
sigma2eta)
# prior
mu ~ dnorm(0,0.1);
phistar ~ dbeta(20,1.5);
phi <- 2*phistar-1;
isigma2eta ~ dgamma(5, 0.01);
sigma2eta <- 1/isigma2eta;
nustar ~ dchisqr(8);
nu <- nustar + 2;
# likelihood: joint distribution of ys
isigma2h1 <- 1/(sigma2eta/(1-pow(phi,2)));
h[1] ~ dnorm(mu, isigma2h1);
for (t in 2:n) {
hmean[t] <- mu + phi*(h[t-1]-mu);
h[t] ~ dnorm(hmean[t], isigma2eta);
}
for (t in 1:n) {
# isigma2y[t] <- 1/(exp(h[t])); # this works well
isigma2y[t] <- 1/(((nu-2)/nu) * exp(h[t])); #
nu get stuck at
~
2.5
y[t] ~ dt(0, isigma2y[t], nu)
}
}
# init values
list(
mu = 0.1,
phistar = 0.975,
isigma2eta =50,
nustar = 10;
)
list(y = c(-0.320221363079782, 1.46071929942995,
-0.408629619810947,
1.06096027386685,
1.71288920763163, 0.404314365893326,
-0.905699012715806,
-1.01657225575983, -0.260349143819501,
0.142923934468979,
-1.74434715110073, 0.92367209586645,
-0.781910308424867,
-0.513237470519186, -0.32286618308129,
0.640705611916052,
-0.874162733440316, 0.477299926963042,
0.365525196723841,
0.828856629597501, 0.633138124619574,
1.32738745185945,
0.142233549879449, 0.32876118135045,
0.19501218089653,
-0.177682368634564, 0.831704166376694,
-0.867750328861068,
0.567509490942002, 0.511879864449387,
1.06015170628473,
0.530812640102611, -1.40582565001029,
0.404119948113806,
0.585986881451155, -0.252761174224876,
0.454049419120999,
-0.0692102645179014, 1.27207513801409,
0.0714551469122732,
0.985863336005215, 0.265166060047333,
-0.655848260257315,
0.189314394362088, -0.737093171060495,
0.910251505158115,
-0.159601581333619, -0.851704996008369,
-0.338347347149055,
-1.42067021334525, -0.695392983431149,
-1.17838122576754,
1.39769275572254, 0.406073393737309,
-0.282402480319284,
-0.565803343720923, 0.37088997921471,
0.364467487865554,
0.326400462425584, -0.0810241645176584,
0.00885173073348744,
0.773515560448772, 0.428547098920022,
0.895026376869083,
-0.563104433519941, 0.425986623302326,
-0.355366109006468,
0.399988962945323, -1.5106395675451,
-0.60045347368783,
-0.257437789584276, -0.95572504027764,
0.812898301710256,
0.163433272752771, 1.12833328944201,
-0.414247554068221,
0.167743066862362, -0.761930213166269,
-1.19960476533907,
0.520355670522881, 0.817191817661771,
0.0253102571479286,
0.514289352760826, -0.844578101889377,
0.115620795529529,
-0.227276641141767, -0.0720665383080424,
-0.0775596051477994,
0.0836986556296532, -0.812175315092896,
0.289770208748379,
0.148796178160841, -0.506256189706806,
-0.454619955283415,
0.0625916650377739, 0.405600377483122,
0.154817034367465,
0.565930377017369, -0.0349163616256659,
-0.778584631784247,
-0.346786277597373, 0.226541021611897,
-0.484597877978306,
-0.0195744862715524, -0.173526925808605,
0.315491734215361,
0.259986352427592, 0.668258297028195,
-0.674299707415589,
-0.789776931851634, -0.0696882327836894,
0.16792161485129,
-0.651749183151902, 0.324006882267207,
0.118433478248385,
0.240052602416201, 0.0850491291009931,
-0.34665483400292,
0.0630379711755763, 0.0463991904039157,
0.301076428747831,
-0.297007966156922, -0.828325142819682,
-0.30101292982871,
0.113886901478259, 0.0857912296981994,
0.236979699762723,
0.080070510790668, -1.05581417886321,
-1.06213344708502,
0.917627066820197, -0.390645235674831,
0.376219678225225,
0.182677511613587, -0.538375676256049,
0.489985663909913,
-0.0611354428932192, 0.556144767861748,
0.0917595953672063,
0.260789495856843, -0.128111491769329,
0.266276757028987,
-0.0885566580757964, 0.541071380191786,
0.566408640386189,
0.230269238270102, 0.313165395620345,
0.11851647467898,
0.962520387973869, 0.430069254355974,
0.521132332261269,
-0.204576456951207, 0.38948580787304,
-0.488222595931738,
-0.31524057562375, 0.04628359195538,
-0.746804326725588,
-0.519168568499469, -1.08295691756895,
0.930922177063136,
0.674112596074821, 0.0131594097874483,
-0.219777775589065,
-0.120279905380423, -0.254286737406047,
-0.255127837990128,
0.0185284485889875, 0.487433491109361,
0.0253102571479286,
-0.271481225985755, -0.412618823256679,
-0.307588979872582,
-0.665376341296349, 0.550002719967006,
-0.39436023654212,
-0.163186901462538, -0.24894235039314,
-0.764922649972351,
-0.137004547120285, -0.975820703284141,
1.21875602184822,
-0.569095094081913, 0.553595321728788,
-0.858969465865163,
-0.266506676358531, 0.568675774570919,
0.812851971427679,
-0.442017618117847, -0.0338899070805715,
-0.0512573431218427,
-0.369665708544105, -0.925815533863435,
0.1639953474379,
0.896732265129123, 0.699572627452609,
-0.571014683957867,
-0.167617773063806, -0.237842500375092,
0.0253102571479286,
1.32482996190168, -0.33884473395271,
0.673408481581765,
0.0253102571479286, 0.891235596714916,
0.120501232057417,
-0.385671136007855, -0.250143236523777,
-0.34274037068593,
-0.0795332811706034, 0.551070712772843,
0.20093467034799,
-1.06637635025097, -0.932897439652831,
-0.256405235602737,
-1.02196831409344, 0.97566393930089,
-0.686799317970683,
0.111877684394794, 0.241162410416022,
0.111661830469138,
0.135066742256499, 1.57760766963388,
-0.53808913035321,
1.06967271960107, 0.1100164641106, 0.921764833754572,
0.925263130881564, -0.105872880802889,
-1.64588050054641,
-1.2778720647279, 0.337653646947649,
0.758379206462527,
0.0122528440875053, -0.571856149707057,
1.13130646104936,
-1.32784837770195, 0.215432905423156,
-0.424353659878836,
-0.602398500458619, 0.35759819249616,
0.309899276698193,
-0.473566926737719, 0.503338959153769,
0.163635053105675,
-0.268268702137937, 0.368030991374106,
-0.215586977480971,
-0.321697115861381, -0.193610102265514,
-0.317901389283,
0.117837967561733, -0.10620754464143,
0.200394900500427,
-0.780972519761787, 0.124360101258673,
0.514813913791272,
0.489012829604622, 0.82582820785924,
0.198489965832076,
0.546434097430641, -0.627328763635866,
-0.227471289147137,
-0.44531900170562, 0.445747655375077,
-0.0642126266923687,
-0.646443779262691, 0.0117183962304907,
0.176778008415972,
-1.02465525535818, 0.415584036852783,
-0.0358810130633841,
-0.524115114210295, 0.0890079404882766,
0.130701667231196,
0.279336209270013, -0.131277120739477,
-0.573901446058596,
-0.30675506873868, -0.513230857294207,
0.23457966881895,
0.510742200136343, -0.572923830192425,
-0.2247679128578,
-1.10366115651782, -0.425166381526899,
-1.48386327824408,
0.110258733581168, 1.23924685447566,
-1.65052482258878,
0.00393770787099184, 0.386121867948462,
-0.881896826294161,
0.821107165551625, 1.1313481317382,
0.996856127092126,
0.0453102571479286, 0.0230410711930124,
0.585938751450103,
-0.638092960986487, 0.059877263781753,
-0.15524209482143,
-0.811183722045879, 0.295581829989532,
-0.666490592421727,
0.972012617957373, -0.360631858731371,
0.517656130794235,
-0.211755958708999, -0.107029711805213,
-0.31210618509916,
0.18435083618673, -0.931182067425908,
0.659921906843218,
1.21143028286101, -0.14947575170003,
-0.242510572882339,
0.448674204473425, -0.100232860147299,
-0.707267412537023,
-0.306889485711788, -0.64634711480986,
-1.61605117517787,
0.753617385309567, 0.269391280111851,
-0.0911519791179553,
0.666028210500568, -0.94400573579861,
-0.168071025617951,
-0.142988312756277, 0.194520607606895,
-2.24958399585254,
0.36030241839775, 0.423911782442969,
-0.548159793599752,
-0.0297303955514211, -0.722269123697823,
0.0453102571479286,
-0.358778922839727, 0.133978247392423,
-0.162123173223823,
0.560935646030635, 0.916085809163207,
0.236471870682296,
0.0871573095083273, 0.235964067310084,
-0.548348987297205,
0.683610744955753, -0.0293309862147611,
-0.0876233418481544,
-0.0359309621470144, -0.386699783213896,
-1.03086068207032,
0.173309293340822, 0.474324165409522,
0.0253102571479286,
-0.877698154078761, -0.480700414150577,
-0.0310379406150879,
0.39968178884061, 0.068369201546335,
0.417997448912914,
-0.817841308320889, -0.0976154569612993,
0.526255315419581,
-0.695347261095876, 0.434512384101675,
0.598132467893235,
-0.46113292693173, -0.0177894387764737,
-1.1132066411763,
-1.11296308237082, -0.134671085837014,
-0.503737822369583,
0.22669787537634, -0.128713836487799,
-0.54778177393139,
0.131583129389172, 0.665665204957271,
1.22349682639578,
1.32288169315245, 1.04300905218361,
-0.573398781295177,
-0.177286155638369, 1.40917598811615,
0.610926707817415,
0.672462142824008, -0.634458478681955,
0.705078992977813,
0.874295494665549, 0.0453102571479286,
-0.286543899031889,
-0.404080473034408, 0.287549824318371,
1.18493275758079,
0.398634110301464, -0.411062120279294,
-0.252699158231952,
0.150613581689783, 1.02273665872161,
0.395990244446708,
-0.0594794747433474, -0.12920509253664,
-0.351733784284037,
-0.442625972033823, 0.258631453805157,
0.0735438649545434,
-0.213469892214214, -0.444859684924022,
-0.241030653258996,
0.420691940361377, -0.176465852805592,
0.125209447688511,
-0.189589436040584, 1.1229729310293,
0.922234031225904,
0.770538378214357, 0.0791273527755915,
0.547171549498803,
-1.03508899606564, -0.368272079014366,
-1.28129327399369,
0.883232203271821, -0.238044224754243,
0.111670426305353,
0.726257825502318, -0.484039823995043,
-1.45529726096681,
-1.45822399860665, -0.555242640256205,
0.671649203688911,
-0.206939509405397, 0.297176200571307,
0.185573245601427,
-0.0103980592964475, 0.712263958663499,
0.430247807163213,
-0.191102492806007, -0.882037836885814,
-0.160960659636945,
0.531783709641175, -0.0951018635781634,
-0.141016319149136,
-0.0300748635286024, 0.732722241450239,
0.145667631456224,
-0.0490697173519866, -0.309439165514637,
-0.206070295188622,
0.10713292355035, -0.0887794952477164,
-0.864029509763643,
0.377618536891243, -0.0304273208176292,
0.540378399781087,
-0.0956312307243544, -0.351969100512346,
-0.0765576188292834,
0.534457490785416, 0.0484121241827157,
0.0453102571479286,
-0.371621257399802, -0.531898755978456,
-0.176568256864747,
-0.23017075097171, -1.00013771947912,
-0.280794522326812,
0.0555170399600885, 0.418465365766933,
-0.563594665473184,
-0.187670341339154, 0.379707396689287,
0.385243319483185,
0.978051167734977, 0.962653459714973,
0.397283734741931,
-0.221226637366996, 0.587035794623396,
0.146599588132755,
-0.298929985861014, -1.08696188624067,
-0.61073414910321,
-0.00478865403562726, -0.125246373543038,
0.462889743426785,
-0.238397313840689, 0.415627646336313,
-0.0579671165283918,
-0.882096652590426, 0.404624089703314,
0.236180763255999,
0.515759599860381, -0.552219807883077,
-0.172485507537497,
0.249801927289671, 0.282744094558872,
0.588147446299391,
0.373495652903831, -0.329447914955123,
-0.464241186351012,
0.255420401042066, 0.254936980151298,
-0.451178989963342,
0.255523218582519, 0.0253102571479286,
-0.305246313857844,
-0.730153763787185, -0.437631641889131,
0.582368657236414,
0.512381546659217, 1.00923563933591,
0.393139808661301,
-0.289333086248845, -0.0908559669653324,
-0.350816312733894,
-0.111542449305009, 0.39538266058493,
-0.0512554216388644,
-0.15806825808687, 0.102034754185458,
0.181947622622351,
-0.171377151832426, 0.108699859134258,
-0.0914874507878044,
-0.145152980679637, 0.155655260640862,
-0.118489632743142,
0.0253102571479286, -0.414098555043669,
0.109232507750471,
-0.206820611753096, 0.0757061373175311,
-0.0859263711591244,
0.149815371871613, 0.230340414128431,
-0.132796563868638,
0.0958612732274583, -0.139715031558458,
0.169972275881501,
-0.463847608941283, -0.527536649694778,
-0.141656845938283,
0.144250146726381, -0.0191448527676124,
-0.169160915508244,
-0.38859301676062, 0.17909173411068,
-0.29363740789194,
0.692127068357622, -0.436340365984646,
-0.170451132320094,
-0.370593089869799, -0.00606049432125996,
-0.12343636831429,
-0.380001477066051, -0.298185501121779,
-0.180665024490985,
-0.847357470042055, -0.15485073264866,
0.190283520060462,
-0.232521873637099, 0.190458384178997,
0.0564481821870006,
0.323748319868898, 0.266864933812354,
0.468907691491465,
0.153872184765179, 0.888978209861884,
0.380257132473676,
-1.43550854283994, -1.00446305597184,
-0.233412059993933,
-0.305163897831857, -0.520444646743635,
0.498653567471645,
-0.599657809261385, 0.00667747241401684,
0.997164418433609,
0.481028919280695, -0.0282423347591504,
-0.552697529652364,
0.954759410796367, -1.23290611006022,
0.554459451440302,
-0.783753472149086, 0.356612879069733,
0.462114148745262,
-0.263261088559698, 0.142045244332921,
-0.164020626820073,
0.291519919755683, 0.997332248255438,
0.246280799532887,
0.294895767913199, -0.929248212062063,
-6.9187763830858E-05,
0.77566266050441, -0.60601122632339,
0.310666098866201,
0.295846263410364, 0.994130634194139,
0.840031908138998,
0.221690734254042, -0.220188276345452,
0.111337492382039,
0.572760734336446, 0.563052135160723,
0.328815808963927,
0.0253102571479286, 1.57723571394726,
0.129219574486804,
-0.691427346865082, 0.325292589360619,
-0.0185763129287602,
-0.221048245255297, -0.0255026100257255,
-0.792711305536382,
-0.429203181414635, -0.266411153945752,
0.487551674766305,
0.859144703842628, -1.19956813336081,
-0.556814854886596,
-0.407627694521952, -0.172994220339136,
-0.459412557963741,
-0.1464698390524, 0.628369731311739,
0.313184697843065,
0.63013840468719, -0.233999024151878,
0.401118029531243,
-0.65601638147484, -0.110477543327371,
-0.745834738721503,
0.280074182275152, 0.230690962661705,
-0.383831117911244,
0.475362655877902, -0.0902215258476404,
0.578146860505378,
-0.228780521124212, -0.627984197738036,
-0.294479888438583,
-0.0209327139634746, -0.211125354280074,
0.225471246944518,
-0.642466977427776, 0.12736195421265,
-0.425797926937028,
-0.0144746021713121, -0.642803622993977,
0.0209846357495863,
0.235682443838241, 0.370749318419565,
0.653275785178852,
-2.11192368534731, 0.136546797719887,
-0.0514576441743147,
0.187104713270468, 0.136378703521943,
0.00644397997556064,
0.517724700301241, 0.451051663066864,
-0.668159731679281,
0.430723979145974, -0.259304262708944,
-0.317932369474756,
-0.645851796852693, 0.644228412615587,
0.056988907375542,
0.0786534637789588, 0.172439938338696,
0.682329049202339,
0.464342019994539, -0.293449329985841,
0.206971839964169,
0.00672044921965324, -0.30123368586072,
0.142841003377946,
-0.611615518330073, -0.101799632633977,
0.121927845932827,
-0.529049825526158, -0.153519779351725,
0.0571165447138961,
-0.54051406797956, -0.206209236694844,
-0.0526598386945703,
-0.811684311125439, 0.131417905102975,
-0.320008793119593,
0.14648314241698, 0.500891410767328,
-0.467314793913061,
-0.970097578998891, 0.0453102571479286,
-0.716008077930392,
-0.493991545701401, -0.687538619806861,
-0.155784775206548,
0.203493157428279, 0.0253102571479286,
0.95536389020605,
0.337607948058554, -0.153518682225985,
-0.55613823676492,
0.634318758624385, 0.133538380955282,
-0.456798091080125,
0.308161722468313, 0.886956509484442,
-0.114896305077645,
-1.40301885393361, -0.193697476524863,
0.226186436497854,
-0.71501865930242, 0.892370905922956,
0.990803990485527,
-0.153547211638878, -1.24314867469822,
0.417515278298618,
0.0658236451335487, 0.0658143373051684,
-0.469200826724804,
1.5412711793494, -0.27467373582656,
0.556439792710216,
-0.258907449715735, -0.229470318926396,
-0.473519395836248,
-0.338464921519234, 0.233813910663482,
-0.163193396367624,
0.203300522677862, 0.301987240974693,
-0.216108868852473,
-0.0486367848330909, -0.538941923881643,
-0.712313557338324,
-0.577736321975182, -0.0737240215669224,
-0.3785426741456,
-0.309571727588222, 0.231411822129134,
0.277943335129301,
-0.828320768233386, -0.138314599033044,
-1.7659658297405,
-1.17025473025242, 0.846015953965974,
-1.30590066263943,
1.37652117693529, 0.879536376764285,
-0.970532059262761,
-0.394240186532203, 1.47070301723875,
-0.792768599394429,
0.0191629940739302, 0.253078621629029,
0.757798749496606,
-0.582495695544892, -0.6349389512338,
0.197227390968576,
-0.459358877895434, -0.429143623200263,
0.100627045884215,
0.304291957409279, -1.68058915570707,
-0.246637023085706,
-0.0228365235741451, -1.22730110631949,
0.396488256765022,
0.53710941999101, 0.890903797321778,
1.08028623667007,
0.468193687237663, -0.438508127870939,
-0.877787848523677,
0.200449424393882, 0.414098588841629,
0.723330007820093,
2.24721832303742, 0.767156654615507,
0.0986966787298549,
1.02053990144909, -0.420629531200657,
-0.296155597594076,
0.193288173099775, 0.805814894588457,
-1.07515596794304,
-0.0756247780007754, -0.0519394013713164,
-0.913471027947056,
-0.205305835842313, -1.64907647634012,
0.402133574529183,
-0.699686926725339, -1.57596194945151,
0.732582111811776,
-0.912170235139671, 0.102093797487985,
0.484936326869755,
-0.798931671321719, 1.1018981535573,
-0.047608487238131,
-0.0891969180980154, -0.0893521317370874,
0.209794120118374,
-0.130857943267311, -0.247810924560095,
-0.566899659161367,
-0.166234990787041, 0.0941362599367984,
-0.368764709689455,
-0.709761346409758, -0.492979996743846,
0.120707358836407,
0.461205279104622, -0.904064712012616,
-0.136437316198613,
-0.438522203792661, -1.0500053667911,
0.601144193376559,
0.0787036186446472, -0.652516232432242,
0.479891035617182,
-0.61041624483137, -0.826309281123307,
-0.229941887765193,
-1.43628820610338, 0.715828642711865,
0.204718705670451,
-0.125174798694778, 0.115584979382253,
0.382424663794059,
-0.0446861917206223, -0.929672213105394,
0.340106548693281,
-0.251531101231296, -0.0814544752095304,
0.483661079939023,
0.792923400043175, 0.345607948384409,
-0.115285510339962,
-1.17769070209288, -0.0724290242381024,
-0.0365804720446577,
0.421116666341591, -0.314544327103398,
-1.53153790022327,
-0.513890207936736, -0.314083257538865,
0.577267216785606,
1.02889210582971, -0.857552817282211,
0.0810580048692497,
-0.551847393024095, 0.145665243517464,
-1.16673842826456,
-1.93751088889761, -1.10974042165161,
4.44710031911275,
-0.609556095505426, -0.939854192131601,
0.00730820348103634,
-0.902606954189888, -0.598051977327595,
0.856961005168551,
0.532566993164611, 1.58616085970536,
0.476649700989212,
-0.516669065211858, -0.297345750965178,
0.460174662757866,
1.80753166529188, 2.85642217965765,
0.228784945940634,
4.56983257577558, -1.55578627414921,
-0.152547367904775,
0.69127376271803, 3.85053226067029,
0.157834266758035,
0.442642795911504, -0.453688272271251,
-1.15640304507101,
0.776664558665817, -1.99584765412342,
0.478214085660735,
1.78756601668186, 2.11111656872865,
0.363796712036939,
2.44563675057934, -0.293174317900825,
0.379410072703114,
0.975524650624639, 0.0894332723478148,
-0.608327341519112,
-1.60400642556868, -3.26080806558141,
-1.32245592137155,
0.819304369752498, 0.829517567648956,
1.0334116172306,
-1.34682556601397, -0.16956586450443,
-0.912564138306455,
0.118091718828915, 0.159354101872843,
1.87773698975377,
0.399756904712213, 1.32046850750595,
1.46164188648651,
-0.477410250795489, -0.774603650791151,
0.647321864200877,
1.95806911921196, -1.29491280055863,
-0.0592598499870023,
-0.92330274816242, 0.37702791791734,
-0.657284956589409,
0.926043043136922, 0.86322746405, 1.05094398737664,
0.500607723226464,
-0.819395800697901, -1.64077257246915,
0.904400028603049,
-0.256177718568871, -0.613734288205821,
0.526439254485729,
-0.0912019760618964, 0.153920163118269,
1.06523405899366,
-0.113411933780509, 1.54354066617424,
1.15555522646558,
-2.52269019560576, 0.23081374072826,
0.464077236376069,
-0.0580822315454882, 0.926754476832613,
-0.910653220867578,
2.22371628398118), n = 945)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|