Re: [R] problem in metro_hasting function‏

2015-12-10 Thread hms Dreams
No, it is not a homework.. The 3 paramters I want to estimate it are : alpha,gam and delta, the range of them >0 here my code: library("MHadaptive") baysianlog5=function (param,data) { alpha=param[1] gam=param[2] delta=param[3] x=data

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread Bert Gunter
gt;> >> >> return(prior_alpha+ prior_gam +prior_delta) >> >> >> } >> >> >> alphaB5=c();gamB5=c();deltaB5=c() >> >> >> n=5 ; m=5 >> >> >> alpha=2;gam=3;delta=4 #initial values >> >> >> v=

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread Bert Gunter
> > > mc5 =Metro_Hastings(li_func=baysianlog5, > pars=c(.8,.2,.2),par_names=c('alpha','gamma','delta'),data=x ) > > > > > > > #the output is > Error in optim(pars, li_func, control = list(fnscale = -1), hessian = TRUE, > : >

Re: [R] problem in metro_hasting function‏

2015-12-10 Thread Bert Gunter
Heh, heh ... Uniform distributions are not necessarily "non-informative" priors (itself, a non-definition). See, e.g. http://www.stats.org.uk/priors/noninformative/YangBerger1998.pdf . For a basic argument, see: http://www.amstat.org/publications/jse/v12n2/zhu.pdf Further discussion is off-topi

[R] problem in metro_hasting function‏

2015-12-10 Thread hms Dreams
Hello, I estimated three paramters using non informative prior(all paramters following uniform distribution) the output is: Error in optim(pars, li_func, control = list(fnscale = -1), hessian = TRUE, : non-finite finite-difference value [1] How can I solve it using uniform distribution for