Read a gnssts object

read.gnssts(filename, format = "mom")

Arguments

filename

A string specifying the name of the file to read.

format

A string specifying the format of the file to read.

Value

Return a gnssts object.

Examples

phase <- 0.45
amplitude <- 2.5
sigma2_wn <- 15
bias <- 0
trend <- 5 / 365.25
cosU <- amplitude * cos(phase)
sinU <- amplitude * sin(phase)
year <- 5
n <- year * 365
jump_vec <- c(200, 300, 500)
jump_height <- c(10, 15, 20)
nbr_sin <- 1
A <- create_A_matrix(1:n, jump_vec, n_seasonal = nbr_sin)
x_0 <- c(bias, trend, cosU, sinU, jump_height)
eps <- rnorm(n = n, sd = sqrt(sigma2_wn))
yy <- A %*% x_0 + eps
gnssts_obj <- create.gnssts(t = 1:length(yy), y = yy, jumps = jump_vec)
str(gnssts_obj)
#> List of 4
#>  $ t              : num [1:1825] 1 2 3 4 5 6 7 8 9 10 ...
#>  $ y              : num [1:1825] -13.93 -14.84 -20.6 -7.54 -10.66 ...
#>  $ jumps          : num [1:3] 200 300 500
#>  $ sampling_period: num 1
#>  - attr(*, "class")= chr "gnssts"
if (FALSE) { # \dontrun{
write.gnssts(x = gnssts_obj, filename = "test.mom")
gnssts_obj <-read.gnssts(filename = "test.mom", format = "mom")
} # }