Displaying 20 results from an estimated 3000 matches similar to: "comparing fit of cubic spline"
2003 May 23
2
predict.smooth.spline
I'm using R 1.7.0 on linux. With this version of R the package modreg is
automatically loaded at start of session. However attempting to use
predict.smooth.spline() produces Error: couldn't find function
predict.smooth.spline.
The function smooth.spline() is OK. What am I missing?
======================================
I.White
ICAPB, University of Edinburgh
Ashworth Laboratories, West
2007 Oct 12
0
change of variance components depending on scaling of fixed effects
Dear all,
I am trying to understand the output from a binomial lmer object and why
the scaling of a fixed effect changes the variance components.
In the model p2rec is cbind(number recruits2,number recruits 1), Pop is
populations (five level factor) and ja is year (covariate running from
1955-2004). I.e. biologically I am interested to see how the proportion
of recruits from the second
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
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.
2000 Sep 04
2
bug in spline()? (PR#653)
BUG IN SPLINE()?
Version R-1.0.1, system i486,linux
If the spline(x,y,method="natural") function is given values outside the
range of the data, it does not give a warning. Moreover, the extrapolated
value reported is not the ordinate of the natural spline defined by (x,y).
Example. Let x <- c(2,5,8,10) and y <- c(1.2266,-1.7606,-0.5051,1.0390).
Then interpolate/extrapolate with
2007 Dec 26
1
Cubic splines in package "mgcv"
R-users
E-mail: r-help@r-project.org
My understanding is that package "mgcv" is based on
"Generalized Additive Models: An Introduction with R (by Simon N. Wood)".
On the page 126 of this book, eq(3.4) looks a quartic equation with respect
to
"x", not a cubic equation. I am wondering if all routines which uses
cubic splines in mgcv are based on this quartic
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),
2005 Feb 10
1
Failure of update.packages()
Can anyone explain why with latest version of R (2.0.1) on FC3, installed
from R-2.0.1-0.fdr.2.fc3.i386.rpm, update.packages() produces the message
/usr/lib/R/bin/Rcmd exec: INSTALL: not found.
Indeed /usr/lib/R/bin seems to lack various shell scripts (INSTALL,
REMOVE, etc).
======================================
I.White
University of Edinburgh
Ashworth Laboratories, West Mains Road
Edinburgh
2010 Apr 09
1
How to get the penalty matrix for natural cubic spline?
Hi, all
I am trying to get the basis matrix and penalty matrix for natural
cubic splines. In the "splines" package of R,"ns" can
generate the B-spline basis matrix for a natural cubic spline. How can
I get the basis matrix and penalty matrix for natural cubic
spline.
Thanks a lot!
Lee
[[alternative HTML version deleted]]
2012 Dec 01
3
cubic spline
Hallo,
I'm facing a problem and I would really appreciate your support.
I have to translate some Matalb code in R that I don't know very well but I
would like to.
I have to interpolate 5 point with a cubic spline function and then I expect
my function returns the Y value as output a specific X value inside the
evaluation range. Let's suppose that:
1- *X = [-10, -5, 0, 5, 10]*
2
2011 Oct 11
1
restricted cubic spline within survfit.cph in the package rms
Hello,
does anyone have an example on how to use restricted cubic
splines function rcs within survfit.cph, if cph (Cox Proportional Hazard Regression) was done with restricted cubic
splines (which I made to work)?
Thank you.
>
[[alternative HTML version deleted]]
2010 May 14
1
Cubic B-spline, how to numerically integrate?
(corrected version of previous posting)
I fit a GAM to turtle growth data following methods in Limpus & Chaloupka
1997 (http://www.int-res.com/articles/meps/149/m149p023.pdf).
I want to obtain figures similar to Fig 3 c & f in Limpus & Chaloupka
(1997), which according to the figure legend are "expected size-at-age
functions" obtained by numerically integrating
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
2008 Oct 10
1
how to evaluate a cubic Bezier curve (B-spline?) given the four control points
I'm trying to use R to determine the quality of a cubic Bezier curve
approximation of an elliptical arc. I know the four control points
and I want to compute (x,y) coordinates of many points on the curve.
I can't find anything in either the base distribution or CRAN that
does this; all the spline-related packages seem to be about *fitting*
piecewise Bezier curves to a data set.
2006 Oct 27
1
(no subject)
Hi,
I have generated a profile likelihood for a parameter (x) and am
trying to get 95% confidence limits by calculating the two points
where the log likelihood (LogL) is 2 units less than the maximum
LogL. I would like to do this by linear interpolation and so I have
been trying to use the function approxfun which allows me to get a
function to calculate LogL for any value of x within
2004 Nov 10
2
cubic spline/smoother with nlme
Greetings, I would like to use a cubic spline
or smoother to model the fixed effects within
nlme. So far the only smoother I have been able
to get to run successfully in nlme is smooth().
I tried smooth.spline:
fixed=list(lKa~1,lCL~smooth.spline(BSA, df=3))
the error I got was the following.
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, : invalid
2010 Sep 26
1
Basis functions of cubic regression spline in mgcv
I have a question about the basis functions of cubic regression spline in
mgcv. Are there some ways I can get the exact forms of the basis functions
and the penalty matrix that are used in mgcv? Thanks in advance!
Yan
[[alternative HTML version deleted]]
2011 Oct 27
1
Fitting Maximums of data series with cubic spline
Hi Users,
I want to fit the maximums of a data series with a cubic spline. How do I
go about this in R.
I failed to figure out how I can use the mgcv library to do this.
Thanks
----------------------------
ZABLONE
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
2018 Mar 23
1
restricted cubic spline in FGR function
Dear Thomas,
I want to use evaluate effect of Age using restricted cubic form in the FGR function as
Fgr.crr <- FGR(Hist(time, event) ~ rcs(Age_years), data=dat)
It provides error. " Error in parse(text = termtext, keep.source = FALSE): .... 1: response ~ rcs(Age_years
Do I need to change any of the R code?
Regards
Amalraj Raja
The University of Aberdeen is a charity