Select the correct data from matrix
1 view (last 30 days)
Hello. I have the following problem: For a product I predict the prices it will have the next day (24 prices). I use 5 models to predict. So I have 5 different predictions. I put these predictions in a matrix A (1X120). Next, I calcuate the error resulting between the acual values and the predicted values of each model and place the results in matrix B (24X5). Then, I select the smallest error for each one hour out of 24 and I put the result in matric C(1X24). What I am trying to do is in another matrix (for example D) to set the prediciton values that correspond to each error from matrix C. But beacuse the errors are different evry time I run the code, how can I find the corresponding values from matrix A? Your help is important!!!!
Rik on 11 Jun 2020
You're probably using min to select the smallest value, so you should use the second output to find the index of those values. Then you can use those col indices to find the linear indices in A.