similar to: boundary constraints with smooth.spline

Displaying 20 results from an estimated 7000 matches similar to: "boundary constraints with smooth.spline"

2010 Apr 19
0
Natural cubic splines produced by smooth.Pspline and predict function in the package "pspline"
Hello, I am using R and the smooth.Pspline function in the pspline package to smooth some data by using natural cubic splines. After fitting a sufficiently smooth spline using the following call: (ps=smooth.Pspline(x,y,norder=2,spar=0.8,method=1) [the values of x are age in years from 1 to 100] I tried to check that R in fact had fitted a natural cubic spline by checking that the resulting
2013 Nov 01
0
Impose constraint on first order derivative at a point for cubic smoothing spline
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, 0.6).        I really appreciate your help!        Thanks!                 Best             Victor   
2007 Dec 07
1
Make natural splines constant outside boundary
Hi, I'm using natural cubic splines from splines::ns() in survival regression (regressing inter-arrival times of patients to a queue on queue size). The queue size fluctuates between 3600 and 3900. I would like to be able to run predict.survreg() for sizes <3600 and >3900 by assuming that the rate for <3600 is the same as for 3600 and that for >4000 it's the same as for
2012 Mar 12
1
Fwd: Re[2]: B-spline/smooth.basis derivative matrices
--- On Mon, 3/12/12, aleksandr shfets <a_shfets at mail.ru> wrote: > From: aleksandr shfets <a_shfets at mail.ru> > Subject: Fwd: Re[2]: [R] B-spline/smooth.basis derivative matrices > To: "Vassily Shvets" <shv736 at yahoo.com> > Received: Monday, March 12, 2012, 5:15 PM > > > > -------- ???????????? ????????? > -------- > ?? ????:
2009 Sep 24
1
basic cubic spline smoothing
Hello, I come from a non statistics background, but R is available to me, and I needed to test an implementation of smoothing spline that I have written in c++, so I would like to match the results with R (for my unit tests) I am following http://www.nabble.com/file/p25569553/SPLINES.PDF SPLINES.PDF where we have a list of points (xi, yi), the yi points are random such that: y_i = f(x_i) +
2009 Sep 24
0
basic cubic spline smoothing (resending because not sure about pending)
Hello, I come from a non statistics background, but R is available to me, and I needed to test an implementation of smoothing spline that I have written in c++, so I would like to match the results with R (for my unit tests). I am following Smoothing Splines, D.G. Pollock (available online) where we have a list of points (xi, yi), the yi points are random such that: y_i = f(x_i) + e_i
2006 Mar 17
1
smooth.spline
I have noticed a slightly puzzling behaviour exhibited by smooth.spline(). If I do sss <- smooth.spline(x,y) for a certain pair of data vectors x and y, and then do length(sss$x) I get the result ``18''. However if I do length(unique(x)) I get ``27''. Trying to force smooth.spline() to use more knots I tried sss <- smooth.spline(x,y,all.knots=TRUE) but again
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.
2007 Jul 04
3
Problem/bug with smooth.spline and all.knots=T
Dear list, if I do smooth.spline(tmpSec, tmpT, all.knots=T) with the attached data, I get this error-message: Error in smooth.spline(tmpSec, tmpT, all.knots = T) : smoothing parameter value too small If I do smooth.spline(tmpSec[-single arbitrary number], tmpT[-single arbitrary number], all.knots=T) it works! I just don't see it. It works for hundrets other datasets, but not for
2011 Nov 22
0
plotting output from LME with natural cubic spline
I have used LME to fit a mixed effects model on my data. The data has 274 subjects with 1 to 6 observations per subject. Time is not linearly associated with the outcome, so I used ns to fit a natural cubic spline with 3 auto knots. Subject and the natural cubic time of spline are both treated as random effects. This model has run without any problem, but now I would like to plot trajectories for
2010 May 24
1
finding the best cubic spline fitting
Hi, I am trying to fit cubic spline to a data on mortality rate by age and year (1900-2008). The data is noisy and hence I would like to smooth using spline and also extrapolate beyond 2008. Data from 1900 to 1948 are very unreliable while data from 1948 to 2008 are reliable. I would like to have a higher weight for data between 1948 to 2008. I am not sure how to do this. When I smooth data from
2013 Feb 27
1
Finding the knots in a smoothing spline using nknots
Hi r-helpers. Please forgive my ignorance, but I would like to plot a smoothing spline (smooth.spline) from package "stats", and show the knots in the plot, and I can't seem to figure out where smooth.spline has located the knots (when I use nknots). Unfortunately, I don't know a lot about splines, but I know that they provide me an easy way to estimate the location of local
2013 Mar 06
1
Constrained cubic smoothing spline
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, decreasing). However,  this package is using  B-spline and can only do linear and quadratic
2011 Aug 06
1
How to estimate confidential intervals for the derivatives of cubic smoothing spline
Dear all, I want to use smooth.spline to construct a cubic smoothing spline and its first derivative to my data. However, the predict.smooth.spline does not seem to provide a SE for both the fitted values and their derivatives. How should I calculate it? Thank you very much, Bingzhang
2009 Oct 13
2
How to choose a proper smoothing spline in GAM of mgcv package?
Hi, there, I have 5 datasets. I would like to choose a basis spline with same knots in GAM function in order to obtain same basis function for 5 datasets. Moreover, the basis spline is used to for an interaction of two covarites. I used "cr" in one covariate, but it can only smooth w.r.t 1 covariate. Can anyone give me some suggestion about how to choose a proper smoothing spline
2008 Dec 28
1
Logistic regression with rcs() and inequality constraints?
Dear guRus, I am doing a logistic regression using restricted cubic splines via rcs(). However, the fitted probabilities should be nondecreasing with increasing predictor. Example: predictor <- seq(1,20) y <- c(rep(0,9),rep(1,10),0) model <- glm(y~rcs(predictor,n.knots=3),family="binomial") print(1/(1+exp(-predict(model)))) The last expression should be a nondecreasing
2008 Nov 06
0
Inference and confidence interval for a restricted cubic spline function in a hurdle model
Dear list, I'm currently analyzing some count data using a hurdle model. I've used the rcspline.eval function in the Hmisc-library to contruct the spline terms for the regression model, and what I want in the end is the ability to compute coefficients and confidence intervals for different changes in the smooth function as well as plotting the smooth function along with the
2008 May 01
1
Optimal knot locations for splines
Suppose I have two variables, x and y. For a fixed number of knots, I want to create a spline transformation of x such that a loss function is minimized. Presumably, this loss function would be least squares, i.e. sum (f(x)-y)^2. The spline transformations would be linear, quadratic or cubic. I know I can solve this problem using some optimization function in R, but I was wondering if anyone
2012 Feb 24
1
B-spline/smooth.basis derivative matrices
Hello, I've noticed that SPLUS seems to have a function for evaluating derivative matrices of splines. I've found the R function that evaluates matrices from 'smooth.spline'; maybe someone has written something to do the same with smooth.basis? regards, s
2010 Jun 11
1
Documentation of B-spline function
Goodmorning, This is a documentation related question about the B-spline function in R. In the help file it is stated that: "df degrees of freedom; one can specify df rather than knots; bs() then chooses df-degree-1 knots at suitable quantiles of x (which will ignore missing values)." So if one were to specify a spline with 6 degrees of freedom (and no intercept) then a basis