gadget-framework / gadget2

Gadget is the Globally applicable Area Disaggregated General Ecosystem Toolbox
GNU General Public License v2.0
18 stars 20 forks source link

Predictions from the survey index likelihood component #25

Closed alfonsoperezrodriguez closed 5 years ago

alfonsoperezrodriguez commented 6 years ago

Hello, here another question.

I am using the survey index at age as likelihood components with a loglinearfit type.

My question is about the parameters intercept and slope. As far as I know what you compare with the observed index is not the Nt directly but intercept+slope*Nt, as it is indicated in the equation to estimate the loglikelihood score.

Then, the numbers in the file are the final survey index? Do I have to use the slope and intercept to transform the numbers in the table somehow?

Thanks, Alfonso.

bthe commented 6 years ago

The comparison is based on a linear regression of the modeled abundance (or biomass), which can be log-transformed. The likelihood printer output from gadget prints out the raw modeled abundance, not the value which is used to compare with the data. To do this you need to take the alpha and beta to transform the output from gadget to be able to compare with the model. These numbers are printed at the bottom of the output file.

Note that all this is taken care of in Rgadget, so in R all you need to do:

fit <- gadget.fit(wgts=NULL, params.file = 'paramsfile') ## this will call gadget and get the fit to all likelihood components in the correct format..
fit$sidat

where fit$sidat gives you the model output joined with the input data along with the transformed model index.

alfonsoperezrodriguez commented 6 years ago

Thanks Bjarki, I will check in Rgadget code to find the way the parameters are used