How to run a regression of a time series with random data and log-norm distribution?

2 ビュー (過去 30 日間)
Fernanda Suarez Jaimes
Fernanda Suarez Jaimes 2020 年 3 月 12 日
I have a vector containing 6,000 random entries distributed with log-norm. What type of regression model should I use?
This is my dataset
% generating time series with 6000 entries log-normal distributed
rng ( 'default' ); % So that numbers can be repeated
time_series2 = lognrnd (0,0.25,6000,1); % generating time series with mu set to zero and sigma 0.25
This is what I have so far
% REGRESSION TIME SERIES 2
logarithms_ts2 = log (time_series2); % calculating logarithm of the values ​​in order to use GLM fuction
% [regression2, dev, stats] = glmfit (xtime2, logarithms_ts2, 'normal');
regression2 = fitglm (xtime2, time_series2) % regression of time series 2
% GLM function does not support lognormal distributions, so the logarithms
% are calculated in order to use the GLM fit function with the use of normal
% distribution https://www.mathworks.com/matlabcentral/answers/101420-why-does-the-glmfit-function-not-recognize-lognormal-as-a-distribution

回答 (0 件)

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by