Need help/suggestions finding optimization parameters

1 回表示 (過去 30 日間)
Trader
Trader 2012 年 5 月 3 日
I have a large vector of data that I'm performing calculations on. My calculation is dependent on the state of a leading and lagging moving average. I'm trying to find a maximum value based on moving average periods. A very simple example:
data = [big vector];
[lead,lag] = movavg(data,M,N,'e');
for M = 1:1000
for N = 1:1000
[lead,lag] = movavg(data,M,N,'e');
for i = 1:size(data)
if lead(i) > lag(i)
data(i) = data(i)-1;
else
data(i) = data(i)+1;
end
end % end N
end % end M
Instead of the 2 M,N 'for' loops I've converted the values to a matrix (trying to avoid 'for' loops). I'm interested in using an algorithm to find the best M,N combination. I would appreciate any suggestions or examples that might be able to help me out.
Thank you!
I would like to expand my M/N parameters but the # of iterations takes a long time.

回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by