Time Series Regression and ARMA model
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi, following question. I have a time series of 12000 lognormally distributed (mu=0 and sigma=0.25) numbers.
R=lognrnd(0,0.25,12000,1)
How do you get a regression model for that data? No function seams to support lognormal distribution. And also, for that set of data how do you decide how many lags the ARMA model need?
Please help
댓글 수: 0
답변 (1개)
Aman
2024년 9월 26일
Hi,
The lognormal distribution is not directly supported in some regression functions, you can transform the data to a normal distribution by taking the natural logarithm of your series. This transformation makes the data suitable for many statistical models, including ARMA. I have done the same thing to the data points that you have created and have fit a ARMA model, you can refer the below code for reference.
% Generate lognormal data
mu = 0;
sigma = 0.25;
R = lognrnd(mu, sigma, 12000, 1);
% Transform to normal distribution
log_R = log(R);
% Perform ADF test
[h, pValue] = adftest(log_R);
fprintf('ADF Test p-value: %f\n', pValue);
% Plot ACF and PACF
figure;
subplot(2,1,1);
autocorr(log_R);
title('ACF of log-transformed data');
subplot(2,1,2);
parcorr(log_R);
title('PACF of log-transformed data');
% Fit ARMA model (example: ARMA(1,1))
model = arima('ARLags',1,'MALags',1,'Constant',0);
fit = estimate(model, log_R);
% Display the results
disp(fit);
I hope this clarify your query :)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Conditional Mean Models에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!