pyflux icon indicating copy to clipboard operation
pyflux copied to clipboard

getting fitted values and residuals

Open wgmueller1 opened this issue 8 years ago • 3 comments

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.

wgmueller1 avatar Feb 22 '17 17:02 wgmueller1

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).

RJT1990 avatar Feb 22 '17 17:02 RJT1990

Hello,I am a new hand on pyflux. mu,Y=model._model(model.latent_variables.get_z_values()) mu is the fitted values?

yuiant avatar Jan 18 '18 09:01 yuiant

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'

bastien-unchartech avatar Oct 11 '18 16:10 bastien-unchartech