Skip to content
Prev 326997 / 398502 Next

error in "predict.gam" used with "bam"

Solved it!! ;)

The problem was that the test-data contained factor-levels the
training-data didn't.
So when trying to fit this new factor-levels to a model which didn't have
this levels, the error occurred.

When excluding the factor-levels not used when fitting the model or when
taking care all levels are used for modell-fitting, everything is fine.

All the best

Julian

-----Urspr?ngliche Nachricht-----
Von: Simon Wood [mailto:s.wood at bath.ac.uk]
Gesendet: Dienstag, 9. Juli 2013 09:07
An: julian.bothe at elitepartner.de
Cc: r-help at r-project.org
Betreff: Re: [R] error in "predict.gam" used with "bam"

Hi Julian,

Any chance you could send me (offline) a short version of your data, which
reproduces the problem? I can't reproduce it in a quick attempt (but it is
quite puzzling, given that bam calls predict.gam internally in pretty much
the same way that you are doing here).

btw (and nothing to do with the error) given that you are using R 3.0.1
it's a good idea to upgrade to mgcv_1.7-23 or above, for the following
reason (taken from the mgcv changeLog)

1.7-23
------

*** Fix of severe bug introduced with R 2.15.2 LAPACK change. The shipped
version of dsyevr can fail to produce orthogonal eigenvectors when
uplo='U' (upper triangle of symmetric matrix used), as opposed to 'L'.
This led to a substantial number of gam smoothing parameter estimation
convergence failures, as the key stabilizing re-parameterization was
substantially degraded. The issue did not affect gaussian additive models
with GCV model selection. Other models could fail to converge any further
as soon as any smoothing parameter became `large', as happens when a
smooth is estimated as a straight line.
check.gam reported the lack of full convergence, but the issue could also
generate complete fit failures. Picked up late as full test suite had only
been run on R > 2.15.1 with an external LAPACK.

best,
Simon
On 08/07/13 10:02, julian.bothe at elitepartner.de wrote:
--
Simon Wood, Mathematical Science, University of Bath BA2 7AY UK
+44 (0)1225 386603               http://people.bath.ac.uk/sw283