Creating Equation from Data

9 visualizaciones (últimos 30 días)
Derrick Vaughn
Derrick Vaughn el 21 de Abr. de 2020
Comentada: Ameer Hamza el 21 de Abr. de 2020
Hi, I'm a relatively new user to Matlab and have hit a roadblock. I'm currently trying to generate an equation with three independent variables (Discharge_prist, Q_prist, Ch_slope) and one dependent variable (Infill_vol), with the dependent variable being a function of the three independent variables. The only function I could find to do this was fitlm (see code below) but I'm not sure if it's the best to use here based on the low confidence that came with the equation it generated from the data. Is there anything else I can use? Thanks!
Also, I do not have permission to attach the data for the 4 variables here so I included a line of code that generated random numbers for each variable. I don't necessarily need the an equation right now that works with the data, just a way to generate one.
discharge_prist=rand(100,1);
q_prist=rand(100,1);
ch_slope=rand(100,1);
infill_vol=rand(100,1);
TBL=table(discharge_prist,q_prist,ch_slope,infill_vol);
mdl=fitlm(TBL,'infill_vol~discharge_prist+q_prist+ch_slope')
  3 comentarios
Derrick Vaughn
Derrick Vaughn el 21 de Abr. de 2020
Hi Ameer, the data wasn't generated by a model. The data was measured in the field. I'm trying to create a model that relates the infill to the other three variables. The problem I've run into is just I'm not sure how to move further in Matlab past using fitlm to generate a model that does just that. Any recommendations will be useful!
Also, I tried using nlinfit but I wasn't sure what values I would need to use for beta0 (the initial values). https://nl.mathworks.com/help/stats/nlinfit.html
Ameer Hamza
Ameer Hamza el 21 de Abr. de 2020
Derrick, in nlinfit(), beta0 is just the initial point for the optimization algorithm, and it is not a big issue. You can select it randomly or make an educated guess based on your model or data. The actual issue is, what is the formula for modelfun? You need to have an equation (with unknown parameters) that can relate the input observations to the output data. Then you can use the observed to find the unknown parameters.

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by