orthogonal

When are hash functions orthogonal to each other?

♀尐吖头ヾ 提交于 2019-12-07 07:29:05
问题 When are hash functions orthogonal to each other? And can you provide an example in Java of two hash functions that are orthogonal to each other? 回答1: From (a Google search result paper) (Orthogonal Hash Functions) Two hash functions h1 and h2 are orthogonal, if for all states s, s' ∈ S with h1 (s) = h1 (s') and h2 (s) = h2 (s') we have s = s'. S. Edelkamp, Perfect Hashing for State Space Exploration on the GPU. In English, if any two given values passed to two different orthogonal hash

partition of anova and comparisons (orthogonal single df) in r

此生再无相见时 提交于 2019-12-06 03:21:07
问题 I want to do single df orthogonal contrast in anova (fixed or mixed model). Here is just example: require(nlme) data (Alfalfa) Variety: a factor with levels Cossack, Ladak, and Ranger Date : a factor with levels None S1 S20 O7 Block: a factor with levels 1 2 3 4 5 6 Yield : a numeric vector These data are described in Snedecor and Cochran (1980) as an example of a split-plot design. The treatment structure used in the experiment was a 3\times4 full factorial, with three varieties of alfalfa

Looking for a non “brute force” algorithm to remove intersecting areas of a collection of Rects

拟墨画扇 提交于 2019-12-06 03:11:06
问题 I have an n-sized collection of Rects, most of which intersect each other. I'd like to remove the intersections and reduce the intersecting Rects into smaller non-intersecting rects. I could easily brute force a solution, but I'm looking for an efficient algorithm. Here's a visualization: Original: Processed: Ideally the method signature would look like this: public static List<RectF> resolveIntersection(List<RectF> rects); the output would be greater or equal to the input, where the output

Orthogonal hull algorithm

会有一股神秘感。 提交于 2019-12-04 20:57:54
I am trying to find a way to determine the rectilinear polygon from a set of integer points (indicated by the red dots in the pictures below). The image below shows what I would like to achieve: 1. I need only the minimal set of points that define the boundary of the rectilinear polygon. Most hull algorithms I can find do not satisfy the orthogonal nature of this problem, such as the gift-wrapping algorithm , which produce the following result (which is not what I want)... 2. How can I get the set of points that defines the boundary shown in image 1. ? Updated: Figure 1. is no longer refereed

Looking for a non “brute force” algorithm to remove intersecting areas of a collection of Rects

北城以北 提交于 2019-12-04 08:05:21
I have an n-sized collection of Rects, most of which intersect each other. I'd like to remove the intersections and reduce the intersecting Rects into smaller non-intersecting rects. I could easily brute force a solution, but I'm looking for an efficient algorithm. Here's a visualization: Original: Processed: Ideally the method signature would look like this: public static List<RectF> resolveIntersection(List<RectF> rects); the output would be greater or equal to the input, where the output resolves the above visual representation. this is a problem I solved in the past. The first thing it to

How to estimate goodness-of-fit using scipy.odr?

烈酒焚心 提交于 2019-12-04 07:58:59
I am fitting data with weights using scipy.odr but I don't know how to obtain a measure of goodness-of-fit or an R squared. Does anyone have suggestions for how to obtain this measure using the output stored by the function? The res_var attribute of the Output is the so-called reduced Chi-square value for the fit, a popular choice of goodness-of-fit statistic. It is somewhat problematic for non-linear fitting, though. You can look at the residuals directly ( out.delta for the X residuals and out.eps for the Y residuals). Implementing a cross-validation or bootstrap method for determining

how to generate a random matrix with Orthogonalized rows using Gram-Schmidt algorithm in Matlab

无人久伴 提交于 2019-12-02 00:55:15
问题 I want to generate a M*N matrix (M is not equal to N) with following constraints in MATLAB: Step 1. Set each entry of the matrix to an i.i.d. N(0,1) value. Step 2. Orthogonalize the M rows of the matrix using the Gram-Schmidt algorithm. Step 3. Normalize the rows of the matrix to unit length. I do not know how to implement second step of above. Any help is appreciated. 回答1: You might want to look at orth: A = randn( m, n ); % random iid ~N(0,1) oA = orth( A.' ).'; % orthogonal rows nA =

linear regression using lm() - surprised by the result

半城伤御伤魂 提交于 2019-12-01 03:47:16
I used a linear regression on data I have, using the lm function. Everything works (no error message), but I'm somehow surprised by the result: I am under the impression R "misses" a group of points, i.e. the intercept and slope are not the best fit. For instance, I am referring to the group of points at coordinates x=15-25,y=0-20. My questions: is there a function to compare fit with "expected" coefficients and "lm-calculated" coefficients? have I made a silly mistake when coding, leading the lm to do that? Following some answers: additionnal information on x and y x and y are both visual

R: Translate a model having orthogonal polynomials to a function using qr decomposition

一世执手 提交于 2019-11-30 16:59:25
I'm using R to create a linear regression model having orthogonal polynomial. My model is: fit=lm(log(UFB2_BITRATE_REF3) ~ poly(QPB2_REF3,2) + B2DBSA_REF3,data=UFB) UFB2_FPS_REF1= 29.98 27.65 26.30 25.69 24.68 23.07 22.96 22.16 21.51 20.75 20.75 26.15 24.59 22.91 21.02 19.59 18.80 18.21 17.07 16.74 15.98 15.80 QPB2_REF1 = 36 34 32 30 28 26 24 22 20 18 16 36 34 32 30 28 26 24 22 20 18 16 B2DBSA_REF1 = DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DOFFSOFF DONSON DONSON DONSON DONSON DONSON DONSON DONSON DONSON DONSON DONSON DONSON Levels: DOFFSOFF

How to create random orthonormal matrix in python numpy

末鹿安然 提交于 2019-11-30 11:11:25
Is there a method that I can call to create a random orthonormal matrix in python? Possibly using numpy? Or is there a way to create a orthonormal matrix using multiple numpy methods? Thanks. hpaulj This is the rvs method pulled from the https://github.com/scipy/scipy/pull/5622/files , with minimal change - just enough to run as a stand alone numpy function. import numpy as np def rvs(dim=3): random_state = np.random H = np.eye(dim) D = np.ones((dim,)) for n in range(1, dim): x = random_state.normal(size=(dim-n+1,)) D[n-1] = np.sign(x[0]) x[0] -= D[n-1]*np.sqrt((x*x).sum()) # Householder