Time Series Regression and ARMA model
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Aman
el 26 de Sept. de 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 comentarios
Ver también
Categorías
Más información sobre Conditional Mean Models en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!