Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Fit spline methodology/calculation?

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Fit spline methodology/calculation?

May 30, 2020 10:19 PM
(703 views)

Hi All,

Currently i manually analyse the data and generate splines (all done manually). I am trying to write a python code which can eventually run on the company server.

python's cubicspline function does not match the spline i normally generate in jmp (Analyze --> Fit Y vs X--> Flexible --> Fit spline --> Other --> Specify smoothness =0.1 check Standardize x (red)

When i am generating in Python (cubicsplines from scipy), i am getting more close to the red curve shown in the diagram.

I could not find the lambda (or equivalent) parameter in python's cubic spline function, and neither to standardize the data. i did try to standardize

(x_i-Mean(x))/Std dev (x)) the data by my own, but the curves were getting more weird.

Can some help point to what is the exact methodology/calculation used to generate these splines when we standardize the data. I have seen some post that point this is cubic splines, but i have not explanation how data is treated and spline generate when we use the standardized option.

A little far fetched, and not sure if this is the right forum, does someone know the another alternate python function that can generate matched splines?

Thank you!

3 REPLIES 3

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Fit spline methodology/calculation?

Created:
May 31, 2020 5:39 AM
| Last Modified: May 31, 2020 5:43 AM
(680 views)
| Posted in reply to message from deveshchugh 05-31-2020

I don't see how understanding JMP smoothers will help you with your problem with the Python library function.

The Scipy.org on-line documentation indicates that the optional *bc_type* argument in the `scipy.interpolate.`

`CubicSpline`

(*x*, *y*, *axis=0*, *bc_type='not-a-knot'*, *extrapolate=None*) call is used to control the construction of the spline model. There is no argument corresponding to the JMP lambda argument that you can use to control the fit.

Learn it once, use it forever!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Fit spline methodology/calculation?

I was hoping, i could write a code to plot it using own code, rather than using Python library function. Is additional documentation available somewhere?

Thank you!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: Fit spline methodology/calculation?

There are many kinds of splines and each kind usually has more than one method or implementation. I suggest that you search the vast literature about spline models if you are going to write your own code. For example, this chapter from a high level computer science course at Clemson University provides an overview of splines used in computer graphics. You might also examine the open source code such as available in Python or R for spline models that you like to learn about how to write such code.

Please see these references if you want to implement your own version of the cubic spline interpolating functions in the Bivariate platform:

- Reinsch, C. H. (1967). “Smoothing by Spline Functions.” Numerische Mathematik 10:177–183.
- Eubank, R. L. (1999). Nonparametric Regression and Spline Smoothing. 2nd ed. Boca Raton, Florida: CRC.

Learn it once, use it forever!

Article Labels

There are no labels assigned to this post.