Среднеквадратичная ошибка matlab

Main Content

Syntax

Description

example

err = immse(X,Y)
calculates the mean-squared error (MSE) between the arrays X
and Y. A lower MSE value indicates greater similarity between
X and Y.

Examples

collapse all

Calculate Mean-Squared Error in Noisy Image

Read image and display it.

ref = imread('pout.tif');
imshow(ref)

Figure contains an axes object. The axes object contains an object of type image.

Create another image by adding noise to a copy of the reference image.

A = imnoise(ref,'salt & pepper', 0.02);
imshow(A)

Figure contains an axes object. The axes object contains an object of type image.

Calculate mean-squared error between the two images.

err = immse(A, ref);
fprintf('\n The mean-squared error is %0.4f\n', err);
 The mean-squared error is 353.7631

Input Arguments

collapse all

XInput array
numeric array

Input array, specified as a numeric array of any dimension.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

YInput array
numeric array

Input array, specified as a numeric array of the same size and data type as
X.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Output Arguments

collapse all

err — Mean-squared error
positive number

Mean-squared error, returned as a positive number. The data type of err
is double unless the input arguments are of data type
single, in which case err is of
data type single

Data Types: single | double

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

immse supports the generation of C
code (requires MATLAB®
Coder™
). For more information, see Code Generation for Image Processing.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2014b

Root-mean-square error between arrays

Since R2022b

Syntax

Description

example

E = rmse(F,A)
returns the root-mean-square
error (RMSE) between the forecast (predicted) array F and the
actual (observed) array A.

  • F and A must either be the same size or
    have sizes that are compatible.

  • If F and A are vectors of the same size,
    then E is a scalar.

  • If F-A is a matrix, then E is a row vector
    containing the RMSE for each column.

  • If F and A are multidimensional arrays,
    then E contains the RMSE computed along the first array dimension
    of size greater than 1, with elements treated as vectors. The size of
    E in this dimension is 1, while the sizes of all other
    dimensions are the same as in F-A.

E = rmse(F,A,"all")
returns the RMSE of all elements in F and A.

example

E = rmse(F,A,dim)
operates along dimension dim. For example, if F and
A are matrices, then rmse(F,A,2) operates on the
elements in each row and returns a column vector containing the RMSE of each row.

example

E = rmse(F,A,vecdim)
operates along the dimensions specified in the vector vecdim. For
example, if F and A are matrices, then
rmse(F,A,[1 2]) operates on all the elements in F
and A because every element of a matrix is contained in the array slice
defined by dimensions 1 and 2.

example

E = rmse(___,nanflag)
specifies whether to include or omit NaN values in F
and A for any of the previous syntaxes. For example,
rmse(F,A,"omitnan") ignores NaN values when
computing the RMSE. By default, rmse includes NaN
values.

example

E = rmse(___,Weight=W)
specifies a weighting scheme W and returns the weighted RMSE. If
W is a vector, its length must equal the length of the operating
dimension. If W is a matrix or multidimensional array, it must have the
same dimensions as F, A, or F-A.
You cannot specify a weighting scheme if you specify vecdim or
"all".

Examples

collapse all

RMSE of Two Forecasts

Create two column vectors of forecast (predicted) data and one column vector of actual (observed) data.

F1 = [1; 10; 9];
F2 = [2; 5; 10];
A = [1; 9; 10];

Compute the RMSE between each forecast and the actual data.

Alternatively, create a matrix containing both forecasts and compute the RMSE between each forecast and the actual data in one command.

The first element of E is the RMSE between the first forecast column and the actual data. The second element of E is the RMSE between the second forecast column and the actual data.

RMSE of Matrix Rows

Create a matrix of forecast data and a matrix of actual data.

F = [17 19; 1 6; 16 15];
A = [17 25; 3 4; 16 13];

Compute the RMSE between the forecast and the actual data across each row by specifying the operating dimension as 2. The smallest RMSE corresponds to the RMSE between the third rows of the forecast data and actual data.

E = 3×1

    4.2426
    2.0000
    1.4142

RMSE of Array Pages

Create a 3-D array with pages containing forecast data and a matrix of actual data.

F(:,:,1) = [2 4; -2 1];
F(:,:,2) = [4 4; 8 -3];
A = [6 7; 1 4];

Compute the RMSE between the predicted data in each page of the forecast array and the actual data matrix by specifying a vector of operating dimensions 1 and 2.

E = 
E(:,:,1) =

    3.2787


E(:,:,2) =

    5.2678

The first page of E contains the RMSE between the first page of F and the matrix A. The second page of E contains the RMSE between the second page of F and the matrix A.

RMSE Excluding Missing Values

Create a matrix of forecast data and a matrix of actual data containing NaN values.

F = [17 19 3; 6 16 NaN];
A = [17 25 NaN; 4 16 NaN];

Compute the RMSE between the forecast and the actual data, ignoring NaN values. For columns that contain all NaN values in F or A, the RMSE is NaN.

E = 1×3

    1.4142    4.2426       NaN

Specify RMSE Weight Vector

Create a forecast column vector and an actual column vector.

F = [2; 10; 13];
A = [1; 9; 10];

Compute the RMSE between the forecast and actual data according to a weighting scheme specified by W.

W = [0.5; 0.25; 0.25];
E = rmse(F,A,Weight=W)

Input Arguments

collapse all

FForecast array
vector | matrix | multidimensional array

Forecast or predicted array, specified as a vector, matrix, or multidimensional
array.

Inputs F and A must either be the same size or
have sizes that are compatible. For example, F is an
m-by-n matrix and
A is a 1-by-n row vector. For more
information, see Compatible Array Sizes for Basic Operations.

Data Types: single | double
Complex Number Support: Yes

AActual array
vector | matrix | multidimensional array

Actual or observed array, specified as a vector, matrix, or multidimensional
array.

Inputs F and A must either be the same size or
have sizes that are compatible. For example, F is an
m-by-n matrix and
A is a 1-by-n row vector. For more
information, see Compatible Array Sizes for Basic Operations.

Data Types: single | double
Complex Number Support: Yes

dimDimension to operate along
positive integer scalar

Dimension
to operate along, specified as a positive integer scalar. If you do not specify the dimension,
then the default is the first array dimension of size greater than 1.

The size of E in the operating dimension is 1. All other
dimensions of E have the same size as the result of
F-A.

For example, consider four forecasts in a 3-by-4 matrix, F, and
actual data in a 3-by-1 column vector, A:

  • rmse(F,A,1) computes the RMSE of the elements in each
    column and returns a 1-by-4 row vector.

    The size of E in the operating dimension is 1. The
    difference of F and A is a 3-by-4 matrix.
    The size of E in the nonoperating dimension is the same as the
    second dimension of F-A, which is 4. The overall size of
    E becomes 1-by-4.

  • rmse(F,A,2) computes the RMSE of the elements in each row
    and returns a 3-by-1 column vector.

    The size of E in the operating dimension is 1. The
    difference of F and A is a 3-by-4 matrix.
    The size of E in the nonoperating dimension is the same as the
    first dimension of F-A, which is 3. The overall size of
    E becomes 3-by-1.

vecdimVector of dimensions to operate along
vector of positive integers

Vector of dimensions to operate along, specified as a vector of positive integers.
Each element represents a dimension of the input arrays. The size of
E in the operating dimensions is 1. All other dimensions of
E have the same size as the result of
F-A.

For example, consider forecasts in a 2-by-3-by-3 array, F, and
actual data in a 1-by-3 row vector, A. rmse(F,A,[1
2])
computes the RMSE over each page of F and returns a
1-by-1-by-3 array. The size of E in the operating dimensions is 1.
The difference of F and A is a 2-by-3-by-3 array.
The size of E in the nonoperating dimension is the same as the third
dimension of F-A, which is 3.

nanflagMissing value condition
"includemissing" (default) | "includenan" | "omitmissing" | "omitnan"

Missing value condition, specified as one of these values:

  • "includemissing" or "includenan"
    Include NaN values in the input arrays when computing the RMSE.
    If any element in the operating dimension is NaN, then the
    corresponding element in E is NaN.
    "includemissing" and "includenan" have the
    same behavior.

  • "omitmissing" or "omitnan" — Ignore
    NaN values in the input arrays when computing the RMSE. If all
    elements in the operating dimension are NaN in
    F, A, or W, then the
    corresponding element in E is NaN.
    "omitmissing" and "omitnan" have the same
    behavior.

WWeighting scheme
vector | matrix | multidimensional array

Weighting scheme, specified as a vector, matrix, or multidimensional array. The
elements of W must be nonnegative.

If W is a vector, it must have the same length as the operating
dimension. If W is a matrix or multidimensional array, it must have
the same dimensions as F, A, or
F-A.

You cannot specify this argument if you specify vecdim or
"all".

Data Types: single | double

More About

collapse all

Root-Mean-Square Error

For a forecast array F and actual array
A made up of n scalar observations, the
root-mean-square error is defined as

with the summation performed along the specified dimension.

Weighted Root-Mean-Square Error

For a forecast array F and actual array
A made up of n scalar observations and weighting
scheme W, the weighted root-mean-square error is defined as

with the summation performed along the specified dimension.

Extended Capabilities

Tall Arrays
Calculate with arrays that have more rows than fit in memory.

This function fully supports tall arrays. For
more information, see Tall Arrays.

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.

This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).

Distributed Arrays
Partition large arrays across the combined memory of your cluster using Parallel Computing Toolbox™.

This function fully supports distributed arrays. For more
information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).

Version History

Introduced in R2022b

expand all

R2023a: Specify missing value condition

Include or omit missing values in the input arrays when computing the RMSE by using the
"includemissing" or "omitmissing" options. These
options have the same behavior as the "includenan" and
"omitnan" options, respectively.

R2023a: Improved performance with small group size

The rmse function shows improved performance when computing over a
real vector when the operating dimension is not specified. The function determines the
default operating dimension more quickly in R2023a than in R2022b.

For example, this code computes the root-mean-square error along the default vector
dimension. The code is about 2x faster than in the previous release.

function timingRmse
F = rand(10,1);
A = rand(10,1);
for i = 1:8e5
    rmse(F,A);
end
end

The approximate execution times are:

R2022b: 4.12 s

R2023a: 2.07 s

The code was timed on a Windows® 10, Intel®
Xeon® CPU E5-1650 v4 @ 3.60 GHz test system using the timeit
function.

R2023a: Code generation support

Generate C or C++ code for the rmse function.

  • Редакция Кодкампа


читать 1 мин


Одной из наиболее распространенных метрик, используемых для измерения точности прогноза модели, является MSE , что означает среднеквадратичную ошибку .

Он рассчитывается как:

MSE = (1/n) * Σ(факт – прогноз) 2

куда:

  • Σ — причудливый символ, означающий «сумма».
  • n – размер выборки
  • фактический – фактическое значение данных
  • прогноз – прогнозируемое значение данных

Чем ниже значение MSE, тем лучше модель способна точно прогнозировать значения.

Чтобы вычислить MSE в MATLAB, мы можем использовать функцию mse(X, Y) .

В следующем примере показано, как использовать эту функцию на практике.

Пример: как рассчитать MSE в MATLAB

Предположим, у нас есть следующие два массива в MATLAB, которые показывают фактические значения и прогнозируемые значения для некоторой модели:

%create array of actual values and array of predicted values
actual = [34 37 44 47 48 48 46 43 32 27 26 24];
predicted = [37 40 46 44 46 50 45 44 34 30 22 23];

Мы можем использовать функцию mse(X, Y) для вычисления среднеквадратичной ошибки (MSE) между двумя массивами:

%calculate MSE between actual values and predicted values
mse(actual, predicted)

ans = 5.9167

Среднеквадратическая ошибка (MSE) этой модели оказывается равной 5,917 .

Мы интерпретируем это как означающее, что среднеквадратическая разница между предсказанными значениями и фактическими значениями составляет 5,917 .

Мы можем сравнить это значение с MSE, полученным другими моделями, чтобы определить, какая модель является «лучшей».

Модель с наименьшим MSE — это модель, которая лучше всего способна прогнозировать фактические значения набора данных.

Дополнительные ресурсы

В следующих руководствах объясняется, как рассчитать среднеквадратичную ошибку с помощью другого статистического программного обеспечения:

Как рассчитать среднеквадратичную ошибку (MSE) в Excel
Как рассчитать среднеквадратичную ошибку (MSE) в Python
Как рассчитать среднеквадратичную ошибку (MSE) в R

Среднеквадратическая ошибка

Синтаксис

Описание

пример

err = immse(X,Y) вычисляет среднеквадратическую ошибку (MSE) между массивами X и Y.

Примеры

свернуть все

Вычислите среднеквадратическую ошибку в шумном изображении

Считайте изображение и отобразите его.

ref = imread('pout.tif');
imshow(ref)

Figure contains an axes object. The axes object contains an object of type image.

Создайте другое изображение путем добавления шума в копию ссылочного изображения.

A = imnoise(ref,'salt & pepper', 0.02);
imshow(A)

Figure contains an axes object. The axes object contains an object of type image.

Вычислите среднеквадратическую ошибку между двумя изображениями.

err = immse(A, ref);
fprintf('\n The mean-squared error is %0.4f\n', err);
 The mean-squared error is 353.7631

Входные параметры

свернуть все

XВходной массив
числовой массив

Входной массив в виде числового массива любой размерности.

Типы данных: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

YВходной массив
числовой массив

Входной массив в виде числового массива, одного размера и тип данных как X.

Типы данных: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Выходные аргументы

свернуть все

err — Среднеквадратическая ошибка
положительное число

Среднеквадратическая ошибка, возвращенная как положительное число. Тип данных err double если входные параметры не имеют типа данных single, в этом случае err имеет тип данных single

Типы данных: single | double

Расширенные возможности

Генерация кода C/C++
Генерация кода C и C++ с помощью MATLAB® Coder™.

immse поддерживает генерацию кода С (требует MATLAB® Coder™). Для получения дополнительной информации смотрите Генерацию кода для Обработки изображений.

Генерация кода графического процессора
Сгенерируйте код CUDA® для NVIDIA® графические процессоры с помощью GPU Coder™.

Введенный в R2014b

Main Content

Syntax

Description

example

err = immse(X,Y)
calculates the mean-squared error (MSE) between the arrays X
and Y. A lower MSE value indicates greater similarity between
X and Y.

Examples

collapse all

Calculate Mean-Squared Error in Noisy Image

Read image and display it.

ref = imread('pout.tif');
imshow(ref)

Figure contains an axes object. The axes object contains an object of type image.

Create another image by adding noise to a copy of the reference image.

A = imnoise(ref,'salt & pepper', 0.02);
imshow(A)

Figure contains an axes object. The axes object contains an object of type image.

Calculate mean-squared error between the two images.

err = immse(A, ref);
fprintf('n The mean-squared error is %0.4fn', err);
 The mean-squared error is 353.7631

Input Arguments

collapse all

XInput array
numeric array

Input array, specified as a numeric array of any dimension.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

YInput array
numeric array

Input array, specified as a numeric array of the same size and data type as
X.

Data Types: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Output Arguments

collapse all

err — Mean-squared error
positive number

Mean-squared error, returned as a positive number. The data type of err
is double unless the input arguments are of data type
single, in which case err is of
data type single

Data Types: single | double

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

immse supports the generation of C
code (requires MATLAB®
Coder™
). For more information, see Code Generation for Image Processing.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced in R2014b

Main Content

Mean squared normalized error performance function

Syntax

Description

example

perf = mse(net,t,y,ew)
takes a neural network, net, a matrix or cell array of targets,
t, a matrix or cell array of outputs, y, and error
weights, ew, and returns the mean squared error.

This function has two optional parameters, which are associated with networks whose
net.trainFcn is set to this function:

  • 'regularization' can be set to any value between 0 and 1. The greater
    the regularization value, the more squared weights and biases are included in the performance
    calculation relative to errors. The default is 0, corresponding to no regularization.

  • 'normalization' can be set to 'none' (the
    default); 'standard', which normalizes errors between -2 and 2,
    corresponding to normalizing outputs and targets between -1 and 1; and
    'percent', which normalizes errors between -1 and 1. This feature is
    useful for networks with multi-element outputs. It ensures that the relative accuracy of
    output elements with differing target value ranges are treated as equally important, instead
    of prioritizing the relative accuracy of the output element with the largest target value
    range.

You can create a standard network that uses mse with
feedforwardnet or cascadeforwardnet. To prepare a custom
network to be trained with mse, set net.performFcn to
'mse'. This automatically sets net.performParam to a
structure with the default optional parameter values.

mse is a network performance function. It measures the network’s
performance according to the mean of squared errors.

Examples

collapse all

Train Neural Network Using mse Performance Function

This example shows how to train a neural network using the mse performance function.

Here a two-layer feedforward network is created and trained to estimate body fat percentage using the mse performance function and a regularization value of 0.01.

[x, t] = bodyfat_dataset;
net = feedforwardnet(10);
net.performParam.regularization = 0.01;

MSE is the default performance function for feedforwardnet.

Train the network and evaluate performance.

net = train(net, x, t);
y = net(x);
perf = perform(net, t, y)

Alternatively, you can call mse directly.

perf = mse(net, t, y, 'regularization', 0.01)

Input Arguments

collapse all

netInput matrix
matrix

Network you want to calculate the performance of, specified as a SeriesNetwork or a
DAGNetwork
object.

tTargets
matrix | cell array

Targets, specified as a matrix or a cell array.

yOutputs
matrix | cell array

Outputs, specified as a matrix or a cell array.

ewError weights
1 (default) | scalar

Error weights, specified as a scalar.

Output Arguments

collapse all

perf — Network performance
scalar

Performance of the network as the mean squared errors.

Version History

Introduced before R2006a

  • Редакция Кодкампа

17 авг. 2022 г.
читать 1 мин


Одной из наиболее распространенных метрик, используемых для измерения точности прогноза модели, является MSE , что означает среднеквадратичную ошибку .

Он рассчитывается как:

MSE = (1/n) * Σ(факт – прогноз) 2

куда:

  • Σ — причудливый символ, означающий «сумма».
  • n – размер выборки
  • фактический – фактическое значение данных
  • прогноз – прогнозируемое значение данных

Чем ниже значение MSE, тем лучше модель способна точно прогнозировать значения.

Чтобы вычислить MSE в MATLAB, мы можем использовать функцию mse(X, Y) .

В следующем примере показано, как использовать эту функцию на практике.

Пример: как рассчитать MSE в MATLAB

Предположим, у нас есть следующие два массива в MATLAB, которые показывают фактические значения и прогнозируемые значения для некоторой модели:

%create array of actual values and array of predicted values
actual = [34 37 44 47 48 48 46 43 32 27 26 24];
predicted = [37 40 46 44 46 50 45 44 34 30 22 23];

Мы можем использовать функцию mse(X, Y) для вычисления среднеквадратичной ошибки (MSE) между двумя массивами:

%calculate MSE between actual values and predicted values
mse(actual, predicted)

ans = 5.9167

Среднеквадратическая ошибка (MSE) этой модели оказывается равной 5,917 .

Мы интерпретируем это как означающее, что среднеквадратическая разница между предсказанными значениями и фактическими значениями составляет 5,917 .

Мы можем сравнить это значение с MSE, полученным другими моделями, чтобы определить, какая модель является «лучшей».

Модель с наименьшим MSE — это модель, которая лучше всего способна прогнозировать фактические значения набора данных.

Дополнительные ресурсы

В следующих руководствах объясняется, как рассчитать среднеквадратичную ошибку с помощью другого статистического программного обеспечения:

Как рассчитать среднеквадратичную ошибку (MSE) в Excel
Как рассчитать среднеквадратичную ошибку (MSE) в Python
Как рассчитать среднеквадратичную ошибку (MSE) в R

Среднеквадратическая ошибка

Синтаксис

Описание

пример

err = immse(X,Y) вычисляет среднеквадратическую ошибку (MSE) между массивами X и Y.

Примеры

свернуть все

Вычислите среднеквадратическую ошибку в шумном изображении

Считайте изображение и отобразите его.

ref = imread('pout.tif');
imshow(ref)

Figure contains an axes object. The axes object contains an object of type image.

Создайте другое изображение путем добавления шума в копию ссылочного изображения.

A = imnoise(ref,'salt & pepper', 0.02);
imshow(A)

Figure contains an axes object. The axes object contains an object of type image.

Вычислите среднеквадратическую ошибку между двумя изображениями.

err = immse(A, ref);
fprintf('n The mean-squared error is %0.4fn', err);
 The mean-squared error is 353.7631

Входные параметры

свернуть все

XВходной массив
числовой массив

Входной массив в виде числового массива любой размерности.

Типы данных: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

YВходной массив
числовой массив

Входной массив в виде числового массива, одного размера и тип данных как X.

Типы данных: single | double | int8 | int16 | int32 | uint8 | uint16 | uint32

Выходные аргументы

свернуть все

err — Среднеквадратическая ошибка
положительное число

Среднеквадратическая ошибка, возвращенная как положительное число. Тип данных err double если входные параметры не имеют типа данных single, в этом случае err имеет тип данных single

Типы данных: single | double

Расширенные возможности

Генерация кода C/C++
Генерация кода C и C++ с помощью MATLAB® Coder™.

immse поддерживает генерацию кода С (требует MATLAB® Coder™). Для получения дополнительной информации смотрите Генерацию кода для Обработки изображений.

Генерация кода графического процессора
Сгенерируйте код CUDA® для NVIDIA® графические процессоры с помощью GPU Coder™.

Введенный в R2014b

Residual square and (SSE)

Calculation formula:

sse

Code:

sse = sum((YReal - YPred).^2);

Mean square error (MSE)

Calculation formula:

mse

Code:

mse = sqrt(sum((YReal - YPred).^2))./2;

Average absolute error (MAE)

Calculation formula:

mae

Code:

mae = mean(abs(YReal - YPred));

Average absolute percentage error (MAPE)

Calculation formula:

mape

Code

mape = mean(abs((YReal - YPred)./YReal));

Some root error (RMSE)

Calculation formula:

rmse

Code:

rmse = sqrt(mean((YPred-YReal).^2));

Decision coefficient (R2-R-Square)

Calculation formula:

r2

Code:

r2 = 1 - (sum((YPred - YReal).^2) / sum((YReal - mean(YReal)).^2));

If there is any error, please point out in the comment area, thank you.

Li Pei Guan blog

Welcome to my personal website:

Li Pei Guan blog:lpgit.com

руководство

LEAD

язык

спасибовниманиеПубличный номер энтузиастов Matlab! Если вам нужна статья в публичном аккаунте, не забудьте нажатьПоделисьс участием»смотреть в«О! Если у вас есть какие-либо комментарии или предложения в публичном аккаунте, пожалуйста, ответьте в публичном аккаунте или оставьте сообщение внизу любой статьи!

Автор: Ай Альба

При расчете подбора, интерполяции, моделирования и прогнозирования часто необходимо использовать разницу между фактическим значением и рассчитанным значением, чтобы охарактеризовать осуществимость метода расчета.Сумма квадратов невязок (SSE), среднеквадратическая ошибка (MSE), среднеквадратическая ошибка (RMSE),Средняя абсолютная ошибка (MAE) и коэффициент детерминации R-квадрат (R-квадрат) и т. Д.

1、Сумма квадратов остатков(SSE)

дляСумма квадрата разности между вычисленным значением и соответствующей точкой фактического значения, чем ближе SSE к 0, тем лучше результат вычисления.

2. Среднеквадратичная ошибка (MSE)

Повторно усредните сумму квадратов разности между вычисленными и фактическими значениями, то есть MSE = SSE / n, n — это количество данных, и значение аналогично SSE.

3. Среднеквадратичное отклонение (RMSE)

Это корень среднеквадратичной ошибки (MSE), то есть RMSE = MSE ^ 0,5, что аналогично MSE.

4、Средняя абсолютная ошибка(MAE)

Чтобы усреднить абсолютное значение вычисленного значения и фактическое значение, оно может эффективно предотвращать взаимное устранение ошибок, поэтому оно может более точно отражать размер фактической ошибки прогнозирования.

5、Коэффициент детерминации R(R-Squared)

дляОтношение суммы квадратов регрессий к сумме квадратов отклонений. когдаR-SquaredЧем ближе к 1, тем выше корреляция между вычисленным значением и фактическим значением, и наоборот, чем ближе к 0, тем ниже корреляция.

От 1 до 5, соответствующие параметры:

6. Коэффициент корреляции (COR)

Это отношение ковариации расчетного значения и фактического значения к корню произведения двух дисперсий, используемое для линейного отношения между ними.

7、Средняя абсолютная ошибка в процентах(MAPE) 

Это среднее из отношения абсолютного значения расчетного значения и фактического значения к фактическому значению,Чем меньше значение MAPE, тем меньше разница между вычисленным значением и фактическим значением и тем лучше результат вычисления.

8. Коэффициент неравенства Хилла (Тейл)

Обычно оно составляет от 0 до 1. Чем меньше значение, тем меньше разница между вычисленным значением и истинным значением, то есть чем выше точность результата вычисления.

Пример программы demo.m выглядит следующим образом:

clc;clear;close all;
x = 0:0.2:3;
y = 0.58*x+0.2*rand(1,length(x));
lab = polyfit(x,y,1);
ny = lab(1)*x+lab(2);
plot(x,y,'r.-',x,ny,'bo-');
легенда («Фактическая стоимость», «Подходящая стоимость»);
 title («Тест параметров индекса анализа ошибок»);
Re = calcE(ny,y);

Эффект изображения:

Нужна программа расчета calcE.m и другие связанные файлыДрузья, пожалуйста, ответьте в публичном аккаунтеошибка”、“err«или»R2«Вы можете получить ссылку для скачивания. Если есть другие параметры индикатора, которые не были добавлены, пожалуйста, ответьте в сообщении, и они будут добавлены один за другим позже !!!

Справочные материалы:

[1] https://www.datatechnotes.com/2019/02/regression-model-accuracy-mae-mse-rmse.html

[2] https://www.jianshu.com/p/9ee85fdad150

Изображение обложки было размещено на Pixabay Тумису,Картинки формул в тексте взяты из интернета.

подсказки

Долгосрочная настойчивостьСоздание не легко, если вам нравится этот твит, пожалуйста, будьте свободныдать подобноеДля поощрения! КаквниманиеСпасибо!

Я хочу увидеть его после прочтения (нажмите на текст ниже, чтобы получить прямой доступ)

Произвольное создание QR-кода Matlab

Численный метод оптимизации — метод итерации и условие завершения

Научный сотрудник Рекомендация шестая

Matlab рисует прямые линии со стрелками между любыми двумя точками

Быстрый старт в MATLAB-работе с графическими объектами

Технология нанесения водяных знаков на изображение Matlab

смотреть вкликните сюда

Понравилась статья? Поделить с друзьями:
  • Среднеквадратичная ошибка разности
  • Спутниковое тв триколор ошибка 10 что делать
  • Среднеквадратическая ошибка mse формула
  • Среднеквадратическое отклонение и стандартная ошибка
  • Средний отказ кисти робот пылесос редмонд ошибка