Displaying 20 results from an estimated 11000 matches similar to: "bs() function of the splines package with intercept=FALSE"
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
2002 May 02
1
splines
I've got a problem with the R function spline.des.
I use the following arguments:
x_seq(0,1,length=200)
knot_quantile(x,(1:8)/9)
ord_3
k_sort(c(rep(range(x),ord,knot)))
derivs_rep(2,200)
When I do spline.des(k,x,ord,derivs)$design on Splus and on R, I don't
have the same results.
However, if I take an order ord=4 (ie a spline of degree 3), then, I
have the same
2006 Jan 25
0
documentation mistake
dear r-help.
i want top report a mistake in the documentation help(splineDesign).
the last sentence of "value" is
" Each B-spline is defined by a set of 'ord' successive knots
so the total number of B-splines is 'length(knots)-ord'. "
it is not correct!
one b-spline is defines by a set of 'ord+1' successive knots.
take an easy example:
degree 0 is a
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
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)
2024 Jul 26
1
Automatic Knot selection in Piecewise linear splines
dear all,
I apologize for my delay in replying you. Here my contribution, maybe
just for completeness:
Similar to "earth", "segmented" also fits piecewise linear relationships
with the number of breakpoints being selected by the AIC or BIC
(recommended).
#code (example and code from Martin Maechler previous email)
library(segmented)
o<-selgmented(y, ~x, Kmax=20,
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
2024 Jul 16
2
Automatic Knot selection in Piecewise linear splines
>>>>> Anupam Tyagi
>>>>> on Tue, 9 Jul 2024 16:16:43 +0530 writes:
> How can I do automatic knot selection while fitting piecewise linear
> splines to two variables x and y? Which package to use to do it simply? I
> also want to visualize the splines (and the scatter plot) with a graph.
> Anupam
NB: linear splines, i.e. piecewise
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
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
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),
2002 Jul 29
0
Choosing knots of B-splines
Dear Sir,
I am taking about the choosing knots of B-splines. Can you tel me the R
docomentation for choosing the knots of B-splines automatically? It is
possible to choose the knots by eye, but which is time consuming and a
little arbitrary.
Thanks for your reply.
Shahid
PhD Student
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
2016 Mar 04
0
R 3.2.4 rc issue
Thanks for the info, Dirk.
The tarball builds don't run make check (because of a policy decision that it is better to have the sources available on all platforms for testing than to have none if it breaks on a single platform). However the build as of tonight has no problem with make check on the build machine. Did you by any chance forget that Matrix is a recommended package and expected to
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
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
2016 Mar 04
2
R 3.2.4 rc issue
I generally run 'make; make check' (with more settings) when building the
Debian package. Running 3.2.4 rc from last night, I see a lot of package
loading issues during 'make check'. Here is splines as one examples:
checking package 'splines'
* using log directory '/build/r-base-3.2.3.20160303/tests/splines.Rcheck'
* using R version 3.2.4 RC (2016-03-02 r70270)
*
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
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
>
>
>
> -------- ???????????? ?????????
> --------
> ?? ????:
2024 Jul 08
0
package spline - default value of Boundary.knots of ns
Dear Maintainer,
Thanks for the excellent package splines. I am writing this email to request you to consider a suggestion I have with regards to the function ns.
While trying to rework an example from a textbook, I couldn't call ns with appropriate arguments to reproduce the results. The package documentation also couldn't help me find the problem. Finally, I found a stack exchange