[R] problem in metro_hasting function
cute_loomaa at hotmail.com
Thu Dec 10 22:22:22 CET 2015
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:
x=data n =length(x)
return(logl+p) #return log(p(x|theta)p(theta))
informative prior using uniform
n=5 ; m=5
alpha=2;gam=3;delta=4 #initial values
x =delta^(1/alpha)*((1-v)^(-1/gam)-1)^(1/alpha)# quantile
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, :
non-finite finite-difference value 
Can you help me
> Date: Thu, 10 Dec 2015 11:23:56 -0800
> Subject: Re: [R] problem in metro_hasting functionþ
> From: bgunter.4567 at gmail.com
> To: cute_loomaa at hotmail.com
> CC: r-help at r-project.org
> 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:
> Further discussion is off-topic here (it's a statistical, not an R,
> question). I suggest you consult a local statistician for details.
> And your question itself is noninformative: how can one tell without
> knowing what you are trying to optimize, your data, your starting
> values, etc. (unless I have missed something obvious)?
> Finally, if this is homework, post elsewhere: this list has a no
> homework policy.
> Bert Gunter
> "The trouble with having an open mind is that people keep coming along
> and sticking things into it."
> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> On Thu, Dec 10, 2015 at 9:26 AM, hms Dreams <cute_loomaa at hotmail.com> wrote:
> > 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 
> > How can I solve it using uniform distribution for all paramters??
> > (the same code is working when I use informative prior When I sugessted other distriutions like gamma and exp.)
> > Thank you
> > [[alternative HTML version deleted]]
> > ______________________________________________
> > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]
More information about the R-help