View source: R/SkeweDF_functions.R
This function generates a table of optimized parameters and Psi Criterion for a given function within specified starting parameter bounds. This function uses Limited Memory BFGS as it's gradient descent algorithm.
1 2 3 4 5 6 7 8 9 10 11 12 | local_fit_function(
param_bounds,
data,
model_fn_name,
weighted_rt = FALSE,
par_chunk = 100,
par_chunk_size = 10,
n_cores = 1,
clust,
left_trunc = 1,
right_trunc = left_trunc + length(data) - 1
)
|
param_bounds |
A list of sequences which indicate space where parameters should be generated and fit |
data |
Vector of observed values |
model_fn_name |
Character vector indicating name of function of theoretical model to be used. For example, for Generalized_Yule(n, rho, alpha), model_fn_name <- 'Generalied Yule' |
weighted_rt |
Boolean used to determine if the weighted right-tail cumulative distribution function should be used or not. |
par_chunk |
Integer used to indicate number of optimization chunks to be run. Total number of rows in the output table = par_chunk * par_chunk_size |
par_chunk_size |
Integer used to indicate number of starting parameters to be generated and optimized in a given chunk. Total number of rows in the output table = par_chunk * par_chunk_size |
n_cores |
Integer used to indicate number of cores to be used for this function if a socket cluster object is not defined. |
clust |
socket cluster object from 'parallel::makeCluster()'. This is used if you have already generated a socket cluster object and would like to run this functoin on it. If no object is defined, one will be made for this function call. |
left_trunc |
Int used to determine starting index of model to use for optimization |
right_trunc |
Int used to determine ending index of model to use for optimization |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.