loess

Understanding loess errors in R

核能气质少年 提交于 2019-12-14 03:46:13
问题 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 ,NA,NA,178.0,180.9,180.9,NA,NA,192.5,194.7) fit = loess(formula = y ~ x, control = loess.control(surface = "direct"), span = 0.3, degree = 1) x2 = seq(0,20,.1) library(ggplot2) qplot(x=x2 ,y=predict(fit, newdata=data.frame(x=x2)) ,geom="line") I realize I can fix

How to apply loess.smoothing to both plot and then extract points?

百般思念 提交于 2019-12-12 02:32:42
问题 I am trying to apply loess smoothing to a scatterplot (i.e. between two quantitative variables). I would like to plot where the loess smoothing occurs in the scatterplot, and then would like to extract only the data points in the scatterplot that are above that smoothing. For instance, if this is my scatterplot: qplot(mpg, cyl, data=mtcars) And I wanted to superimpose the smoother: qplot(mpg, wt, data=mtcars) + with(mtcars, loess.smooth(mpg, wt)) This results in the error: "Don't know how to

scatter plot with loess line, loess to not show line in a given region

独自空忆成欢 提交于 2019-12-11 10:43:52
问题 I plot here values over length for a chromosome The middle region without points contains no data and should not get a loess line. How can I modify my code to stop the loess line over this region? The data is continuous but I could add lines to mark the blank region with some special value or add a column with a label?? but how to use this in the command? my current command: library(IDPmisc) # plot settings (edit here) spanv<-0.05 pointcol1="#E69F00" pointcol2="#56B4E9" pointcol3="#009E73"

Setting an upper bound of 0 on a 3d loess smoothing with negative values in R

血红的双手。 提交于 2019-12-08 17:15:40
问题 I have a bit of a bizarre question, but hoping someone can help me. I am attempting to create a surface plot of the bottom of a lake and then add some points showing plant frequency for a visual of where aquatic plants are occurring throughout the lake. Right now I am working on creating the surface plot in both scatterplot3d and wireframe using the scatterplot3d and lattice packages, respectively, in R. In order to achieve the type of plot I am interested in I have converted the depths to

Residuals calculation in series with few points (max 20)

别说谁变了你拦得住时间么 提交于 2019-12-08 13:52:46
问题 I'm using loess to calculate the residuals. I expect for the following (small series) to find a big value of the residual for the third point y <- c(5814, 6083, 17764, 6110, 6556) x <- c(14564, 14719, 14753, 14754, 15086) > residuals(loess(y ~ x)) 1 2 3 4 5 2.728484e-12 -9.094947e-13 3.637979e-12 3.637979e-12 0.000000e+00 In particular, loess gives the following output: > loess(y ~ x) Call: loess(formula = y ~ x) Number of Observations: 5 Equivalent Number of Parameters: 5 Residual Standard

Jittering effects on LOESS

淺唱寂寞╮ 提交于 2019-12-08 06:11:22
问题 I asked a previous question regarding LOESS errors and warnings : LOESS warnings/errors related to span in R . The issue related to warnings like these that occurred while trying to run a LOESS regression on my data set. Warning messages: 1: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   pseudoinverse used at -2703.9 2: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   neighborhood radius 796.09 3: In simpleLoess(y, x, w, span, degree =

Predicting via Lowess in R (OR reconciling Loess & Lowess)

假装没事ソ 提交于 2019-12-08 04:11:18
问题 I'm trying to interpolate/locally extrapolate some salary data to fill out a data set. Here's the data set and a plot of the available data: experience salary 1: 1 21878.67 2: 2 23401.33 3: 3 23705.00 4: 4 24260.00 5: 5 25758.60 6: 6 26763.40 7: 7 27920.00 8: 8 28600.00 9: 9 28820.00 10: 10 32600.00 11: 12 30650.00 12: 14 32600.00 13: 15 32600.00 14: 16 37700.00 15: 17 33380.00 16: 20 36784.33 17: 23 35600.00 18: 25 33590.00 19: 30 32600.00 20: 31 33920.00 21: 35 32600.00 Given the clear

LOESS warnings/errors related to span in R

↘锁芯ラ 提交于 2019-12-07 17:33:53
问题 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 simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   neighborhood radius 796.09 3: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   reciprocal condition number  0 4: In simpleLoess(y, x, w, span, degree = degree,

LOESS warnings/errors related to span in R

柔情痞子 提交于 2019-12-06 04:11:54
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 simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   neighborhood radius 796.09 3: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   reciprocal condition number  0 4: In simpleLoess(y, x, w, span, degree = degree, parametric = parametric,  :   There are other near singularities as well. 6.1623e+005 These errors are

Problems displaying LOESS regression line and confidence interval

给你一囗甜甜゛ 提交于 2019-12-04 02:13:51
问题 I am having some issues trying to compete a LOESS regression with a data set. I have been able to properly create the line, but I am unable to get it to plot correctly. I ran through the data like this. animals.lo <- loess(X15p5 ~ Period, animals, weights = n.15p5) animals.lo summary(animals.lo) plot(X15p5~ Period, animals) lines(animals$X15p5, animals.lo, col="red") At this point I received an error "Error in xy.coords(x, y) : 'x' and 'y' lengths differ" I searched around and read that this