Displaying 20 results from an estimated 10000 matches similar to: "Application of results from smooth.spline outside R"
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 ...
2006 Apr 05
1
page() (Was: Re: predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall()))
Here I think S3 dispatch is very natural. Try the following:
page <- function(x, method = c("dput", "print"), ...) UseMethod("page")
page.getAnywhere <- function(x, ..., idx=NULL) {
name <- x$name;
objects <- x$obj;
if (length(objects) == 0)
stop("no object named '", name, "' was found");
if (is.null(idx)) {
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
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
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.
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] -
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
>
>
>
> -------- ???????????? ?????????
> --------
> ?? ????:
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.
--------
>
2009 Aug 12
3
Obtaining the value of x at a given value of y in a smooth.spline object
I have some data fit to a smooth.spline object as follows: (x=vector of data
for the predictor variable, y=vector of data for the response variable)
fit <- smooth.spline(x,y)
Now, given a spline fit point y_new, I want to be able to find out what
value of x_new yielded this fit value. How to do so?
(This problem is the inverse of the predict.smooth.spline function, which
takes x_new as input
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
2008 Jul 17
1
smooth.spline
I like what smooth.spline does but I am unclear on the output. I can see from the documentation that there are fit.coef but I am unclear what those coeficients are applied to.With spline I understand the "noraml" coefficients applied to a cubic polynomial. But these coefficients I am not sure how to interpret. If I had a description of the algorithm maybe I could figure it out but as it
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
2006 Jun 24
3
getting the smoother matrix from smooth.spline
Can anyone tell me the trick for obtaining the smoother matrix from smooth.spline when there are non-unique values for x. I have the following code but, of course, it only works when all values of x are unique.
## get the smoother matrix (x having unique values
smooth.matrix = function(x, df){
n = length(x);
A = matrix(0, n, n);
for(i in 1:n){
y = rep(0, n); y[i]=1;
yi =
2003 Sep 24
1
getAnywhere (PR#4275)
'getAnywhere' is not reporting methods when there are periods in the class name or the generic name
(in R-devel).
> getAnywhere( 'predict.loess')
A single object matching 'predict.loess' was found
It was found in the following places
registered S3 method for predict from namespace modreg
namespace:modreg
with value
<<...>>
> getAnywhere(
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
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
2003 Apr 08
5
Help on smooth.spline?
Hey, R-listers
I was recommended to try using smooth.spline function
for estimating 2-Dimensinal curve given a data set.
So will you please tell me where to get this R function?
Or which package provides this function?
Thanks for your point.
Fred
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