Clear Filters
Clear Filters

plotting 95% confidence line?

1 view (last 30 days)
abdur rauf
abdur rauf on 14 Apr 2017
Edited: abdur rauf on 14 Apr 2017
hi, Matlab users, by using the following code, I can plot correlation coefficient values against time.
coeffs = [0.54 0.81 0.21 0.61 0.52 0.47 -0.42 -0.20];
T = {'00:00 - 00:27:02', '00:27:02 - 00:35:02', '00:35:02 - 00:47:02', '00:47 - 00:59:55', '01:05:02 - 01:12', '01:15 - 01:25', '01:27 - 01:35', '01:35 - 01:45'};
% split to start and end times
startEndTimes = cellfun(@(str) strsplit(str,' - '),T,'UniformOutput',0);
startTimes = cellfun(@(c) c{1},startEndTimes,'UniformOutput',0);
endTimes = cellfun(@(c) c{2},startEndTimes,'UniformOutput',0);
% add seconds where missing
missingSecondsIdx = cellfun(@length,startTimes) == 5;
startTimes(missingSecondsIdx) = cellfun(@(str) [str ':00'],startTimes(missingSecondsIdx),'UniformOutput',0);
missingSecondsIdx = cellfun(@length,endTimes) == 5;
endTimes(missingSecondsIdx) = cellfun(@(str) [str ':00'],endTimes(missingSecondsIdx),'UniformOutput',0);
% convert time strings to numbers
startTimeNums = datenum(startTimes,'HH:MM:SS');
EPS = 1e-4;
endTimeNums = datenum(endTimes,'HH:MM:SS') - EPS;
% interpolate coefficients on "continous" time vector
contTime = linspace(startTimeNums(1),endTimeNums(end),200);
repCoeffs = repmat(coeffs,[2 1]);
repCoeffs = repCoeffs(:);
allTimes = [startTimeNums';endTimeNums'];
allTimes = allTimes(:);
contCoeffs = interp1(allTimes,repCoeffs,contTime);
% plot
plot(contTime,contCoeffs,'b')
hold on;
plot(startTimeNums,coeffs,'og')
plot(endTimeNums,coeffs,'*r')
datetick('x','HH:MM')
xlabel('TIME [HH:MM]')
ylabel('CORRELATION COEFFICIENTS')
can any help me to plot the 95% confidence line, like the one shown in link:
https://www.researchgate.net/post/plotting_95_confidence_line
in the attach figure, the spearman correlation coefficient values are above the 95% confidence line for the time interval(20 to 06). What is meant by that the correlation coefficient values are above the 95% confidence level.

Answers (0)

Categories

Find more on Time Series in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!