R의 NLS에 대한 적합 함을 읽는 방법은 무엇입니까?


12

nls ()의 출력을 해석하려고합니다. 이 게시물 을 읽었 지만 여전히 가장 적합한 방법을 이해하지 못합니다. 내 몸매에는 두 가지 출력이 있습니다.

> summary(m)

  Formula: y ~ I(a * x^b)

  Parameters:
  Estimate Std. Error t value Pr(>|t|)    
  a 479.92903   62.96371   7.622 0.000618 ***
  b   0.27553    0.04534   6.077 0.001744 ** 
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

  Residual standard error: 120.1 on 5 degrees of freedom

  Number of iterations to convergence: 10 
  Achieved convergence tolerance: 6.315e-06 

과

> summary(m1)

  Formula: y ~ I(a * log(x))

  Parameters:
  Estimate Std. Error t value Pr(>|t|)    
  a   384.49      50.29   7.645 0.000261 ***
  ---
  Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

  Residual standard error: 297.4 on 6 degrees of freedom

  Number of iterations to convergence: 1 
  Achieved convergence tolerance: 1.280e-11

첫 번째는 두 개의 매개 변수와 더 작은 잔차 오류가 있습니다. 두 번째 유일한 매개 변수이지만 최악의 잔차 오류입니다. 어느 것이 가장 적합합니까?


4
엑스

3
AICAIC가 일반적으로 nls적합 선택에 적용 할 수 없다는 매력적인 사례가 있었기 때문에을 사용하여 제안한 내 대답을 삭제했습니다 . 나는 특히 데이터 세트가 당신의 것보다 작은 경우에 기계적인 지식에 기초하여 비선형 모델을 결정하려고 항상 노력합니다.
— Roland

1
흠. @Roland의 삭제 된 답변에 대한 원래 의견 작성자가 의견을 다시 게시 할 의향이 있습니까? 왜 AIC가 적절하지 않은지 분명하지 않습니다 ... ( stat.ethz.ch/pipermail/r-help/2010-August/250742.html에 힌트가 있지만 ) '전력 변환을 식별하기 위해 노력하고, 당신은 (박스 콕스 transformationss 시도 할 수 boxcox에서 MASS패키지)
— 벤 Bolker에게

1
AIC를 사용하여 모델을 선택할 수 있습니다.

답변:


2

F 테스트와 anova를 사용하여 간단히 비교할 수 있습니다. 다음은 몇 가지 코드입니다.

> x <- 1:10
> y <- 2*x + 3                            
> yeps <- y + rnorm(length(y), sd = 0.01)
> 
> 
> m1=nls(yeps ~ a + b*x, start = list(a = 0.12345, b = 0.54321))
> summary(m1)

Formula: yeps ~ a + b * x

Parameters:
   Estimate Std. Error t value Pr(>|t|)    
a 2.9965562  0.0052838   567.1   <2e-16 ***
b 2.0016282  0.0008516  2350.6   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 0.007735 on 8 degrees of freedom

Number of iterations to convergence: 2 
Achieved convergence tolerance: 3.386e-09 

> 
> 
> m2=nls(yeps ~ a + b*x+c*I(x^5), start = list(a = 0.12345, b = 0.54321,c=10))
> summary(m2)

Formula: yeps ~ a + b * x + c * I(x^5)

Parameters:
   Estimate Std. Error  t value Pr(>|t|)    
a 3.003e+00  5.820e-03  516.010   <2e-16 ***
b 1.999e+00  1.364e-03 1466.004   <2e-16 ***
c 2.332e-07  1.236e-07    1.886    0.101    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 0.006733 on 7 degrees of freedom

Number of iterations to convergence: 2 
Achieved convergence tolerance: 1.300e-06 

> 
> anova(m1,m2)
Analysis of Variance Table

Model 1: yeps ~ a + b * x
Model 2: yeps ~ a + b * x + c * I(x^5)
  Res.Df Res.Sum Sq Df     Sum Sq F value Pr(>F)
1      8 0.00047860                             
2      7 0.00031735  1 0.00016124  3.5567 0.1013
>

5
결과를 해석하는 방법에 대한 추가 정보?
— skan

확장하십시오. 내 데이터 세트를 사용하면 F 값과 Pr (> F)에 대한 출력이 없습니다. anova 분석을 실행하는 요점은 무엇입니까? 모델이 아닌 범주를 비교하는 데만 익숙합니다.
— user3386170
당사 사이트를 사용함과 동시에 당사의 쿠키 정책과 개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.