Description Usage Arguments Details Examples
Generic Bayesian routine for fitting a model to y given 1 predictor variable x. The function of y~x must be supplied, as well as the function for the SD~y. Any functions with any numbers of parameters can be used: predfunc is the function of y~x, and sdfunc is the function sd~y.
1 2 3 4 |
add |
xxxdocparam in model.xy() is different to add in add_plot.R. |
steps |
The number of steps to run the Gibbs sampler. |
showstep |
Information is printed to the screen every showstep steps. |
The function badpredpar is needed so the user can make up any definition for parameter values that are out of bounds. Without this, the model could not support any generic predfunc. Badpredpar must accept two vectors of parameters, one for main and one for sd.
The ellipses allow additional parameters to be passed to the model function, but there is no such option for the sd function. The additional parameters mean that some of the variables defining the model do not have to be fitted.
The sd function can be omitted if the likelihood does not require it.
This works only if one likelihood function defines the likelihood of the model, given data and parameters only.
If the likelihood of some parameters is conditional on other parameters, as in hierarchical model, this can't be used.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | ## Not run:
testx = 1:10
testy = 1 + 2 * testx + rnorm(10, 0, 1)
model.xy(
x = testx,
y = testy,
predfunc = linear.model,
llikefunc = llike.GaussModel,
badpredpar = BadParam,
start.predpar = c(1, 1),
sdfunc = constant,
start.sdpar = 1,
llikefuncSD = llike.GaussModelSD
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.