similar to: How to compute the minimal distanct between a point and curve in N-dim space

Displaying 20 results from an estimated 6000 matches similar to: "How to compute the minimal distanct between a point and curve in N-dim space"

2006 Dec 02
1
Trouble passing arrays to C code
Hello, I'm having more trouble with interfacing with C code. I have a function in C that will return the result of its computation as 3 arrays. The signature of the function is as follows: void lorenz_run(double x0, double y0, double z0, double h, int steps, double *res_x, double *res_y, double *res_z) The function works, as I've tested it from within C itself and the results
2012 Jun 12
4
How do I connect dots in the RGL package?
Hi all, I just started using the rgl package in R, and I need to know how I connect the dots I created. A simple line from one co?rdinate (x0,y0,z0) to another (x1,y1,z1) will do. I tried using the code rgl.lines, but it doesn't accept lines that don't stem from O (0,0,0). Please help! Thanks! -- View this message in context:
2013 Jun 27
3
using "rollapply" to calculate a moving sum or running sum?
#using "rollapply" to calculate a moving sum or running sum? #I am tryign to use rollapply to calcualte a moving sum? #I tried rollapply and get the error message #"Error in seq.default(start.at, NROW(data), by = by) : # wrong sign in 'by' argument" #example: mymatrix <- ( matrix(data=1:100, nrow=5, ncol=20) ) mymatrix_cumsum <- ( matrix(data=NA, nrow=5,
2006 Mar 14
5
GROUP BY and SUM
I have orders, order_items, and products. I want to collate several orders so that I can get a SUM of quantities ordered for each product etc. Can I say something like (the below gives an error on :sum, and ignores :group) OrderItem.find(:all, :sum => ''quantity'', :group => ''product_id'', :include => [:order, :product]) I want to get back a
2020 Oct 23
2
3d plot of earth with cut
Dear All, Thanks a lot for the useful help again. I manage to get it done up to a point where I think I just need to apply some smoothing/interpolation to get denser points, to make it nice. Basically, I started from Duncen's script to visualize and make the clipping along a plane at a slice. Then I map my data points' values to a color palette and just plot them as points on this plane.
2008 Nov 21
2
Calculating correlation for a big matrix
Dear All, I have a matrix of size 10000 x 50. I would like to calculate all possible pair-wise correlation coefficient (5x10^7 combinations) using cor(). How can I efficiently calcualte and save the result in a matrix? Thanks in advance. Kind regards, Ezhil
2010 Dec 27
1
R-code to generate random rotation matrix for rotation testing
Dear list, I am looking for an implementation of random rotation matrix generation in R to do a rotation test: I want to use the matrices to create random multivariate normal matrices with common covariance structure and mean based on an observed data matrix. The rRotationMatrix-function in the mixAK-package is an option, but as far as I can tell I need to draw rotation matrices with determinant
2010 Feb 01
4
'R' and 'Yield to Maturity'
Dear R helpers   I am calculating the 'Yield to Maturity' for the Bond with following characteristics.   Its a $1000 face value, 3 year bond with 10% annual coupon and is priced at 101. The yield to maturity can be calculated after solving the equation -   1010 = [100 / (1+ytm)]  + [100 / (1+ytm)^2] + [ 1100 / (1 + ytm)^3]   This can be solved by trial and error method s.t. ytm = 9.601%.
2020 Oct 22
0
3d plot of earth with cut
> It should be a 2D slice/plane embedded into a 3D space. I was able to come up with the plot, attached. My intention was to plot national boundaries on the surface of a sphere. And put the slice inside. However, I haven't (as yet) worked out how to get the coordinates for the boundaries. Let me know, if of any value. And I'll post the code. (But needs to be polished first)
2000 Apr 28
3
L(x,y,t)?
I have been using the following method to create L(x,t) x<-seq(1,66) time<-seq(1,19) v0<-.01 f0<-function(x,time) .45*cos(2*pi*3*x/66+v0*time) L0<-outer(x,time,f0) If I do image(L0) I get an x,t plot of a drifting cosine wave grating. The grating is actually a pattern of fuzzy bars; I have been ignoring the y dimension (because the grating is vertical: y has no effect on the
2010 Dec 13
3
curve
Hi All, I generated 5000 samples using the following script test<- rnorm(5000,1000,100) test1 <- subset(test, subset=(test > 1100)) d <- density(test) plot(d, main="Density of production") abline(v=mean(test1) I wanted to do the following but faced difficulties 1. to shade or color (blue) the curve using the criterion that any
2010 Feb 22
2
Creating regularly spaced time series from irregular one
Hello, I have a series of intraday (high-frequency) price data in the form of POSIX timestamp followed by the value. I sucesfuly loaded that into "its" package object. I would like to create from it a regularly spaced time series of prices (for example 1min, 5min, etc apart) so i could calcualte returns. There is an interpolation function locf() that for timestamp with value NA uses last
2020 Oct 23
0
3d plot of earth with cut
Good to hear you've made such progress. Just a couple of comments: - You should use points3d() rather than rgl.points(). The latter is a low level function that may have unpleasant side effects, especially mixing it with other *3d() functions like persp3d(). - There are several ways to draw a flat surface to illustrate your data. Which one to use really depends on the form of data.
2005 Oct 10
1
using innov in arima.sim
Hello, I have used the arima.sim function to generate a lot of time series, but to day I got som results that I didn't quite understand. Generating two time series z0 and z1 as eps <- rnorm(n, sd=0.03) z0 <- arima.sim(list(ar=c(0.9)), n=n, innov=eps) and z1 <- arima.sim(list(ar=c(0.9)), n=n, sd=0.03), I would expect z0 and z1 to be qualitatively similar. However, with n=10 the
2009 Sep 05
1
how do I draw this surface -- hand drawn in the attachemtn
Basially I have the observation for x, y, and z for each fixed z, the value of y moves from 0 to y0 as x moves from 0 to x0. I then move the curve for z from 0 to z0 and form a continuous surface. want to know if there is a way that R can replace my handdrawing. -------------- next part -------------- A non-text attachment was scrubbed... Name: draw0001.pdf Type: application/pdf Size: 292083
2002 Nov 27
1
[No Subject]
Hi,I try to calcualte AIC or Loglik to GARCH model,But the Packege Tseries do not deal with them.How can I calculate AIC or Loglike to GARCH Model By Packege Tseries? Thanks. ____________________________________________________ Free Internet Access NOW! In Alexandria, Ismaileya, Suez, Portsaid, Hurgadha, Sharm Banha, Shebin El-Kom, Damietta, Tanta, Zagazig, Mansoura, Damanhour, Assyout, Qena
2013 Feb 17
1
Hyperparameters in ARIMA models with dlm package
Hi, i'm beginner in Bayesian methods, I'm reading the documentation about dlm package and kalman filters, I'm looking for a example of transformation of ARIMA in a state space equivalent to use the dlm package and calcualte the hyperparameters. Someone can help me about it?. If it's possible with a arima(1,0,1) example, or more complex model. While I have more examples best for me.
2012 Oct 02
3
Integration in R
Dear R-users, I am facing problem with integrating in R a likelihood function which is a function of four parameters. It's giving me the result at the end but taking more than half an hour to run. I'm wondering is there any other efficient way deal with. The following is my code. I am ready to provide any other description of my function if you need to move forward.
2003 Jul 14
2
Subsetting a matrix
I'd welcome some comments or advice regarding the situation described below. The following illustrates what seems to me to be an inconsistency in the behaviour of matrix subsetting: > Z<-matrix(c(1.1,2.1,3.1,1.2,2.2,3.2,1.3,2.3,3.3),nrow=3) > Z [,1] [,2] [,3] [1,] 1.1 1.2 1.3 [2,] 2.1 2.2 2.3 [3,] 3.1 3.2 3.3 > dim(Z) [1] 3 3 >
2020 Oct 22
2
3d plot of earth with cut
Thanks for your idea. It should be a 2D slice/plane embedded into a 3D space. Could be static, I just need to make a single figure from it for illustration of the Earth together with its interior in 3D. So, the interior would be a slice in 2D along a fixed longitude. And along this 2D slice would be a heatmap. Again, embedded in 3D, since it would be shown as a slice of Earth in 3D. Duncan?s