Package 'geoFourierFDA'

Title: Ordinary Functional Kriging Using Fourier Smoothing and Gaussian Quadrature
Description: Implementation of the ordinary functional kriging method proposed by Giraldo (2011) <doi:10.1007/s10651-010-0143-y>. This implements an alternative method to estimate the trace-variogram using Fourier Smoothing and Gaussian Quadrature.
Authors: Gilberto Sassi [aut, cre]
Maintainer: Gilberto Sassi <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2024-11-19 06:33:47 UTC
Source: CRAN

Help Index


Time series from 35 weather stations of Canada.

Description

A dataset containing time series from 15 weather stations (The Pas station and more 34 stations to estimate the temperature curve at the Pas station). This dataset is present in the fda package.

Usage

data(canada)

Format

A list with four matrices:

m_data

A matrix with 14 columns where each column is a wheather station

m_coord

A matrix with 14 rows where each row is a weather station

ThePas_coord

Coordinate of the The Pas station

ThePas_ts

Observed time series of the station The Pas

Source

https://weather.gc.ca

References

J. O. Ramsay, Spencer Graves and Giles Hooker (2020). fda: Functional Data Analysis. R package version 5.1.9. https://CRAN.R-project.org/package=fda


This function computes minimum square estimates for Fourier coefficients.

Description

This function computes minimum square estimates for Fourier coefficients.

Usage

coef_fourier(f, m)

Arguments

f

A time series to be smoothed.

m

Order of the Fourier polynomial. Default value is computed using the Sturge's rule.

Value

A vector with the fourier coefficients.

Examples

data(canada)

coef_fourier(canada$ThePas_ts)

This function the smoothed curve

Description

This function the smoothed curve

Usage

fourier_b(coef, x)

Arguments

coef

Fourier coefficients.

x

a time series to evaluate the smoothed curve.

Value

a time series with the smoothed curve.

Examples

data(canada)

coefs <- coef_fourier(canada$ThePas_ts)
y_hat <- fourier_b(coefs)

Geostatistical estimates for function-valued data.

Description

geo_fda finds the ordinary kriging estimate for sptial functional data using the model proposed by Giraldo(2011).

Usage

geo_fda(
  m_data,
  m_coord,
  new_coord,
  m,
  n_quad = 20,
  t = seq(from = -pi, to = pi, length.out = 1000)
)

Arguments

m_data

a matrix where each column is a time series in a location

m_coord

a matrix with coordinates (first column is latitude and second column longitude)

new_coord

a vector with a new coordinate (first column is latitude and second longitude)

m

order of the Fourier polynomial

n_quad

a scalar with number of quadrature points. Default value nquad = 20.

t

a vector with points to evaluate from π-\pi to π\pi. Default t = seq(from = -pi,to = pi,length.out = 1e+3).

Details

geo_fda is similar to model proposed by giraldo2011ordinary. The mais difference is we have used gauss-legendre quadrature to estimate the trace-variogram. Using gauss-legendre qudrature gives estimates with smaller mean square error than the trace-variogram estimates from Giraldo(2011).

For now, we have used Fourier's series to smooth the time series.

Value

a list with three components

curve

estimate curve at t points

lambda

weights in the linear combination in the functional kriging

x

points where the curve was evaluated

References

Giraldo, R., Delicado, P., & Mateu, J. (2011). Ordinary kriging for function-valued spatial data. Environmental and Ecological Statistics, 18(3), 411-426.

Giraldo, R., Mateu, J., & Delicado, P. (2012). geofd: an R package for function-valued geostatistical prediction. Revista Colombiana de Estadística, 35(3), 385-407.

See Also

coef_fourier, fourier_b

Examples

data(canada)

y_hat <- geo_fda(canada$m_data, canada$m_coord, canada$ThePas_coord,
n_quad = 2)

EStimates the parameters of the exponential model.

Description

geo_model finds the maximum likelihood estimate for the parameters in the geostatistical exponential model.

Usage

geo_model(v_data, m_coord)

Arguments

v_data

a numeric vector with the data

m_coord

a matrix with two column. The first column must be the latitude and the second column must be the longitude.

Value

a list with components

mean

mean of the process

phi

range of exponential model

sigmasq

total sill of exponential model

convergence

convergence as specified in the function nlminb

Examples

data(canada)
v_data <- canada$m_data[1, ]
geo_model(v_data, canada$m_coord)

Log-likehood function multiplied by -1.

Description

This function computes the likelihood function used at geo_model.

Arguments

mDist

distance matris;

s2

variance from the covariance model;

phi

variance from the covariance model;

vDiff

column vector of data (subtracted the mean vector)

Value

log-likelihood value multiplied by -1.