dmm.JModel: Create a model using Julia fucntions

Description Usage Arguments Details 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.JConjugateModel and dmm.JNonConjugateModel are alternatives.

Usage

1
2
3
4
5
dmm.addfile(filename)
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)
model <- dmm.JNonConjugateModel(pdf_name, sample_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 for conjugate case or the sample prior for nonconjugate case. 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. For conjugate case only. 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.

Details

marg_name is only requried for conjugate models.

Value

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

Examples

1
2
3
4
5
6
dmm.addfile(filename)
# The following all make 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)
model <- dmm.JNonConjugateModel(pdf_name, sample_name, params)

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