dmm.JConjugateModel: Create a conjugate model using Julia fucntions

Description Usage Arguments Value Examples

View source: R/dmm_model.R

Description

Create an model object to be used in the dmm.cluster function, using user given Julia functions. Must call dmm.addfile to import files, in which the Julia functions are stored, before using dmm.cluster on a JModel. Functions dmm.JModel and dmm.model are alternatives.

Usage

1
2
dmm.addfile(filename)
model <- dmm.JConjugateModel(pdf_name, sample_name, marg_name, params)

Arguments

pdf_name

A string. The name of the Julia function in filename that returns the probability density function likelihood. The function should be of the form pdf_name(y::Float64, theta::Tuple, params::Tuple) or pdf_name(y::Array{Float64,1}, theta::Tuple, params::Tuple).

sample_name

A string. The name of the Julia function in filename that returns the sample posterior function. The function should be of the form sample_name(y::Float64, params::Tuple), sample_name(y::Array{Float64,1}, params::Tuple) or sample_name(y::Array{Float64,2}, params::Tuple).

marg_name

A string. The name of the Julia function in filename that returns the marginal likelihood. The function should be of the form marg_name(y::Float64, params::Tuple).

params

A list of all hyperparameters needed for the above three functions.

isconjugate

A logical. TRUE (default) if the user specfied model is conjugate, FALSE if not.

Value

A model object of type JModel which can be passed to dmm.cluster.

Examples

1
2
3
4
5
dmm.addfile(filename)
# The following all make conjugate models using Julia functions
model <- dmm.model(pdf_name, sample_name, marg_name, params, isconjugate=TRUE)
model <- dmm.Jmodel(pdf_name, sample_name, marg_name, params, isconjugate=TRUE)
model <- dmm.JConjugateModel(pdf_name, sample_name, marg_name, params)

nsdumont/jDirichletMixtureModels documentation built on May 23, 2019, 2:51 p.m.