fstats_doe_diagnostics Module

DOE goodness of fit, residual analysis, comparison, and ANOVA.

The routines in this module operate on a fitted (or user-defined) doe_model and the data used to evaluate it. In each case, the model is evaluated at the M-by-N factor matrix X using doe_evaluate_model, and the result is compared with the M observed responses Y. The factor values must be supplied in the same scale (e.g. coded on [-1, 1]) used when the model was fit.

The number of model parameters, , is taken as the number of coefficients enabled in the model's usage map (i.e. count(mdl%map)).



Functions

public function doe_compare_models(mdl1, mdl2, x, y) result(comp)

Compares two DOE models using the same data set.

Read more…

Arguments

Type IntentOptional Attributes Name
class(doe_model), intent(in) :: mdl1

The full model.

class(doe_model), intent(in) :: mdl2

The reduced model.

real(kind=real64), intent(in), dimension(:,:) :: x

The M-by-N matrix containing the M values of each of the N factors at which to evaluate both models.

real(kind=real64), intent(in), dimension(:) :: y

The M-element array containing the observed responses. This array must have the same number of rows as x.

Return Value type(doe_comparison_result)

A doe_comparison_result object containing the comparison results.

public function doe_model_anova(mdl, x, y) result(anova)

Computes an analysis of variance (ANOVA) table for a DOE model.

Read more…

Arguments

Type IntentOptional Attributes Name
class(doe_model), intent(in) :: mdl

The DOE model to analyze.

real(kind=real64), intent(in), dimension(:,:) :: x

The M-by-N matrix containing the M values of each of the N factors at which to evaluate the model.

real(kind=real64), intent(in), dimension(:) :: y

The M-element array containing the observed responses. This array must have the same number of rows as x.

Return Value type(doe_anova_table)

A doe_anova_table object containing the ANOVA table.

public function doe_model_diagnostics(mdl, x, y) result(diag)

Computes model diagnostics and goodness-of-fit metrics.

Read more…

Arguments

Type IntentOptional Attributes Name
class(doe_model), intent(in) :: mdl

The fitted DOE model.

real(kind=real64), intent(in), dimension(:,:) :: x

The M-by-N matrix containing the M values of each of the N factors used in model fitting.

real(kind=real64), intent(in), dimension(:) :: y

The M-element array containing the observed responses. This array must have the same number of rows as x.

Return Value type(doe_diagnostics)

A doe_diagnostics object containing the R-squared, adjusted R-squared, RMSE, residual standard error, F-statistic, mean response, observation count, and parameter count.

public function doe_residuals_analysis(mdl, x, y) result(resid)

Computes residual analysis data for model diagnostics.

Read more…

Arguments

Type IntentOptional Attributes Name
class(doe_model), intent(in) :: mdl

The fitted DOE model.

real(kind=real64), intent(in), dimension(:,:) :: x

The M-by-N matrix containing the M values of each of the N factors at which to evaluate the model.

real(kind=real64), intent(in), dimension(:) :: y

The M-element array containing the observed responses. This array must have the same number of rows as x.

Return Value type(doe_residuals)

A doe_residuals object containing the observed values, predicted values, residuals, standardized residuals, and the residual mean and standard deviation.