Skip to content

Commit

Permalink
Fixed #3: Morris Test Ranking calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
thehoglet committed Nov 28, 2019
1 parent f8e4497 commit a194cff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Company>HSE</Company>
<Product>RVis</Product>
<Copyright>Copyright © HSE 2019</Copyright>
<AssemblyVersion>0.7.11068.0</AssemblyVersion>
<FileVersion>0.7.11068.0</FileVersion>
<AssemblyVersion>0.7.11068.1</AssemblyVersion>
<FileVersion>0.7.11068.1</FileVersion>
</PropertyGroup>
</Project>
11 changes: 7 additions & 4 deletions UI/Module/Sensitivity/Model/Fast99Scorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,15 @@ private void ComputeScores(string output)
var firstOrders = Range(0, nXs)
.Map(i => firstOrder.Rows[i].Field<double>(pn))
.ToArr();
var maxMuStar = firstOrders.Max();
firstOrders = firstOrders.Map(d => d / maxMuStar);

return (pn, firstOrders);

return (ParameterName: pn, Scores: firstOrders);
});

var maxScore = scores.Max(s => s.Scores.Max());
scores = scores.Map(
s => (s.ParameterName, s.Scores.Map(d => d / maxScore))
);

_scores.Add(output, scores);
}

Expand Down
11 changes: 6 additions & 5 deletions UI/Module/Sensitivity/Model/MorrisScorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,24 @@ private void ComputeScores(string output)
var muStars = Range(0, nXs)
.Map(i => muStar.Rows[i].Field<double>(pn))
.ToArr();
var maxMuStar = muStars.Max();
muStars = muStars.Map(d => d / maxMuStar);

var sigmas = Range(0, nXs)
.Map(i => sigma.Rows[i].Field<double>(pn))
.ToArr();
var maxSigma = sigmas.Max();
sigmas = sigmas.Map(d => d / maxSigma);

var combined = Range(0, nXs)
.Map(i => muStars[i] * muStars[i] + sigmas[i] * sigmas[i])
.Map(Sqrt)
.ToArr();

return (pn, combined);
return (ParameterName: pn, Scores: combined);
});

var maxScore = scores.Max(s => s.Scores.Max());
scores = scores.Map(
s => (s.ParameterName, s.Scores.Map(d => d / maxScore))
);

_scores.Add(output, scores);
}

Expand Down
4 changes: 2 additions & 2 deletions Version/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[assembly: AssemblyProduct("RVis")]
[assembly: AssemblyCopyright("Copyright © HSE 2019")]

[assembly: AssemblyVersion("0.7.11068.0")]
[assembly: AssemblyFileVersion("0.7.11068.0")]
[assembly: AssemblyVersion("0.7.11068.1")]
[assembly: AssemblyFileVersion("0.7.11068.1")]

[assembly: NeutralResourcesLanguage("en")]

0 comments on commit a194cff

Please sign in to comment.