GLEON / LakeMetabolizer

Collection of Lake Metabolism Functions
16 stars 10 forks source link

Model Fits #144

Closed RFlazcano closed 2 years ago

RFlazcano commented 3 years ago

Is there a way when running the models to also get the model fits as output? Some of the days in my dataset are generating 'impossible' GPP and CR values, trying to see if this could be due to poor fits on those days.

jzwart commented 3 years ago

Hi @RFlazcano what fit metab fit method are you using?

RFlazcano commented 3 years ago

Hi, I have been using the bayesian method.

jzwart commented 3 years ago

You can access other attributes from the model fits with

attr(model_out, 'attr_name') 

for bayesian method, you can access the jags model with model, fitted parameters with params, or the standard deviation of the estimated metabolism with metab.sd - see list here. For example, if you want to access these attributes using the demo code, after fitting the bayesian model here you could access standard deviation of the model fits with:

> attr(bayes.res, 'metab.sd')
  year doy      GPPsd        Rsd      NEPsd
1 2009 183 0.02058126 0.02053629 0.02907451
2 2009 184 0.02601569 0.02501228 0.03608920
3 2009 185 0.03036113 0.02933163 0.04221543
4 2009 186 0.02357550 0.02318174 0.03306353
5 2009 187 0.02870900 0.02874457 0.04062582
6 2009 188 0.02870158 0.02859743 0.04051658
7 2009 189 0.02733625 0.02667180 0.03819234
8 2009 190 0.03161766 0.03150976 0.04463789
9 2009 191 0.01397511 0.01390819 0.01971652
RFlazcano commented 3 years ago

Thank you!