[R] Impose constraint on first order derivative at a point for cubic smoothing spline

2013-11-01 Thread Victor hyk
Hello,        Dr. Simon Wood told me how to force a cubic spline passing through a point. The code is as following. Anyone  who knows how I can change the code to force the first derivative to be certain value. For example, the first derivative of the constrained cubic spline equals 2 at point (0,

[R] Use pcls in mgcv package to achieve constrained cubic spline

2013-03-11 Thread Victor hyk
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? #

[R] Constrained cubic smoothing spline

2013-03-05 Thread Victor hyk
Hello everone,    Anyone who knows how to force a cubic smoothing spline to pass through a particular point?    I found on website  someone said that we can use cobs package to force the spline pass through certain points or impose shape   constraints (increasing,

[R] About basic logical operators

2013-03-05 Thread Victor hyk
Hello everyone,   I have a basic question regarding logical operators. x-seq(-1,1,by=0.02) x   [1] -1.00 -0.98 -0.96 -0.94 -0.92 -0.90 -0.88 -0.86 -0.84 -0.82 -0.80 -0.78  [13] -0.76 -0.74 -0.72 -0.70 -0.68 -0.66 -0.64 -0.62 -0.60 -0.58 -0.56 -0.54  [25] -0.52 -0.50 -0.48 -0.46 -0.44