Displaying 20 results from an estimated 200 matches similar to: "Dependency errors for package pracma"
2013 Jul 17
2
Using RasterBricks
Dear listers,
I am trying to create a RasterLayer of the values of a rasterbrick object.
The rasterbrick object has, for example, 100cells
library(raster)
r <- raster(ncol=10, nrow=10)
r[]=1:ncell(r)
s <- brick(r,r,r)
s <- s * 1:3
Each cell of the rasterfinal will have the AREA UNDER CURVE formed by the
values in each cell of the three original rasters.
For example:
s[4] has the
2013 Feb 15
1
minimizing a numerical integration
Dear all,
I am a new user to R and I am using pracma and nloptr libraries to minimize
a numerical integration subject to a single constraint . The integrand
itself is somehow a complicated function of x and y that is computed
through several steps. i formulated the integrand in a separate function
called f which is a function of x &y. I want to find the optimal value of x
such that the
2012 Dec 31
2
code to convert 3D geographical coordinates to Cartesian?
Is there packaged code to convert geographical coordinates (e.g.,
longitude, latitude, elevation) to Cartesian coordinates in 3-space?
I can see how to do this using
1. a spherical-to-Cartesian conversion like pracma::sph2cart(tpr)
http://cran.r-project.org/web/packages/pracma/
2. a geographical-to-spherical conversion. This seems to involve (in
roughly increasing order of difficulty or
2012 May 09
2
problem with Gauss Hermite ( x and w )
Hi all,
I am using the 'gaussHermite' function from the 'pracma' library
############ CODES ###########
library(pracma)
cc=gaussHermite(10)
cc$x^2
cc$x^5
cc$x^4
############ CODES ###########
as far so good. However, it does NOT work for any NON integer values, say
############ CODES ###########
cc$x^(2.5)
cc$x^(-2.5)
############ CODES ###########
But just think about it
2012 Jan 27
3
Numerical instability in new R Windows development version
I have a question concerning the new Windows toolchain for R >= 2.14.2.
When trying out my package 'pracma' on the win-builder development version
it will stop with the following error message:
> f3 <- function(x, y) sqrt((1 - (x^2 + y^2)) * (x^2 + y^2 <= 1))
> dblquad(f3, -1, 1, -1, 1) # 2.094395124 , i.e. 2/3*pi , err = 2e-8
Warning in sqrt((1 - (x^2 + y^2)) *
2023 Nov 09
1
Dependency errors for package pracma
What really interests me:
With all those strict checking procedures, how is it possible that the
new 'Matrix' version got accepted on CRAN?
I think this happened twice to me before, and it takes a lot of time
to check package dependencies that turn out to be not dependent --
more time than checking dependencies that are real.
2025 Mar 27
1
Problem with minimization that I failed to understand
?s 19:36 de 27/03/2025, Daniel Lobo escreveu:
> My code is to minimize the objective function
>
> therefore, shouldnt I expect that
>
> StartingValue = c(0.12, 0.04, 0.07, 0.03, 0.06, 0.07, 0.07, 0.04, 0.09,
> 0.08, 0.02, 0.02, 0.03, 0.06, 0.02, 0, 0.07, 0.05, 0.02, 0.02, 0.02)
> Fn(q1$par) < Fn(StartingValue)
> ## FALSE
>
> Below is the corrected code that can
2023 Aug 13
4
Noisy objective functions
While working on 'random walk' applications, I got interested in
optimizing noisy objective functions. As an (artificial) example, the
following is the Rosenbrock function, where Gaussian noise of standard
deviation `sd = 0.01` is added to the function value.
fn <- function(x)
(1+rnorm(1, sd=0.01)) * adagio::fnRosenbrock(x)
To smooth out the noise, define another
2025 Mar 27
1
Problem with minimization that I failed to understand
My code is to minimize the objective function
therefore, shouldnt I expect that
StartingValue = c(0.12, 0.04, 0.07, 0.03, 0.06, 0.07, 0.07, 0.04, 0.09,
0.08, 0.02, 0.02, 0.03, 0.06, 0.02, 0, 0.07, 0.05, 0.02, 0.02, 0.02)
Fn(q1$par) < Fn(StartingValue)
## FALSE
Below is the corrected code that can be reproduced:
MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L,
25L,
2013 Feb 18
2
error: Error in if (is.na(f0$objective)) { : argument is of length zero
Dear all,
I tried running the following syntax but it keeps running for about 4 hours
and then i got the following errors:
Error in if (is.na(f0$objective)) { : argument is of length zero
In addition: Warning message:
In is.na(f0$objective) :
is.na() applied to non-(list or vector) of type 'NULL'
Here is the syntax itself:
library('nloptr')
library('pracma')
#
2025 Mar 27
1
Problem with minimization that I failed to understand
?s 18:35 de 27/03/2025, Daniel Lobo escreveu:
> Hi,
>
> I have below minimization problem
>
>
> MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L,
> 25L, 50L, 50L, 75L, 75L, 75L, 0L, 75L, 75L, 75L, 0L, 25L, 75L,
> 75L, 0L, 75L, 100L, 0L, 25L, 100L), c(75L, 0L, 0L, 50L, 100L,
> 50L, 75L, 75L, 100L, 25L, 0L, 25L, 100L, 0L, 50L, 0L, 25L, 25L,
>
2025 Mar 27
2
Problem with minimization that I failed to understand
Hi,
I have below minimization problem
MyDat = structure(list(c(50L, 0L, 0L, 50L, 75L, 100L, 50L, 0L, 50L, 0L,
25L, 50L, 50L, 75L, 75L, 75L, 0L, 75L, 75L, 75L, 0L, 25L, 75L,
75L, 0L, 75L, 100L, 0L, 25L, 100L), c(75L, 0L, 0L, 50L, 100L,
50L, 75L, 75L, 100L, 25L, 0L, 25L, 100L, 0L, 50L, 0L, 25L, 25L,
100L, 75L, 0L, 0L, 0L, 50L, 0L, 75L, 75L, 0L, 50L, 25L), c(50L,
0L, 0L, 0L, 100L, 25L, 0L, 0L,
2012 Mar 23
3
R numerical integration
Hi all,
Is there any other packages to do numerical integration other than the
default 'integrate'?
Basically, I am integrating:
integrate(function(x) dnorm(x,mu,sigma)/(1+exp(-x)),-Inf,Inf)$value
The integration is ok provided sigma is >0.
However, when mu=-1.645074 and sigma=17535.26
It stopped working. On the other hand, Maple gives me a value of
0.5005299403.
It is an
2025 Mar 28
1
Problem with minimization that I failed to understand
I haven't run your code, but since Kendall correlation is based on
ranks, your Fn is probably locally constant with jumps when the ranks
change. That's a really hard kind of function to maximize, and the
algorithm used by fmincon is not appropriate to do it.
Sorry, but I don't know if there is an R function that can do
constrained discrete maximization.
Duncan Murdoch
On
2024 Feb 24
1
Clustering Functions used by Reverse-Dependencies
Dear R Users,
Are there any tools to extract the function names called by reverse-dependencies?
I would like to group these functions using clustering methods based on the co-occurrence in the reverse-dependencies.
Utility: It may be possible to split complex packages into modules with fewer reverse-dependencies.
Package pkgdepR may offer some of the functionality; but I did not have time to
2025 Mar 28
3
Problem with minimization that I failed to understand
Hi Duncan,
Thanks for your comment, I agree with that.
But, how it can be justified that an Optimizer gives a result which is
inferior to the starting value? At most, resulting value can remain at the
same level, isnt it?
On Fri, 28 Mar 2025 at 14:34, Duncan Murdoch <murdoch.duncan at gmail.com>
wrote:
> I haven't run your code, but since Kendall correlation is based on
>
2012 Apr 02
2
Error in gamma(delta + (complex(0, 0, 1) * (x - mu))/alpha) : unimplemented complex function
I am trying to obtain the grafic of a pdf . but this error keeps showing .
Here is the code
MXN.fd = function(x,alpha,beta,mu,delta)
{
A = (2*cos(beta/2))^(2*delta)
B = 2*alpha*pi*gamma(2*delta)
C = (beta*(x-mu))/alpha
D = abs(gamma(delta + (complex(0,0,1)*(x-mu))/alpha)^2)
M = A/B*exp(C)*D
M
plot(x,M,type="l",lwd=2,col="red")
}
alpha = 0.02612297
beta = -0.50801886
mu =
2011 Nov 10
2
performance of adaptIntegrate vs. integrate
Dear list,
[cross-posting from Stack Overflow where this question has remained
unanswered for two weeks]
I'd like to perform a numerical integration in one dimension,
I = int_a^b f(x) dx
where the integrand f: x in IR -> f(x) in IR^p is vector-valued.
integrate() only allows scalar integrands, thus I would need to call
it many (p=200 typically) times, which sounds suboptimal. The
2011 Nov 22
5
x, y for point of intersection
Hi everyone,
?
I am trying to get a point of intersection between a
polyline and a straight line ?.. and get the x and y coordinates of this point.
For exemplification consider this:
?
?
set.seed(123)
?
k1 <-rnorm(100, mean=1.77, sd=3.33)
?k1 <- sort(k1)
q1 <- rnorm(100, mean=2.37, sd=0.74)
q1 <- sort(q1, decreasing = TRUE)
plot(k1, q1, xlim <- c((min(k1)-5),
2025 Mar 28
1
Problem with minimization that I failed to understand
?s 13:59 de 28/03/2025, Daniel Lobo escreveu:
> Hi Duncan,
>
> Thanks for your comment, I agree with that.
>
> But, how it can be justified that an Optimizer gives a result which is
> inferior to the starting value? At most, resulting value can remain at the
> same level, isnt it?
>
> On Fri, 28 Mar 2025 at 14:34, Duncan Murdoch <murdoch.duncan at gmail.com>