sphere_sm: Truncated Spherical Score Matching

View source: R/spherical_sm.R

sphere_smR Documentation

Truncated Spherical Score Matching

Description

Numerical minimisation of objective function corresponding to score matching on a sphere with a boundary defined on a sphere

Usage

sphere_sm(x, dV, family = vmf(), g = "Default", init = NULL, options = list())

Arguments

x

(truncated) euclidean coordinate data; 3D

dV

boundary euclidean coordinates; 3D

family

distribution, e.g. "vmf" for von-Mises Fisher

g

boundary function

init

optional; initial condition

options

optional list; non-specified family by including psi which returns first and second derivative of log pdf as f and grad

Details

The variable x can take values within a certain truncated region, where the boundary of this region is defined by dV. It is possible through score matching to estimate parameters that are not constrained to the boundary by minimising the difference in score functions of the model and the data - the gradient of the log pdf, i.e.

ψ = \nabla log p(x; θ).

This function is mostly a wrapper function; it goes through multiple functions to eventually optimise the objective function. If g is not included as an argument, then non-truncated score matching will be used. For a sphere.

Use the following arguments for g:

"Haversine"

haversine distance function g_hav

"Euclidean"

euclidean projection distance function g_disk

The argument g can be overwritten by including a function as an element of the options list. This needs to return the values of the function for each point in the truncated dataset as g, and its first derivative as grad, both in a list. See g_hav and g_disk for examples.

psi can also be overwritten by including it as an element of the options list. This needs to return the first and second derivative of the log pdf as f and grad respectively in a list. See psi_vmf or psi_kent for examples.

Value

parameter estimates


dannyjameswilliams/truncsm documentation built on Aug. 22, 2022, 3:44 p.m.