1
votes

I am using Surface fitting toolbox in Matlab r2010b to curve fit 3 dimesional data. This tool is very useful and easy tool for doing 3d curve fitting via GUI. Until now, I deal with 3d data like; (X input : x (n x 1 vector), Y input : y (n x 1 vector), and Z output : z (n x n matrix))

But now, I am try to deal with 4 dimensional data like; (X input : x (n x 1 vector), Y input : y (n x 1 vector), Z input : z (n x 1 vector) and T output : t (n x n x n matrix)).

I cannot achieve this via surface fitting toolbox. How can I do curve fitting with 4 dimensional data?

Will appreciate any help on this.

1
I think you might have to implement a spline fitting or other similar algorithms in 4D yourself. You can also see if the info in this thread is helpful.user564376

1 Answers

1
votes

I can point you at a variety of different algorithms for 4d curve fitting. The correct choice of methods will depend on what information you have available regarding the relationship between your variables.

  1. If you know that there is a linear relationship between your variables, your best option is to use the "regress" command in Statistics Toolbox.

  2. If you know that the relationship between your variables is best described using a known nonlinear relationship then you should look at "nlinfit".

  3. If you can't specify a model that describes the relationship between your variables your best option is to use a boosted or a bagged decision tree.

I attached a very simple example showing how to use regress to fit a plane to a set of data points.

X = 10 * rand(100,1);
Y = 10 * randn(100,1);
Z = 10 * randn(100,1);

t = 50 + 2*X + 3*Y + 4*Z;

b = regress(t, [ones(length(t),1), X, Y, Z])