R 언어 학습 노트 - Error in ts(x): 대상은 행렬 문제 해결이 아닙니다.
1. 문제
시간 시퀀스를 맞추는 동안 발생: Error in ts(x): 객체는 행렬 오류가 아니라 arima() 함수에서 직접 사용하는 경우 문제가 없습니다.
> sample > sample [1] [1] 0.00 0.00 0.00 0.00 0.00 0.00 0.06 0.09 0.20 0.09 0.08 0.14 0.23 [15] 0.08 0.06 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.09 0.08 0.14 0.14 0.14 0.14 0.11 0.20 0.14 0.11 0.14 0.14 0.11 0.14 0.14 0.14 0.11 0.14 0.14 0.14 0.11 0.14 0.14 0.11 0.14 0.14 0.14 0.11 0.14 0.14 0.14 0.11 0.14 0.14 0.14 0.14 0.14 0.11 0.14 0.14 0.14 0.14 0.14 0.14 0.11 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 0.14 sample,order=c(4,0,3)Call:arima(x = sample, order = c(4, 0, 3)) Coefficients: ar1 ar2 ar3 ar4 ma1 ma2 ma3 intercept 0.6740 0.0666 -0.4026 0.4924 -0.6160 0.2129 0.3564 0.1097 s.e. 0.2761 0.3073 0.2510 0.1724 0.3005 0.3112 0.2361 0.0380 sigma^2 estimated as 0.002756: log likelihood = 67.68, aic = -117.37 >
2. 원인 분석
원본: 데이터의 변수 이름은 기본 패키지의 Sample 함수와 동명이기 때문에fitted () 함수에서 정확하게 처리되지 않았습니다.
R 언어에서sample은 기본 패키지의 함수입니다. R 프로그램에서 변수 이름은 같은 이름의 이름을 사용하지 않도록 주의하십시오.그렇지 않으면 정확한 결과를 얻지 못할 것이다.
3. 해결
해결 방법은 함수와 동명하지 않는 것이다. 왜 fitted () 함수에서 Sample () 함수가 정확하게 처리되지 않았는지, fitted () 함수 자체와 관련이 있을 수 있다.
주의: 혼동을 일으킬 수 있는 데이터 () 함수도 있습니다.
4、sample 명령 참조
도움말 (Sample) 을 사용하면 Sample () 함수의 사용 도움말을 볼 수 있습니다.
sample {base}
R Documentation
Random Samples and Permutations
Description
sample
takes a sample of the specified size from the elementsof x
using either with or without replacement. Usage
sample(x, size, replace = FALSE, prob = NULL)
sample.int(n, size = n, replace = FALSE, prob = NULL)
Arguments
x
Either a vector of one or more elements from which to choose,or a positive integer. See ‘Details.’
n
a positive number, the number of items to choose from. See‘Details.’
size
a non-negative integer giving the number of items to choose.
replace
Should sampling be with replacement?
prob
A vector of probability weights for obtaining the elementsof the vector being sampled.
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.