Non Linear Regression for a surface
3 次查看（过去 30 天）
I have the following matrices, and their dimensions:
X (1*249 double)
Y (1*20 double)
Z (20*249 double)
I know that the relation between X and Z is a Sigmoid function ( Z = 1/exp(b(1).*X + b(2))).
I would like to find a function Z = function(X,Y), with the variables X, and Y.
@Hidd_1 "I found a function that fitt the surface with R2 = 0.92, do you have any tips how can I improve it?"
About this problem, you may try this, here's the result:
The fitted surface match your data quite well.
The model I used is a neural net, and its mathematical model is just lots of "weighted sigmoid function".
Notation: is point-wise sigmoid function, and are weight matrices and bias vectors
The neural net perform the following operation;
Neural nets are universal approximator, so if you want further improvement, use a larger net, but be careful of overfitting.
clear; clc; close all;
% to run this script, download the tool
% at file exchange: https://tinyurl.com/wre9r5uk
%% Reshape the data to required format
Y = 1:0.2:4.8;
%% model set up
NN.InputAutoScaling='on'; NN.LabelAutoScaling='on'; % perform normalization x'=(x-mean(x))/std(x)
NN.ActivationFunction='Sigmoid'; % 'Gaussian' actually performs better
InSize=2; OutSize=1; % input : x,y ,output : z=f(x,y)
LayerStruct=[InSize,5,5,5,OutSize]; % change the size of network here, e.x. [2,10,10,1];
%% least square solver
legend('data point','fitted surface')