Time Series Regression and ARMA model
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
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);
% 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 Commenti
Vedere anche
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!