Learn R Programming

geoFKF (version 0.1.1)

log_lik_rf: Maximum likelihood estimate for \(\sigma^2\), \(\phi\) and \(\rho\).

Description

This function maximum likelihood estimate for \(\sigma^2\), \(\phi\) and \(\rho\) in the random field model for the covariance.

Usage

log_lik_rf(m_coef, m_coord)

Value

Return a list with

par

A vector with the estimates of \(\sigma^2\), \(\phi\) and \(\rho\).

m_cov

A matrix of covariances of the estimates.

Arguments

m_coef

Matrix where each column is an observed vector

m_coord

Matrix where each observation contains the latitude and longitude

Examples

Run this code
data("datasetCanada")

m_data <- as.matrix(datasetCanada$m_data)
m_coord <- as.matrix(datasetCanada$m_coord[, 1:2])

p <- ceiling(1 + log2(nrow(m_data)))
m_coef <- sapply(seq_len(nrow(m_coord)), function(i) {
    coef_fourier(m_data[, i], p)
})
log_lik_rf(m_coef, m_coord)

Run the code above in your browser using DataLab