View source: R/class_parameter_VAR.R
parameter_VAR | R Documentation |
Creates a new instance of a 'parameter_VAR' object
parameter_VAR(
name,
index,
d,
init,
prior.dist = rep("FlatPrior", length(init)),
prior.par = rep(list(NULL), length(init))
)
name |
character, parameter name. |
index |
character, name of column in VAR.indx (see ?dataset) containing the index for this varying parameter |
d |
dataset object, the dataset containing (amongst other things) the index above |
init |
numeric vector, initial guesses for each instance of the VAR parameter. |
prior.dist |
character vector, prior distribution for each instance of the VAR parameter. |
prior.par |
list of numeric vectors, prior parameters for each instance of the VAR parameter |
An object of class 'parameter_VAR'.
X=data.frame(input1=rnorm(100),input2=rnorm(100))
Y=data.frame(output=X$input1+0.8*X$input2+0.1*rnorm(100))
VAR.indx=data.frame(indx=c(rep(1,50),rep(2,50)))
workspace=tempdir()
d <- dataset(X=X,Y=Y,data.dir=workspace,VAR.indx=VAR.indx)
p <- parameter_VAR(name='par',index='indx',d=d,
init=c(-1,1,2),
prior.dist=c('Gaussian','FlatPrior','Triangle'),
prior.par=list(c(-1,1),NULL,c(2,0,5)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.