(I edited your post so that the formula is more compact with latex display)
The easiest way would be to define two observed, which internally added together.
But your model set up is a bit unconventional - in linear regression you dont usually observed the error explicitly, but here you are assuming you observed the error at each measure?
But I have a ValueError: setting an array element with a sequence.
So how should I correct it?
Or should I correct the sentences with the theano.tensor?
I forgot the priors on s_1 and s_0 but you get the idea. If you really want to make it work with DensityDist I found that you need to use the following trick when passing two variables:
The above solution will probably work because of the way Python deals with scope AND your function is defined after\mu_0 and \mu_1. However, this will break if for some reason (cleaner code usually) you decide to define the log-likelihood before. Do the following instead, it is more explicit:
Thank you for your help!
I have successfully solve the problem!
I cannot remember who mentioned hierarchical model, but actually that is.
It is a great hint!
Hello,
I have a similar problem but for me the two data sets are of different lengths and using hierarchical model creates error :
ValueError: Input dimension mis-match. (input[0].shape[0] = 26, input[1].shape[0] = 140)
What can I do?
For clarity, the problem is Y1 = alpha + beta_0*X_0 + beta_1*X_1 + beta_2*X2 + mu
here I know Y1, X0, X1, X2 and mu and the length is 26
Y2 = alpha + beta_0*X_0 + beta_1*X_1 + beta_2*X2 + gamma*Z
here I know Y2 , all Xs and Z and need to estimate: alpha, beta, and gamma altogether. The length here is 140. gamma*Z is equivalent to mu but for the first part I know the mu while in the second part, I want to estimate the gamma so as to calculate mu.
mu in first model is basically acting as a calibrator/hinge for defining alpha and betas.
I would like to do it in one step evaluating all alpha, betas and gamma simultaneously but how do I include mu or gamma*Z for the two different samples.