link: link

Description Usage Arguments Value Examples

View source: R/graph.R

Description

This function takes am object of class process and an object of class Obs and creates a link between the two. If the process is of class GMRF_basis, then an incidence matrix is constructed which maps the process to the observation. If there is no basis set associated with the GMRF, then the incidence matrix needs to be specified manually.

Usage

1
2
link(Obj1, Obj2, Cmat = NULL, mul_factor = NULL, mulfun = NULL,
  muldata = NULL, n_grid = NULL, mask = NULL, md5_wrapper = NULL)

Arguments

Obj1

object of class process.

Obj2

object of class Obs.

Cmat

the matrix mapping the process to the observation. Needs to be specified if no basis function set is assoicated with the process.

mul_factor

a constant with which to scale the process, i.e. y = mul_factor * C * x

mulfun

as above, but a possibly spatially varying amplification of the process of the observation. This, for example, could be a spatially-varying density function when converting height to mass.

n_grid

the number of grid points to use when integrating over the process with an observation of a large footprint. Defaults to a 400 x 400 grid.

mask

the label of a process attribute. The observation is assumed to only be influenced by the process where this attribute is set to 1.

Value

Object of class linkGO, a link between a GMRF and an observation.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## Not run: 
require(Matrix)
data(icesat)
data(surf_fe)

## First create observation object
icesat_obs <- Obs(df=icesat,
                 abs_lim = 5,
                 avr_method = "median",
                 box_size=100,
                 name="icesat")

## Now create GMRF defined over some FE basis
Mesh <- initFEbasis(p=surf_fe$p,
                    t=surf_fe$t,
                    M=surf_fe$M,
                    K=surf_fe$K)

mu <- matrix(0,nrow(Mesh),1)
Q <- sparseMatrix(i=1:nrow(surf_fe$p), j = 1:nrow(surf_fe$p), x = 1)

my_GMRF <- GMRF(mu = mu, Q = Q,name="SURF",t_axis = 0:6)
SURF <-GMRF_basis(G = my_GMRF, Basis = Mesh)

L1 <- link(SURF,icesat_obs)

## End(Not run)

shazhe/mvst0 documentation built on May 29, 2019, 9:20 p.m.