I am a new user of Wolfram Mathematica. I need your help.
Let's say I have three variables: x, y, z. I want to calculate the "z" depending on x, and y. In other words, I want to find a function for z like z=f(x,y)
.
I have this data
y = {140, 360, 500, 740, 800};
x = {4, 10, 35, 70, 90};
z = {{97.438, 103.891, 110.344, 118.7545, 124.13475},
{110.344, 116.797, 123.25, 127.165, 129.515},
{118.7545, 122.95975, 127.165, 131.08, 131.865},
{121.444625, 124.8923125, 128.34, 131.4725, 132.2575},
{124.13475, 126.824875, 129.515, 131.865, 132.65}
};
I have found this thread enter link description here
based on which I have
- Created the plots of the data
ListPlot3D[vals, Mesh -> All]
2. Created the predict and prediction is by "LinearRegression"
trainingSet =
Flatten[Table[
Rule[{s[[i]], t[[j]]}, data[[i, j]]], {i, Length@s}, {j,
Length@t}], 1];
pf = Predict[trainingSet, Method -> "LinearRegression"];
Show[Plot3D[pf[{x, y}], {x, Min@s, Max@s}, {y, Min@t, Max@t}],
ListPointPlot3D[vals, PlotStyle -> {PointSize -> Large}]]
[![enter image description here][3]][3]
LinearRegression results.
it doesn't represent all the points that I need.
- By "
PredictorInformation[pf, "Function"]
" I get the function of my data. The function is = "109.712 + 0.115408 #1 + 0.0168067 #2 &"
However, the prediction is linear which doesn't fully give me what I want to see. There is another prediction method which is "GaussianProcess" and it gives me what I want it to see.
but when I try to get the function of it by "PredictorInformation[pf, "Function"]"
there is an error "PredictorInformation::elmntavs: "Function" is not an available property. Did you mean "FunctionMemory" instead?
"
So my question is: Is there a way of getting the function of GaussianProcess prediction?
Or if there is not a way for that. How can I get a function of z = f(x,y) that would represent my data properly?
Fit
orNonlinearModelFit
(a 2nd degree model will probably do). Predict is a machine learning method that is geared towards prediction of unseen values and not so much towards fitting a model you can easily interpret. $\endgroup$