Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

QuantileRegression

Guides

  • Quantile regression

Tech Notes

  • Quantile regression 3D examples
  • Quantile regression over weather time series
  • Unit tests

Symbols

  • NURBSBasis
  • QuantileEnvelope
  • QuantileEnvelopeRegion
  • QuantileRegressionFit
  • QuantileRegression
AntonAntonov`QuantileRegression`
QuantileRegression
​
QuantileRegression
[data,ks_List,probs]
finds the regression quantiles corresponding to the probabilities
probs
for a list of
data
as linear combinations of splines generated over the knots ks.
With
the signature
​
​
QuantileRegression
[data,n_Integer,probs]
n equally spaced knots are generated. The order of the splines is specified with the option
InterpolationOrder
.
​
Details and Options

Examples  
(19)
Basic Examples  
(1)
Make a random signal:
In[1]:=
SeedRandom[23];​​n=200;​​randData=Transpose[{Range[n],RandomReal[{0,100.},n]}];
Compute Quantile Regression with
5
knots for the probabilities
0.25
and
0.75
:
In[2]:=
qFuncs=
QuantileRegression
[randData,5,{0.25,0.75}];
Here are the formulas of the obtained regression quantiles:
In[3]:=
Simplify/@Through[qFuncs[x]]
Out[3]=

0.
x>200||x<1
3818.78-70.5999x+0.433163
2
x
-0.000875772
3
x
801
5
<x≤200
4099.05-75.8484x+0.465925
2
x
-0.000943942
3
x
5x801
84.2683-0.501637x-0.00576232
2
x
+0.0000412732
3
x
403
5
<x≤
602
5
-62.9078+4.97638x-0.0737278
2
x
+0.000322355
3
x
204
5
≤x≤
403
5
34.9017-2.21549x+0.102544
2
x
-0.00111777
3
x
1≤x<
204
5
110.681-1.15976x-0.000296216
2
x
+0.0000261401
3
x
True
,
0.
x>200||x<1
506.187-14.1371x+0.14281
2
x
-0.000456464
3
x
403
5
≤x<
602
5
983.69-15.2439x+0.0846418
2
x
-0.000155264
3
x
801
5
<x≤200
59.6756+1.19519x-0.0158668
2
x
-0.0000579967
3
x
1≤x<
204
5
-759.529+17.4007x-0.119132
2
x
+0.000268735
3
x
602
5
≤x≤
801
5
24.2224+3.80204x-0.0797601
2
x
+0.000464008
3
x
True

Here is a plot of the original data and the obtained regression quantiles:
In[4]:=
ListLinePlot[{randData,qFuncs〚1〛/@randData〚All,1〛,qFuncs〚2〛/@randData〚All,1〛},PlotLegends{"data",0.25`,0.75`},PlotStyle{Thin,Thick,Thick},PlotTheme"Detailed"]
Out[4]=
data
0.25
0.75
Find the fraction of the data points that are under the second regression quantile:
In[5]:=
Length[Select[randData,#〚2〛<qFuncs〚2〛[#〚1〛]&]]/Length[randData]//N
Out[5]=
0.75
The obtained fraction is close to the second probability,
0.75
, given to
QuantileRegression
.
Scope  
(4)

Options  
(2)

Applications  
(4)

Properties & Relations  
(2)

Possible Issues  
(5)

Neat Examples  
(1)

SeeAlso
QuantileRegressionFit
 
▪
Fit
 
▪
BSplineBasis
RelatedGuides
▪
Quantile regression
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com