post_density_solmfd: Title Posterior density of solution manifold points

Description Usage Arguments Value Examples

View source: R/solmfd_ftns.R

Description

Title Posterior density of solution manifold points

Usage

1
post_density_solmfd(X, prob_density, points, k, h = 1, prior = "gaussian", ...)

Arguments

X

matrix(n*m) input data with n samples in m dimension

prob_density

function of data and parameters

points

matrix (N * d) points obtained in solution manifold. N samples in d dim

k

function kernel function.

h

double normalizer. default = 1

prior

str prior distribution. either "gaussian" or "uniform"/

...

additional parameter for prior

Value

vector (N) vector(i) is density of ith row of points

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
set.seed(10)
k = get("dnorm", mode = 'function')
prob_density = function(x, theta) {return(dnorm(x, mean = theta[[1]], sd = theta[[2]]))}
n = 100
X = rnorm(n, 1.5, 3)
s = 1
N = 10
d = 2
phi = function(x) {return(pnorm(2, x[[1]], x[[2]]) - pnorm(-5, x[[1]], x[[2]]) - 0.5)}
points = sol_mfd_points(N, phi, d, s, prior = "uniform")
res_with_density = post_density_solmfd(X, prob_density, points, k)
head(res_with_density)

wldyddl5510/SolMfd documentation built on Dec. 23, 2021, 5:18 p.m.