File:Linear regression.svg

From testwiki
Jump to navigation Jump to search
    Original file (SVG file, nominally 438 × 289 pixels, file size: 71 KB)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    Summary

    Description
    Français : Un nuage de points (en bleu) peut être modélisé par une droite de régression (en rouge).
    English: Random data points and their linear regression. Created with the following Sage (http://sagemath.org) commands:
    X = RealDistribution('uniform', [-20, 60])
    
    Y = RealDistribution('gaussian', 1.5)
    
    f(x) = 3*x/20 + 5
    
    xvals = [X.get_random_element() for _ in range(100)]
    
    data = [(x, f(x) + Y.get_random_element()) for x in xvals]
    
    m, b = var('m b')
    
    g(x) = m*x + b
    
    g(x) = g(x).subs(find_fit(data, g, solution_dict=True))
    
    p = list_plot(data) + plot(g, (x, -20, 60), color='red')
    
    p.save('linear_regression.svg')
    
    Date
    Source Own work
    Author Sewaqu
    Other versions Derivative works of this file:  Sedm zakladnich nastroju zlepsovani kvality cz.svg: 
    SVG development
    InfoField
     This image was created with Sage.
     and with Inkscape.

    Licensing

    Public domain This work has been released into the public domain by its author, Sewaqu. This applies worldwide.
    In some countries this may not be legally possible; if so:
    Sewaqu grants anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

    Captions

    A straight line with y-intercept 5 fitted to datapoints. A scatter plot (blue) can be rendered as a linear regression (red).

    Items portrayed in this file

    depicts

    5 November 2010

    image/svg+xml

    File history

    Click on a date/time to view the file as it appeared at that time.

    Date/TimeThumbnailDimensionsUserComment
    current11:42, 31 March 2016Thumbnail for version as of 11:42, 31 March 2016438 × 289 (71 KB)wikimediacommons>RaphaelQStransparent background

    There are no pages that use this file.