Construct a parameter with a prior, weight and an update flag.
Param.RdConstruct a parameter with a prior, weight and an update flag.
Value
A list with the following elements:
initthe initial value of the parameter.weightthe weight of the prior.updatea flag indicating if the parameter shouldbe updated in the MCMC.priormean value of the prior distribution, may be used with weight to fully determine prior parameters.
Examples
# Fully specified parameter.
Param(init = 0, weight = 1, update = TRUE, prior = 0.5)
#> $init
#> [1] 0
#>
#> $update
#> [1] TRUE
#>
#> $prior
#> [1] 0.5
#>
#> $weight
#> [1] 1
#>
#> attr(,"class")
#> [1] "Param"
# Fixed parameter
# Weight = 0 implies update=FALSE and prior is ignored.
Param(0, 0)
#> $init
#> [1] 0
#>
#> $update
#> [1] FALSE
#>
#> $prior
#> [1] 0
#>
#> $weight
#> [1] 0
#>
#> attr(,"class")
#> [1] "Param"
# Update parameter that starts at zero.
Param(0, weight =1, update=TRUE)
#> $init
#> [1] 0
#>
#> $update
#> [1] TRUE
#>
#> $prior
#> [1] 0
#>
#> $weight
#> [1] 1
#>
#> attr(,"class")
#> [1] "Param"
# Parameters specified at zero implies fixed.
Param(0)
#> $init
#> [1] 0
#>
#> $update
#> [1] FALSE
#>
#> $prior
#> [1] 0
#>
#> $weight
#> [1] 0
#>
#> attr(,"class")
#> [1] "Param"