Time Series Regression and ARMA model

1 visualizzazione (ultimi 30 giorni)
ingCr
ingCr il 10 Mar 2020
Risposto: Aman il 26 Set 2024
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

Risposte (1)

Aman
Aman il 26 Set 2024
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);
ADF Test p-value: 0.001000
% 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);
ARIMA(1,0,1) Model (Gaussian Distribution): Value StandardError TStatistic PValue _________ _____________ __________ _______ Constant 0 0 NaN NaN AR{1} -0.094932 1.4889 -0.06376 0.94916 MA{1} 0.10089 1.4882 0.067793 0.94595 Variance 0.061965 0.00080299 77.168 0
% Display the results
disp(fit);
arima with properties: Description: "ARIMA(1,0,1) Model (Gaussian Distribution)" SeriesName: "Y" Distribution: Name = "Gaussian" P: 1 D: 0 Q: 1 Constant: 0 AR: {-0.0949321} at lag [1] SAR: {} MA: {0.100891} at lag [1] SMA: {} Seasonality: 0 Beta: [1×0] Variance: 0.0619655
I hope this clarify your query :)

Categorie

Scopri di più su Conditional Mean Models in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by