Questions tagged [loess]

Local regression - a form of non-parametric regression.

Local regression - a form of non-parametric regression. Useful for scatter plot smoothing. See https://en.wikipedia.org/wiki/Local_regression

200 questions
5
votes
2 answers

How to smooth in Octave?

I'm trying to get a piece of MATLAB code to run in Octave, and I've come upon the line: xsm = smooth(x,0.03,'loess') which doesn't seem to have an octave equivalent. x is just an array of a few thousand real numbers. Is there any Octave code out…
John Lawrence Aspden
  • 17,124
  • 11
  • 67
  • 110
5
votes
1 answer

"loess" for time series with missing data

I have a problem using loess and loess.smooth with a time series with missing data. Both commands don't work with this toy data. x <- as.Date(c(1, 2, 4, 5, 6), origin="2010-1-1") y <- c(4, 8, 8, 28, 11) plot(x, y, ylim=c(1,30)) lines(loess(y ~ x),…
majom
  • 7,863
  • 7
  • 55
  • 88
4
votes
1 answer

Equivalent of span using geom_smooth() with "gam"

This is probably a very basic question but I haven't found an answer yet. Is there an equivalent to the span argument in the geom_smooth function when method = "gam"? I am not familiar with GAM's in general so I would appreciate any input on that. I…
b_surial
  • 512
  • 4
  • 14
4
votes
1 answer

Is there an implementation of loess in R with more than 3 parametric predictors or a trick to a similar effect?

Calling all experts on local regression and/or R! I have run into a limitation of the standard loess function in R and hope you have some advice. The current implementation supports only 1-4 predictors. Let me set out our application scenario to…
kreil
  • 43
  • 1
  • 4
4
votes
1 answer

How to plot regression or LOWESS lines over data in coplot

It is often helpful to plot a line (e.g., a fitted regression line or a non-parametric LOWESS line) over data. Likewise, when variables are confounded, it is often helpful to plot x1, y data stratified by x2. However, I can't quite figure out how…
gung - Reinstate Monica
  • 11,583
  • 7
  • 60
  • 79
4
votes
0 answers

LOESS smoothing - geom_smooth vs() loess()

I have some data which I would like to fit with a model. For this example we have been using LOESS smoothing (<1.000 observations). We applied LOESS smoothing using the geom_smooth() function from the ggplot package. So far, so good. The next step…
wptmdoorn
  • 160
  • 1
  • 12
4
votes
3 answers

How to make geom_smooth less dynamic

When generating smoothed plots with faceting in ggplot, if the range of the data changes from facet to facet the smoothing may acquire too many degress of freedom for the facets with less data. For example library(dplyr) library(ggplot2) #…
banbh
  • 1,331
  • 1
  • 13
  • 31
4
votes
3 answers

Shading confidence intervals in R - base R if possible

I am comparing two lines that were regressed using LOESS. I want to display the confidence intervals of the two lines clearly, and I am having some difficulties. I have tried using a variety of line types and colors, but the result is still to busy…
Corey
  • 405
  • 2
  • 6
  • 18
4
votes
1 answer

Prediction at a new value using lowess function in R

I am using lowess function to fit a regression between two variables x and y. Now I want to know the fitted value at a new value of x. For example, how do I find the fitted value at x=2.5 in the following example. I know loess can do that, but I…
JACKY88
  • 3,391
  • 5
  • 32
  • 48
4
votes
0 answers

Memory error when trying LOESS prediction with standard errors

If I try to predict standard errors using my LOESS model trained on 30000 observations I get a memory error saying Error: cannot allocate vector of size 6.7 Gb. However, I really need this for plotting. Sadly, I need to use LOESS with span=1 so…
pir
  • 5,513
  • 12
  • 63
  • 101
4
votes
1 answer

interpolate in a 3 dimensional spline in R

I would like to fit a surface to some values: x = 1:10 y = 10:1 z = sample(1:10,10) I would like to fun something like spline_function(z ~ x + y). The actual spline functions in R seem to take only x and y so that i cannot have a two dimensional x…
Alex
  • 19,533
  • 37
  • 126
  • 195
4
votes
3 answers

loess method fails on data frame due to multiple series not having enough data points

I have a data frame is like this: dput(xx) structure(list(TimeStamp = structure(c(15705, 15706), class = "Date"), Host = c("Host1", "Host2"), OS = structure(c(1L, 1L), .Label = "solaris", class = "factor"), ID = structure(c(1L, 1L), .Label…
user1471980
  • 10,127
  • 48
  • 136
  • 235
3
votes
3 answers

Adding loess regresion line on a hexbin plot

I have been trying to find method to add a loess regression line on a hexbin plot. So far I do not have any success... Any suggestions? My code is as follow: bin<-hexbin(Dataset$a, Dataset$b, xbins=40) plot(bin, main="Hexagonal Binning", xlab…
Chet
  • 79
  • 1
  • 7
3
votes
1 answer

LOESS confidence intervals excessively narrow in qqplot2

I'm having some trouble understanding how confidence intervals are calculated in ggplot2 while using LOESS smoothing. From a few other threads, my understanding is that ggplot2 uses t-intervals calculated based on regression standard errors, i.e.,…
Jon
  • 33
  • 4
3
votes
4 answers

Seasonal-Trend-Loess Method for Time Series in Python

Does anyone know if there is a Python-based procedure to decompose time series utilizing STL (Seasonal-Trend-Loess) method? I saw references to a wrapper program to call the stl function in R, but I found that to be unstable and cumbersome from the…
Toly
  • 2,981
  • 8
  • 25
  • 35
1 2
3
13 14