[R] Error using betamix function

Camille Dezecache Camille.Dezecache at ecofog.gf
Tue Oct 14 20:07:46 CEST 2014


Hi all,

I'm trying to use the betamix function (betareg package) to create a beta mixture model but get this error that I don't understand:
"Error in lm.wfit(x, linkfun(y), weights, offset = offset[[1L]]) :
  NA/NaN/Inf in 'y'
Error in lm.wfit(x, linkfun(y), weights, offset = offset[[1L]]) :
  NA/NaN/Inf in 'y'
Error in lm.wfit(x, linkfun(y), weights, offset = offset[[1L]]) :
  NA/NaN/Inf in 'y'
Error in flexmix::stepFlexmix(fullformula, data = mf, k = k, nrep = nstart,  :
  no convergence to a suitable mixture"

The code I wrote was:
"beta_mix_model <- betamix(formula = def_relat ~ data_roads,
                          k = 2)"

I'm making the hypothesis that def_relat (ie the level of deforestation) is a function of data_roads (ie distance to roads). When a pixel is far from a road, its probability of deforestation is very close to zero with very low uncertainty. Closer to roads however, deforestation is possible (with very high uncertainty of the intensity of deforestation) but occurences of deforestation also occur. This is why I'm considering to groups of observations, with a beta distribution of probability for modelling a probability of deforestation between 0 and 1.

I don't understand the error message, because none of the data I'm using includes NA or Inf. Does anyone has an idea of the reason why I get this error, or can tell me if I'm using the function betamix the wrong way?

Thanks,
Camille

	[[alternative HTML version deleted]]



More information about the R-help mailing list