Could anyone help me diagnose why this code fails (system becomes unresponsive, need to close browser window and start a new session) as soon as PROC MCMC starts running, before it even has a chance to put out a single line to the log? Everything before PROC MCMC runs fine on its own. By the time PROC MCMC runs, all the data I'm using has been converted to numeric, and all the non-categorical variables have been standardized. There is no missing data.
I'm using SAS Studio Release 3.7 (Enterprise Edition) on Google Chrome Version 71.0.3578.98 (Official Build) (64-bit).
EDIT @9:17 1/14/2019: PROC MCMC runs in general, including on this same dataset if I use fewer parameters. Since making this post, I was able to get this code to run by simply changing the algorithm to the default rather than NUTS (i.e. by deleting "alg=nuts" from the PROC MCMC line). So whatever the issue is, it seems to be something about the way NUTS does its initial optimization/tuning.
FILENAME REFFILE '/home/brandonmadsen1/toneGlideFFR_forR.csv';
PROC IMPORT DATAFILE=REFFILE DBMS=CSV OUT=tg_orig;
GETNAMES=YES;
RUN;
data tone_glide;
set tg_orig;
* logit transform to allow use of normal distribution (0-1 scale --> -inf to +inf scale);
rho_logit=log(rho/(1-rho));
run;
proc standard data=tone_glide mean=0 std=1 out=STD_TONE_GLIDE;
Var freq rho_logit hzPerSec snrDb lagMs tMs rho;
Run;
proc transreg data=std_tone_glide design;
model identity(freq|hzPerSec|tMs / tstandard=z)|class(mont|direction|group);
id sid slopeCode rho_logit rho snrDb octsPerEpoch lagMs;
output out=std_tone_glide;
run;
%put &_trgind;
* macro for putting linear model into proc mcmc;
%macro linpred;
%do i=1 %to 96;
beta&i.*data[&i.] +
%end;
%mend linpred;
%put %linpred 0;
options nocenter;
ods graphics on;
proc mcmc data=std_tone_glide nmc=3000 nbi=1000 alg=nuts(maxheight=12) propcov=quanew
statistics(percent=5.5 94.5)=(summary) outpost=op;
array data 1 &_trgind;
array beta[96] beta1-beta96;
mu = 0 + %linpred 0; *zero at end because of trailing "+";
parms beta: sigma;
prior beta: ~ normal(0, sd=1);
prior sigma ~ expon(scale=1);
model rho_logit ~ normal(mu , sd=sigma);
run;
ods graphics off;
PROC MCMC runs in general, including on this same dataset if I use fewer parameters. Since making this post, I was able to get this code to run by simply changing the algorithm to the default rather than NUTS (i.e. by deleting "alg=nuts" from the PROC MCMC line). So whatever the issue is, it seems to be something about the way NUTS does its initial optimization/tuning.
PROC MCMC runs in general, including on this same dataset if I use fewer parameters. Since making this post, I was able to get this code to run by simply changing the algorithm to the default rather than NUTS (i.e. by deleting "alg=nuts" from the PROC MCMC line). So whatever the issue is, it seems to be something about the way NUTS does its initial optimization/tuning.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.