Fit quality

Binder

Summary: this tutorial shows how to assess fit quality with FSharp.Stats

Table of contents

Linear regression report

Consider this simple linear regression:

open FSharp.Stats
open FSharp.Stats.Fitting
open LinearRegression.OrdinaryLeastSquares
open GoodnessOfFit.OrdinaryLeastSquares.Linear.Univariable

//data sorted by x values
let x = vector [|1. .. 10.|]
let y = vector [|4.;10.;9.;7.;13.;17.;16.;23.;15.;30.|]

///linear regression line fitting function
let coefficients = Linear.Univariable.coefficient x y
let fitFunc = Linear.Univariable.fit coefficients

let fittedValues = x |> Seq.map fitFunc

open Plotly.NET

let myAxis title = Axis.LinearAxis.init(Title=title,Mirror=StyleParam.Mirror.All,Ticks=StyleParam.TickOptions.Inside,Showgrid=false,Showline=true,Zeroline=false)

let chart =
    [
    Chart.Point(x,y) |> Chart.withTraceName "raw"
    Chart.Line(fittedValues|> Seq.mapi (fun i y -> x.[i],y)) |> Chart.withTraceName "fit"
    ]
    |> Chart.Combine
    |> Chart.withX_Axis(myAxis "")
    |> Chart.withY_Axis(myAxis "")

Various quality parameters can be accessed via the GoodnessOfFit module:

//In the following some quality/interval/significance values are computed:
let sos         = GoodnessOfFit.calculateSumOfSquares fitFunc x y
let n           = sos.Count
let meanX       = sos.MeanX
let meanY       = sos.MeanY
let slope       = coefficients.[1]
let intercept   = coefficients.[0]
//coefficient of determination
let rSq        = GoodnessOfFit.calculateDeterminationFromValue y fittedValues
//adjusted coefficient of determination; variable=number of coefficints (excluding intercept)
let rSqAdj    = GoodnessOfFit.calculateDeterminationAdj y fittedValues 1
//pearson correlation coefficient
let r           = sqrt rSq
//total sum of squares
let ssTotal     = sos.Total
//regression sum of squares
let ssReg       = sos.Regression
//residual sum of squares
let ssResidual  = sos.Error
//sum of squares xx
let ssxx        = sos.SSxx
//sum of products xy
let ssxy        = sos.SSxy
//standard error of the regression slope
let stdErrSlope = GoodnessOfFit.standardErrorSlope sos 
//standard error of the regression intercept
let stdErrIntercept = GoodnessOfFit.standardErrorIntercept sos 
//standard error of the estimate (S)
let stdErrEstimate  = GoodnessOfFit.standardErrorEstimate sos 
//confidence intervals (df = n-#coefficients; a=5%)
let criticalT   = Distributions.Continuous.getCriticalTValue (n - 2.) 0.05 Distributions.Continuous.TwoTailed
let lowerS      = slope - criticalT * stdErrSlope
let upperS      = slope + criticalT * stdErrSlope
let lowerI      = intercept - criticalT * stdErrIntercept
let upperI      = intercept + criticalT * stdErrIntercept
//significance tests
let testSlope   = GoodnessOfFit.ttestSlope slope sos
let testInterc  = GoodnessOfFit.ttestIntercept intercept sos

  
let outputTable = 
    let header = ["<b>ParameterName</b>";"Value";"StandardError (SE Coeff)"]
    let rows = 
        let print f = sprintf "%.3f" f
        [
        ["n";               sprintf "%.0f" n;       "-"] 
        ["meanX";           print meanX;            "-"]
        ["meanY";           print meanY;            "-"]
        ["slope";           print slope;            print stdErrSlope]
        ["intercept" ;      print intercept;        print stdErrIntercept]
        ["<b>Goodness of fit</b>";"";               ""]
        ["SS_total";        print ssTotal;          ""]
        ["SS_regression";   print ssReg;            ""]
        ["SS_residual";     print ssResidual;       ""]
        ["r (pearson cor. coef.";               print r;                ""]
        ["r_squared";       print rSq;             ""]      
        ["r_squared_adj";   print rSqAdj;         ""]
        ["SE Estimate";     print stdErrEstimate;   ""]   
        ["<b>95% Confidence interval</b>";"<b>min</b>";    "<b>max</b>"]
        ["slope";           print lowerS;           print upperS]
        ["intercept";       print lowerI;           print upperI]
        ["<b>significances</b>";"";                 ""]
        ["slope p Value";   print testSlope.PValue; ""]
        ["intercept p Value";print testInterc.PValue;""]
        ]
    Chart.Table(
        header, 
        rows, 
        ColorHeader = "#deebf7",
        ColorCells  = ["#deebf7";"white";"white"],
        AlignCells  = [StyleParam.HorizontalAlign.Left;StyleParam.HorizontalAlign.Center]
        )
    |> Chart.withTitle "Regression report"
    

Confidence bands

A confidence band shows the uncertainty of an curve estimate. It widens towards the periphery.

A prediction band shows the uncertainty of a value of a new data point.

In both cases homoscedasticity is assumed.

//data sorted by x values
let xData = vector [|1. .. 10.|]
let yData = vector [|4.;10.;9.;7.;13.;17.;16.;23.;15.;30.|]
//let xData = vector [|1.47;1.50;1.52;1.55;1.57;1.60;1.63;1.65;1.68;1.70;1.73;1.75;1.78;1.80;1.83|]
//let yData = vector [|52.21;53.12;54.48;55.84;57.20;58.57;59.93;61.29;63.11;64.47;66.28;68.10;69.92;72.19;74.46|]
let values = Seq.zip xData yData

///linear regression line fitting function
let coeffs = Linear.Univariable.coefficient xData yData
let fit = Linear.Univariable.fit coeffs

let fitValues = xData |> Seq.map (fun xi -> xi,(fit xi))

///calculate confidence band errors for every x value
let confidence = 
    xData
    |> Vector.map (calculateConfidenceBandError xData yData 0.95)

///lower and upper bounds of the 95% confidence band sorted according to x values
let (lower,upper) = 
    xData 
    |> Seq.mapi (fun i xi -> (fit xi) - confidence.[i],(fit xi) + confidence.[i]) 
    |> Seq.unzip

let rangePlot = 
    [
    Chart.Range (
        fitValues,
        lower,
        upper,
        mode = StyleParam.Mode.Lines,
        Color = Colors.toWebColor Colors.Table.Office.blue,
        RangeColor = Colors.toWebColor Colors.Table.Office.lightBlue)
        |> Chart.withTraceName "CI95"
    Chart.Point (values,Color="#000000") |> Chart.withTraceName "raw"
    ]
    |> Chart.Combine
    |> Chart.withY_Axis (myAxis "")
    |> Chart.withX_Axis (myAxis "")
    |> Chart.withTitle "Confidence band 95%"

The confidence band calculation is not limited to the original x values. To get a smooth confidence band, introduce additional x values in small steps.

let newXValues =
    vector [|1. .. 0.5 .. 11.|]

///calculate confidence band errors for every x value
let newConfidence = 
    newXValues
    |> Vector.map (calculateConfidenceBandError xData yData 0.95)

///lower and upper bounds of the 95% confidence band sorted according to x values
let (newLower,newUpper) = 
    newXValues 
    |> Seq.mapi (fun i xi -> (fit xi) - newConfidence.[i],(fit xi) + newConfidence.[i]) 
    |> Seq.unzip

let linePlot =
    [
    Chart.Point(xData,yData) |> Chart.withTraceName (sprintf "%.2f+%.4fx" coeffs.[0] coeffs.[1])
    Chart.Line(fitValues) |> Chart.withTraceName "linear regression"
    Chart.Line(newXValues,newLower,Color= "#C1C1C1") |> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "lower"
    Chart.Line(newXValues,newUpper,Color= "#C1C1C1") |> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "upper"
    ]
    |> Chart.Combine
    |> Chart.withX_Axis(myAxis "")
    |> Chart.withY_Axis(myAxis "")
    |> Chart.withTitle "Confidence band 95%"

Prediction bands

let predictionXValues = vector [|1. .. 0.5 .. 15.|]
///calculate preditcion band errors for every x value
let prediction = 
    predictionXValues
    |> Vector.map (calculatePredictionBandError xData yData 0.95)

///lower and upper bounds of the 95% prediction band sorted according to x values
let (pLower,pUpper) = 
    predictionXValues 
    |> Seq.mapi (fun i xi -> (fit xi) - prediction.[i],(fit xi) + prediction.[i]) 
    |> Seq.unzip

let predictionPlot =
    [
    Chart.Point(xData,yData) |> Chart.withTraceName (sprintf "%.2f+%.4fx" coeffs.[0] coeffs.[1])
    Chart.Line(fitValues) |> Chart.withTraceName "linear regression"
    Chart.Line(predictionXValues,pLower,Color= "#C1C1C1") |> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "pLower"
    Chart.Line(predictionXValues,pUpper,Color= "#C1C1C1") |> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "pUpper"
    ]
    |> Chart.Combine
    |> Chart.withX_Axis(myAxis "")
    |> Chart.withY_Axis(myAxis "")
    |> Chart.withTitle "Prediction band"

Cook's distance

Leverage: Leverage describes the potential impact of data points regarding their regression line. Points that show a great dependent-variable-distance to all other points, have a higher potential to distort the regression line coefficients (high-leverage points).

Cooks distance (D) is a measure to describe the influence of each data point to the regression line. If D is low, the influence is low, while a high D indicates an 'influential observation' that is worth taking a closer look. Cooks distance is a mixture of the residual sum of squares at the particular point and its leverage.

A linear threshold is arbitrarily defined by either 1, 4/n, or 3*mean(D). Because outliers have a strong influence to D of all other points as well, the thresholds should not be applied without checking the issues by eye.

open LinearRegression.OrdinaryLeastSquares.Linear

let xD = vector [|1. .. 10.|]
let yD = vector [|4.;6.;9.;7.;13.;17.;16.;23.;14.;26.|]

let cooksDistance = Univariable.cooksDistance xD yD

let nD         = float xD.Length
let meanCook   = Seq.mean cooksDistance
let threshold1 = 1.
let threshold2 = 4. / nD
let threshold3 = 3. * meanCook

let cook = 
    [
    Chart.Column (Seq.zip xD cooksDistance) |> Chart.withTraceName "cook's distance"
    Chart.Line([0.5,threshold1;10.5,threshold1])|> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "t=1"
    Chart.Line([0.5,threshold2;10.5,threshold2])|> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "t=4/n"
    Chart.Line([0.5,threshold3;10.5,threshold3])|> Chart.withLineStyle(Dash=StyleParam.DrawingStyle.Dash)|> Chart.withTraceName "t=3*mean(D)"
    ]
    |> Chart.Combine
    |> Chart.withX_Axis(myAxis "x")
    |> Chart.withY_Axis(myAxis "cook's distance")
    |> fun l -> Chart.Stack 1 [(Chart.Point(xD,yD) |> Chart.withTraceName "raw");l]
    |> Chart.withX_Axis(myAxis "")
    |> Chart.withY_Axis(myAxis "")
    |> Chart.withTitle "Cook's distance"
    |> Chart.withSize (650.,650.)
Multiple items
namespace FSharp

--------------------
namespace Microsoft.FSharp
namespace FSharp.Stats
namespace FSharp.Stats.Fitting
module LinearRegression

from FSharp.Stats.Fitting
module OrdinaryLeastSquares

from FSharp.Stats.Fitting.LinearRegression
module GoodnessOfFit

from FSharp.Stats.Fitting
module OrdinaryLeastSquares

from FSharp.Stats.Fitting.GoodnessOfFit
module Linear

from FSharp.Stats.Fitting.GoodnessOfFit.OrdinaryLeastSquares
module Univariable

from FSharp.Stats.Fitting.GoodnessOfFit.OrdinaryLeastSquares.Linear
val x : Vector<float>
Multiple items
val vector : l:seq<float> -> Vector<float>

--------------------
type vector = Vector<float>
val y : Vector<float>
val coefficients : Vector<float>
linear regression line fitting function
module Linear

from FSharp.Stats.Fitting.LinearRegression.OrdinaryLeastSquares
module Univariable

from FSharp.Stats.Fitting.LinearRegression.OrdinaryLeastSquares.Linear
val coefficient : xData:Vector<float> -> yData:Vector<float> -> Vector<float>
val fitFunc : (float -> float)
val fit : coef:Vector<float> -> x:float -> float
val fittedValues : seq<float>
Multiple items
module Seq

from FSharp.Stats

--------------------
module Seq

from Microsoft.FSharp.Collections
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>
namespace Plotly
namespace Plotly.NET
val myAxis : title:string -> Axis.LinearAxis
val title : string
module Axis

from Plotly.NET
Multiple items
type LinearAxis =
  inherit DynamicObj
  new : unit -> LinearAxis
  static member init : ?AxisType:AxisType * ?Title:string * ?Titlefont:Font * ?Autorange:AutoRange * ?Rangemode:RangeMode * ?Range:Range * ?RangeSlider:RangeSlider * ?Fixedrange:'a * ?Tickmode:TickMode * ?nTicks:'b * ?Tick0:'c * ?dTick:'d * ?Tickvals:'e * ?Ticktext:'f * ?Ticks:TickOptions * ?Mirror:Mirror * ?Ticklen:'g * ?Tickwidth:'h * ?Tickcolor:'i * ?Showticklabels:'j * ?Tickfont:Font * ?Tickangle:'k * ?Tickprefix:'l * ?Showtickprefix:ShowTickOption * ?Ticksuffix:'m * ?Showticksuffix:ShowTickOption * ?Showexponent:ShowExponent * ?Exponentformat:ExponentFormat * ?Tickformat:'n * ?Hoverformat:'o * ?Showline:bool * ?Linecolor:'p * ?Linewidth:'q * ?Showgrid:bool * ?Gridcolor:'r * ?Gridwidth:'s * ?Zeroline:bool * ?Zerolinecolor:'t * ?Zerolinewidth:'a1 * ?Anchor:AxisAnchorId * ?Side:Side * ?Overlaying:AxisAnchorId * ?Domain:Range * ?Position:float * ?IsSubplotObj:'a2 * ?Tickvalssrc:'a3 * ?Ticktextsrc:'a4 * ?Showspikes:'a5 * ?Spikesides:'a6 * ?Spikethickness:'a7 * ?Spikecolor:'a8 * ?Showbackground:'a9 * ?Backgroundcolor:'a10 * ?Showaxeslabels:'a11 -> LinearAxis
  static member style : ?AxisType:AxisType * ?Title:string * ?Titlefont:Font * ?Autorange:AutoRange * ?Rangemode:RangeMode * ?Range:Range * ?RangeSlider:RangeSlider * ?Fixedrange:'a * ?Tickmode:TickMode * ?nTicks:'b * ?Tick0:'c * ?dTick:'d * ?Tickvals:'e * ?Ticktext:'f * ?Ticks:TickOptions * ?Mirror:Mirror * ?Ticklen:'g * ?Tickwidth:'h * ?Tickcolor:'i * ?Showticklabels:'j * ?Tickfont:Font * ?Tickangle:'k * ?Tickprefix:'l * ?Showtickprefix:ShowTickOption * ?Ticksuffix:'m * ?Showticksuffix:ShowTickOption * ?Showexponent:ShowExponent * ?Exponentformat:ExponentFormat * ?Tickformat:'n * ?Hoverformat:'o * ?Showline:bool * ?Linecolor:'p * ?Linewidth:'q * ?Showgrid:bool * ?Gridcolor:'r * ?Gridwidth:'s * ?Zeroline:bool * ?Zerolinecolor:'t * ?Zerolinewidth:'a1 * ?Anchor:AxisAnchorId * ?Side:Side * ?Overlaying:AxisAnchorId * ?Domain:Range * ?Position:float * ?IsSubplotObj:'a2 * ?Tickvalssrc:'a3 * ?Ticktextsrc:'a4 * ?Showspikes:'a5 * ?Spikesides:'a6 * ?Spikethickness:'a7 * ?Spikecolor:'a8 * ?Showbackground:'a9 * ?Backgroundcolor:'a10 * ?Showaxeslabels:'a11 -> (LinearAxis -> LinearAxis)

--------------------
new : unit -> Axis.LinearAxis
static member Axis.LinearAxis.init : ?AxisType:StyleParam.AxisType * ?Title:string * ?Titlefont:Font * ?Autorange:StyleParam.AutoRange * ?Rangemode:StyleParam.RangeMode * ?Range:StyleParam.Range * ?RangeSlider:RangeSlider * ?Fixedrange:'a * ?Tickmode:StyleParam.TickMode * ?nTicks:'b * ?Tick0:'c * ?dTick:'d * ?Tickvals:'e * ?Ticktext:'f * ?Ticks:StyleParam.TickOptions * ?Mirror:StyleParam.Mirror * ?Ticklen:'g * ?Tickwidth:'h * ?Tickcolor:'i * ?Showticklabels:'j * ?Tickfont:Font * ?Tickangle:'k * ?Tickprefix:'l * ?Showtickprefix:StyleParam.ShowTickOption * ?Ticksuffix:'m * ?Showticksuffix:StyleParam.ShowTickOption * ?Showexponent:StyleParam.ShowExponent * ?Exponentformat:StyleParam.ExponentFormat * ?Tickformat:'n * ?Hoverformat:'o * ?Showline:bool * ?Linecolor:'p * ?Linewidth:'q * ?Showgrid:bool * ?Gridcolor:'r * ?Gridwidth:'s * ?Zeroline:bool * ?Zerolinecolor:'t * ?Zerolinewidth:'a1 * ?Anchor:StyleParam.AxisAnchorId * ?Side:StyleParam.Side * ?Overlaying:StyleParam.AxisAnchorId * ?Domain:StyleParam.Range * ?Position:float * ?IsSubplotObj:'a2 * ?Tickvalssrc:'a3 * ?Ticktextsrc:'a4 * ?Showspikes:'a5 * ?Spikesides:'a6 * ?Spikethickness:'a7 * ?Spikecolor:'a8 * ?Showbackground:'a9 * ?Backgroundcolor:'a10 * ?Showaxeslabels:'a11 -> Axis.LinearAxis
module StyleParam

from Plotly.NET
type Mirror =
  | True
  | Ticks
  | False
  | All
  | AllTicks
    static member convert : (Mirror -> obj)
    static member toString : (Mirror -> string)
union case StyleParam.Mirror.All: StyleParam.Mirror
type TickOptions =
  | Outside
  | Inside
  | Empty
    static member convert : (TickOptions -> obj)
    static member toString : (TickOptions -> string)
union case StyleParam.TickOptions.Inside: StyleParam.TickOptions
val chart : GenericChart.GenericChart
type Chart =
  static member Area : xy:seq<#IConvertible * #IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:'a2 -> GenericChart
  static member Area : x:seq<#IConvertible> * y:seq<#IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:'a2 -> GenericChart
  static member Bar : keysvalues:seq<#IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
  static member Bar : keys:seq<#IConvertible> * values:seq<#IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart
  static member BoxPlot : xy:seq<'a0 * 'a1> * ?Name:string * ?Showlegend:bool * ?Color:string * ?Fillcolor:'a2 * ?Opacity:float * ?Whiskerwidth:'a3 * ?Boxpoints:Boxpoints * ?Boxmean:BoxMean * ?Jitter:'a4 * ?Pointpos:'a5 * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?Alignmentgroup:'a6 * ?Offsetgroup:'a7 * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod -> GenericChart
  static member BoxPlot : ?x:'a0 * ?y:'a1 * ?Name:string * ?Showlegend:bool * ?Color:string * ?Fillcolor:'a2 * ?Opacity:float * ?Whiskerwidth:'a3 * ?Boxpoints:Boxpoints * ?Boxmean:BoxMean * ?Jitter:'a4 * ?Pointpos:'a5 * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?Alignmentgroup:'a6 * ?Offsetgroup:'a7 * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod -> GenericChart
  static member Bubble : xysizes:seq<#IConvertible * #IConvertible * #IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool -> GenericChart
  static member Bubble : x:seq<#IConvertible> * y:seq<#IConvertible> * sizes:seq<#IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool -> GenericChart
  static member Candlestick : stockTimeSeries:seq<DateTime * StockData> * ?Increasing:Line * ?Decreasing:Line * ?WhiskerWidth:float * ?Line:Line * ?XCalendar:Calendar -> GenericChart
  static member Candlestick : open:seq<#IConvertible> * high:seq<#IConvertible> * low:seq<#IConvertible> * close:seq<#IConvertible> * x:seq<#IConvertible> * ?Increasing:Line * ?Decreasing:Line * ?WhiskerWidth:float * ?Line:Line * ?XCalendar:Calendar -> GenericChart
  ...
static member Chart.Point : xy:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
static member Chart.Point : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
static member Chart.withTraceName : ?Name:string * ?Showlegend:bool * ?Legendgroup:string * ?Visible:StyleParam.Visible -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.Line : xy:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:'c * ?Width:'d * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
static member Chart.Line : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?MarkerSymbol:StyleParam.Symbol * ?Color:string * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Dash:'c * ?Width:'d * ?StackGroup:string * ?Orientation:StyleParam.Orientation * ?GroupNorm:StyleParam.GroupNorm * ?UseWebGL:bool -> GenericChart.GenericChart
Multiple items
module Seq

from Plotly.NET

--------------------
module Seq

from FSharp.Stats

--------------------
module Seq

from Microsoft.FSharp.Collections
val mapi : mapping:(int -> 'T -> 'U) -> source:seq<'T> -> seq<'U>
val i : int
val y : float
static member Chart.Combine : gCharts:seq<GenericChart.GenericChart> -> GenericChart.GenericChart
static member Chart.withX_Axis : xAxis:Axis.LinearAxis * ?Id:int -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withY_Axis : yAxis:Axis.LinearAxis * ?Id:int -> (GenericChart.GenericChart -> GenericChart.GenericChart)
module GenericChart

from Plotly.NET
val toChartHTML : gChart:GenericChart.GenericChart -> string
val sos : GoodnessOfFit.SumOfSquares
val calculateSumOfSquares : fitFunc:(float -> float) -> xData:seq<float> -> yData:seq<float> -> GoodnessOfFit.SumOfSquares
val n : float
GoodnessOfFit.SumOfSquares.Count: float
val meanX : float
GoodnessOfFit.SumOfSquares.MeanX: float
val meanY : float
GoodnessOfFit.SumOfSquares.MeanY: float
val slope : float
val intercept : float
val rSq : float
val calculateDeterminationFromValue : actual:seq<float> -> expected:seq<float> -> float
val rSqAdj : float
val calculateDeterminationAdj : actual:seq<float> -> expected:seq<float> -> variables:int -> float
val r : float
val sqrt : value:'T -> 'U (requires member Sqrt)
val ssTotal : float
GoodnessOfFit.SumOfSquares.Total: float
val ssReg : float
GoodnessOfFit.SumOfSquares.Regression: float
val ssResidual : float
GoodnessOfFit.SumOfSquares.Error: float
val ssxx : float
GoodnessOfFit.SumOfSquares.SSxx: float
val ssxy : float
GoodnessOfFit.SumOfSquares.SSxy: float
val stdErrSlope : float
val standardErrorSlope : sumOfSquares:GoodnessOfFit.SumOfSquares -> float
val stdErrIntercept : float
val standardErrorIntercept : sumOfSquares:GoodnessOfFit.SumOfSquares -> float
val stdErrEstimate : float
val standardErrorEstimate : sumOfSquares:GoodnessOfFit.SumOfSquares -> float
val criticalT : float
namespace FSharp.Stats.Distributions
module Continuous

from FSharp.Stats.Distributions
val getCriticalTValue : df:float -> significanceLevel:float -> tailed:Distributions.Continuous.Tails -> float
union case Distributions.Continuous.Tails.TwoTailed: Distributions.Continuous.Tails
val lowerS : float
val upperS : float
val lowerI : float
val upperI : float
val testSlope : Testing.TestStatistics.TTestStatistics
val ttestSlope : slope:float -> sumOfSquares:GoodnessOfFit.SumOfSquares -> Testing.TestStatistics.TTestStatistics
val testInterc : Testing.TestStatistics.TTestStatistics
val ttestIntercept : intercept:float -> sumOfSquares:GoodnessOfFit.SumOfSquares -> Testing.TestStatistics.TTestStatistics
val outputTable : GenericChart.GenericChart
val header : string list
val rows : string list list
val print : (float -> string)
val f : float
val sprintf : format:Printf.StringFormat<'T> -> 'T
Testing.TestStatistics.TTestStatistics.PValue: float
static member Chart.Table : headerValues:seq<#seq<'b>> * cellValues:seq<#seq<'d>> * ?AlignHeader:seq<StyleParam.HorizontalAlign> * ?AlignCells:seq<StyleParam.HorizontalAlign> * ?ColumnWidth:seq<int> * ?ColumnOrder:seq<int> * ?ColorHeader:'e * ?ColorCells:'f * ?FontHeader:Font * ?FontCells:Font * ?HeightHeader:'g * ?HeightCells:'h * ?LineHeader:Line * ?LineCells:Line -> GenericChart.GenericChart (requires 'b :> System.IConvertible and 'd :> System.IConvertible)
type HorizontalAlign =
  | Left
  | Center
  | Right
    static member convert : (HorizontalAlign -> obj)
    static member toString : (HorizontalAlign -> string)
union case StyleParam.HorizontalAlign.Left: StyleParam.HorizontalAlign
union case StyleParam.HorizontalAlign.Center: StyleParam.HorizontalAlign
static member Chart.withTitle : title:string * ?Titlefont:Font -> (GenericChart.GenericChart -> GenericChart.GenericChart)
val xData : Vector<float>
val yData : Vector<float>
val values : seq<float * float>
val zip : source1:seq<'T1> -> source2:seq<'T2> -> seq<'T1 * 'T2>
val coeffs : Vector<float>
linear regression line fitting function
val fit : (float -> float)
val fitValues : seq<float * float>
val xi : float
val confidence : Vector<float>
calculate confidence band errors for every x value
Multiple items
module Vector

from FSharp.Stats

--------------------
type Vector<'T> =
  interface IEnumerable
  interface IEnumerable<'T>
  interface IStructuralEquatable
  interface IStructuralComparable
  interface IComparable
  new : opsV:INumeric<'T> option * arrV:'T array -> Vector<'T>
  override Equals : yobj:obj -> bool
  override GetHashCode : unit -> int
  member GetSlice : start:int option * finish:int option -> Vector<'T>
  member Permute : p:permutation -> Vector<'T>
  ...

--------------------
new : opsV:INumeric<'T> option * arrV:'T array -> Vector<'T>
val map : mapping:(float -> float) -> vector:vector -> Vector<float>
val calculateConfidenceBandError : xData:Vector<float> -> yData:Vector<float> -> confidenceLevel:float -> (float -> float)
val lower : seq<float>
lower and upper bounds of the 95% confidence band sorted according to x values
val upper : seq<float>
lower and upper bounds of the 95% confidence band sorted according to x values
val unzip : input:seq<'a * 'b> -> seq<'a> * seq<'b>
val rangePlot : GenericChart.GenericChart
static member Chart.Range : xy:seq<#System.IConvertible * #System.IConvertible> * upper:seq<#System.IConvertible> * lower:seq<#System.IConvertible> * mode:StyleParam.Mode * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?Color:string * ?RangeColor:string * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font -> GenericChart.GenericChart
static member Chart.Range : x:seq<#System.IConvertible> * y:seq<#System.IConvertible> * upper:seq<#System.IConvertible> * lower:seq<#System.IConvertible> * mode:StyleParam.Mode * ?Name:string * ?ShowMarkers:bool * ?Showlegend:bool * ?Color:string * ?RangeColor:string * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font -> GenericChart.GenericChart
type Mode =
  | None
  | Lines
  | Lines_Markers
  | Lines_Text
  | Lines_Markers_Text
  | Markers
  | Markers_Text
  | Text
    static member convert : (Mode -> obj)
    static member toString : (Mode -> string)
union case StyleParam.Mode.Lines: StyleParam.Mode
module Colors

from Plotly.NET
val toWebColor : c:Colors.Color -> string
module Table

from Plotly.NET.Colors
module Office

from Plotly.NET.Colors.Table
val blue : Colors.Color
val lightBlue : Colors.Color
val newXValues : Vector<float>
val newConfidence : Vector<float>
calculate confidence band errors for every x value
val newLower : seq<float>
lower and upper bounds of the 95% confidence band sorted according to x values
val newUpper : seq<float>
lower and upper bounds of the 95% confidence band sorted according to x values
val linePlot : GenericChart.GenericChart
static member Chart.withLineStyle : ?Width:'a * ?Color:'b * ?Shape:StyleParam.Shape * ?Dash:StyleParam.DrawingStyle * ?Smoothing:'c * ?Colorscale:StyleParam.Colorscale -> (GenericChart.GenericChart -> GenericChart.GenericChart)
type DrawingStyle =
  | Solid
  | Dash
  | Dot
  | DashDot
  | User of int
    static member convert : (DrawingStyle -> obj)
    static member toString : (DrawingStyle -> string)
union case StyleParam.DrawingStyle.Dash: StyleParam.DrawingStyle
val predictionXValues : Vector<float>
val prediction : Vector<float>
calculate preditcion band errors for every x value
val calculatePredictionBandError : xData:Vector<float> -> yData:Vector<float> -> confidenceLevel:float -> (float -> float)
val pLower : seq<float>
lower and upper bounds of the 95% prediction band sorted according to x values
val pUpper : seq<float>
lower and upper bounds of the 95% prediction band sorted according to x values
val predictionPlot : GenericChart.GenericChart
val xD : Vector<float>
val yD : Vector<float>
val cooksDistance : vector
val cooksDistance : xData:Vector<float> -> yData:Vector<float> -> vector
val nD : float
Multiple items
val float : value:'T -> float (requires member op_Explicit)

--------------------
type float = System.Double

--------------------
type float<'Measure> = float
property Vector.Length: int with get
val meanCook : float
val mean : items:seq<'T> -> 'U (requires member ( + ) and member get_Zero and member DivideByInt and member ( / ))
val threshold1 : float
val threshold2 : float
val threshold3 : float
val cook : GenericChart.GenericChart
static member Chart.Column : keysvalues:seq<#System.IConvertible * #System.IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'c * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart.GenericChart
static member Chart.Column : keys:seq<#System.IConvertible> * values:seq<#System.IConvertible> * ?Name:string * ?Showlegend:bool * ?Color:'a2 * ?Opacity:float * ?Labels:seq<string> * ?TextPosition:StyleParam.TextPosition * ?TextFont:Font * ?Marker:Marker -> GenericChart.GenericChart
val l : GenericChart.GenericChart
static member Chart.withSize : width:float * height:float -> (GenericChart.GenericChart -> GenericChart.GenericChart)