How to derive a function from 6 variables
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Flavio Lupoli
le 17 Nov 2022
Commenté : Flavio Lupoli
le 20 Nov 2022
I have a nx1 column array A and a nx6 matrix B. Every line of the matrix B corresponds to a value in the same line of A. I want to "interpolate" these values (not sure if it is the right term) so that I obtain a function that puts in correlation every line of B with the correspondent line of A (so basically, a function f of six variables). Which Matlab function should I use?
1 commentaire
VBBV
le 17 Nov 2022
Search in the google god. You will find many results suggesting which function to use. Or use the help centre of matlab website to find more info about those functions.
Réponse acceptée
John D'Errico
le 17 Nov 2022
Modifié(e) : John D'Errico
le 17 Nov 2022
Knowing which function to use, given 6 independent variables is terribly difficult to know. If you lack knowledge of a good nonlinear form, it is often the case you want to use simple, LOW order polynomial models. A linear model would be a start, so linear in 6 variables. Even there you will have 7 parameters to estimate. (Don't forget the constatn term.)
That fit requires nothing more than:
% coeffs = [B,ones(n1)]\A;
So the constant term will be the last coefficient in that list.
I don't know how much data you have, but that is where I would start. Beyond that point, beware, as there lie dragons. Far too many people want to fit high order polynomials. And that is often a bad idea. At most, I might suggest a 2nd order polynomial model. You could use my polyfitn, as found on the file exchange. But as I said, far too many abuse this sort of thing, not realizing how difficult polynomials can get in high dimensions.
If you find the fit is inadequate with the linear polynomial, AND you have sufficient data to build a neural net model, I would go in that direction. Of course, it would require you learn to use those tools. You might start looking here:
help fitnet
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!