Description Usage Arguments Functions Author(s) References Examples
This function approximates the maximum likelihood estimate of the multivariate parameter theta. It requires a function to simulate data and compute summary statistics at each position of the parameter space. These simulations are used to obtain estimates the likelihood in a stochastic approximation algorithm based where the ascent direction is given by simultaneous perturbations.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | KDKW.SP(s.obs, theta.0, simfun, rest = matrix(c(-Inf, Inf), ncol = 2,
nrow = length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a,
alpha = 1, A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, kernel,
lg = T, lib = "~/Rpack", ...)
KDKW.SP.theta.0(theta.0, s.obs, simfun, rest = matrix(c(-Inf, Inf), ncol
= 2, nrow = length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a,
alpha = 1, A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, lg = T, ...)
KDKW.SP.s.obs(s.obs, theta.0, simfun, rest = matrix(c(-Inf, Inf), ncol =
2, nrow = length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a,
alpha = 1, A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, lg = T, ...)
KDKW.SP.mult1(mult, simfun, rest = matrix(c(-Inf, Inf), ncol = 2, nrow =
length(theta.0), byrow = T), ce, gamma = 1/6, C = 0, a, alpha = 1,
A = 0, K, nk, Hfun = bw.nrd0.mult, Hnum, lg = T, ...)
|
s.obs |
Vector of observed summary statistics |
theta.0 |
Vector of starting point |
simfun |
name of the function which is used to simulate data (further arguments to simfun are given with ...) |
rest |
Matrix with restrictions on the parameterspace (matrix with 2 columns that contain the lower and upper bounds for the elements of theta). Use -Inf and Inf for unrestricted parameters. The default value is an unrestricted parameter space. |
ce |
numeric |
gamma |
numeric |
C |
integer |
a |
numeric |
alpha |
numeric |
A |
integer |
K |
number of steps |
nk |
number of simulations per step |
Hfun |
function which computes the bandwidth matrix. Can be one of the functions in bw.r |
Hnum |
how often shall the bandwidth matrix be computed? Possible values: "once" or an integer indicating after how many iterations the bandwidth selection is to be renewed (e. g. 1 => bandwidth selection in each step) |
kernel |
kernel function |
lg |
logical. Use the log-likelihood instead of the likelihood? |
... |
further arguments which are passed on to simulate the data with simfun |
KDKW.SP.theta.0
: The same function for a set of different starting values, use e. g. with apply or mclapply.
KDKW.SP.s.obs
: The same function for a set of different summary statistics, use e. g. with apply or mclapply.
KDKW.SP.mult1
: The same function for a set of different starting values and different summary statistics, use e. g. with apply or mclapply.
Johanna Bertl
Bertl, J.; Ewing, G.; Kosiol, C. & Futschik, A. Approximate Maximum Likelihood Estimation for Population Genetic Inference. Statistical Applications in Genetics and Molecular Biology, 2017, 16, p. 291-312
Spall, J. C. Multivariate stochastic approximation using a simultaneous perturbation gradient approximation. IEEE Transactions on Automatic Control, 1992, 37, 352-355
Spall, J. C. Introduction to Stochastic Search and Optimization: Estimation, Simulation and Control. Wiley, 2003
1 2 3 4 | # bivariate normal distribution
test1 = KDKW.SP(s.obs=c(0,0), theta.0=c(2,2), simfun=SIMnormalmean.anydim, rest=matrix(c(-100, 100), ncol=2, nrow=2, byrow=T), ce=2, gamma = 1/6, C=0, a = 10, alpha = 1, A=10, K=500, nk=50, Hfun = bw.nrd0.mult, Hnum="once", dmvnorm2, lg = T, sigma=diag(c(1,1)), n=1)
matplot(test1$theta, t="l")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.