complete.series: Complete relatively large holes in data-sets

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/complete.series.R

Description

This functions completes relatively large holes in monthly time-series objects.

Usage

1
2
complete.series(collection, model, k.ubic = NA, centers = 3, nstart = 3, 
weps = 0.05, MAX.ITER = 100, AEM.debug = T)

Arguments

collection

A list of class Catalog that contains the objects to complete.

model

A list of fixed-effects models related to collection$data.

k.ubic

A data.frame of exactly one member k.ubic$cluster which is a scalar vector of length equal to collection$data and specifying to which cluster belongs to each element of the list collection$data.

centers

If k.ubic is unavailable, this sets the quantity of clusters to build.

nstart

If k.ubic is unavailable, then this parametre sets the initial quantity of center with which to start the k-means algorithm.

weps

Tolerance for the E-M Algorithm.

MAX.ITER

Maximum number of iterations for the E-M Algorithm.

AEM.debug

Logical flag indicating if verbosity is required.

Details

The main idea behind this functions is to complete the time-series of the list by first clustering similar stations and then applying to each cluster the E-M Algorithm in order to complete the series. The E-M Algorithms is an iterative method that in each iteration performs two tasks: fist estimates the expected values and then maximizes their likelyhood. This goes on util some stopping criteria is meat.

Value

Returns a completed version of collection (collection$data).

Note

The current implementation is known to have problems. The iterative proccess not always converges. It is also known that the E-M has been surpassed by other methods and it would be desireble to replace it.

Author(s)

A. Jhan, fixed-up by A.M. Sajo-Castelli.

See Also

fill.small.missing

Examples

1
2
3
4
5
6
## Not run: 
for (k in 1:15) {
        fit[[k]] = lm(collection$data[[k]] ~ ZZ - 1, singular.ok=T, na.action=na.omit)
}
collection.completed = complete.series(collection, fit)
## End(Not run)

vetools documentation built on May 2, 2019, 10:15 a.m.