Effacer les filtres
Effacer les filtres

Is it possible to obtain the script file for the fitlm function?

7 vues (au cours des 30 derniers jours)
Gautam
Gautam le 18 Mar 2014
I need the script file for the fitlm, using the polyijk attribute, so that I can create my own modified function. Is that possible or should I necessarily use the one given by the Matlab statistics toolbox.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 20 Mar 2014
edit fitlm
And since fitlm is just a wrapper around LinearModel.fit:
edit LinearModel.fit
  1 commentaire
Gautam
Gautam le 20 Mar 2014
Oh, thanks very much. That answers my question.

Connectez-vous pour commenter.

Plus de réponses (1)

Shashank Prasanna
Shashank Prasanna le 20 Mar 2014
Modifié(e) : Shashank Prasanna le 20 Mar 2014
It is not entirely clear what you are requesting but if you have fit a linear model using fitlm as follows:
mdl = fitlm(...)
You can access the model function this way:
mdl.Formula.ModelFun
If you want to use an custom polynomial function you can type it out:
y ~ 1 + x1^2 ... so on
If you want to use an arbitrary function i recommend fitnlm :
  2 commentaires
Gautam
Gautam le 20 Mar 2014
Thanks for replying, but I was hoping to get the code for the function, not the function syntax.
Shashank Prasanna
Shashank Prasanna le 20 Mar 2014
Can you elaborate? its not very clear what you are asking for. What do you mean by code for the function? If it is code for fitlm, then see what Sean posted. If not please explain.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by