Hola Luis,
With the following priors your program runs:
beta ~ dexp(0.01)
beta1 ~ dnorm(0.0, 0.001)
beta2 ~ dnorm(0.0, 0.001)
beta3 ~ dnorm(0.0, 0.001)
I run 20,000 iterations, these are the posteriors:
node mean sd MC error 2.5% median 97.5%
start sample
beta 75.96 12.64 0.2514 52.87 75.28 102.6
10001 10000
beta1 28.14 18.05 1.576 5.097 24.19 70.63
10001 10000
beta2 -1.076 0.3769 0.0254 -1.81 -1.064 -0.3404
10001 10000
beta3 -2.78 0.7468 0.07025 -4.134 -2.781 -1.176
10001 10000
Anyway, given that you have a non-linear gamma regression, I think that
you should make priors on beta1-3 that are meaningful, i.e. priors
that have more sense in your application.
This is also the common procedure in classical statistics when you fit
non-linear models.
Hope it helps.
Pablo
Am 10.03.2015 um 19:23 schrieb Luis:
> Hi everyone,
>
> I'm trying to estimate the scale parameter of a gamma distribution considering a link function with covariables as the shape parameter, but I have a problem with the logGamma function, apparently the obtained values for this function are negative, I have tried changing the initial values of the parameters and the values of the prior distributions but the problem is still the same
>
> I would really appreciate if there is any suggestion to make this work
>
> Here is the code with the data
>
> model{
> for(i in 1:n)
> {
> for(j in 1:m)
> {
> x[i,j] ~ dgamma(alpha.1[i,j], beta)
> alpha.1[i,j]<-beta1*exp(beta2*T[j])*exp(beta3*Vi[j])
>
> }
> }
> beta ~ dgamma(0.01, 0.01)
> beta1 ~ dnorm(0.0, 0.0000001)
> beta2 ~ dnorm(0.0, 0.0000001)
> beta3 ~ dnorm(0.0, 0.0000001)
>
> }
> #Inits
> inits=list(beta= 1, beta1=1, beta2=1, beta3=1)
>
> #Data
> list(T=c(0.364,0.545,0.727,0.773,0.909,1,0.818),
> Vi=c(1,1,1,1,1,1,1), n=15, m=7,
> x= structure(
> .Data = c(
> 0.0141, 0.0182, 0.0016, 0.0021, 0.0089, 0.009, 0.002,
> 0.0031, 0.0172, 0.0075, 0.0011, 0.0024, 0.0025, 0.008,
> 0.11, 0.0069, 0.007, 0.03, 0.0001, 0.0001, 0.0001,
> 0.003, 0.002, 0.008, 0.003, 0.0005, 0.0006, 0.009,
> 0.001, 0.0121, 0.0008, 0.0031, 0.0005, 0.0005, 0.001,
> 0.011, 0.005, 0.0009, 0.0261, 0.0084, 0.0085, 0.0022,
> 0.017, 0.0012, 0.0007, 0.0001, 0.0015, 0.0016, 0.001,
> 0.0259, 0.0161, 0.0104, 0.0105, 0.012, 0.0001, 0.0001,
> 0.003, 0.008, 0.0051, 0.0719, 0.0009, 0.0009, 0.0003,
> 0.008, 0.0012, 0.0159, 0.0319, 0.0105, 0.0106, 0.002,
> 0.014, 0.0043, 0.0728, 0.0549, 0.0015, 0.0016, 0.003,
> 0.006, 0.001, 0.012, 0.002, 0.0035, 0.0036, 0.0099,
> 0.021, 0.0008, 0.0013, 0.0163, 0.0033, 0.0034, 0.008,
> 0.005, 0.001, 0.002, 0.005, 0.004, 0.004, 0.008,
> 0.0004, 0.001, 0.0011, 0.0012, 0.0004, 0.0005, 0.0039),
> .Dim = c(15, 7)))
>
>
> Thanks in advance & have a great day
>
>
> Luis Rodriguez
>
> -------------------------------------------------------------------
> 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
-------------------------------------------------------------------
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
|