Is there an R function for deriving digits - r

Is there there is any function in R (in any package) which gives the arc-length parametrization for any such given parametric f?
I know how to derive the arc-length parametrized function from a given function. It involves derivative and integration as here. But looking for whether there is any R function for computation of arc-length parametrization.

Related

What are the equivalent functions of fmincon with 'trust-region-reflective' algorithm and fminsearchbnd in R?

I am trying to reproduce the following matlab functions in R. I need to find the closest approximations of fmincon and fminsearchbnd in R.
if license('test','optimization_toolbox')
% IF OPTIMIZATION TOOLBOX IS PRESENT, AN ANALYTICAL GRADIENT BASED
% MINIMIZATION APPROACH IS USED (trust-region-reflective)
if(exist('optimoptions', 'file'))
options = optimoptions('fmincon','Algorithm','trust-region-reflective','Display','off','GradObj','on','MaxIter',2000,...
'MaxFunEvals',10000,'TolFun',1e-8,'TolX',1e-8);
else
options = optimset('Algorithm','trust-region-reflective','Display','off','GradObj','on','MaxIter',2000,...
'MaxFunEvals',10000,'TolFun',1e-8,'TolX',1e-8);
end
[xfit1,fval1] = fmincon(FUN_MIN_GRAD_PARAMETRIZED,x0,[],[],[],[],LB,UB,[],options);
end
% WE also USE A CONSTRAINED VERSION OF FREELY AVAILABLE fminsearch
% (THIS USES DERIFVATIVE FREE SIMPLEX ALGORITHM)
[xfit2,fval2] = fminsearchbnd(FUN_MIN_GRAD_PARAMETRIZED,x0,LB,UB,optimset(...
'MaxIter',2000,'MaxFunEvals',10000,'TolFun',1e-8,'TolX',1e-8));
The pracma package provides fmincon equivalence but with the Squential
Quadratic Programming (SQP) approach.
Are there any equivalent functions of fmincon with trust-region-reflective algorithm and fminsearchbnd in R?

Data imputation with mtsdi package R

I found the package mtsdi and the corresponding function mnimput:
R Documentation
This function gives very good results for my data sets. However, I would like to understand the mathematical background of the function. I am familiar with the EM algorithm but how exactly does the function work? How are splines used here and is there a connection with the algorithm derived by Schafer?

Arc length parametrization using R

I am dealing with 2-dimensional parametric curve f.
Is there there is any function in R (in any package) which gives the arc-length parametrization for any such given parametric f?
I know how to derive the arc-length parametrized function from a given function. It involves derivative and integration as here. But looking for whether there is any R function for computation of arc-length parametrization.
The pracma package seems to have the functions you are looking for. See arclength() in particular on page 23 of the pracma documentation.

Operations on long numbers in R

I aim to use maximum likelihood methods (usually about 10^5 iterations) with a probability distribution that creates very big integers and very small float values that cannot be stored as a numeric nor a in a float type.
I thought I would use the as.bigq in the gmp package. My issue is that one can only add, substract, multiply and dived two objects of class/type bigq, while my distribution actually contains logarithm, power, gamma and confluent hypergeometric functions.
What is my best option to deal with this issue?
Should I use another package?
Should I code all these functions for bigq objects.
Coding these function on R may cause some functions to be very slow, right?
How to write the logarithm function using only the +,-,*,/ operators? Should I approximate this function using a taylor series expansion?
How to write the power function using only the +,-,*,/ operators when the exponent is not an integer?
How to write the confluent hypergeometric function (the equivalent of the Hypergeometric1F1Regularized[..] function in Mathematica)?
I could eventually write these functions in C and call them from R but it sounds like some complicated work for not much, especially if I have to use the gmp package in C as well to handle these big numbers.
All your problems can be solved with Rmpfr most likely which allows you to use all of the functions returned by getGroupMembers("Math") with arbitrary accuracy.
Vignette: http://cran.r-project.org/web/packages/Rmpfr/vignettes/Rmpfr-pkg.pdf
Simple example of what it can do:
test <- mpfr(rnorm(100,mean=0,sd=.0001), 240)
Reduce("*", test)
I don't THINK it has hypergeometric functions though...

R equivalent of MATLAB's fmincon for constrained optimization?

Is there an equivalent to the MATLAB function fmincon() which finds the minimum of a constrained non-linear function (with linear equality AND inequality constraints) in R?
I can rule out constrOptim (doesn't support equality constraints) and quadprog (only quadratic functions) which are listed on the R Optimization task page.
The package nloptr is an R interface to NLopt, a library for nonlinear optimization with algorithms for unconstrained optimization, bound-constrained optimization, and general nonlinear inequality/equality constraints.
There is also a package called pracma which includes fmincon() function similar to Matlab version.

Resources