similar to: Choosing knots of B-splines

Displaying 20 results from an estimated 6000 matches similar to: "Choosing knots of B-splines"

2008 Jul 29
1
tensor product of equi-spaced B-splines in the unit square
Dear all, I need to compute tensor product of B-spline defined over equi-spaced break-points. I wrote my own program (it works in a 2-dimensional setting) library(splines) # set the break-points Knots = seq(-1,1,length=10) # number of splines M = (length(Knots)-4)^2 # short cut to splineDesign function bspline = function(x) splineDesign(Knots,x,outer.ok = T) # bivariate tensor product of
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
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
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 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 > > > > -------- ???????????? ????????? > -------- > ?? ????:
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
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
2003 May 08
2
natural splines
Apologies if this is this too obscure for R-help. In package splines, ns(x,,knots,intercept=TRUE) produces an n by K+2 matrix N, the values of K+2 basis functions for the natural splines with K (internal) knots, evaluated at x. It does this by first generating an n by K+4 matrix B of unconstrained splines, then postmultiplying B by H, a K+4 by K+2 representation of the nullspace of C (2 by K+4),
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
2005 Jun 14
0
bs() function of the splines package
Laurent 14 juin 12:02 afficher les options De : "Laurent" <eddy_l... at hotmail.com> - Rechercher les messages de cet auteur Date : Tue, 14 Jun 2005 03:02:37 -0700 Local : Mar 14 juin 2005 12:02 Objet : bs() function of the splines package R??pondre | R??pondre ?? l'auteur | Transf??rer | Imprimer | Message individuel | Afficher l'original | Retirer | Signaler un
2005 Jul 24
1
Buglet in src/appl/splines.c (PR#8030)
--AZaLVt6Pw+ Content-Type: text/plain; charset=us-ascii Content-Description: message body text Content-Transfer-Encoding: 7bit Dear all, I was looking at "splinefun" and the underlying C code and believe that there is a memory access error in the C routine "spline_eval". Specifically, on line 368 and following the following code appears: if(ul < x[i] || x[i+1] < ul)
2011 May 14
0
obscure error message from splines::ns
In the following case, library(splines) tt <- c(55, 251, 380, 289, 210, 385, 361, 669) nn <- rep(0:7,tt) ns(nn,4) ## knots are located at (0.25,0.5,0.75); quantiles = (2,5,7) we get the error Error in qr.default(t(const)) : NA/NaN/Inf in foreign function call (arg 1) because the 75th quantile (the location of the last "interior" knot) ends up on the boundary. As a
2010 Nov 17
1
where are my pspline knots?
Hi All, I am trying to figure out how to get the position of the knots in a pspline used in a cox model. my.model = coxph(Surv(agein, ageout, status) ~ pspline(x), mydata) # x being continuous How do I find out where the knot of the spline are? I would like to know to figure out how many cases are there between each knot. Best, Federico -- Federico C. F. Calboli Department of Epidemiology
2013 May 28
3
R-3.0.1 - "transient" make check failure in splines-EX.r
Hello. I seem to be having the same problem that Paul had in the thread titled "[Rd] R 2.15.2 make check failure on 32-bit --with-blas="-lgoto2"" from October of last year <https://stat.ethz.ch/pipermail/r-devel/2012-October/065103.html> Unfortunately, that thread ended without an answer to his last question. Briefly, I am trying to compile an Rblas for Windows NT 32bit
2005 Jun 14
0
bs() function of the splines package with intercept=FALSE
Hello, I'm implementing a function using non uniform B-Splines. Looking at the code of the bs() function, I realized that if the intercept was set to FALSE, the behavior of the function was the following (df is the number of degrees of freedom that I believe can be interpreted as the number of control points): - Compute df- ord + 1 _internal_ knots (ord is the order of the spline) - Add ord
2009 Sep 20
1
How to choose knots for GAM?
Hi, all I want to choose same knots in GAM for 10 different studies so that they has the same basis function. Even though I choose same knots and same dimensions of basis smoothing, the basis representations are still not same. My command is as follows: data.gam<-gam(y~s(age,bs='cr',k=10)+male,family=binomial,knots=list(age=seq(45,64,length=10))) What is my mistake for choice of
2006 Feb 02
1
the meaning of the B-spline coefficients
Dear all, I'm trying to figure out the exact meaning of the B-spline coefficients generated by the R command bs(). After reading a lot of things, I still have no clue... Here's my data. > test time f0 1 1 94.76328 2 2 102.47954 3 3 105.01234 4 4 107.21387 5 5 108.63279 6 6 109.54507 7 7 113.87931 8 8 118.21356 9 9 121.08652 10
2011 May 04
1
natural cubic splines
Dear R-helpers, I need to fit natural cubic spline with specified number of knots. I expected 'splines' package will be helpful, but I am confused by its help. Is more detailed documentation available for it or could you recommend another R function? Best regards Ondrej Mikula
2004 Oct 15
0
constrained splines in GLM
Hi, I would like to use constrained splines in a GLM model (Poisson link) to take into account the nonlinear effect of some covariate. The constraints I need are described below. I have several variables that I need concurrently in the same model. I looked at package mgcv but I do not know if/how I can use it in GLM (not GAM) : I could not manage to adapt the mono.con(mgcv) example to GLM. The
2017 May 03
4
Cálculo de splines racionales no uniformes o NURBS (non-uniform rational B-spline)
Hola a todos, Llevo unos días buscando en Internet alguna librería de R que me permita el cálculo de NURBS a partir de ficheros de texto con coordenadas X Y Z de puntos. No he encontrado nada que me convenza y finalmente, hoy, he empezado a trabajar este asunto en MATLAB (la última vez que había usado este programa fue en 1999). ¿Alguno de vosotros ha trabajado en R? ¿Podríais hacerme alguna