compare model result using neural network
4 次查看(过去 30 天)
显示 更早的评论
hi,
For predicting a parameter I have two different equations. I also have my own observations and want to compare them with prediction results to see wich equation is better. I wanted to use neural network like grnn to do this job.
If you have any information in this regard and how to do it, I would be grateful for your help.
0 个评论
回答(1 个)
Ayush Aniket
2025-6-12
One way to do this would be by using a Generalized Regression Neural Network (GRNN). GRNN is particularly useful for function approximation and regression tasks, making it well-suited for your problem. Refer the code snippet below for the general steps that you can follow:
% Load dataset (assuming data to be the variable that stores your data)
X = data.inputs; % Independent variables
Y_actual = data.observed_values; % Actual observations
% Train GRNN model
sigma = 0.1; % Smoothing parameter (adjust as needed)
grnnModel = newgrnn(X', Y_actual', sigma);
% Generate predictions using equations
Y_pred_eq1 = equation1(X); % Replace with actual equation
Y_pred_eq2 = equation2(X); % Replace with actual equation
% Compute GRNN predictions
Y_pred_grnn = sim(grnnModel, X');
% Compare errors
mse_eq1 = mean((Y_pred_eq1 - Y_pred_grnn).^2);
mse_eq2 = mean((Y_pred_eq2 - Y_pred_grnn).^2);
% Determine best equation using errors
Refer the following documentation to read more about the function: https://www.mathworks.com/help/deeplearning/ref/newgrnn.html
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!