Displaying 4 results from an estimated 4 matches for "parapen".
2009 Feb 07
1
paraPen in gam [mgcv 1.4-1.1] and centering constraints
Dear Mr. Simon Wood, dear list members,
I am trying to fit a similar model with gam from mgcv compared to what I
did with BayesX, and have discovered the relatively new possibility of
incorporating user-defined matrices for quadratic penalties on
parametric terms using the "paraPen" argument. This was really a very
good idea!
However, I would like to constraint the coefficients belonging to one
penalty matrix to sum to zero. So I would like to have the same
centering constraint on user-defined penalized coefficient groups like
it is implemented for the spline smoothing...
2012 Jul 11
2
Modifying the design matrix X in GAMS to suit data assimilation
I have a data assimilation problem that might be amenable to the use of GAMS, but I am not sure how feasible it is to implement. I was told the R mailing list was a great resource.
My observations are spatiotemporal salinity in the San Francisco Bay at a number of instruments over a few days. The thing that I want to fit is the initial condition for a salt transport model at the beginning of this
2013 Nov 01
0
Impose constraint on first order derivative at a point for cubic smoothing spline
...spline at knot location 0,
## set it to 0 by dropping...
X <- sm$X[,-3] ## spline basis
S <- sm$S[[1]][-3,-3] ## spline penalty
off <- y*0 + .6 ## offset term to force curve through (0, .6)
## fit spline constrained through (0, .6)...
b <- gam(y ~ X - 1 + offset(off),paraPen=list(X=list(S)))
lines(x,predict(b))
## compare to unconstrained fit...
b.u <- gam(y ~ s(x,k=9),data=dat,knots=knots)
lines(x,predict(b.u))
[[alternative HTML version deleted]]
2013 Mar 11
1
Use pcls in "mgcv" package to achieve constrained cubic spline
Hello everyone,
Dr. wood told me that I can adapting his example to force cubic spline to pass through certain point.
I still have no idea how to achieve this. Suppose we want to force the cubic spline to pass (1,1), how can
I achieve this by adapting the following code?
# Penalized example: monotonic penalized regression spline .....
# Generate data from a monotonic truth.