파일:Thiel-Sen estimator.svg

testwiki
둘러보기로 이동 검색으로 이동
    원본 파일 (SVG 파일, 실제 크기 2,936 × 3,075 픽셀, 파일 크기: 37 KB)

    이 파일은 위키미디어 공용에 있으며, 다른 프로젝트에서 사용하고 있을 가능성이 있습니다. 해당 파일에 대한 설명이 아래에 나와 있습니다.

    파일 설명

    설명
    English: The Theil–Sen estimator (black line) of a set of sample points, compared to the simple linear regression line (blue). The points were generated by adding a small amount of jitter to points on the green dashed line and then replacing some of the points by random outliers.
    날짜
    출처 자작
    저자 David Eppstein
    SVG 발전
    InfoField
     이 SVG 파일의 소스 코드 문법이 올바릅니다.
     이 벡터 그림은 Python(으)로 제작되었습니다.

    라이선스

    David Eppstein은(는) 아래 작품의 저작권자로서, 해당 저작물을 다음과 같은 라이선스로 배포합니다:
    Creative Commons CC-Zero 이 파일은 크리에이티브 커먼즈 CC0 1.0 보편적 퍼블릭 도메인 귀속에 따라 이용할 수 있습니다.
    저작물에 본 권리증서를 첨부한 자는 법률에서 허용하는 범위 내에서 저작인접권 및 관련된 모든 권리들을 포함하여 저작권법에 따라 전 세계적으로 해당 저작물에 대해 자신이 갖는 일체의 권리를 포기함으로써 저작물을 퍼블릭 도메인으로 양도하였습니다. 저작권자의 허락을 구하지 않아도 이 저작물을 상업적인 목적을 포함하여 모든 목적으로 복제, 수정·변경, 배포, 공연·실연할 수 있습니다.

    Source code

    This image was created as a pdf file by the following Python code, then converted to SVG.

    from pyx import canvas,path,color
    from random import random,seed
    seed(12345)
    
    N = 103
    noise = 10
    slope = 1.0
    
    def sample(x):
        y = x * slope
        if random() < (y/N)**3:
            y = random()*N      # outlier
        else:
            y += (random()-0.5)*noise # non-outlier, jitter
        return y
    
    samples = [(i*1.0,sample(i)) for i in range(N)]
    
    c = canvas.canvas()
    
    for x,y in samples:
        c.fill(path.circle(x,y,0.5),[color.rgb.red])
    
    def theilsen(samples):
        N = len(samples)
        def slope(i,j):
            xi,yi = samples[i]
            xj,yj = samples[j]
            return (yi-yj)/(xi-xj)
        
        def median(L):
            L.sort()
            if len(L) & 1:
                return L[len(L)//2]
            else:
                return (L[len(L)//2 - 1] + L[len(L)//2])/2.0
        
        m = median([slope(i,j) for i in range(N) for j in range(i)])
        
        def error(i):
            x,y = samples[i]
            return y - m*x
        
        b = median([error(i) for i in range(N)])
        
        return m,b
    
    m,b = 1,0
    c.stroke(path.line(0,b,N,N*m+b),[color.rgb.green])
    
    m,b = theilsen(samples)
    c.stroke(path.line(0,b,N,N*m+b),[color.rgb.black])
    
    def slr(samples):
        N = len(samples)
        sumxy = sum([x*y for x,y in samples])
        sumx = sum([x for x,y in samples])
        sumy = sum([y for x,y in samples])
        sumxx = sum([x*x for x,y in samples])
        m = (sumxy - sumx*sumy/N)/(sumxx - sumx**2/N)
        b = sumy/N - m*sumx/N
        return m,b
    
    m,b = slr(samples)
    c.stroke(path.line(0,b,N,N*m+b),[color.rgb.blue])
    
    c.writePDFfile("ThielSen")
    

    설명

    이 파일이 나타내는 바에 대한 한 줄 설명을 추가합니다

    이 파일에 묘사된 항목

    다음을 묘사함

    38,284 바이트

    image/svg+xml

    b609f78fc8c00033406a20c18637e1219c88cb72

    파일 역사

    날짜/시간 링크를 클릭하면 해당 시간의 파일을 볼 수 있습니다.

    날짜/시간섬네일크기사용자설명
    현재2011년 11월 3일 (목) 19:592011년 11월 3일 (목) 19:59 판의 섬네일2,936 × 3,075 (37 KB)wikimediacommons>David EppsteinDarker green, thicker lines

    이 파일을 사용하는 문서가 없습니다.