New answers tagged

0

A solution not efficient but it works and it is easy to follow : size_matrix = 5 %% m_ones = ones(size_matrix,size_matrix) %% create n * n matrix m_idx_uper = triu(m_ones,1) %% get index uper part rann = rand(size_matrix,size_matrix) %% random positive values upper = rann .* m_idx_uper %% upper part of the final matrix lower = (1./upper)' ...


1

Your question is not clear enough. Go long on 3 highest returns... since when? During the past month? If so, at the end of each month you need to compute the average return on each index, and then find the minimum and maximum returns. As simple dummy example, I will generate a matrix of 10 stocks and 30 daily returns. Then I will average those and find ...


2

Why do you think this is not apropriate? Matlabs documentation for 1-D Data interpolation states that interpl1 using method spline is the right way to go: Spline interpolation using not-a-knot end conditions. The interpolated value at a query point is based on a cubic interpolation of the values at neighboring grid points in each respective dimension. ...



Top 50 recent answers are included