I have my search engine build using embeddings from documents using ELK...I want to query using mathematical equations and their respective outcomes.
for example: My query is Give me water pH 8+-1
The outcome should be:every document with an pH value from 7 to 9
Exampe 2:Density 1080 would search Density 1080 +- 10% by meaning 1080 +- 108 or, pH 7 would search pH 7 +- 10% by meaning 7 +- 0.7
How can i do this?
How can you with Stata test the null hypothesis against the alternative hypothesis. If I have the hypothesis H_0:\beta_1=\beta_2=0 against H_A:\beta_1 ≠ \beta_2 ≠ 0. What will the code be?
This can be done using testparm or test:
. sysuse auto, clear
(1978 Automobile Data)
. replace weight = weight/1000
variable weight was int now float
(74 real changes made)
. reg price mpg weight i.foreign
Source | SS df MS Number of obs = 74
-------------+---------------------------------- F(3, 70) = 23.29
Model | 317252879 3 105750960 Prob > F = 0.0000
Residual | 317812517 70 4540178.81 R-squared = 0.4996
-------------+---------------------------------- Adj R-squared = 0.4781
Total | 635065396 73 8699525.97 Root MSE = 2130.8
------------------------------------------------------------------------------
price | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg | 21.85361 74.22114 0.29 0.769 -126.1758 169.883
weight | 3464.706 630.749 5.49 0.000 2206.717 4722.695
|
foreign |
Foreign | 3673.06 683.9783 5.37 0.000 2308.909 5037.212
_cons | -5853.696 3376.987 -1.73 0.087 -12588.88 881.4934
------------------------------------------------------------------------------
. test weight=1.foreign=3500
( 1) weight - 1.foreign = 0
( 2) weight = 3500
F( 2, 70) = 0.05
Prob > F = 0.9466
The two-sided p-value is stored in r(p):
. display r(p)
.94664298
I have a text file of a grid that has x y z coordinates (of cell centers and are in UTM) and varying lengths of the sides of the cells(sx, sy and sz). The points are random points. I would like to plot this in Python. Can anyone offer any suggestions?
x y z sx sy sz
584597 1848923 210 143 53 143
584885 1848927 210 143 62 143
585173 1853185 210 143 224 143
As far as how? I would start by:
1) using readline, you split each by the " "(space) values
2) create dict with a for loop, and setting the key.. x y z etc...
3) ?? You say you want to plot but since I don't know the end game here; I imagine matploit should be the goto forgraphical plotting
4) As to the other variables, the non-coordinantes, it's up to you in how you want to correlate/express these values.
I tried to know and searches very much but I didn't find for y-direction shear [1,0,0]
[shy,1,0]
[0,0,1]
You can find the answer at http://web.archive.org/web/20060914224155/http://web.archive.org:80/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q43
In case the link gets broken somehow, here is the relevant part:
A shearing matrix is used to make a 3D model appear to slant sideways.
For example, "italic" text requires each character to slant towards the
right.
In three dimensions six possible shearing directions exist:
o shear X by Y
o shear X by Z
o shear Y by X
o shear Y by Z
o shear Z by X
o shear Z by Y
All six shearing directions may be combined into a single matrix:
| 1 Syx Szx 0 |
| |
| Sxy 1 Szy 0 |
M = | |
| Sxz Syz 1 0 |
| |
| 0 0 0 1 |
| |
Where Sij implements a shear of I by J
Thus, Sxy shears X by Y
In theory, rotation in three dimensions may be considered a combination
of six shearing directions.
I know two coordinates of two vertices in a triangle (not aligned to an axis) and I'm attempting to calculate the coordinates of the third.
a
B ------- C
\ |
\ |
C' \ |
c \ | b
\ |
\ |
\|
A
I know the coordinates of A and B, the lengths of a and c, and that the angle C will always be a right angle. I believe there can only be two possible solutions for the coordinates of C; the one drawn above, and one with C reflected about the line c, approximately at C'. I'd like to calculate both positions.
EDIT:
The source of the triangle is as below.
I know the apex A, the centre of the circle B, the radius of the circle (a) and, from Pythag with (B - A), I know the length of c. I'm trying to find the points at which a line from the apex are at a tangent to each side of the circle, C and C'.
This appears to be an answer to my problem; can anyone elaborate on 'Given two sides of a right triangle, it's easy to find the length and direction of the third side.'.
I know the coordinates of A and B, and the lengths of a and c. From this, I believe there can only be two possible solutions for the coordinates of C
This is not true. There are an infinite number of choices for the position of C, as you don't know the length of b.
For example:
C
|
|
|
|
|
B
\
\
\
c \
\
\
\
A
If you connect C to A, you still maintain those known lengths....
In order for this to be true, you would also need to know one of the angles (such as that it's a right triangle), or the length of b.
It is easy: As the C angle is PI/2 then b=sqrt(c*c-a*a) so you know the lengths of a, b, c.
The coordinates of C and C' = the intersections of two circles:
center B radius a
center A radius b
Solved here for example //A=P1, B=P0, C=P3: https://math.stackexchange.com/questions/187107/calculate-coordinates-of-3rd-point-vertex-of-a-scalene-triangle-if-angles-and
The essential condition for this: if (a<c) otherwise it has no solution.
If you know it's going to be a right triangle, then you know the x and y values will be taken from the other two points.
Point coordsForCompletingTriangleTop(Point a, Point b) {
return new Point(a.x,b,y);
}
Point coordsForCompletingTriangleBottom(Point a, Point b) {
return new Point(b.x,a,y);
}
If cannot be guaranteed that it will be a right triangle, then you do need more information. The length of B, the length of C, or the angle of BCA would be required.
If you assume a and b are the opposite corners of a rectangle
a = (xa, ya)
b = (xb, yb)
then the top right rectangle point is c1 = (max(xa,xb), max(ya,yb))
and the bottom left rectangle point is c2 = (min(xa,xb), min(ya,yb))
Assuming that xa != xb and ya != yb
(xa, ya) A C1 (max(xa, xb), max(ya, yb))
o----------o
|\ |
| \ |
| \ |
| \ |
| \ |
| \ |
| \ |
| \ |
| \ |
o----------o
(min(xa, xb), min(ya, yb)) C2 B (xb, yb)
If your diagonal is going the other way (to test this see if xa > xb) you need to swap min for max on the x
(min(xa, xb), max(ya, yb)) C3 A'
o----------o
| /|
| / |
| / |
| / |
| / |
| / |
| / |
| / |
| / |
o----------o
B' C4 (max(xa, xb), min(ya, yb))
And if you're interested, the full set of solutions actually lies on the circle:
To compute this, suppose we have two points A = (xa, ya) and B = (xb, yb). Then the center point of this circle is c = (0.5 (xa + xb), 0.5 (ya + yb)) - just the midpoint of the A and B. The radius of the circle is r = sqrt( (xb - xa)^2 + (yb - ya)^2) / 2 - using pythagoras' theorem to get the length of the line and halving it. Then any point on the circle can be defined by p = c + (rcos(u), rsin (u)) for some angle u. There are 2 angles which give you the points p = A and p = B so these values of u are not good solutions. You can write out the equation and solve it for these 2 points to give you the values of u which you cannot use.