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
9
votes
1 answer

R circular LOESS function over 24 hours (a day)

I have data for free parking slots over hours and days. Here's a random sample of 100. sl <- list(EmptySlots = c(7, 6, 20, 5, 16, 20, 24, 5, 24, 24, 15, 11, 8, 6, 13, 2, 21, 6, 1, 6, 9, 1, 8, 0, 20, 9, 20, 11, 22, 24, 1, 2, 12, 6, 8, 2, 23, 18, 8,…
Rico
  • 1,998
  • 3
  • 24
  • 46
8
votes
0 answers

Multicore ggplot2

I am trying to analyze a very large dataset (over 10 million rows; OK, it's big in my field). I'm trying to generate a smoothed regression plot using the following command: ggplot(dataset, aes(x=IV, y=DV)) + geom_smooth(method="loess") This has…
Sean C. Rife
  • 103
  • 7
8
votes
1 answer

How to plot weighted loess smoothing in ggplot2?

How do I add a loess-smoothing which respects another column as weights? Let's say I have the following data.frame: library(ggplot2) df <- data.frame(x=seq(1:21)) df$y <- df$x*0.3 + 10 df$weight <- 10 df[6,] <- c(6, 0.1, 1) …
JerryWho
  • 3,060
  • 6
  • 27
  • 49
7
votes
2 answers

Error using `loess.smooth` but not `loess` or `lowess`

I need to smooth some simulated data, but occasionally run into problems when the simulated ordinates to be smoothed are mostly the same value. Here is a small reproducible example of the simplest case. > x <- 0:50 > y <- rep(0,51) >…
Sandy
  • 135
  • 2
  • 6
7
votes
1 answer

LOESS warnings/errors related to span in R

I am running a LOESS regression in R and have come across warnings with some of my smaller data sets. Warning messages: 1: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   pseudoinverse used at -2703.9 2: In…
Corey
  • 405
  • 2
  • 6
  • 18
7
votes
3 answers

Remove values outside Loess curve limits

I am looking to remove outliers before I apply a model. I am using a Loess curve to delimit the trend line and have set outlier limits. I would like to remove the rows that are outside the defined limits. Besides doing this with a custom function…
Cyrille
  • 3,427
  • 1
  • 30
  • 32
6
votes
1 answer

Not possible to load skmisc.loess in python

I am using the package plotnine to make ggplot's. In this context I wanted to use "loess". The package gives an error and says: "For loess smoothing, install 'scikit-misc'". I installed it but I still receive this error. It seems that the following…
user15568232
6
votes
1 answer

Understanding loess errors in R

I'm trying to fit a model using loess, and I'm getting errors such as "pseudoinverse used at 3", "neighborhood radius 1", and "reciprocal condition number 0". Here's a MWE: x = 1:19 y = c(NA,71.5,53.1,53.9,55.9,54.9,60.5,NA,NA,NA …
random_forest_fanatic
  • 1,232
  • 1
  • 12
  • 30
6
votes
1 answer

standard errors for loess in R

I am attempting to find a reference which explains how one computes standard errors for local polynomial regression? Specifically, in R one can use the loess function to get a model object and then use the predict function to retrieve standard…
Alex
  • 19,533
  • 37
  • 126
  • 195
6
votes
1 answer

Applying a loess smoothing to a time series

I would like to smooth a time curve, that I have plotted, by applying a loess function, but I can't get it to work. An example: mydat <- runif(50) day1 <- as.POSIXct("2012-07-13", tz = "UTC") day2 <- day1 + 49*3600*24 pdays <- seq(day1, day2, by =…
Sisse
  • 291
  • 1
  • 4
  • 14
6
votes
1 answer

loess line not plotting correctly

I'm having trouble fitting a loess smooth plus confidence limits to a scatterplot of residuals. My model is height ~ weight + chest circumference. To check linearity of chest circumference, I've fitted a model without chest circumference (i.e.…
MatW
  • 305
  • 3
  • 7
5
votes
2 answers

ImportError: cannot import name 'STL' from 'statsmodels.tsa.seasonal'

I have this issue now, I cannot import STL from statsmodels. I've tried to uninstall statsmodels as it was recommended somewhere with a similar issue but it is not possible, at least the way I do it: !pip uninstall statsmodels - NOT working.
Yana
  • 785
  • 8
  • 23
5
votes
2 answers

Set limits on loess line confidence interval shading in ggplot

I am having a problem with loess lines displaying properly in ggplot. I have several variables, none of which can go below zero e.g. heights, weights and abundances. I am trying to plot this data in ggplot with a loess line. Using some made up…
James
  • 1,164
  • 2
  • 15
  • 36
5
votes
1 answer

No output displayed from for loop

I'm trying to write a for loop to repeat (c) and (d) 100 times. I want to print the estimates of TRS-TRS0 at each iteration of the for loop. It should stop algorithm if it is small (say 1/10000). Finally I want it to create a plot in which each of…
Tarzan
  • 124
  • 1
  • 2
  • 14
5
votes
1 answer

Programming language R: meaning of 'weights' parameter in library method 'loess'

I use the library method loess of the R programming language for non parametric data fitting. The dataset is two-dimensional. I have not found any proper documentation of the method parameter weights. My data points are normally distributed random…
sperber
  • 661
  • 6
  • 20
1
2
3
13 14