[R-sig-eco] cozigam

Ben Bolker bbolker at gmail.com
Wed Jun 13 10:33:17 CEST 2012


Mahnaz Rabbaniha <rab.mahnaz at ...> writes:

> i try to find regression between clupeidae,with temperature,salinity and
> depth. the response variable is inclued many zero ( 86 from 133 observed)
> 
> therefore i used this code :
> 
>  res <- cozigam(Clupeidae~s(temperature,salinity)+s(depth), constraint =
> "proportional", family = gaussian)
> 
> the result:
> iteration = 2    norm = 1.001743
> iteration = 3    norm = 0.3377464
> iteration = 4    norm = 9.172232e-05
> 
> ==========================================
> estimated alpha = -0.5337883 ( 0.1789113 )
> estimated delta = -0.0009891505 ( NaN )
> ==========================================
> 
> Warning message:
> 
> In sqrt(V.theta[2, 2]) : NaNs produced
> 
> what is exactly meaning?


  You're probably not getting answers to your repeated posts
because you're not providing a reproducible example
( http://tinyurl.com/reproducible-000 ) and not giving very much
detail about your problem.
  I strongly suspect that your model is too complex for your data:
a general rule of thumb is that you need about 10 observations
per parameter estimated. It's a bit hard to count in this case
for two reasons -- zeroes are relatively uninformative (so each
zero counts for less than one 'effective' observation), and it's
a little hard to count parameters for penalized smooth terms --
but I think you can't really expect to fit a two-way smooth term
on temperature and salinity *and* a smooth term on depth ... the
example in the COZIGAM JRSS paper (referenced in the help)
fits a model of about the same complexity to 274 data points with
84 zero catches -- somewhere between 3 and 4 times as much data
as you have.
  Most narrowly, the program is trying to estimate the standard
error of the parameter by inverting the matrix of second derivatives,
and failing because the surface is too flat, or too strongly
correlated, or some similar problem.



More information about the R-sig-ecology mailing list