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 |
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.
data(canada)
data(canada)
A list with four matrices:
A matrix with 14 columns where each column is a wheather station
A matrix with 14 rows where each row is a weather station
Coordinate of the The Pas station
Observed time series of the station The Pas
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.
coef_fourier(f, m)
coef_fourier(f, m)
f |
A time series to be smoothed. |
m |
Order of the Fourier polynomial. Default value is computed using the Sturge's rule. |
A vector with the fourier coefficients.
data(canada) coef_fourier(canada$ThePas_ts)
data(canada) coef_fourier(canada$ThePas_ts)
This function the smoothed curve
fourier_b(coef, x)
fourier_b(coef, x)
coef |
Fourier coefficients. |
x |
a time series to evaluate the smoothed curve. |
a time series with the smoothed curve.
data(canada) coefs <- coef_fourier(canada$ThePas_ts) y_hat <- fourier_b(coefs)
data(canada) coefs <- coef_fourier(canada$ThePas_ts) y_hat <- fourier_b(coefs)
geo_fda
finds the ordinary kriging estimate for sptial functional
data using the model proposed by Giraldo(2011).
geo_fda( m_data, m_coord, new_coord, m, n_quad = 20, t = seq(from = -pi, to = pi, length.out = 1000) )
geo_fda( m_data, m_coord, new_coord, m, n_quad = 20, t = seq(from = -pi, to = pi, length.out = 1000) )
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
|
t |
a vector with points to evaluate from |
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.
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
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.
data(canada) y_hat <- geo_fda(canada$m_data, canada$m_coord, canada$ThePas_coord, n_quad = 2)
data(canada) y_hat <- geo_fda(canada$m_data, canada$m_coord, canada$ThePas_coord, n_quad = 2)
geo_model
finds the maximum likelihood estimate for the parameters
in the geostatistical exponential model.
geo_model(v_data, m_coord)
geo_model(v_data, m_coord)
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. |
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
data(canada) v_data <- canada$m_data[1, ] geo_model(v_data, canada$m_coord)
data(canada) v_data <- canada$m_data[1, ] geo_model(v_data, canada$m_coord)
This function computes the likelihood function
used at geo_model
.
mDist |
distance matris; |
s2 |
variance from the covariance model; |
phi |
variance from the covariance model; |
vDiff |
column vector of data (subtracted the mean vector) |
log-likelihood value multiplied by -1.