genTS: Generate FDSLRM time series realization

Description Usage Arguments Details Value Note Examples

View source: R/genTS.R

Description

genTS(mean, V, var) generates a realization of a time series (FDSLRM) with mean value mean, variance parameters of white noise and random effects var and design matrix for random effects V. Normal distribution of white noise and random effects is assumed.

Usage

1
genTS(mean, V, var)

Arguments

mean

vector of mean values, mean = Fβ.

V

design matrix for random effects.

var

vector of variance parameters, the first one is for the white noise and the next are for the random effects.

Details

explain the form of FDSLRM time series realization as linear mixed model?

Value

Realization of particular FDSLRM time series.

Note

Ver.: 03-Jan-2019 18:56:51.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## EXAMPLE 1
# realization from general FDSLRM
beta <- c (-3, 8, 7)
times <- 1:24
matF <- makeF(times, c(1/24))
matV <- makeV(times, c(1/8, 1/6))
meanv <- matF %*% beta
variances <- c(3, 2.7, 1.5, 1, 2)
realization <- genTS(meanv, matV, variances)
print(realization)
plot(times, realization, xlab = "time", type = "o")

## EXAMPLE 2
# realization from classical linear regression time series model (special case of FDSLRM)
beta <- c (-3, 8, 7)
times <- 1:24
matF <- makeF(times, c(1/24))
meanv <- matF %*% beta
variances <- 3
realization <- genTS(meanv, var = variances)
print(realization)
plot(times, realization, xlab = "time", type = "o")

gajdosandrej/fdslrm documentation built on April 28, 2020, 11:35 a.m.