Chapter 3 Getting your data in right format

Your data need to be a matrix (not data frame nor a ts object) with time across the columns (\(n \times T\) matrix). The MARSS functions assume discrete time steps and you will need a column for each time step. Replace any missing time steps with NA. Why does MARSS require your data in matrix form? Because MARSS will not make any guesses about your intentions. You must be 100% explicit in terms of what model you trying to fit and what you consider to be data. MARSS models are used in many different fields in different ways. There is no ‘guess’ that would work for all models. Instead MARSS requires that you write your model in matrix form, and then pass everything in in a format that is one-to-one with that mathematical model. That way MARSS knows exactly what you are trying to fit.