open-AIMS / ADRIA_matlab

Repository for the development of ADRIA: Adaptive Dynamic Reef Intervention Algorithms. ADRIA is a multi-criteria decision support tool set particularly useful for informing reef restoration and adaptation interventions.
1 stars 0 forks source link

Summary metric function #95

Closed ConnectedSystems closed 2 years ago

ConnectedSystems commented 2 years ago

Added a new summarizeMetrics() function that takes a collated set of metrics and extracts the summary statistics across the scenarios run.

Includes plotTrajectory() function to quickly visualize results.

In visualizing results, I am assuming the mean of standard deviation is acceptable - I have heard no objections so far!

ai.runToDisk(sample_table, sampled_values=true, nreps=n_reps, ...
    file_prefix=file_prefix, batch_size=4);

input_table = extractInputsUsed(strcat(file_prefix, "_[[1-4]]_inputs.nc"));
[~, ~, coral_params] = ai.splitParameterTable(input_table);

% Collect the desired metrics from the result files
desired_metrics = {@coralEvenness, ...
                   @shelterVolume, ...
                   @(x, p) coralTaxaCover(x, p).total_cover, ...
                   @(x, p) coralTaxaCover(x, p).juveniles, ...
                   };
Y = ai.gatherResults(file_prefix, desired_metrics);

% Total coral cover
TC = concatMetrics(Y, "coralTaxaCover_x_p_total_cover");

% Extract juvenile corals (< 5 cm diameter)
juv = concatMetrics(Y, "coralTaxaCover_x_p_juveniles");

% Evenness
evenness = concatMetrics(Y, "coralEvenness");

% Calculate coral shelter volume per ha
SV_per_ha = concatMetrics(Y, "shelterVolume");

RCI = ReefConditionIndex(evenness, SV_per_ha, TC, juv);

% Collate summary stats
x = struct('TC', TC, 'SV_per_ha', SV_per_ha, 'evenness', evenness, ...
           'juv', juv, 'RCI', RCI);

met_summaries = summarizeMetrics(x);

plotTrajectory(met_summaries.TC);

plotTrajectory(met_summaries.evenness);
ConnectedSystems commented 2 years ago

Closes #92

ConnectedSystems commented 2 years ago

@ryanheneghan @Rosejoycrocker

Completely forgot to say: As part of this set of changes I had to update ReefConditionIndex() to use pre-calculated metrics values.

ryanheneghan commented 2 years ago

Thanks Takuya, I'll take a look at this and provide feedback asap. Apologies for the silence - I've had something urgent come up that's due Thursday that is taking all my attention.

On Tue, Feb 15, 2022 at 5:16 PM Takuya Iwanaga @.***> wrote:

@ryanheneghan https://github.com/ryanheneghan @Rosejoycrocker https://github.com/Rosejoycrocker

Completely forgot to say: As part of this set of changes I had to update ReefConditionIndex() to use pre-calculated metrics values.

— Reply to this email directly, view it on GitHub https://github.com/open-AIMS/ADRIA_repo/pull/95#issuecomment-1039933037, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMUXJVG2UILRQKIIWE5DDFLU3H4S5ANCNFSM5ONMZBUA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

ConnectedSystems commented 2 years ago

Closing in favour of #103 which includes this change

ConnectedSystems commented 2 years ago

Sorry, in favour of #101 not #103