14 April 2017 1 511 Report

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 one help  me how to plot the 95% confidence line and what is needed for this to plot? example is shown in the attach figure. 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.

More Abdur Rauf's questions See All
Similar questions and discussions