View source: R/basic_functions.R
get_mle | R Documentation |
For each regression, the MLE is used (i.e. the coefficients and residual standard error obtained from lm). This will only work when N > m (or lm will have issues), so call the function accordingly.
get_mle(datum, NNarray)
datum |
an N * n matrix, where each row corresponds to N replications for that location |
NNarray |
an n * m integer matrix giving the m nearest neighbors previous in the ordering (or outputting NAs if not available [i.e. there are not m previous points]) that are ordered from closest to furthest away. Required: m < N, m >= 2 |
Sparse triangular matrix that is the Cholesky of the precision matrix Ω such that
Ω = U U'
#create fake data and fake neighbor matrix datum <- matrix(rnorm(1e4), nrow = 10) NNarray <- matrix(NA, nrow = 1e3, ncol = 100) #can only use previous points in ordering (this is actually #impossible in low dimensional space like this is designed for) for(i in 1:100){ NNarray[(i + 1):1e3, i] <- i } #Return sparse Cholesky of the precision matrix uhat <- get_mle(datum, NNarray)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.