nansencenter / DAPPER

Data Assimilation with Python: a Package for Experimental Research
https://nansencenter.github.io/DAPPER
MIT License
341 stars 119 forks source link

Definition of Ko in chrono #107

Open yumengch opened 11 months ago

yumengch commented 11 months ago

Hi Patrick

I understand this might be trivial but I feel this can help others better understand the time handling in DAPPER. I find the definition of HMM.tseq.Ko a bit confusing.

I can understand that the whole trajectory is K+1 with K being the number of forecast time steps (len(kk) == len(tt) == K + 1), and 1 is the initial condition.

But the logic of having len(kko) == len(tto) == Ko+1 is unclear to me. The only reason that I can think of is to match the definition of K. However, we don't have any observation values at initial step, so in the end, when I try to describe Ko, it is always the number of observations minus one. I feel this is an unconventional concept.

patnr commented 11 months ago

Hi! I think indeed there is something suboptimal about this convention. I made the choice about it very early on, when I was still relatively inexperienced with Python vs Matlab. I'm a bit busy now, but will try to say something more soon!

patnr commented 11 months ago

Yes, I completely agree with you. At the time of making the choice I was too amateur with python and felt that kko[Ko] (rather than kko[-1]) would be valuable.

PR would be welcome. Grepping for Ko turns up 82 counts, but there might be other more subtle/implicit hardcoded dependencies on the convention, perhaps necessitating further grepping for len.