Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • (Maybe beginner's) question on writing substitutable expression

    Hello Stata,

    I am using db bayesmh to run MCMC on my model. My data (y) is 440 observations (i) by 2000 variables (j). My likelihood function is the following:
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	8.4 KB
ID:	1450051

    where y_{i,j} is the data, x_i, alpha_j, and beta_j are all parameters to estimate (with prior normal (0,1)), and Phi is normal cumulative density function. I don't know how to write this as a substitutable expression. The difficulties for me are:

    1. How do I index the y_{i,j}, x_i, alpha_j and beta_j inside the summation function sum()?
    2. How do I generate the x_i, alpha_j, and beta_j using maybe a for loop instead of writing x_1, x_2, ...?
    3. Is it possible for me to use a matrix presentation of those parameters, and use inner product inside the normal() function?
Working...
X