Hi again :) my code is in the attachment file the problem I think in the :
mcmc_r=Metro_Hastings(li_func=baysianlog, pars=c(1,1,1),par_names=c('alpha','gamma','delta'),data=x ) because I did not write the prop_sigma because I don't know how can I calcalute the covariance matrix. somebody told me to compute the cov without itreation then add the reasulting cov matrix to metro hasting using itreation but it also gave me an error Can you check my code and correct it please 😢 Thank you, Sara ______________________________________________ R-help@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.