This function estimates parameters for a Multivariate Space-Time Stochastic Weather Generator (MSTWeatherGen), allowing for detailed analysis and modeling of weather data. Estimation can be performed on a seasonal basis or annually, depending on the provided data and specified parameters. It handles multiple weather variables, with special consideration for precipitation if indicated.

MSTWeatherGen_Estim(
  data,
  dates,
  by_season = TRUE,
  seasons,
  scale = FALSE,
  precipitation = T,
  names = NULL,
  names_weather_types = NULL,
  coordinates,
  max_it,
  tmax,
  n1,
  n2
)

Arguments

data

A multi-dimensional array of weather data, encompassing time, location, and various weather variables.

dates

A vector of dates corresponding to the time dimension in the data array, used for temporal analysis.

by_season

Logical flag indicating whether to perform the estimation seasonally (`TRUE`) or annually (`FALSE`).

seasons

A list defining the seasons, each with start and end days and months, required if `by_season` is `TRUE`.

scale

Logical, indicating if the data needs to be standardized (`TRUE`) or not (`FALSE`). If `scale` is `TRUE` each meteorological variable is standardized at each location using smoothed mean and standard deviation.

precipitation

Logical, indicating if precipitation should be considered as a primary variable for analysis. Defaults to `TRUE`.

names

Optionally, names of the variables in the data array to be used for analysis. If `precipitation` is `TRUE` and `names` is not provided, "Precipitation" is assumed to be the first variable, with other variables numerically named.

names_weather_types

Specific variables from `names` to be used for classifying weather types. If not provided, it defaults to using all variables specified in `names`.

coordinates

A matrix or data frame containing the geographical coordinates for each location in the data.

max_it

The maximum number of iterations for optimization procedures within the estimation process.

tmax

The maximum temporal lag to be considered in the analysis.

n1

First parameter defining spatial window size for analysis, crucial for detailed spatial analysis within the Gaussian field model.

n2

Second parameter defining spatial window size.

Value

A list containing the results of the `MSTWeatherGen_Estim_season` function for each season (or for the entire year if `by_season` is `FALSE`), including estimated parameters and other outputs relevant to weather generation, such as weather type classifications and spatial dependencies.

Details

The MSTWeatherGen model operates in three stages: Initially, weather types are determined through a clustering algorithm. Subsequently, for each identified weather type, the weather data undergo transformations into residuals that adhere to a normal distribution via a specific transformation function. In the final stage, a multivariate space-time Gaussian random field is fitted to these transformed variables for each weather type. The user has the option to configure the model to fit data for each season, with the seasons defined by the user.