오늘, 다음 코드를 사용하여 비모수 적 밀도 추정과 함께 데이터의 정규성을 확인합니다. 그러나, 나는 오류가있어 :width.SJ()를 실행하는 중에 오류가 발생했습니다.
width.SJ(bc.mdat[, 2]) :
no solution in the specified range of bandwidths
그래서, 나는이 오류가 일어날 이유를 모른다. 왜냐하면 내가 다른 데이터로 완벽하게 처리하기 때문이다. 몇 가지 간단한 디버깅을 적용 당신의 도움이
library(car)
library(MASS)
library(graphics)
Q=read.table(text='
12.5 13.7
14.5 16.5
8.0 17.4
9.0 11.0
19.5 23.6
8.0 13.2
9.0 32.1
7.0 12.3
7.0 11.8
9.0 24.4
6.5 18.2
10.5 22.0
10.0 32.5
4.5 18.7
7.0 15.8
8.5 15.6
6.5 12.0
8.0 12.8
3.5 26.1
8.0 14.5
17.5 42.3
10.5 17.5
12.0 21.8
6.0 10.4
13.0 25.6
')
bc=powerTransform(as.matrix(Q)~1)
summary(bc)
bc.mdat<-bcPower(Q,bc$lambda)
f2=kde2d(bc.mdat[,1],bc.mdat[,2],h=c(width.SJ(bc.mdat[,1]),width.SJ(bc.mdat[,2])))
persp(f2,phi=30,theta=20,d=5)