Learn R Programming

RMAWGEN (version 1.3.9.3)

Multi-Site Auto-Regressive Weather GENerator

Description

S3 and S4 functions are implemented for spatial multi-site stochastic generation of daily time series of temperature and precipitation. These tools make use of Vector AutoRegressive models (VARs). The weather generator model is then saved as an object and is calibrated by daily instrumental "Gaussianized" time series through the 'vars' package tools. Once obtained this model, it can it can be used for weather generations and be adapted to work with several climatic monthly time series.

Copy Link

Version

Install

install.packages('RMAWGEN')

Monthly Downloads

547

Version

1.3.9.3

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Emanuele Cordano

Last Published

April 12th, 2025

Functions in RMAWGEN (1.3.9.3)

TemperatureEndDay

Gets the last day in a temperature time series, expressed as decimal julian days since 1970-1-1 00:00 UTC
RMAWGEN-package

R - Multi-site Autoregressive WEather Generator
WhereIs

Gets the toponym where a meteorological station is located
arch_test

arch.test function for varest2 object
PrecipitationStartDay

Gets the first day in a precipitation time series, expressed in decimal julian days since 1970-1-1 00:00 UTC
adddate

Inserts three columns (year,month,day) passing dates to a matrix or to a dataframe
extractdays

Extracts the rows of a matrix corresponding to the requested days (expressed as dates YYYY-MM-DD) given the date (origin) of the first row
findDate

Finds the date corresponding a row index of a matrix given the date (origin) of the first row
extractyears

Extracts the elements of a data frame corresponding to a period between year_min and year_max for the stations listed in station
extractmonths

Extracts the rows of a matrix corresponding to requested months of a year given the date (origin) of the first row
countNAs

counts NAs in each row of data
covariance

Calculates the covariance matrix of the normally standardized variables obtained from the columns of x
is.monthly.climate

Verifies if 'climate' represents the monthly climatology in one year, i.e 'climate' is monthly.climate type matrix whose rows represent months and each column represents a station. It is also used in setComprehensiveTemperatureGeneratorParameters.
months_f

months REPLACEMANT
forecastResidual

Forecasts the residual value of a VAR realization given the white noise covariance matrix
forecastEV

Forecasts the expected value of a VAR realization given the prievious one
generateTemperatureTimeseries

Returns time series of Daily Maximum and Minimum with a random multi-realization obtained by using newVARmultieventRealization. This function is called by ComprehensiveTemperatureGenerator.
inv_GPCA

This function makes an inverse Gaussianization procedure besad on PCA iteration ( see inv_GPCA_iteration
inv_GPCA_iteration

This function makes an inverse iteration of PCA-Gaussianization process
continuity_ratio

Calculates the continuity ratio of a set of precipitation measured or generated data in several sites as defined by Wilks, 1998 (see reference link)
collinear_dataset

Collinear Dataset
getDailyMean

Calculates the daily means of a range of days around each date of a data frame corresponding to a period between year_min and year_max for stations listed in station
normality_test

normality.test method for varest2 object
getMonthlyMean

Calculates the monthly means of a data frame corresponding to a period between year_min and year_max for stations listed in station
newVARmultieventRealization

Generates several realizations of a VAR model
extractTxFromAnomalies

Extracts generated time series of Daily Maximum Temperature from a random multi-realization obtained by generateTemperatureTimeseries function
extractTnFromAnomalies

Extracts generated time series of Daily Minimum Temperature from a random multi-realization obtained by generateTemperatureTimeseries function
getVARmodel

Either creates a VAR model or chooses a VAR model by using VAR or VARselect commands of vars package
normalizeGaussian

Converts a random variable x extracted by a population represented by the sample data or sample to a normally-distributed variable with assigned mean and standard deviation or vice versa in case inverse is TRUE
normalizeGaussian_prec

Converts precipitation values to "Gaussinized" normally-distributed values taking into account the probability of no precipitation occurrences. values or vice versa in case inverse is TRUE
plot_sample

It makes a plot by sampling (e.g. monthly) the variables x and y
serial_test

serial.test function for varest2 object
normalizeGaussian_severalstations

Converts several samples x random variable extracted by populations represented by the columns of data respectively or sample to a normally-distributed samples with assinged mean and standard deviation or vice versa in case inverse is TRUE
print.GPCA

print S3 method for GPCA or GPCA_iteration object
qqplot.lagged

This function creates a Q-Q plot of the lag-lag moving cumulative addition of the values in the samples x,y,z
qqplotTnTxWGEN

Makes a qqplot of measured and simulated data for several stations.
plotDailyClimate

Plots daily climatology through one year
normalizeGaussian_severalstations_prec

DEPRECATED Converts several samples x random variable (daily precipitation values) extracted by populations represented by the columns of data respectively or sample to a normally-distributed samples with assinged mean and standard deviation or vice versa in case inverse is TRUE using the function normalizeGaussian_prec
removeNAs

Replaces each entry of the rows containing NA values with NA
rescaling_monthly

This function adjusts the monthly mean to a daily weather dataset (e. g. spline-interpolated temperature)
residuals.varest2

residuals S3 method for varest2 object
qqplotTnTxWGEN_seasonal

Makes four seasonal qqplots (winter, spring, summer and autumn) of measured and simulated data for several stations.
setComprehensiveTemperatureGeneratorParameters

Computes climatic and correlation information useful for creating an auto-regeressive random generation of maximum and minimun daily temparature. This function is called by ComprehensiveTemperatureGenerator.
qqplotprecWGEN

Makes a qqplot of measured and simulated data for several stations.
qqplot_RMAWGEN_Tx

It makes the Q-Q plots observed vs generated time series of daily maximum, minimum temperature and daily thermal range for a list of collected stochastic generations
qqplotWGEN

Makes a qqplot and Wilcoxon test between the two columns of val
varest2-class

varest2-class
varest-class

varest-class
splineInterpolateMonthlytoDaily

Interpolates monthly data to daily data using spline and preserving monthly mean values
splineInterpolateMonthlytoDailyforSeveralYears

Interpolates monthly data to daily data using splineInterpolateMonthlytoDaily for several years
qqplotprecWGEN_seasonal

Makes four seasonal qqplots (winter, spring, summer and autumn) of measured and simulated data for several stations.
trentino

Trentino Dataset
ElevationOf

Extracts the elevation of a meteorological station expressed in meters above a reference (sea level)
ComprehensivePrecipitationGenerator

The comprehensive Precipitation Generator
NewVAReventRealization

Generates a new realization of a VAR model
GPCA

This function makes a Gaussianization procedure based on PCA iteration ( see GPCA_iteration)
GPCA_iteration

This function makes an iteration of PCA-Gaussianization process
ComprehensiveTemperatureGenerator

The Comprehensive Temperature Generator
GPCAvarest2-class

GPCAvarest2-class
PrecipitationEndDay

Gets the last day in a precipitation time series, expressed in decimal julian days since 1970-1-1 00:00 UTC
acvWGEN

Plots the auto- and cross- covariance functions between measured and simulated data for several stations
TemperatureStartDay

Gets the first day in a temperature time series, expressed as decimal julian days since 1970-1-1 00:00 UTC
VAR_mod

Modified version of VAR function allowing to describe white-noise as VAR-(0) model (i. e. varest objects)
GPCA-class

GPCA-class
GPCAiteration-class

GPCAiteration-class
addsuffixes

Adds suffixes for daily maximum and minimum temperature to the names of a column data frame