Skip to content
Prev 327310 / 398502 Next

mgcv: pcls() makes everything linear

I can't see anything immediately wrong except:

1. presumably there are repeated values in 'road_quiet' aren't there? If 
so then your inequality constraint matrix
will contain constraints that are *exact* copies of each other. I'm not 
sure, and don't immediately have time to try it
out, but it could be that this will cause a problem (what might happen 
is that you hit a constraint, project into its null space, but 
numerically the search direction then appears to be about to violate a 
copy of the constraint, so the copy gets added to the set of active 
constraints, and then another copy, and so on until it appears that the 
problem is fully constrained). Could you try replacing your constraints 
with some based on a grid  of e.g. 50 points spread evenly over the 
range of 'road_quiet' values. (If that does solve the problem please let 
me know, and I can add a check for constraint uniqueness to pcls.)

2. A long shot, but what is the range of values of road_quiet? eps 
should probably be around 1e-7 times the typical size of road_quiet (by 
'around' I mean something in the range 1e-4 to 1e-9, say). If eps is 
much too small or much too large
then the constraints become poor approximations to the gradient of the 
spline. I doubt this is the problem, however.

If those two fail you could send me some data (offline) with which I can 
reproduce the problem (smaller the better!), and I can dig further (on 
usual - only for this purpose - basis).

best,

Simon
On 23/07/13 10:19, Kathrine Veie wrote: