BookmarkSubscribeRSS Feed
Marwah
Calcite | Level 5

Hi,

I am applying MCMC in SAS University edition, I got the error that the log likelihood is not positive.

This is a part of the code. 

 

 

p= A**(x+B)**C + D*exp(-1*E*(log(x)-log(F))**2) + G*(H**x)/(1+G*(H**x));
model y ~ binomial(n,p);

 

A to H are parameters which have prior distribution of uniform.

Thanks.

2 REPLIES 2
Rick_SAS
SAS Super FREQ

What is the range and typical values of x?  Obviously x must be greater than 0, but also x > B so that the expression (x-B)**C is defined.  Is B always bounded above by some B0 and x > B0? Otherwise  you're going to have problems.

 

It also looks like it is possible to choose parameters such that p is greater than 1, which will cause problems in the binomial(n,p) computation.

 

What are you trying to accomplish?

Marwah
Calcite | Level 5

x is age grouped in five years, it ranges from 0 to 110 (eg. 0,5,10,...110). B ranges from 0 to 1. The exponent is (x+B) not (x-B) so it is always defined.

 

It rarely happens in the models that p is greater than 1 but anyway I put a condition that if it is greater than 1 then substitute with 0.999.

 

I am trying to approximate a posterior distribution of the parameters (A to H) through slice sampling or Metropolis Hastings method. but the problem here is that the deaths is binomial and the prior distributions are not for the probability of success of the binomial, they are for the parameters that are in Heligman Pollard model (the p equation).

Sorry for replying late and thank you for your time.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1206 views
  • 0 likes
  • 2 in conversation