Main Content

이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.

predint

cfit 또는 sfit 객체에 대한 예측 구간

설명

예제

ci = predint(fitresult,x)는 벡터 x로 지정된 새 예측 변수 값에서 cfit 객체 fitresult와 연관된 응답 변수 값의 95% 예측한계의 상한과 하한을 반환합니다. fitresultci에 필요한 정보를 포함하려면 fit 함수의 출력값이어야 합니다. ci는 2×n 배열이며 n = length(x)입니다. ci의 왼쪽 열은 각 계수의 하한을 포함하고, 오른쪽 열은 상한을 포함합니다.

ci = predint(fitresult,x,level)level로 지정된 신뢰수준을 갖는 예측한계를 반환합니다. level01 사이여야 합니다. level의 디폴트 값은 0.95입니다.

ci = predint(fitresult,x,level,intopt,simopt)는 계산할 한계 유형을 지정합니다.

관측값의 한계는 새 관측값에서 피팅된 곡선과 불규칙 변동에 대한 예측 불확실성을 측정한 값이므로 함수의 한계보다 넓습니다. 비동시적 한계는 x의 개별 요소에 대한 한계이고, 동시적 한계는 x의 모든 요소에 대한 한계입니다.

[ci,y] = predint(...)x의 예측 변수에서 fitresult가 예측한 응답 변수 값 y를 반환합니다.

참고

predint보간, Lowess, 스플라인 같은 비모수적 회귀 방법에 대한 예측 구간은 계산할 수 없습니다.

예제

모두 축소

잡음이 있는 데이터에 대한 피팅을 위해 관측값과 함수 예측 구간을 계산하고 플로팅합니다.

지수 추세를 갖는 잡음이 있는 데이터를 생성합니다.

x = (0:0.2:5)';
y = 2*exp(-0.2*x) + 0.5*randn(size(x));

단일 항 지수를 사용하여 데이터에 곡선을 피팅합니다.

fitresult = fit(x,y,'exp1');

95% 관측값과 함수 예측 구간을 동시적 및 비동시적 유형으로 계산합니다. 비동시적 한계는 x의 개별 요소에 대한 한계이고, 동시적 한계는 x의 모든 요소에 대한 한계입니다.

p11 = predint(fitresult,x,0.95,'observation','off');
p12 = predint(fitresult,x,0.95,'observation','on');
p21 = predint(fitresult,x,0.95,'functional','off');
p22 = predint(fitresult,x,0.95,'functional','on');

데이터, 피팅, 예측 구간을 플로팅합니다. 관측값의 한계는 새 관측값에서 피팅된 곡선과 불규칙 변동에 대한 예측 불확실성을 측정한 값이므로 함수의 한계보다 넓습니다.

subplot(2,2,1)
plot(fitresult,x,y), hold on, plot(x,p11,'m--'), xlim([0 5]), ylim([-1 5])
title('Nonsimultaneous Observation Bounds','FontSize',9)
legend off
   
subplot(2,2,2)
plot(fitresult,x,y), hold on, plot(x,p12,'m--'), xlim([0 5]), ylim([-1 5])
title('Simultaneous Observation Bounds','FontSize',9)
legend off

subplot(2,2,3)
plot(fitresult,x,y), hold on, plot(x,p21,'m--'), xlim([0 5]), ylim([-1 5])
title('Nonsimultaneous Functional Bounds','FontSize',9)
legend off

subplot(2,2,4)
plot(fitresult,x,y), hold on, plot(x,p22,'m--'), xlim([0 5]), ylim([-1 5])
title('Simultaneous Functional Bounds','FontSize',9)
legend({'Data','Fitted curve', 'Prediction intervals'},...
       'FontSize',8,'Location','northeast')

Figure contains 4 axes objects. Axes object 1 with title Nonsimultaneous Observation Bounds, xlabel x, ylabel y contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent data, fitted curve. Axes object 2 with title Simultaneous Observation Bounds, xlabel x, ylabel y contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent data, fitted curve. Axes object 3 with title Nonsimultaneous Functional Bounds, xlabel x, ylabel y contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent data, fitted curve. Axes object 4 with title Simultaneous Functional Bounds, xlabel x, ylabel y contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent Data, Fitted curve, Prediction intervals.

입력 인수

모두 축소

예측 구간을 구하려는 함수로, cfit 객체 또는 sfit 객체로 지정됩니다.

fitresultci에 필요한 정보를 포함하려면 fit 함수의 출력값이어야 합니다.

fitresult의 상한 및 하한 예측한계를 계산하는 데 사용된 예측 변수 값으로, 벡터로 지정됩니다.

예측한계의 신뢰수준으로, 01 사이의 양의 스칼라로 지정됩니다.

한계 유형으로, 다음 중 하나로 지정됩니다.

  • 'observation' — 새 관측값에 대한 한계(디폴트 값)

  • 'functional' — 피팅된 곡선에 대한 한계

한계 유형으로, 다음 중 하나로 지정됩니다.

  • 'off' — 비동시적 한계(디폴트 값)

  • 'on' — 동시적 한계

출력 인수

모두 축소

상한 및 하한 예측한계로, 크기가 n×2인 배열로 반환됩니다. 여기서 n = length(x)입니다.

x의 예측 변수에서 fitresult가 예측한 응답 변수 값으로, 벡터로 반환됩니다.

버전 내역

R2013a에 개발됨

참고 항목

| |