pyflux
pyflux copied to clipboard
getting fitted values and residuals
Is there a better way to get the fitted values and residuals after fitting a model? I used the following code from plot_fit
mu,Y=model._model(model.latent_variables.get_z_values()) values=model.link(mu)
it would be nice if you could just do model.fit().residuals or model.fit().fitted or something like that.
Hi Graham - agreed, it would be nice to make this easier rather than having to construct manually. The results objects are also in need of further documentation, so will make a note of that. For the meantime, the results objects do contain some properties of the model - such as model.fit().signal, model.fit().states, model.fit().data - but will look to document this and add some more properties (like residuals).
Hello,I am a new hand on pyflux. mu,Y=model._model(model.latent_variables.get_z_values()) mu is the fitted values?
Hi, Is there any update on this post ? I am struggling to get the residuals of a fitted model. As far as i'm concerned, model.link(mu) does not work. The function link is unknown., i get the following error: object has no attribute 'link'