필터 지우기
필터 지우기

Help defining normalized SSE for problem based objective function

조회 수: 1 (최근 30일)
Anthony Ozzello
Anthony Ozzello 2022년 2월 2일
댓글: Anthony Ozzello 2022년 2월 3일
Hi all, I'm using problem-based solving to fit some coefficients in a differential equation to some experimental data that I'm reading in from an Excel file. Everything is working well. But I have some issues in that I'm working with multiple data sets simulaneously that span a wide range of responses and the sets at the high end of the distribution are forcing the fit at the expense of the datasets at the low end of the distribution just due to the fact that I'm using a sum-square-error objective function:
obj = sum(sum((myfcn - experimentalData{5:height(experimentalData),3:width(experimentalData)}).^2));
There are individual data sets in each column of the experimentalData table with different ranges. I want to scale the objective function calculation by the mean of these datasets.
I have calculated the mean for each one:
cAverage(i) = mean(experimentalData{5:height(experimentalData),i+2}); % there are two dummy columns before the data
What I want is a simple expression to divide the delta between the result of the calculated function and the experimental data by the average. So a matrix divided by a vector, by column.
When I type manually in the script prompt the right equation for this:
(myfcn - experimentalData{5:height(experimentalData),3:width(experimentalData)})./cAverage,
it appears to work, but when I edit the formula to
add this in and run the script, I'm getting an error for the argument dimensions must agree.
Can someone give me a clue how to do a normalized SSE objective function?
Thanks,
Tony

답변 (1개)

Matt J
Matt J 2022년 2월 3일
편집: Matt J 2022년 2월 3일
add this in and run the script, I'm getting an error for the argument dimensions must agree.
Well, we have no idea what you've done to ensure that myfcn is the same size as your experimentalData block, but assuming you have, then,
selection = experimentalData{5:height(experimentalData),3:width(experimentalData)};
Error= ( myfcn-selection./mean(selection,1) );
SSE=sum( Error.^2,'all');
  댓글 수: 10
Anthony Ozzello
Anthony Ozzello 2022년 2월 3일
the || indicates the 2-norm of the vector.
Anthony Ozzello
Anthony Ozzello 2022년 2월 3일
Hi Matt,
I got it working with the NMSE definition above for the objective function on a single line and everything is working well now. I appreciate the time you spend trying to help me figure this out.
Tony

댓글을 달려면 로그인하십시오.

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by