MATLAB Answers

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

2 views (last 30 days)
Fernanda Suarez Jaimes
Fernanda Suarez Jaimes on 12 Mar 2020
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
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

Answers (0)

Community Treasure Hunt

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

Start Hunting!