Displaying 2 results from an estimated 2 matches for "xextrap".
Did you mean:
extrap
2006 Apr 05
1
predict.smooth.spline.fit and Recall() (Was: Re: Return function from function and Recall())
...:10
> y <- 1:10 + rnorm(length(x))
>
> # Estimate predictor function
> fcn <- getPredictor(x,y)
>
> # No extrapolation => no Recall()
> ypred <- fcn(x)
> print(ypred)
> # Gives: # [1] 2.325181 2.756166 ...
>
> # With extrapolation => Recall()
> xextrap <- c(0,x)
> ypred <- fcn(xextrap)
> # Gives: # Error in Recall(object, xrange) : couldn't find
> # function "predict.smooth.spline.fit"
>
> To see what's the function looks like, do
>
> pfcn <- getAnywhere("predict.smooth.spline.fit")$obj[[...
2006 Apr 05
0
Return function from function and Recall()
....) predict(sp$fit, x, ...)$y
}
# Simulate data
x <- 1:10
y <- 1:10 + rnorm(length(x))
# Estimate predictor function
fcn <- getPredictor(x,y)
# No extrapolation => no Recall()
ypred <- fcn(x)
print(ypred)
# Gives: # [1] 2.325181 2.756166 ...
# With extrapolation => Recall()
xextrap <- c(0,x)
ypred <- fcn(xextrap)
# Gives: # Error in Recall(object, xrange) : couldn't find
# function "predict.smooth.spline.fit"
To see what's the function looks like, do
pfcn <- getAnywhere("predict.smooth.spline.fit")$obj[[2]]
page(pfcn)
A workaround is t...