fitCARBayesST: fitCARBayesST

Description Usage Arguments Details Value See Also Examples

View source: R/bayesianSTmodel.R

Description

a function to model curves using a spatio-temporal bayesian modelling using CARBayesST library

Usage

1
2
fitCARBayesST(datain, xvar, trait, k = NULL, graphDist, burnin = 500,
  n.sample = 1500, formulaModel, typeModel = "anova", verbose)

Arguments

datain

input dataframe of parameters

xvar

character, time variable (ex: thermalTime)

trait

character, parameter of interest (ex: plantHeight)

k

numeric, number of nearest neighbours to be returned

graphDist

logical, display distance graph

burnin

The number of MCMC samples to discard as the burn-in period

n.sample

The number of MCMC samples to generate

formulaModel

A formula for the covariate part of the model using the syntax of the lm() function. see ST.CARanova help

typeModel

character, choice of the model, anova, linear or ar

verbose

logical FALSE by default, if TRUE display information about the progress

Details

the input dataset must contain Position,Line,Ref,scenario,genotypeAlias columns. The function is not generic and needs specific columns names in the input data set. Please have a look of the struture of the data set used in the example.

Value

a list with a spatio-temporal object (CARBayesST) and a dataframe of the formated data

See Also

CARBayesST, ST.CARanova and spdep

Examples

1
2
3
4
5
6
7
8
 library(phisStatR)
 mydata<-plant1
 mydata<-filter(mydata,!is.na(mydata$thermalTime))
 str(mydata)
 test<-fitCARBayesST(datain=mydata,xvar="thermalTime",trait="plantHeight",k=2,
     graphDist=TRUE,burnin=10,n.sample=110,
     formulaModel=as.formula(plantHeight~scenario+genotypeAlias),
     typeModel="anova",verbose=FALSE)

sanchezi/phisStatR documentation built on Nov. 14, 2019, 7:10 p.m.