spline Questions

1

I'm trying to make a model for a very simple data set using spline regression but so far I couldn't find any Python implementation that lets me choose knots position. The picture below shows where ...
Diachronic asked 1/2, 2019 at 15:2

3

I am trying to fit a cubic spline to a given set of points. My points are not ordered. I CANNOT sort or reorder the points, since I need that information. But since the function scipy.interpolate....
Macule asked 27/6, 2013 at 16:15

1

I would like to display a plot created by geom_smooth() but it is important for me to be able to describe how the plot was created. I can see from the documentation when n >= 1000, gam is used as...
Soldier asked 28/11, 2016 at 21:56

1

When creating a spline chart, it is getting loops inside the chart and some portions are going beyond the chart panel. Please find the below code ChartView { title: "Spline" anchors.fill: pare...
Hawsepipe asked 30/12, 2018 at 15:12

2

Solved

I'm trying to make a bumps chart (like parallel coordinates but with an ordinal x-axis) to show ranking over time. I can make a straight-line chart very easily: library(ggplot2) set.seed(47) df...
Pushed asked 4/5, 2017 at 0:19

7

Question: How do you fit a curve to points on a plane if they aren't single valued? For the example shown, how would one fit a curve (like the black one) to the noisy blue data? It's similar to sp...
Cotenant asked 14/6, 2009 at 23:44

1

Solved

I am on the lookout for (an ideally inbuilt) function in Matlab that calculates a B spline basis matrix the same way as in R, e.g. for a spline basis with 20 equally spaced knots of degree 3, I wou...
Hengelo asked 23/7, 2018 at 9:18

1

Solved

Take a data frame that looks like this and contains data for some dates in 2005 and a measurement at each date. df <- data.frame("date" = c('2005-04-04','2005-04-19', '2005-04-26', '2005-05-05...
Banka asked 19/7, 2018 at 13:40

4

Solved

Suppose I want to approximate a half-cosine curve in SVG using bezier paths. The half cosine should look like this: and runs from [x0,y0] (the left-hand control point) to [x1,y1] (the right-hand...
Medellin asked 12/3, 2015 at 23:46

1

Solved

As I was working out how Epi generates the basis for its spline functions (via the function Ns), I was a little confused by how it handles the detrend argument. When detrend=T I would have expecte...
Mulvey asked 5/6, 2017 at 23:49

2

Solved

I would like to calculate a third-degree polynomial that is defined by its function values and derivatives at specified points. https://en.wikipedia.org/wiki/Cubic_Hermite_spline I know of scipy'...
Excitor asked 15/4, 2016 at 10:10

3

Solved

I have data that are strictly increasing and would like to fit a smoothing spline that is monotonically increasing as well with the smooth.spline() function if possible, due to the ease of use of t...
Kristianson asked 22/8, 2014 at 13:17

2

I'm using scipy.interpolate.UnivariateSpline to smoothly interpolate a large amount of data. Works great. I get an object which acts like a function. Now I want to save the spline points for later...
Directorial asked 4/6, 2013 at 22:21

2

Solved

I have a signal which I want to remove the basline drift using the picewise cubic spline algorithm in MATLAB. d=load(file, '-mat'); t=1:length(a); xq1=1:0.01:length(a); p = pchip(t,a,xq1);...
Integrator asked 30/8, 2017 at 20:40

1

Solved

Take for instance the following one-knot, degree two, spline: library(splines) library(ISLR) fit.spline <- lm(wage~bs(age, knots=c(42), degree=2), data=Wage) summary(fit.spline) I see estimat...
Bury asked 24/6, 2017 at 17:40

2

Solved

I am interested in some disturbing behaviour of the lm function and the associated predict.lm function in R. The splines base package provides the function bs to generate b-spline expansions, which...
Hairworm asked 19/4, 2017 at 20:1

2

Solved

I am generating a graph of a cubic spline through a given set of data points: import matplotlib.pyplot as plt import numpy as np from scipy import interpolate x = np.array([1, 2, 4, 5]) # sort d...
Mew asked 17/4, 2017 at 19:41

2

How can I get a fast estimate for the distance between a point and a bicubic spline surface in Python? Is there an existing solution that I could leverage in SciPy, NumPy, or some other package? I...
Jerrylee asked 6/3, 2017 at 20:13

1

Solved

I have the following piece of code. It generates the 3-D cubic spline of the given 3-D function given in parametric form. I pretty much adapted this to my case using the online documentation for sp...
Inefficacious asked 15/1, 2017 at 8:5

1

Solved

Most people are probably familiar with bs from splines: library(splines) workingModel <- lm(mpg ~ factor(gear) + bs(wt, knots = 5) + hp, data = mtcars) bs(mtcars$wt, knots = 4) This uses a ...
Pisolite asked 12/1, 2017 at 21:20

1

Solved

I want to use function gam in mgcv packages: x <- seq(0,60, len =600) y <- seq(0,1, len=600) prova <- gam(y ~ s(x, bs='cr') can I set the number of knots in s()? and then can I kno...
Mcgray asked 15/10, 2016 at 7:54

2

I have a two-part question about how to use splines in pythonOCC. Firstly, I know that I can create a spline with array = [] array.append(gp_Pnt2d (0,0)) array.append(gp_Pnt2d (1,2)) array.appen...
Enfleurage asked 14/10, 2013 at 8:41

5

Solved

I'm trying to do something like the following (image extracted from wikipedia) #!/usr/bin/env python from scipy import interpolate import numpy as np import matplotlib.pyplot as plt # sampling ...
Drabble asked 2/2, 2015 at 13:40

3

Solved

Is there a library or function in python to compute Catmull-Rom spline from three points ? What I need in the end are the x,y coordinates of points along the spline, provided that they are always ...
Ima asked 9/8, 2009 at 14:0

1

Solved

Here is the code I ran fun <- function(x) {1 + 3*sin(4*pi*x-pi)} set.seed(1) num.samples <- 1000 x <- runif(num.samples) y <- fun(x) + rnorm(num.samples) * 1.5 fit <- smooth.spline(...
Cher asked 21/4, 2016 at 20:20

© 2022 - 2024 — McMap. All rights reserved.