> -----Original Message----- > From: r-help-bounces at stat.math.ethz.ch [SMTP:r-help-bounces at stat.math.ethz.ch] On Behalf Of ernesto > Sent: Friday, January 13, 2006 9:25 AM > To: Mailing List R > Subject: [R] help with gepRglm::likfit.glsm > > Hi, > > I'm exploring likfit.glsm and I need some help. I have to say that I'm > not an MCMC expert ... > > I did a first run of likfit.glsm with S.scale=0.002 and it worked > whithout problems but there was strong autocorrelation and the chain > convergence for the ramdom effects was quite poor, so I changed S.scale > to 0.4, which gave acceptance rates close to 0.6 as proposed on the > documentation, and the autocorrelation and chain convergence was ok. > However when I tried to run likfit.glsm it gave the following error: > > > gdn.glsm2.lf <- likfit.glsm(gdn.glsm2.prelf, cov.model > "exponential", ini.phi=26, lambda=0) > -------------------------------------------------------------------- > likfit.glsm: likelihood maximisation using the function optim. > phi = 26 tausq.rel = 0 > Error in if (det(Delta2) != 0) { : missing value where TRUE/FALSE needed > In addition: Warning message: > cannot use argument lambda with the given objects in mcmc.obj in: > likfit.glsm(gdn.glsm2.prelf, cov.model = "exponential", ini.phi = 26,------------- Regarding the warning: the argument 'lambda' corresponds to the model for continuous variables (used in geoR) whereas you seem to have counts. The error has occurred to me when i try to fit a spatial correlation function that the data does not support. For example when i try to fit the matern model with too few observations. Then i fall back into exponential or gaussian and then the error disappears. Try fitting the gaussian. Also try changing the initial values for the correlation distance. Ruben
Hi, I'm exploring likfit.glsm and I need some help. I have to say that I'm not an MCMC expert ... I did a first run of likfit.glsm with S.scale=0.002 and it worked whithout problems but there was strong autocorrelation and the chain convergence for the ramdom effects was quite poor, so I changed S.scale to 0.4, which gave acceptance rates close to 0.6 as proposed on the documentation, and the autocorrelation and chain convergence was ok. However when I tried to run likfit.glsm it gave the following error:> gdn.glsm2.lf <- likfit.glsm(gdn.glsm2.prelf, cov.model "exponential", ini.phi=26, lambda=0)-------------------------------------------------------------------- likfit.glsm: likelihood maximisation using the function optim. phi = 26 tausq.rel = 0 Error in if (det(Delta2) != 0) { : missing value where TRUE/FALSE needed In addition: Warning message: cannot use argument lambda with the given objects in mcmc.obj in: likfit.glsm(gdn.glsm2.prelf, cov.model = "exponential", ini.phi = 26, below is the code for both runs. Thanks EJ # first run mod <- list(beta=gdn.lf$beta, cov.pars=gdn.lf$cov.pars, cov.model=gdn.lf$cov.model, nugget=gdn.lf$nugget, aniso.pars=gdn.lf$aniso.pars, family="poisson", lambda=gdn.lf$lambda) mcc <- mcmc.control(S.scale=0.002) gdn.glsm1 <- glsm.mcmc(gdn, model=mod, mcmc.input=mcc) gdn.glsm1.prelf <- prepare.likfit.glsm(gdn.glsm1) gdn.glsm1.lf <- likfit.glsm(gdn.glsm1.prelf, cov.model = "exponential", ini.phi=26, lambda = 0) # second run mcc <- mcmc.control(S.scale=0.4) gdn.glsm2 <- glsm.mcmc(gdn, model=mod, mcmc.input=mcc) gdn.glsm2.prelf <- prepare.likfit.glsm(gdn.glsm2) gdn.glsm2.lf <- likfit.glsm(gdn.glsm2.prelf, cov.model = "exponential", ini.phi=26, lambda=0)