'Creating Lilliefors test in Matlab
Can someone help me create Lilliefors test in Matlab so that I could compare values with the given function: [h,p,kstat,critval] = lillietest( ). I do not know how to compare data after standardization, as given vectors have different length. This is the beginning of my code:
clear;
clc;
[prices_daily] =xlsread(...);
logreturns_daily = log(prices_daily(2:end,:))-log(prices_daily(1:end-1,:)); % daily log returns
m = mean(logreturns_daily);
s = std(logreturns_daily);
z=(prices_daily(1:end,1)-m)/s;
e = ecdf(z);
n = normcdf(z);
Solution 1:[1]
You do not need to normalize, since Lillietest tests for Normality whichever the mean and standard deviation are. Simply apply:
[h,p,k,c]=lillietest(prices_daily(1:end,1),'Alpha',0.01);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Brethlosze |
