rgeneric.lrd: rgeneric model for long-range dependent forcing model for...

View source: R/rgeneric.lrd.R

rgeneric.lrdR Documentation

rgeneric model for long-range dependent forcing model for INLA.

Description

A script to allow fractional Gaussian noise adapted to the climate forcing model to be passed into the R-INLA framework.

Usage

rgeneric.lrd(cmd = c("graph", "Q", "mu", "initial", "log.norm.const", "log.prior", "quit"), theta = NULL)

Arguments

cmd

Functions that specifies the latent Gaussian field and the prior distributions of the hyperparameters.

theta

The hyperparameters of the latent Gaussian model in logarithmic scaling.

Details

This function sets up the radiative forcing long memory process as an R-INLA rgeneric model. It is used internally by INLA.climate and is not intended to be used separately by the user.

Value

When used as an input argument for inla.rgeneric.define this will return a model eligible to be used within the R-INLA framework (see example).

Author(s)

Eirik Myrvoll-Nilsen <eirikmn91@gmail.com>

See Also

rgeneric

Examples


## Not run: 
  if(require("INLA",quietly=TRUE)){
  data(GISS_E2_R)
  n <- dim(GISS_E2_R)[1]
  m <- 4

  Hprior <- compute.Hprior(n, 0.9, 0.1)
  funks <- h.map.maker(m=m)
  
  model.approx <- inla.rgeneric.define(rgeneric.lrd,lprior.fun.H = Hprior,
                                        n=n,N=m,forcing=GISS_E2_R$Forcing,funks=funks)
                                        
  formula = y ~ -1+ f(idy, model=model.approx)
  result.approx = inla(formula,family="gaussian", data=data.frame(y=GISS_E2_R$Temperature,idy=1:n),
                        num.threads=1, control.inla=list(reordering="metis"),
                        control.family = list(hyper = list(prec = list(initial = 12, fixed=TRUE))))
}

## End(Not run)



eirikmn/INLA.climate documentation built on Feb. 6, 2023, 11:41 a.m.