Hi
I am running a GLS for the following data set but keep getting errors.

Error in gls(model = Res ~ AB * W, data = mydata, method = "ML", weights = varIdent(form = ~fG |  :
  false convergence (8)


Can anyone tell me what I am doing wrong? I have tried many of the suggestions on changing msMaxIter and optimMethod, but nothing is working.

I have used the same code for another data set and it runs with no problem, with no need to change any parameters for glsControl()



The code I am using is:
mydata$fA<-as.factor(mydata$A)
mydata$fB<-as.factor(mydata$B)
mydata$fW<-as.factor(mydata$W)
mydata$fG<-as.factor(mydata$G)
mydata$AB<-with(mydata, interaction(fA,fB,sep="-"))
gls1=gls(Res~AB*W,
          method="ML",
          data=mydata
          )
gls2=update(gls1,weights=varIdent(form=~fG|O),
             control=glsControl(optimMethod="L-BFGS-B"))



DATA

structure(list(A = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L), B = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), G = c(12L, 12L, 10L, 10L, 8L,

8L, 9L, 9L, 13L, 13L, 12L, 12L, 10L, 10L, 8L, 8L, 9L, 9L, 13L,

13L, 12L, 12L, 10L, 10L, 8L, 8L, 9L, 9L, 13L, 13L, 10L, 10L,

8L, 8L, 9L, 9L, 13L, 13L, 12L, 12L, 10L, 10L, 8L, 8L, 13L, 13L,

9L, 9L, 12L, 12L, 10L, 10L, 8L, 8L, 13L, 13L, 9L, 9L, 12L, 12L,

10L, 10L, 8L, 8L, 13L, 13L, 9L, 9L, 12L, 12L, 10L, 10L, 8L, 8L,

13L, 13L, 9L, 9L, 12L, 12L), W = c(2L, 5L, 2L, 5L, 2L, 5L, 2L,

5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L,

5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L,

5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L,

5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L,

5L, 2L, 5L, 2L, 5L, 2L, 5L, 2L, 5L), O = c(1L, 1L, 2L, 2L, 3L,

3L, 4L, 4L, 5L, 5L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L,

11L, 11L, 12L, 12L, 13L, 13L, 14L, 14L, 15L, 15L, 16L, 16L, 17L,

17L, 18L, 18L, 19L, 19L, 20L, 20L, 21L, 21L, 22L, 22L, 23L, 23L,

24L, 24L, 25L, 25L, 26L, 26L, 27L, 27L, 28L, 28L, 29L, 29L, 30L,

30L, 31L, 31L, 32L, 32L, 33L, 33L, 34L, 34L, 35L, 35L, 36L, 36L,

37L, 37L, 38L, 38L, 39L, 39L, 40L, 40L), Res = c(1.05077661,

1.172652991, 1.149087355, 0.686554424, 1.777120394, 1.655794351,

2.480213499, 2.94352487, 9.070517576, 7.836795574, 0.899855385,

0.697373284, 0.573551404, 0.781335929, 1.03026144, 1.072462105,

3.69866354, 5.570436349, 0.737783979, 0.962654599, 6.341501335,

0.164281358, 0.503551815, -0.125363843, -0.245037764, -0.03691376,

0.316934703, -0.282864059, 0.188144954, -0.018515835, -0.498091263,

0.026779496, -0.677362335, -0.186095244, 0.18218447, 0.163746261,

-0.714550883, 1.318294949, -0.058079954, -0.23321688, 0.308430931,

0.318876399, 0.158931598, 0.546959546, 0.400210574, 0.087082369,

0.799610581, 0.422993236, 0.385716289, 0.215094669, 0.554524165,

0.258457534, 0.18458661, 0.258683181, 1.763103859, 0.88126506,

0.864332576, 0.528100739, 0.822592729, 0.355618266, 2.445364301,

1.380761103, 2.715040819, 1.39795487, 0.612449078, 0.468747435,

0.201391889, -0.389318215, 1.023141064, 0.115277971, 0.513945575,

0.173538203, 0.425637648, -0.563469173, 1.145538436, -0.172163111,

0.136309566, 0.465816049, 0.347740868, -0.06157151), fA = structure(c(1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1",

"2"), class = "factor"), fB = structure(c(1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("1",

"2"), class = "factor"), fW = structure(c(1L, 2L, 1L, 2L, 1L,

2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L,

2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L,

2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L,

2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L,

2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("2",

"5"), class = "factor"), fG = structure(c(4L, 4L, 3L, 3L, 1L,

1L, 2L, 2L, 5L, 5L, 4L, 4L, 3L, 3L, 1L, 1L, 2L, 2L, 5L, 5L, 4L,

4L, 3L, 3L, 1L, 1L, 2L, 2L, 5L, 5L, 3L, 3L, 1L, 1L, 2L, 2L, 5L,

5L, 4L, 4L, 3L, 3L, 1L, 1L, 5L, 5L, 2L, 2L, 4L, 4L, 3L, 3L, 1L,

1L, 5L, 5L, 2L, 2L, 4L, 4L, 3L, 3L, 1L, 1L, 5L, 5L, 2L, 2L, 4L,

4L, 3L, 3L, 1L, 1L, 5L, 5L, 2L, 2L, 4L, 4L), .Label = c("8",

"9", "10", "12", "13"), class = "factor"), AB = structure(c(1L,

1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,

1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,

3L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,

2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 4L, 4L, 4L, 4L, 4L,

4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L), .Label = c("1-1",

"2-1", "1-2", "2-2"), class = "factor")), .Names = c("A", "B",

"G", "W", "O", "Res", "fA", "fB", "fW", "fG", "AB"), row.names = c(NA,

-80L), class = "data.frame")



Beatriz de Francisco Mora
PhD Student
The Scottish Association for Marine Science
Scottish Marine Institute
Oban
PA37 1QA

The Scottish Association for Marine Science (SAMS) is registered in Scotland as a Company Limited by Guarantee (SC009292) and is a registered charity (9206). SAMS has an actively trading wholly owned subsidiary company: SAMS Research Services Ltd a Limited Company (SC224404). All Companies in the group are registered in Scotland and share a registered office at Scottish Marine Institute, Oban Argyll PA37 1QA. The content of this message may contain personal views which are not the views of SAMS unless specifically stated. Please note that all email traffic is monitored for purposes of security and spam filtering. As such individual emails may be examined in more detail.

	[[alternative HTML version deleted]]

