Displaying 20 results from an estimated 80000 matches similar to: "smooth.spline() fucntion"
2011 Aug 25
3
Application of results from smooth.spline outside R
Hi,
I want to use the result from smooth.spline outside R.
I take my data ,which is 180 point stored in x and y
s <- smooth(x,y)
I can know use to e.g. find the interpolated value at e.g. x=500
predict (s,500)
My problem is, that i don't know how to implement the predict function. I
have looked at literature, but i cannot connect the output of the
smooth.spline() to an actual spline
2001 Dec 13
1
Code for Hodrick-Prescott Filter: Special Case of smooth. spline?
I've had a play with this and, due to my own short-comings, remain none the
wiser.
In particular, I'm not sure what value of 'spar' is consistent with the
magic lambda=1/1600 for quarterly data.
I initially interpreted spar as lambda and tried setting spar=1/1600. This
results in almost no smoothing while spar=1600 causes an error. The
smooth.spline function seems to want
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
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
2012 Feb 15
1
smooth.spline() unique 'x' values error
Hello.
I'm getting an unexpected result when running smooth.spline(). Here is a simple example that replicates the error I'm getting:
> aa <- c(1, 2, 3, 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 13, 14)
> bb <- 1:length(aa)
> plot(aa, bb)
> smooth.spline(aa, bb)
Error in smooth.spline(aa, bb) : need at least four unique 'x' values
As you can see from the example, my
2009 Mar 28
1
Find inflection points using smooth.spline
Is there any way to identify or infer the inflection points in a smooth
spline object? I am doing a comparison of various methods of time-series
analysis (polynomial regression, spline smoothing, recursive partitioning)
and I am specifically interested in obtaining the julian dates associated
with the inflection points inferred by the various models.
Tyler
e.g.
2008 Jun 05
1
Smooth Spline
Hi,
I have three original curves as follows,
n<-seq(20,200,by=10)
t<-c(0.1138, 0.1639, 0.2051, 0.2473, 0.2890, 0.3304, 0.3827, 0.4075, 0.4618, 0.4944,
0.5209, 0.5562, 0.5935, 0.6197, 0.6523, 0.6771, 0.6984, 0.7209, 0.7453)
es<-c(0.3682, 0.4268, 0.5585, 0.6095, 0.7023, 0.7534, 0.8225, 0.8471, 0.8964, 0.9098, 0.9371, 0.9514, 0.9685, 0.9747, 0.9812, 0.9859, 0.9905, 0.9923, 0.9940)
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
>
>
>
> -------- ???????????? ?????????
> --------
> ?? ????:
2006 Apr 05
1
predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())
Hi,
forget about the below details. It is not related to the fact that
the function is returned from a function. Sorry about that. I've
been troubleshooting soo much I've been shoting over the target. Here
is a much smaller reproducible example:
x <- 1:10
y <- 1:10 + rnorm(length(x))
sp <- smooth.spline(x=x, y=y)
ypred <- predict(sp$fit, x)
# [1] 2.325181 2.756166 ...
2005 Apr 27
0
smooth.spline(): residuals(), fitted(),...
It has bothered me for quite some time that a smoothing spline
fit doesn't allow access to residuals or fitted values in
general, since after
fit <- smooth.spline(x,y, *)
the resulting fit$x is really equal to the unique (up to 1e-6
precision) sorted original x values and fit$yin (and $y) is accordingly.
There are several possible ways to implement the missing
feature. My current
2001 Apr 26
3
Installing smooth.spline command
Hello
I have installed R-0.90.1 on my Linux (Redhat 6.2) machine,
unfortunately I am not able to use a number of commands like e.g.
smooth.spline and predict.smooth.spline.
The error messages being given by is:
Error: Object "smooth.spline" not found
With the command library() I have checked or the libraries for the
smoothing functions are there, as shown below.
--------
>
2002 Jul 08
0
Hodrick-Prescott-Filter as smooth.spline
Could someone, please, write me, how to compute the spar-value for the
smooth.spline-routine to get the same HP-filtered time-series with a
parameter lambda for a function (see mail "Hodrick-Prescott-Filter
example" from ggrothendieck at yifan.net):
hpf <- function(y,lambda{
eye <- diag(length(y))
d <- diff(eye,d=2)
z <- solve(eye+lambda*crossprod(d),y)}
?
Second, is
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
2002 Feb 20
2
How to get the penalized log likelihood from smooth.spline()?
I use smooth.spline(x, y) in package modreg and I would like to get
value of penalized log likelihood and preferable also its two parts. To
make clear what I am asking for (and make sure that I am asking for the
right thing) I clarify my problem trying to use the same notation as in
help(smooth.spline):
I want to find the natural cubic spline f(x) such that
L(f) = \sum_{k=1}{n} w[k](y[k] -
2006 Sep 08
0
boundary constraints with smooth.spline
Hi R Community.
I would like to use smooth.spline to fit a set of data and constrain the
endpoints of the fit to have specific derivatives. I know this is
possible with cubic splines, but I can't figure out how to specify this
with arguments to the smooth.spline function. In general, is it possible
to specify a set of "knots" w/locations and derivatives to constrain the
fit? I
2009 Aug 26
1
increasing significant digits in smooth.spline function
Hello All
I have a very long vector of unique predictor values and 6 significant
digits setting for the smooth.spline rounds them off. Is there any way
of increasing the significant digits withour recompiling a lot if code
(simple editing and tham sourcing of "smooth.spline.r" function does not
work, probably due to presence of Fortan functional calls)?
Thank you very much in advance
2001 Jul 06
0
smooth.spline vs loess
Hello R-users,
I would like to know of anybody have some references for documentation
about smooth.spline() and loess() functions of R. As far as I know the
loess() function is more robust, so I would like to know if there is any
robust version of smooth.spline.
Thank you,
Raphael
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read
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
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
2009 Apr 04
2
Help using smooth.spline with zoo object
Can someone please show me how to smooth time series data that I have in the form of a zoo object?
I have a monthly economies series and all I really need is to see a less jagged line when I plot it.
If I do something like
s <- smooth.spline(d.zoo$Y, spar = 0.2)
plot(predict(s,index(d.zoo)), xlab = "Year")
# not defined for Date objects
and if I do something like