-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFaciesModelBestFit.m
26 lines (19 loc) · 942 Bytes
/
FaciesModelBestFit.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function rmse = FaciesModelBestFit(model_distribution, observed_sequence)
% Convert sequence to frequencies
observed_frequency = histcounts(observed_sequence, 'Normalization', 'probability');
% Calculate the root mean squared error (RMSE)
rmse = sqrt(mean((model_distribution - observed_frequency).^2));
% Scatter plot
%scatter(1:length(model_distribution), model_distribution);
%hold on;
%scatter(1:length(observed_frequency), observed_frequency);
% Line plot
plot(1:length(model_distribution), model_distribution, 'LineWidth', 2);
hold on;
plot(1:length(observed_frequency), observed_frequency, 'LineWidth', 2);
% Box plot (uncomment this if you want to use boxplot instead of line plot)
% boxplot([model_distribution(:), observed_frequency(:)], 'Labels',{'Model','Observed'});
legend('Model', 'Observed');
xlabel('Facies');
ylabel('Probability');
end