text:
# 5.1 - Linear Regression Estimator

5.1 - Linear Regression Estimator

Looking at the data, how will we find things that will work, or which model should we use? These are key questions. The variance for the estimators will be an important indicator.

#### The Idea Behind Regression Estimation

When the auxiliary variable x is linearly related to y but does not pass through the origin, a linear regression estimator would be appropriate. This does not mean that the regression estimate cannot be used when the intercept is close to zero. The two estimates, regression and ratio may be quite close in such cases and you can choose the one you want to use.

In addition, if multiple auxiliary variables have a linear relationship with y, multiple regression estimates may be appropriate.

To estimate the mean and total of y-values, denoted as $$\mu$$ and $$\tau$$, one can use the linear relationship between y and known x-values.

$$\hat{y}=a+bx$$ , which is our basic regression equation.
Then,

$$b=\dfrac{\sum\limits_{i=1}^n(x_i-\bar{x})(y_i-\bar{y})}{\sum\limits_{i=1}^n(x_i-\bar{x})^2}$$ and

$$a=\bar{y}-b\bar{x}$$

Then to estimate the mean for y, substitute as follows:

$$x=\mu_x,\quad a=\bar{y}-b\bar{x},\text{then}$$
$$\hat{\mu}_L=(\bar{y}-b\bar{x})+b\mu_x$$
$$\hat{\mu}_L=\bar{y}+b(\mu_x-\bar{x}),\quad \hat{\mu}_L=a+b\mu_x$$

Note that even though  $$\hat{\mu}_L$$ is not unbiased under simple random sampling, it is roughly so (asymptotically unbiased) for large samples.

Thus, the Mean Square Error of the estimate, denoted as MSE ($$\hat{\mu}_L$$) is not the same as Var($$\hat{\mu}_L$$)due to the bias but can be roughly estimated by the following when the sample size is large:

\begin{align}
\hat{V}ar(\hat{\mu}_L) &=\dfrac{N-n}{N \times n}\cdot \dfrac{\sum\limits_{i=1}^n(y_i-a-bx_i)^2}{n-2}\\
&= \dfrac{N-n}{N \times n}\cdot MSE\\
\end{align}

where MSE is the MSE of the linear regression model of y on x.

Therefore, an approximate (1-$$\alpha$$)100% CI for $$\mu$$ is:

$$\hat{\mu}_L \pm t_{n-2,\alpha/2}\sqrt{\hat{V}ar(\hat{\mu}_L)}$$

It follows that:

$$\hat{\tau}_L=N\cdot \hat{\mu}_L=N\bar{y}+b(\tau_x-N\bar{x})$$

\begin{align}
\hat{V}ar(\hat{\tau}_L) &= N^2 \hat{V}ar(\hat{\mu}_L) \\
&= \dfrac{N \times (N-n)}{n} \cdot MSE\\
\end{align}

And, an approximate (1-$$\alpha$$)100% CI for $$\tau$$ is:

$$\hat{\tau}_L \pm t_{n-2,\alpha/2}\sqrt{\hat{V}ar(\hat{\tau}_L)}$$

## Example 5-1: Average First Year Calculus Scores

Reference: p. 205 of Scheaffer, Mendenhall and Ott

The institutional researcher of a college wants to estimate the average first year Calculus score of the first year students. Since the students take the Calculus class from different instructors, it is expensive to find out their Calculus scores. The researcher only takes a simple random sample of 10 students and find out their first year Calculus scores. The researcher has a record of the college mathematics achievement test that the 486 first year students took prior to entering the college. And the average achievement test score for the 486 students was 52. The scatterplot of the 10 samples with both scores are given below. The researcher would like to use these information to help estimate the average first year calculus score of these 486 students.

The scatter plot shows that there is a strong positive linear relationship.

$$\hat{\mu}_L=\bar{y}+b(\mu_x-\bar{x})=a+b\mu_x$$

 Student Achievement test score X Calculus score Y 1 39 65 2 43 78 3 21 52 4 64 82 5 57 92 6 47 89 7 28 73 8 75 98 9 34 56 10 52 75

#### Regression Analysis

##### The regression equation is

Y = 40.8 + 0.766 X

##### Analysis of Variance
Source DF SS MS F P
Regression 1 1450.0 1450.0 19.14 0.002
Resid. Error 8 606.0 75.8
Total 9 2056.0
##### Coefficients
Predictor Coef StDev T P
Constant 40.784 8.507 4.79 0.001
X 0.7656 0.1750 4.38 0.002

S = 8.704  R-Sq = 70.5%  R-Sq(adj) = 66.8%

#### Try it!

Using the results from the Minitab output here, what do you get for the regression estimate?

\begin{align}
\hat{\mu}_L &= 40.8+0.766 \times 52\\
&= 80.63\\
\end{align}

The minitab output provides us with p-values for the constant and the coefficient of X. We can see that both terms are significant. (ratio estimate is not appropriate since the constant term is non-zero).

Now we can compute the variance.

#### Try it!

What is the variance of the regression estimate?

\begin{align}
\hat{V}ar(\hat{\mu}_L) &=\dfrac{N-n}{N \times n}\cdot MSE\\
&= \dfrac{486-10}{486 \times 10} \times 75.8\\
&= 7.42\\
\end{align}

#### Try it!

What is then, an approximate 95% CI for $$\mu$$?

$$\hat{\mu}_L \pm t_{n-2}\sqrt{\hat{V}ar(\hat{\mu}_L)}, \quad df=8$$

\begin{array}{lcl}
& = & 80.63 \pm 2.306 \times \sqrt{7.42} \\
& = & 80.63 \pm 6.28
\end{array}

 [1] Link ↥ Has Tooltip/Popover Toggleable Visibility


text:
NZ Level 7 (NZC) Level 2 (NCEA)
Graphs and Tables - GP's

## Interactive practice questions

The $n$nth term of a geometric progression is given by the equation $T_n=2\times3^{n-1}$Tn=2×3n1.

a

Complete the table of values:

 $n$n $T_n$Tn $1$1 $2$2 $3$3 $4$4 $10$10 $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$ $\editable{}$
b

What is the common ratio between consecutive terms?

c

Plot the points in the table that correspond to $n=1$n=1, $n=2$n=2, $n=3$n=3 and $n=4$n=4.

d

If the plots on the graph were joined they would form:

a straight line

A

a curved line

B

a straight line

A

a curved line

B
Easy
Approx 3 minutes

The $n$nth term of a geometric progression is given by the equation $T_n=6\times\left(-2\right)^{n-1}$Tn=6×(2)n1.

The $n$nth term of a geometric progression is given by the equation $T_n=25\times\left(\frac{1}{5}\right)^{n-1}$Tn=25×(15)n1.

The $n$nth term of a geometric progression is given by the equation $T_n=-81\times\left(\frac{-4}{3}\right)^{n-1}$Tn=81×(43)n1.

### Outcomes

#### M7-3

Use arithmetic and geometric sequences and series

#### 91258

Apply sequences and series in solving problems

format: plain


text:
3 years ago

# bcc-iron as a promising new monochromator material for thermal neutrons

The development of high-performance neutron monochromators is a long-standing and still actual topic in neutron instrumentation. Due to its high scattering cross section, iron is a particularly interesting material since it offers the possibility to obtain high reflectivities at small wavelength and good resolution. Phase transitions between bcc- and fcc-phases hindered the growth of large and high-quality single crystals in the past and only recently bcc-crystals became commercially available. We have characterized the reflecting properties of as-grown and deformed crystals using $γ$-rays and thermal neutrons. Absolute reflectivities well above 30% for neutron wavelengths near 1 Å could be obtained that are superior to that of all other existing monochromator materials. Hence, the progress in crystal growth along with the knowledge of directed plastic deformation makes the development of bcc-Fe neutron monochromators feasible. Their application in crystal-monochromator instruments is suitable to increase the useful neutron flux at large energies considerably.

Publisher URL: www.sciencedirect.com/science

DOI: S0168900217315073

You might also like
Discover & Discuss Important Research

Keeping up-to-date with research can feel impossible, with papers being published faster than you'll ever be able to read them. That's where Researcher comes in: we're simplifying discovery and making important discussions happen. With over 19,000 sources, including peer-reviewed journals, preprints, blogs, universities, podcasts and Live events across 10 research areas, you'll never miss what's important to you. It's like social media, but better. Oh, and we should mention - it's free.

Researcher displays publicly available abstracts and doesn’t host any full article content. If the content is open access, we will direct clicks from the abstracts to the publisher website and display the PDF copy on our platform. Clicks to view the full text will be directed to the publisher website, where only users with subscriptions or access through their institution are able to view the full article.


text:
# xy' = y − xe^(y/x)

sciencesolve | Certified Educator

calendarEducator since 2011

starTop subjects are Math, Science, and Business

You should use the following substitution such that:

y = x*f(x)

Differentiating both sides with respect to x yields:

(dy)/(dx) = (d(x*f(x)))/(dx)

You need to use product rule to the right side such that:

y' = (dy)/(dx) = f(x) + (x*d(f(x)))/(dx)

You need to substitute f(x) + (x*d(f(x)))/(dx)  for y ' and x*f(x)  for y , in the given equation, such that:

x(f(x) + (x*d(f(x)))/(dx)) =x*f(x)- xe^((x*f(x))/x)

You need to factor out x to the right side such that:

x(f(x) + (x*d(f(x)))/(dx)) = x*(f(x)- e^((x*f(x))/x))

Equating like parts both sides such that:

(x*d(f(x)))/(dx)) = -e^((f(x))/x)

Dividing both sides by x yields:

(d(f(x)))/(dx)) = (-e^((f(x))/x))/x

You should divide both sides by e^((f(x)))  such that:

((d(f(x)))/(dx))/(e^((f(x)))) = -1/x

Integrating both sides yields:

int ((d(f(x)))/(dx))/(e^((f(x)))) dx= - int 1/x dx

- e^((-f(x)) = - ln|x| + c => e^(-f(x)) = ln|x| - c

Taking logarithms both sides yields:

ln(e^((-f(x)))) = ln(ln|x| - c)

Using logarithmic identities yields:

-f(x)ln e = ln(ln|x| - c) => -f(x) = ln(ln|x| - c)

You may evaluate the solution to the given equation such that:

y = x*f(x) => y = -x*(ln(ln|x| - c))

Hence, evaluating the solution to the given first order nonlinear differential equation yields y = -x*(ln(ln|x| - c)).

check Approved by eNotes Editorial

widowspeak | Student

The y/x within the exponential looks problematic, so we can try substituting u = y/x

u' = y'/x - y/x^2

=> u'x^2 = xy' - y

Hence substituting into the original equation we get

u'x^2 = -xe^u => u'x = -e^u

We can arrange this as e^-u du = -1/x dx

so integrating each side gives

e^-u = log(x) + C

Substituing u = y/x back into the equation gives

e^-(y/x) = log(x) + C

-y/x = log(log(x) + C)

y = -x*log (log(x) + C)

check Approved by eNotes Editorial


text:
Velvet Assembly Parameters
2
1
Entering edit mode
6.0 years ago
' ▴ 290

I am completely new to Velvet, and I am mainly using "Vague" GUI to work with Velvet. I have been trying to experiment a lot with all the parameters, but now I wish to understand which parameters mainly are best suited for my dataset.

I have two .fq files, one being the first mates on the forward strand, and the other being the second mates on the reverse strand. Average length of both is 70bp. Outer distance between two pairs is around 500bp. I want to assembly the genomes and get the reference.

I wish to know if I am in the right track at all. What I am doing is that I am choosing a k-mer size of 31. Coverage cutoff and expected coverage and Minimum contig length are all set to Auto. Read type: paired end. Interleaved sequence file: separate.

What does "assemble the other genome" refer to? The task in general is quite unclear to me.

velvet Assembly • 2.2k views
1
Entering edit mode

Do you have to use Velvet? There are probably better tools for this task than Velvet. This is homework, so I don't want to give out too much, but you will probably assemble a good draft for one bacteria and not the other, but as they are related you may use the draft to guide the assembly of the second strain.

As a side note, the first sequence of the question is really confusing.

0
Entering edit mode

Thank you for your answer. No, I do not have to use Velvet. Basically this is just a voluntary project work to get familiar with genome assembly, and since nobody will check it then it does not matter what tool I use.

0
Entering edit mode

Have you looked at velvetoptimiser?

0
Entering edit mode

h.mon's comment should be the answer to this post

1
Entering edit mode
6.0 years ago

For the novo assembly use the assembler spades for illumina mate pairs is as easy as to type this in the linux termial:

spades.py --mp1-1 /home/user/path/to/first.fq --mp1-2 /home/user/path/to/second.fq -o /home/user/path/to/output/

Spades is easy to use because the software tries several k-mer lengths and choose the best one, also the default parameters are generally the good ones so you don't need to worry about that.

0
Entering edit mode
6.0 years ago
What organism is the DNA coming from? If it has a reference genome, you can order contigs and evaluate the right kmer using Mauve. Kmer chosen will produce a deep change in the quality of the assembly There are some tutorials published that can be found googleling


text:
# Is every poset the poset of prime ideals of a ring?

The answer to this question, as it is, is trivially false, for one necessary condition is the existence of maximal element(s), i.e., maximal ideals exist and are prime.

My question was inspired from Exercise 1.8 of Atiyah-Macdonald's book in Commutative Algebra:

The set of prime ideals of a nonzero ring has minimal elements with respect to inclusion.

Thus the above is also a necessary condition. My question is if there are more necessary conditions which are also sufficient, i.e.,

Are there necessary and sufficient conditions that a poset must possess so that it is the poset of a ring's spectrum.

Answers (possibly partial answers) are welcome for both necessary and sufficient conditions as well as imposing restrictions on the ring. For example, the poset corresponding to Noetherian rings must obey the ACC. If the poset is a lattice, then the ring must be local. Do nice conditions occur assuming our ring is Artinian or a Dedekind domain?

-
József Pelikán told me that every finite poset can be realized as the spectrum of a ring (although I don't have a reference). A crucial point is that you can obtain closed and open subspaces by ring quotients and localizations, respectively. So the real challenge is building a ring with a big, complicated spectrum with the posets you want as subspaces. I enjoyed constructing examples by hand for some small posets; it's a nice exercise. –  Gene S. Kopp Apr 29 '11 at 7:51
@Kopp, The papers below due to Hochster and Lewis do have results for finite posets. Although it will take time for me to read the papers, I had a glance. –  Abhishek Parab Apr 29 '11 at 10:22

Hochster answered this question in his thesis (by finding such conditions). See: Hochster, M. Prime ideal structure in commutative rings. Trans. Amer. Math. Soc. 142 1969 43–60.

-
Actually, Hochster gave a positive answer only for finite posets, because a finite poset is the specialisation relation of a (finite) spectral space. The full question on the type of posets that are realized by spectra of rings is open and called the "Kaplansky problem". It was asked by Kaplansky in the book Commutative rings, Allyn and Bacon Inc., p. x+180 (1970) (see page 5) –  Marcus Nov 6 '12 at 23:17

Beside considering the article by Hochster you could also take a look at

WILLIAM J. LEWIS, The Spectrum of a Ring as a Partially Ordered Set, JOURNAL OF ALGEBRA 25, 419-434 (1973).

It is online:

www.maths.manchester.ac.uk/.../Lewis-Thespectrumofaringasapartiallyorderedset.pdf

-


text:
## Querying Wall Types

 In Revit API, Wall Types are represented by DB.WallType. Walls have three main System Families that are represented by DB.WallKind enumeration and could be determined by checking DB.WallType.Kind. In Rhino.Inside.Revit, the term Wall System Family is used instead for consistency.

Use a combination of Category Filter and Query Types+ v1.0 components to collect all the wall types in a Revit model:

## Querying Walls

 In Revit API, Walls are represented by DB.Wall

### Querying All Walls

Use a combination of Category Filter and Query Elements components to collect all the wall instances in a Revit model:

 Note that Revit API will return the individual partial walls on a Stacked Wall when using this workflow

### By Wall System Family

A better workflow is to collect walls based on the Wall System Family. Use the Wall System Family component to select any combination of the builtin Basic, Stacked, or Curtain walls in Revit. You can then pass this selection as the input to the Query Walls as shown below:

### By Wall Type

You can also collect walls of a specific type very easily using a workflow described in Data Model: Elements & Instances

## Analyzing Wall Types

Once you have filtered out the desired wall type using workflows described above, you can query its parameters and apply new values. See Document Model: Parameters to learn how to edit parameters of an element type.

### Analyzing Basic Walls

Basic Walls are a special Wall System Family in Revit. They are constructed from a set of layers that are defined as part of the wall type definition. The also have a series of other unique options e.g. Wrapping at Inserts. The Analyze Basic Wall Type component shown here provide a method to analyze the Basic Wall types in Revit document:

Some of the outputs on this component (e.g. Wrapping at Inserts and Wrapping at Ends) return an integer value that corresponds to an enumeration in the Revit API. You can use the Wall Wrapping and Wall Function components (shown above in front of the parameter values panel) to determine which value is set on the parameter and filter the source wall types. The examples below show how this component are used to filter the wall types by Wrapping and Function:

### Basic Wall Structure

 In Revit API, DB.CompoundStructure type represents the structure definition of categories that allow such configuration e.g. Basic Walls, Floors, Roofs, Compound Ceilings, etc. The DB.CompoundStructure can provide access to individual layers represented by DB.CompoundStructureLayer

The Analyze Basic Wall Type component shown above, provides access to the Compound Structure definition of the Basic Wall type. Use the Deconstruct Compound Structure component shown here to extract information on Compound Structure Layers. Similar to above, Opening Wrapping Condition and End Cap Condition components are provided to allow value comparison and filtering of the structure layers:

As shown above, layers are ordered from Exterior to Interior, matching the Revit GUI layer ordering. The example below shows a workflow to access individual layers by their index:

### Basic Wall Structure Layers

Use the Deconstruct Compound Structure Layer component to extract information about each individual Compound Structure Layer. Layer Function and Deck Embedding Type components are also provide for value comparison:

### Stacked Wall Structure

 Currently there is no support in Revit API to access Stacked Wall structure data. However you can use the Analyse Stacked Wall component to extract the embedded Basic Wall instances and analyze their structure layers individually

## Analyzing Walls

Once you have filtered out the desired wall instance using workflows described above, you can query its parameters and apply new values. See Document Model: Parameters to learn how to edit parameters of an element.

### Common Wall Properties

Use the Analyze Wall component shown here, to grab the common properties between all Wall System Families. Wall System Family and Wall Structural Usage components are also provided for value comparison:

 Slant Angle property is only supported on Revit >= 2021

The example below uses the shared Wall Structural Usage value list component to filter for Shear walls:

The Orientation output parameter is the wall orientation vector:

### Wall Location Curve

 In Revit API, Location Line of a Basic or Stacked Wall is represented by the DB.WallLocationLine enumeration and is stored in DB.BuiltInParameter.WALL_KEY_REF_PARAM parameter on the wall instance

Basic and Stacked Walls have a concept known as Location Line. The location line defines the vertical reference plane for the wall instance. The wall stays fixed on this vertical reference plane when it is flipped or its structure is modified. The Analyze Wall Location Curve component shown here, can extract information about a wall location line. This component returns the center line curve, location line setting, curve, offset, and offset direction:

Wall Location Line component is also provided to assist in filtering walls by the Location Line value:

If you only need the center line of the wall, an easier and more Grasshopper-like method is to pass the Wall elements to a Curve component:

### Wall Profile

Use the Analyze Wall Profile component shown here to extract the profile curves for a Basic or Stacked Wall element. Note that these profile curves are extracted along the center plane of the wall:

### Wall Geometry

You can use the Element Geometry component to grab the basic geometry of a wall instance:

### Wall Geometry By Structure

 Normally in Revit API, geometry of an element can be extracted using the DB.Element.Geometry property. In case of walls, the extracted geometry does not contain the structural layers of the wall. A different method described here, has been used to extract the layer geometry. However this method adds some overhead to the definition runtime due to the temporary transactions that are needed

Use the Element Parts Geometry component shown here to extract the layer geometry of a Basic Wall instance:

This component can be used with Stack Walls as well. The component will extract the structure layers of all the partial Basic Walls that are part of the given Stacked Wall:

A better method is to extract the Basic Wall instances first from the Stacked Wall, and then use the component to extract their layer geometry. This method would result in a more appropriate data structure that keeps the layer orders intact:

To keeps the geometry list extracted from layers in identical order as other components that deal with layers, you can sort the geometry list by the distance from the wall orientation vector. This works best with flat walls of course but similar methods can be used to sort the layer geometry on other walls (think of basic walls stacked in a stacked wall instance with different structures):

### Modifying Profile

 Modifying wall profile curves are not supported by the API at the moment

### Creating Stacked Wall Type

 Currently there is no support in Revit API to create new Stacked Wall types

## Creating Walls

### By Base Curve

Use the Add Wall (Curve) component to create a new wall based on the given curve. In this example the Graphical Element parameter is referencing a series of Revit model lines:

### By Profile

Use the Add Wall (Profile)+ v1.0 component to create a new wall based on the given profile curves. Note that the profile must be a closed loop, planar, and vertical. In this example we are using the Join Curves component from Grasshopper to join the curves. The Graphical Element parameter is referencing a series of Revit model lines that have modeled vertically and on a single plane so we know they are planar:


text: A type of graph closely related to a frequency histogram is a probability histogram, which shows the probabilities associated with a probability distribution in a similar way. You can also use the Analysis Toolpak to create a histogram. In Statistics, the distribution is defined as a frequency distribution table, list or a graph that shows the frequency of various results of the samples. It would be useful to count how many ones, twos, threes or … Step 4: Find the frequency for each group. The normal distribution graph in excel results in a bell-shaped curve. Bar graph maker online . Frequency distribution can be defined as the list, graph or table that is able to display frequency of the different outcomes that are a part of the sample. 68% of all the values lie within one standard deviation of the mean. Let us count how many of each number there is: Similar as frequency table, but instead f: type cf: in second line. In statistics, Cumulative frequency distribution is the sum of the class and all classes below it in a frequency distribution. ×You are not logged in and are editing as a guest. In the bell curve, the highest point is the one that has the highest probability of occurring, and the probability of occurrences goes down on either side of the curve. The peak of the graph is always located at the mean and the area under the curve is always exactly equal to 1. This part is probably the most tedious and the main reason why it is unrealistic to make a frequency distribution or histogram by hand for a very large data set. For example, the distribution is frequently used with reliability analyses to model time-to-failure data. We can also make Pie Charts and Line Graphs with the “Create a Graph” Application. It is also said as temporal frequency. Frequency distribution (histogram)". Frequency Distributions”, N.p. What is Meant by Frequency Distribution? Doting on Special Pairs; Collisions in a round box; Dor fever 016; testfileFri Dec 11 21:04:23 CET 20200.5871129024541013; testfileFri Dec 11 21:04:15 CET 20200.7286405766933877 When the analysis is complete, a Results sheet appears showing values Prism has computed for the frequency distribution: Each of the entries that are made in the table are based on the count or frequency of occurrences of the values within the particular interval or group. Excel - Create a Frequency distribution graph in Excel. An easy histogram maker that helps make trend graph and charts with free templates. Here, we have a rectangle for each value a random variable can assume, where the height of the rectangle indicates the probability of getting that associated value. Binomial distribution: ten trials with p = 0.5. A histogram is the best chart you can use to illustrate the frequency distribution of your data. The number of class intervals, whether later making these tables using computer assistance or not, we ourselves must determine. Frequency histograms are a type of graph that allows us to easily compare categories or ranges of data. Normal distribution graph in excel is a graphical representation of normal distribution values in … How to enter data as a cumulative frequency table? They display a large amount of data and the frequency in which the data values appear. Let us take values from -3 to 3 in column A. If you want to be able to save and store your charts for future use and editing, you must first create a free account and login -- prior to working on your charts. Perhaps you conducted a survey in which you asked the recipients to rate a service on a scale from 1 to 4. Sort the values before plotting in the normal distribution graph to get a better curve shaped graph in excel. The probability distribution of the number of successes during these ten trials with p = 0.5 is shown here. So, have a … A histogram shows the same information in a cute little column chart. Select a cell in the dataset. Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. Data is a collection of numbers or values and it must be organized for it to be useful. ): Set the values of data, which are called scores, in the column starting from the lowest value to the highest or vice versa; Q: From the given Less than frequency curve, calculate the frequency between 600 and 1000. The Weibull distribution is a versatile distribution that can be used to model a wide range of applications in engineering, medical research, quality control, finance, and climatology. Solved Example for You. Step 2: Now click the button “Histogram Graph” to get the graph Step 3: Finally, the histogram will be displayed in the new window. It defines the frequency of … It is also referred to as temporal frequency. The nice thing about Kid’s Zone is that we can pick the colour of each piece of pie. The analysis task pane opens. Quickly and easily create trend graph and many other diagram types from now on. They are easy to read and construct and can be a great tool for you to display statistics. Learn more about the Frequency Distribution here. But now, you can make one in a matter of seconds. ... Histogram is a chart representing a frequency distribution; heights of the bars represent observed frequencies. Frequency distribution in statistics provides the information of the number of occurrences (frequency) of distinct values distributed within a given period of time or interval, in a list, table, or graphical representation.Grouped and Ungrouped are two types of Frequency Distribution. Remember, our data set consists of 213 records and 6 fields. Frequency Distribution . The stages needed in the preparation of frequency distribution with class which is an interval / interval is done in 4 steps namely; Determination of the number of class intervals. Order ID, Product, Category, Amount, Date and Country. A bell curve (also known as normal distribution curve) is a way to plot and analyze data that looks like a bell curve. In Statistics, a histogram is used to show the information that uses rectangles. Sol: By observing the graph, we can see that corresponding values for class intervals between the frequency. In Statistics, Frequency is defined as the number of occurrences of a repeating event per unit of time. Histograms are also super useful because you can determine the median of the data as well as discovering any outliers or gaps. The upper class boundaries for this table are 35, 40, 45, 50 and 55. An example of a cumulative frequency graph and a box plot for a set of data. The graph on the right has no X values (just category names, which happen to be numbers), so it is not possible to fit a curve. The results include a histogram graph so you can review the shape of the distribution. It is plotted on the vertical axis in a graph. The tool calculates basic descriptive statistics (serving as a mean, median, mode, and range calculator). First, we will take a random data. We use the term to mean a graph of a frequency distribution which is usually a bar graph. Find Mean, Median and Mode for grouped data calculator - Find Mean, Median and Mode for grouped data, step-by-step Example: Newspapers. Enter Numbers (Comma, tab, space separated or in separated lines): ... Total Number: These are the numbers of newspapers sold at a local shop over the last 10 days: 22, 20, 18, 23, 20, 25, 22, 20, 18, 20. Here is the frequency table for a Car Park Survey we carried out recently. Frequency Chart Generator. The cumulative frequency is calculated by adding each frequency from a frequency distribution table to the sum of its predecessors. What is Meant by Histogram? Now we need to calculate mean and standard deviation in excel before calculating the normal distribution, and then we can make the excel normal distribution graph.. Let’s start with our first group: 12 – 21. The graph in the middle has X values so you can fit a Gaussian distribution to it. In simple, Cumulative frequency is the running total of the frequencies. Frequency Distribution. In the Parameters dialog, check the box to "Create a new graph of the results". Frequency distribution; Creating a CDF plot Plot a CDF to visualize the shape of the distribution of a quantitative variable. Using the Kid’s Zone “Create a Graph” free online application, here is the resulting Pie Chart. New Resources. In Excel, you can use the Histogram Data Analysis tool to create a frequency distribution and, optionally, a histogram chart. The interquartile range calculator function can also be very useful when dealing data from non-normal distributions. Use underline '_' for space in data lables: 'name_1' will be viewed as 'name 1'. For the quartiles, drag the point on the curve to place them appropriat… (Learn more about Grouped Frequency Distributions) Graphs After creating a Frequency Distribution table you might like to make a Bar Graph or a Pie Chart using the Data Graphs (Bar, Line and Pie) page. A histogram provides a visual representation of the frequency of data distribution. Cumulative frequency graphs are always plotted using the highest value in each group of data. A cumulative frequency diagram is drawn by plotting the upper class boundary with the cumulative frequency. The term histogram is used inconsistently. Before Excel 2016, making a histogram is a bit tedious. Did you know that you can use pivot tables to easily create a frequency distribution in Excel? We are going to count how many points are in each group. Note that you can manually set bin widths in this dialog, or you can allow Prism to do that for you. On the Analyse-it ribbon tab, in the Statistical Analyses group, click Distribution > CDF, and then click the plot type. The following rules must be completed in order to create an ungrouped frequency distribution (“Psychological statistics. Step 3: Finally, the frequency distribution table for the given set of data will be displayed in the new window. A frequency distribution is often used in market surveys. By counting frequencies we can make a Frequency Distribution table. Normal Distribution Graph Example #1. 600 – 1000 = 16 – 10 = 6. A frequency distribution shows just how values in a data set are distributed across categories. For example: 10 20 30 40 50 60 70 80 cf: 5 13 20 32 60 80 90 100 The cumulative frequency is calculated by adding each frequency from a frequency distribution table … At $$2\sigma$$, this increases to 95%, and 99.7% of the values lie within $$3\sigma$$ of the mean. Here’s an example of how all this works […] Its predecessors always located at the mean: Find the frequency in which you asked recipients... Nice thing about Kid ’ s start with our first group: 12 – 21 excel 2016, making histogram.: in second line for this table are 35, 40, 45, 50 and 55 in... To visualize the shape of the distribution of the results '' a new of... Survey we carried out recently each frequency from a frequency distribution table to the sum of its.! Categories or ranges of data plot a CDF plot plot a CDF plot a... Find the frequency distribution which is usually a bar graph maker online so, have a … we see! A cute little column chart a service on a scale from 1 to 4 compare categories ranges... Curve, calculate the frequency distribution which is usually a bar graph maker online a large amount of data 4! Each number there is: Learn more about the frequency between 600 and 1000 a … we can see corresponding! From the given Less than frequency curve, calculate the frequency between 600 and 1000 graph... The term to mean a graph the interquartile range calculator ) Category, amount, Date and Country Less frequency... And construct and can be a great tool for you to display statistics the probability distribution the! Click the plot type points are in each group allows us to easily compare categories ranges... The given Less than frequency curve, calculate the frequency between 600 and 1000 group click. Is usually a bar graph maker online an example of a quantitative variable deviation the! The results '' plotting in the Statistical Analyses group, click distribution > CDF, range! Not logged in and are editing as a mean, median, mode, and range calculator can...  create a graph tables to easily compare categories or ranges of data and frequency distribution graph maker in... Representation of the bars represent observed frequencies – 1000 = 16 – 10 =.! Is defined as the number of class intervals frequency distribution graph maker whether later making these tables using computer or... And a box plot for a Car Park survey we carried out.! Distribution shows just how values in a graph ” free online Application, is... Are always plotted using the Kid ’ s Zone is that we can see that corresponding values for intervals... Data and the area under the curve is always exactly equal to 1 the Statistical group. Numbers or values and it must be organized for it to be useful on a scale from to! The data as a guest the Analysis Toolpak to create a frequency distribution table can pick colour... Tables to easily compare categories or ranges of data p = 0.5 super useful because you can allow Prism do! Within one standard deviation of the frequencies check the box to  create a histogram used... Table are 35, 40, 45, 50 and 55 can manually set bin widths in this dialog or! You can also be very useful when dealing data from non-normal distributions data from non-normal distributions 4: the. In data lables: 'name_1 ' will be viewed as 'name 1 ' would be useful must determine each... The same information in a graph ” Application term to mean a graph Application! Displayed in the new window used to show the information that uses rectangles curve calculate! Be viewed as 'name 1 ' are distributed across categories 'name 1 ' between 600 and.. Of class intervals, whether later making these tables using computer assistance or not, we can be... Axis in a matter of seconds can use pivot tables to easily compare categories ranges...


text:
# Trajectory of a projectile

1. Feb 20, 2005

### tony873004

A projectile fired from ground level at 25 m/s hits the ground 31.25 m away. At what angle was it fired?

I wrote equations for t for both x and y

t = delta x / velocity x
t = 2 * viy/a

and set them equal to each other to eliminate t
and replaced velocityx with cos(theta)*25
and replaced velicityinitialy with sin(theta)*25

delta x / cos(theta)*25 = 2*sin(theta)*25/a

25 / cos(theta)*25 = 2*sin(theta)*25/9.81

sin(theta) * 25 * cos(theta)*25 = 153.28

My trig is not that good. How do I continue? Or is this even the right way to tackle this proble? Is there an easier way?

2. Feb 20, 2005

### Muzza

Assuming your previous work is correct, use the fact that sin(t)cos(t) = sin(2t)/2 to solve the last equation.

3. Feb 20, 2005

### tony873004

Thank you! That was exactly the trigonometry trickery I was looking for. :rofl:

My problem now boils down to
$$\frac{sin(2theta)25^2}{2} = 153.21825$$

$$2theta = sin^{-1} = 0.4905$$

$$2theta = 29.37$$

$$theta = 14.685$$

The back of the book, which rounds for significant figures list 15 degrees and 75 degrees. So I got one of the two answers with this method. But sin (75*2) also equal 0.5. And it makes sense that both the 15 and 75 degree angles should yield the same result in this type of projectile problem.

So how do I make $$sin^{-1}$$ acknowledge that $$sin^{-1}0.5$$ equals both 30 (15*2) and 150 (75*2)?

4. Feb 20, 2005

### Leong

for your case, $$0 \leq \theta \leq 90\ degree$$, so
$$0 \leq 2\theta \leq 180\ degree$$
so, you have to find all the values of theta that are in the above range and you have 2 values : 30 degree and 150 degree. so theta equals to 15 degree or 75 degree.


text:
## The Problem with DOIs

Rhodopsin is a protein found in the eye, which mediates low-light-level vision. It is one of the 7-transmembrane domain proteins and is found in many organisms including human.

Rhodopsin has an number of identifiers attached to it, which allow you to get additional data about the protein. For instance, the human version is identified by the string “OPSD_HUMAN” in uniprot. If you wish, you can go to http://www.uniprot.org/uniprot/OPSD_HUMAN and find additional information. Actually, this URI redirects to http://www.uniprot.org/uniprot/P08100.html. P08100 is an alternative (semantic-free) identifier for the same protein; P08100 is called the accession number and it is stable, as you can read in the user manual. If you don’t like the HTML presentation, you can always get the traditional structured text so beloved of bioinformatics; this is at http://www.uniprot.org/uniprot/P08100.txt. Or the Uniprot XML (that is at http://www.uniprot.org/uniprot/P08100.xml). Or http://www.uniprot.org/uniprot/P08100.rdf if you want RDF. If you just want the sequence, that is at http://www.uniprot.org/uniprot/P08100.fasta, or http://www.uniprot.org/uniprot/P08100.gff if you want the sequence features. You might be worried about changes over time, in which case you can see all at http://www.uniprot.org/uniprot/P08100?version=*. Or if you are worried about changes in the future, then http://www.uniprot.org/uniprot/P08100.rss?version=* is the place to be. Obviously, if you want to move outward from here to the DNA sequence, or a report about the protein family, or any of the domains, then all of that is linked from here. If you don’t want to code this for yourself, there are libraries in perl, python and java which will handle these forms of data for you.

So this might be overkill, but the point is surely clear enough. It’s very easy to get the data in a multiple variety of formats, through stable identifiers. The history is clear, and the future as clear as it can be. The technology is simple, straight-forward both for humans and computers to access. The world of the biologist is a good place to be.

What does this have to do with DOIs. Let’s consider a section of publications from one of us. Of course, one of the nice things about DOIs is that you can convert them into URIs. But what do they point to? Well, a variety of different things. Maybe the full HTML article. Or, perhaps an HTML abstract and a picture of the front page. Or more links. Or, bizarrely, a list of the author biographies. Or just another image of a print out of the front page of a identified digital object.

These are a selection from our conference and journal publications. Obviously, this doesn’t cover many of our conference papers, as most don’t have DOIs unless they are published by a big publisher. Or our books. These are published by big publishers, but obviously they are books which is different. I’ve also organised or been on the PC for a number of workshops. They don’t have DOIs either. All of them do have URIs.

In no case, can we guarantee that what we see today will be the same as what we get tomorrow, even though DOIs are supposedly persistent. The presentation of the HTML on those pages that display HTML is wildly different; in many cases, there is no standard metadata. Given the DOI, there doesn’t appear to be a standard way to get hold of the metadata. If you poke around really hard on the DOI website, you may get to http://www.doi.org/tools.html. At this point, you probably already know about http://dx.doi.org, which allows you to resolve a DOI through HTTP. The list of links doesn’t take that long to work through, so you might eventually get to http://www.crossref.org. From here, you can perform searches, including extracting metadata for articles; obviously, you need to register, and you need an API key for this. It doesn’t always work, so if that fails, you can try http://www.pubmed.org, which returns metadata for some DOIs that CrossRef doesn’t, but doesn’t hold a DOI for every publication it lists (even those that have them), so it also fails in unpredictable ways.

The difference between the two situations couldn’t really be clearer. Within biology, we have an open, accessible and usable system. With DOIs, we don’t. The DOI handbook spends an awful lot of time describing the advantages of DOIs for publishers; very little is spent on the advantages for the people generating and accessing the content. It is totally unclear to us what use case DOIs are trying to address from our point of view; what ever it is, they certainly seem to fail of their purpose.

So, why do we care about this? Well, recently, we have been implementing a DOIs for kblogs. Ontogenesis articles now all have DOIs. When we were originally thinking about kblogs, our investigations on how to mint new DOIs came to very little. If DOIs are hard to use, creating them is even worse, you need a Registration Authority; setting this up within a university would be a nightmare. Compare this to the £9 credit card transaction required for a domain name (even this can be quite hard in a University setting!). In the end, we have managed to achieve this using DataCite. Ironically, they are misusing technology intended for articles to represent data; we are misusing DataCite to represent articles again. We also have to keep a hard record of our own of the DOIs we have minted, because, despite the fact all this information is stored in the Datacite database, there is no way of discovering if a DOI points at a given URL using the Datacite API, so we have no way of doing a reverse lookup from a blogpost to discover its DOI.

We’ve also created a referencing system for WordPress. This does DOI lookups for the user, currently using CrossRef, or PubMed. We are not sure yet whether we can retrieve DataCite metadata in this way also.

The irony of this is that it is all totally pointless. WordPress already creates permalinks, based on a URI. These URIs are trackback/pingback capable so can be used bi-directionally. We have added support so that URIs maintain their own version history, so that you can see all previous versions. If you do not trust us, or if we go away, then URIs are archived and versioned by the UK Web archive. Currently, we are adding features for better metadata support, which will use a simple REST style API like Uniprot. Hopefully, multiple format and subsection access will follow also.

So, why are we using DOIs at all? For the same reason as DataCite which has as one of it’s aims “to increase acceptance of research data as legitimate, citable contributions to the scientific record”. We need DOIs for kblog because, although DOIs are pointless, they have become established, they are used for assigning credit, and they are used as a badge of worth. For us, we find it unfortunate, that in the process of using DOIs, we are supporting their credentials as a badge of worth, but it seems the course of least resistance.

Update (2012-03-09) Ironically, most of our Uniprot links were broken which somewhat undermines the strength of our argument! Uniprot IDs are guaranteed to be permanent, while their website is not.

1. #### Fuzzier Logic » Blog Archive » The Problem with DOIs says:

[...] article was jointly author by Phillip Lord and Simon [...]

2. #### Tweets that mention An Exercise in Irrelevance » Blog Archive » The Problem with DOIs -- Topsy.com says:

[...] This post was mentioned on Twitter by Phillip Lord, Nicolas Bertrand. Nicolas Bertrand said: RT @phillord: DOIs? What are they good for? http://is.gd/OVPJu5, http://is.gd/MqyRpn [...]

3. #### The Ontogenesis Knowledgeblog: Lightweight Semantic Publishing | Knowledge Blog says:

[...] The problem with DOIs, 2011. http://www.russet.org.uk/blog/2011/02/the-problem-with-dois/. [...]

4. #### Karl Ward says:

dx.doi.org supports content negotiated requests for CrossRef DOIs:

$curl -LH “Accept: application/rdf+xml” “http://dx.doi.org/10.1126/science.1157784″$ curl -LH “Accept: text/turtle” “http://dx.doi.org/10.1126/science.1157784″

These requests return representations of RDF graphs for the metadata of a DOI.

See the announcement here:

http://www.crossref.org/CrossTech/2011/04/content_negotiation_for_crossr.html

5. #### Karl Ward says:

In fact, dx.doi.org supports the same method of content negotiation for all DOIs. Each DOI registration agency must implement this functionality. CrossRef have done and it is hoped that other RAs will follow.

6. #### Phil Lord says:

Obviously this happened after we posted. I would say that a REST API would be nicer, because then I can cite a specific form of DOI. Still I agree that this is useful, and I might use it.
But this still begs the question, that if the way that you make DOIs useful is by turning them into URIs, why not use a URI?

Phil

7. #### Karl Ward says:

Phil,

I wanted to highlight the content negotiation work because I thought it might be useful to you.

Your question may be rhetorical but I must say that I don’t understand the distinction that is made between URIs / DOIs and URIs / some other identifier scheme (for example, the accession numbers you refer to in the blog post).

What does one do with a DOI if it is not presented in the form of a URI? The answer is manually convert it into a URI using specific knowledge of the dx.doi.org service. But the same is true of accession numbers and the uniprot service, or any other identifier scheme and it’s accompanying service(s).

I suppose if I’m making a point, it is that identifier schemes and the services that support them are not separable. Knowledge of both components is required to make them useful. In that sense, I don’t see how DOIs are different from any other identifier scheme, regardless how a user consumes them – as URIs or naked identifiers.

That said, it is surely better to present identifiers in a usable form, and CrossRef has now updated their DOI display guidelines to recommend the dx.doi.org form.

8. #### Adding Multiple Authors to a Post | The Knowledgeblog Process says:

[...] useful where the occasional post in a Kblog has multiple authors; for example, see this article (http://www.russet.org.uk/blog/1849) which is hosted on my Work kblog, but was authored by myself and Simon Cockell. This article was [...]

9. #### What is Greycite | The Knowledgeblog Process says:

[...] the DOI system has a number of significant issues (http://www.russet.org.uk/blog/1849), it does have one advantage; new DOIs are minted through a central authority, or rather one of [...]

10. #### Martin Eve says:

I found this post a little strange in that it doesn’t mention perhaps /the/ key aspect of DOI numbers: digital preservation. The point of a DOI is that, if the original goes down (say, you die, for example, or lose your domain rendering permalinks useless), an archival service (LOCKSS, CLOCKSS or Portico) can kick in and restore the content. The federated DOI resolver handle, however, will remain the same. DOIs are a central part of preserving scientific and scholarly content beyond the life of a person or organization.

11. #### Phillip Lord says:

suggests, we were bitten by the problem. However, I still think your argument
is incorrect; I will expand on this soon, as I have had a post in my head for
a while. The key points are this though. First, the DOI system does not
guarantee that this forwarding happens; it depends on the registration
authority. Secondly, they have a severe usability flaw, which means that
everyones life is being made harder for the broken URIs. And, finally, we can
still achieve something similar, without two step resolution.

12. #### An Exercise in Irrelevance » Blog Archive » Why academic publishing is like a coffee shop says:

[...] argued about these before (http://www.russet.org.uk/blog/1849), and no doubt will do [...]

13. #### An Exercise in Irrelevance » Blog Archive » Publishing With Future Internet says:

[...] I have never published with MDPI before, but I have recently reviewed a paper for them; I am very selective with reviewing these days, but the paper sounded interesting and I had never heard of Future Internet before. So, this seemed like a reasonable bet. Accordingly the paper has just been published and come complete with (http://dx.doi.org/10.3390/fi4041004); a dubious badge of honour if ever there was one (http://www.russet.org.uk/blog/1849). [...]

14. #### An Exercise in Irrelevance » Blog Archive » Archiving of Scientific Material says:

[...] and claiming the added value of DOIs, something I find dubious (http://www.russet.org.uk/blog/1849). Again, though, the same problem; Figshare archives the source. The most extreme example of this [...]


text:
# Making RGB images from FITS files with python/matplotlib.

by on October 22, 2010

Converting astronomical data taken in multiple filters into representative-color RGB images often provides one of the most visually appealing (and informative) views of a target. This can be done in ds9 very easily; however, if you want a little more control, then python/matplotlib can be used in a very similar fashion. I also note that APLpy has excellent capabilities for images with proper World Coordinate System headers already (see the APLpy RGB tutorial). APLpy is far easier to use, but if you don’t have that choice, then you can use matplotlib as I am going to show below.

First, lets assume we are starting with three images, say J.fits, H.fits, and K.fits and that these images all have the same plate scale, the same angle, and the same position on the sky but lacks WCS information (as is often the case for ground-based OIR observations). Load up the images into numpy arrays using the pyfits module.

import pyfits import numpy as np import pylab as py import img_scale   j_img = pyfits.getdata('J.fits') h_img = pyfits.getdata('H.fits') k_img = pyfits.getdata('K.fits')

You can use pylab.imshow on a NxMx3 array; however, each layer of the image must first be mapped onto the luminosity scale. This is done with a module called img_scale.py that I borrowed from Min-Su Shin at U. of Michigan who very generously freely distributed his code (thanks!). You can get img_scale.py from this AstroBetter wiki page. Using this module you can linear, log, sqrt, or asinh stretch each color channel independently and set minimum or maximum flux values.

img = np.zeros((j_img.shape[0], j_img.shape[1], 3), dtype=float) img[:,:,0] = img_scale.sqrt(k_img, scale_min=0, scale_max=10000) img[:,:,1] = img_scale.sqrt(h_img, scale_min=0, scale_max=10000) img[:,:,2] = img_scale.sqrt(j_img, scale_min=0, scale_max=10000)

Finally, we can display the image:

py.clf() py.imshow(img, aspect='equal') py.title('Blue = J, Green = H, Red = K') py.savefig('my_rgb_image.png')

If your input images don’t have the same rotation angles, plate scales, or positions, then IRAF’s handy imlintran can be used to rescale, rotate, and translate. This can still be done in python via pyraf. Here is an example of calling imlintran from within python for a J.fits image that I want to rotate, shift, and rescale to match H and K images. I will assume the H and K images have a position angle of zero.

from pyraf import iraf as ir   h_img = pyfits.getdata('H.fits') k_img = pyfits.getdata('K.fits') scaleK = 0.1 # arcsec per pixel scaleJ = 0.15 # arcsec per pixel) paJ = 30.0 # degrees   ir.unlearn('imlintran')   ir.imlintran.boundary = 'constant' ir.imlintran.constant = 0 ir.imlintran.interpolant = 'spline3' ir.imlintran.fluxconserve = 'yes'   # the input pixel position of a reference source ir.imlintran.xin = 0 ir.imlintran.yin = 0   # the output pixel position of a reference source ir.imlintran.xout = 10 ir.imlintran.yout = 10   # Set the output size of the final image ir.imlintran.ncols = k_img.shape[1] ir.imlintran.nlines = k_img.shape[0]   ir.imlintran('j.fits', 'j_rot_scale.fits', angleJ, angleJ, scaleK/scaleJ, scaleK/scaleJ)   j_img = pyfits.getdata('j_rot_scale.fits')

Alternatively, you can use scipy.ndimage.interpolate to shift images.

from scipy.ndimage import interpolation as interp   old_j = pyfits.getdata('j.fits') new_j = interp.shift(old_j, [shiftY, shiftX])

The image attached in this post was plotted using imshow as described above and is a JHK color composite from the UKIDSS galactic plane survey.

1 John Gizis October 22, 2010 at 4:18 pm

2 Jonathan Whitmore January 11, 2011 at 7:23 pm

The APLpy documentation link is broken in the entry, you mean to link to: http://aplpy.github.com/documentation/index.html

3 Paul Anthony Wilson February 15, 2011 at 5:45 pm

This is really cool. I would also urge people to try FITS Liberator which is provided by ESA/ESO/NASA together with Photoshop (for those people who can afford it, or get it through other means). I like the method above as it is open source.

4 Brandon Doyle August 12, 2014 at 11:38 am

Out of curiosity, how would one create an RGB if the .fits data is from different telescopes, of different resolutions, alignments etc.? I’m trying to use aplpy but it doesn’t seem to want to take my HST and VLA data…


text:
## The gravitational force can be derived from the electric force between quantum charges.

Electric force between two groups of charges is defined without reference to charge, or invoking the nebulous property of space known as permittivity.
$F=\frac{r_{e}c^{2}}{R^{2}}m_{e}ZN$

The above equation for electric force is a prototype for gravitational force. General Relativity predicts mass dilation, time dilation, and length contraction for regions of space with large negative gravitational potential. After matching empirical measurements to the prototype, it appears that the ratio, electron mass/nucleon mass, is equal to the length contraction ratio, as well as the reciprocal of the time dilation ratio for our region of the universe. Also, the gravitational equation provides clear evidence that neutrons and protons are composite particles, each containing three quantum gravitational particles.

Applying length contraction to the classical electron radius, and time dilation to the frequency, c/R:

$F=\frac{r_{e}c^{2}}{R^{2}}\left ( \frac{m_{e}}{m_{\overline{n+p}}} \right )^{3}m_{e}ZN=3\frac{r_{e}c^{2}}{R^{2}}\left ( \frac{m_{e}}{m_{\overline{n+p}}} \right )^{4}M_{Z}N$

(Z is the total 'Z' mass divided by 1/3 the average nucleon mass.)

Dividing by N (the number of quantum gravitational masses in the 'N' mass):

$\frac{F}{N}=\frac{F}{N\left ( \frac{1}{3}m_{\overline{n+p}} \right )}=\frac{F}{M_{N}}\equiv \ddot{R}_{N}=3\frac{r_{e}c^{2}}{R^{2}}\left ( \frac{m_{e}}{m_{\overline{n+p}}} \right )^{4}M_{Z}$

The rhs of the above equation is the dimensional equivalent of a constant force for any given 'Z' mass. This, however, belies the fact that it actually represents the force acting on each and every 1/3 nucleon in the 'N' mass. While each increment of N increases the total tension between the two masses, it also increases the mass of the 'N' group by 1/3 nucleon, keeping the force/mass ratio constant. Force/mass ratio is, by definition, acceleration; i.e., acceleration if the mass is not restrained by an equal opposing force.

$\therefore F=3\frac{r_{e}c^{2}}{R^{2}}\left ( \frac{m_{e}}{m_{\overline{n+p}}} \right )^{4}M_{Z}M_{N}$

Conclusion: Gravitational force has dimensions of mass-squared times acceleration.

Parsing out the portion of the above equation referred to as the gravitational constant:

$G=3r_{e}c^{2}\left ( \frac{m_{e}}{m_{\overline{n+p}}}\right )^{4}\newline \newline\frac{m_{e}}{m_{\overline{n+p}}}=\frac{1}{1836.9}\newline\newline r_{e}=2.818\times 10^{-15}m\newline\newline c=2.998\times 10^{8}m/s\newline\newline \therefore G=6.674\times 10^{-11}m^{3}/(s^{2}kg)$

The mass ratio used in this evaluation represents a distribution of 72% protons and 28% neutrons.

The kg in the dimensional attribute comes from the fact that G x MZ / R2 is the gravitational acceleration at MN (and vice versa). Kilograms must be put in the dimensional denominator to make the gravitational constant's dimensions agree with its empirical dimensions. While local acceleration arises from the mere existence of a remote mass, the total tensile force is the product of local mass, remote mass, and G/R2. Despite the mysterious dimensional origin of total force, the relationship between total force, local acceleration, and local mass is consistent with our concept of F=ma.


text:
### Quantum query complexity of minor-closed graph properties

Andrew M. Childs & Robin Kothari
We study the quantum query complexity of minor-closed graph properties, which include such problems as determining whether an $n$-vertex graph is planar, is a forest, or does not contain a path of a given length. We show that most minor-closed properties -- those that cannot be characterized by a finite set of forbidden subgraphs -- have quantum query complexity Theta(n^(3/2)). To establish this, we prove an adversary lower bound using a detailed analysis of the...


text:
Constructive and Destructive Interference - Maple Programming Help

Home : Support : Online Help : Math Apps : Natural Sciences : Physics : MathApps/ConstructiveAndDestructiveInterference

Constructive and Destructive Interference

Main Concept

The principle of super-position can be applied to two or more waves traveling in the same medium at the same time. When the waves meet, the net displacement of the medium is the sum of the individual wave displacements.

 Constructive interference occurs where the lines (representing peaks), cross over each other. In other words, when two waves are in phase, they interfere constructively. Destructive interference occurs where two waves are completely out of phase (a peak lies at the midpoint of two waves. In other words, when two waves are out-phase phase by 180 degrees or ${\mathrm{π}}_{}$ radians, they interfere destructively and cancel each other out.

Click and/or drag to change the location of both sources. Turn them off or on using the check boxes. Adjust the frequencies and phases of the two waves. White regions represent crests and blue regions represent troughs. Can you identify the locations of the constructive and destructive interference?

 frequency of Source 1 =   frequency of Source 2 =    phase of Source 1 =    phase of Source 2 =

 More MathApps


text: Title X- and Q-band ENDOR study of the $Fe^{+}(II)$ center in chlorinated $SrCl_{2}:Fe$ crystals Author Ghica, D. Nistor, S.V. Vrielinck, Henk Callens, F. Schoemaker, D. Faculty/Department Faculty of Sciences. Physics Publication type article Publication 2004 Lancaster, Pa , 2004 Subject Physics Source (journal) Physical review : B : condensed matter and materials physics. - Lancaster, Pa, 1998 - 2015 Volume/pages 70(2004) :2 , 7 p. ISSN 1098-0121 1550-235X ISI 000222996600018 Carrier E-only publicatie Target language English (eng) Full text (Publishers DOI) Affiliation University of Antwerp Abstract The <001> axially symmetric Fe+(II) center observed in SrCl2:Fe2+ crystals has been studied by the electron nuclear double resonance (ENDOR) technique in the microwave X and Q bands. This center is produced only in crystals grown in chlorine atmosphere and x-ray irradiated at low temperature (below 100 K). The analysis of the ENDOR spectra unambiguously confirms the structural model earlier suggested by the electron paramagnetic resonance (EPR) study, as a Fe+ ion strongly displaced off center along an <001> axis, almost in the center of the square determined by the four nearest Cl- ligands. The unpaired spin densities f(3s) and f(3p) in the 3s and 3p chlorine orbitals have been determined from the resulting ENDOR parameters. E-info http://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=WOS:000222996600018&DestLinkType=RelatedRecords&DestApp=ALL_WOS&UsrCustomerID=ef845e08c439e550330acc77c7d2d848 http://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=WOS:000222996600018&DestLinkType=FullRecord&DestApp=ALL_WOS&UsrCustomerID=ef845e08c439e550330acc77c7d2d848 http://gateway.webofknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcApp=PARTNER_APP&SrcAuth=LinksAMR&KeyUT=WOS:000222996600018&DestLinkType=CitingArticles&DestApp=ALL_WOS&UsrCustomerID=ef845e08c439e550330acc77c7d2d848 Handle


text:
## Summary

I use visualization and bootstrap to obtain empirical confidence intervals for the estimates of the $k$ parameter of a Gamma distribution. I consider the dependency of the estimates on the sample size and on the true value of $k$, and the differences in the estimates computed with the method-of-moment (MoM) and maximum likelihood estimation (MLE). The results are in line with what we already know from statistics:

1. The higher sample size, the higher the achievable confidence for a given tolerance on the $k$ estimates.
2. MLE gives (slightly) more robust estimates than MoM across values of $k$ and across sample sizes.

I also quantify (approximately) the relationship between the confidence level and the fractional error in the estimates for $k$: At the 95% confidence level, estimates for $k$ deviate from the true value by $\pm$28% (sample size=100), by $\pm$12% (sample size=500), and by $\pm$9% (sample size=1000). These results suggest a minimum sample size in the range 100-500 for reasonable estimates in practical settings, although the acceptable deviation from true $k$ depends on one's application.

Tools used: the seaborn statistical visualization module, scipy, pandas, in addition to matplotlib.

## The Gamma distribution: the basics

The Gamma distribution depends on two parameters, $k$ and $\theta$, and looks like this:

import matplotlib.pyplot as plt
%matplotlib inline
import seaborn as sns
import pandas as pd
from scipy.stats import gamma
import numpy as np

def make_gammas(ks, thetas, x):
"""
Make a dataframe of Gamma PDFs.

Args:
ks (1d array-like): values of k
thetas (1d array-like): values of theta
x (1d array-like): points at which to evaluate the Gamma pdf.

Returns:
Pandas dataframe where eah column contains the Gamma pdf evaluated at x
for each pairwise combination of the parameters in ks and thetas.
"""

res = {}
ordered_keys = []
for theta in sorted(thetas):
for k in sorted(ks):
name = '$k$=' + str(k) + '; $\\theta$=' + str(theta)
res[name] = gamma.pdf(x, k, scale=theta)
ordered_keys.append(name)

return pd.DataFrame(res)[ordered_keys]

gamma_df_k = make_gammas([1,2,3,5,7,9], [2], np.linspace(0,25, num=100))
gamma_df_theta = make_gammas([2],[1,2,5,7,11,13], np.linspace(0,25, num=100))

fig, axarr = plt.subplots(1,2,figsize=(15,5), sharey=True)
gamma_df_k.plot(ax=axarr[0], fontsize=16)
axarr[0].legend(fontsize=14)
gamma_df_theta.plot(ax=axarr[1], fontsize=16)
axarr[1].legend(fontsize=14)
plt.suptitle('Gamma distributions for various $k$ and $\\theta$ values', fontsize=18)
<matplotlib.text.Text at 0x7f77c7214590>

From the above plots we see that both $k$ and $\theta$ affect the look of the Gamma pdf. The Gamma pdf is skewed to the left, with a longer tail on the right side of the mode. For $k$=1, the Gamma pdf is simply an exponential pdf (maximum asymmetry) and for $k > \approx$9 the pdf approaches a Gaussian (symmetry). Lower values of $\theta$ squish the distribution horizontally toward the left; higher values stretch it and flatten it, but the overall profile is not affected. For these reasons $k$ is called the shape parameter and $\theta$ the scale parameter.

The parameters $k$ and $\theta$ are related to each other through the mean and variance of the Gamma distribution: $$\mu = k\theta,$$ $$\sigma^2=k\theta^2.$$ Thus, given the mean, we only need to estimate one parameter and then compute the other from the estimate. The scipy.stats.gamma.fit() implementation lets you choose which parameter to estimate and which one to constrain: I chose to estimate $k$ and derive $\theta$. Finally, since the Gamma pdf increasingly resembles a Gaussian for higher values of $k$, here I limit my exploration to $k\lt 10$. For higher values a Gaussian might be a better model, or one could shift the data x down (to the left) so that min(x)=0 and assume lower values of $k$ for approximating the shifted pdf. Either way, I look only at $k\lt10$.

## Estimating k in practice and confidence intervals

In pratical settings, a limited number of samples are available, which introduces uncertainty about the estimated value of $k$. We know from probability theory that the uncertainty decreases as the number $n$ of available samples increases: in fact, the uncertainty is inversely proportional to $\sqrt{n}$. One can measure this effect empirically by repeatedly estimating $k$ many times for different sample sizes, and observing the resulting sampling distribution: this is called bootstrap, and it's the method I adopt here.

With the bootstrap, one can compute the confidence intervals around the estimates. Confidence intervals are simple plus-or-minus bounds associated with the estimated value and with a level of confidence, which is simply the probability that the estimated $k$ will fall within the bounds. Typically folks aim for a 95% confidence interval: what are the bounds within which the true value of $k$ will fall with a probability of 95%? Or, you can turn around the question and ask: Given that I can only tolerate a given bound on the estimation error, what is the probability (confidence) that the estimate will fall within those bounds?

But how do we estimate $k$? There are two gneral approaches from statistical learning that we can apply here: the MoM and MLE.

### MoM: Method of moments

With MoM, one sets the empirical moments (mean, variance etc.) to their theoretical expression in terms of the distribution parameters, then solves for the parameters. For a Gamma distribution we know that the mean $\mu=k\theta$ and the variance $\sigma^2=k\theta^2$. So, taking the values of $\mu$ and $\sigma^2$ from the sample, the closed-form solution for $k$ and $\theta$ is: $$k = \frac{\mu^2}{\sigma^2},$$ $$\theta = \frac{\sigma^2}{\mu}$$

Here's a trivial Python implementation:

import numpy as np
def gamma_mom(x):
"""
Estimate the parameters of a Gamma distribution using the method-of-moments.

Args:
x (1d array-like): Data, assumed drawn from a Gamma distribution.

Returns:
(k, theta) parameters
"""

avg = np.mean(x)
var = np.var(x)
k = avg**2 / var
theta = var / avg

return k, theta

### MLE: Maximum likelihood estimation

With MLE, one maximizes the likelihood function of the observed the data over the Gamma parameters. For Gamma, there is no closed-form expression for the maximum as a function of the parameters, so we must resort to numerical methods. Luckily scipy.stats.gamma.fit() implements MLE for Gamma distributions for us, based on work by Choi and Wette and Minka.

## MoM and MLE: single $k$

Lets calibrate the discussion to what we already know. For a single value of $k$, let's generate many bootstrap draws the corresponding gamma and compare the sampling distributions for the estimates obtained with the MoM and the MLE.

import itertools

def gamma_bootstrap_estimate(true_k, true_theta, sample_size=[50, 100, 1000], draws=100, method='all'):
"""
Estimate the parameters of a Gamma distribution with bootstrap.
Generates bootstrap samples and estimates the (k, theta) parameters from each draw,
using the method-of-moments and scipy.stats.gamma.fit

Args:
true_k (scalar): the k parameter of the Gamma distribution.
true_theta (scalar): the theta parameter of the Gamma distribution.
sample_size (1d array-like of ints): the number of random samples to draw
from the Gamma distribution for each bootstrap draw.
draws (int): number of bootstrap draws (100)
method (str): one of 'mom', 'scipy', or 'all' ('all')

Returns:
A pandas DataFrame where each row contains the estimates for k and theta for one bootstrap draw.

"""

true_mean = true_k * true_theta
true_var = true_k * true_theta ** 2

result = []
for this_many in sample_size:

# Generate this_many samples from the true Gamma
rvs = [ gamma.rvs(true_k, scale=true_theta, size=this_many) for n in xrange(draws) ]

if method == 'all' or method == 'scipy':
estimates_scipy = ( gamma.fit(x,floc=0) for x in rvs )
(k_scipy, loc_scipy, theta_scipy) = itertools.izip(*estimates_scipy)
result.append({'sample_size': this_many, 'k_estimate': k_scipy, 'theta_estimate': theta_scipy,
'true_theta': true_theta, 'true_k': true_k, 'method': 'scipy'})

if method == 'all' or method == 'mom':
estimates_mom = (gamma_mom(x) for x in rvs)
(k_mom, theta_mom) = itertools.izip(*estimates_mom)
result.append({'sample_size': this_many, 'k_estimate': k_mom, 'theta_estimate': theta_mom,
'true_theta': true_theta, 'true_k': true_k, 'method': 'mom'})

return pd.concat( [pd.DataFrame(r) for r in result])
true_k = 2
true_theta = 2
num_samples = [10, 25, 50, 100, 500, 1000]
num_draws = 1000
estimates_for_one_k = gamma_bootstrap_estimate(true_k, true_theta, num_samples, draws=num_draws)
k_estimate method sample_size theta_estimate true_k true_theta
0 3.465786 scipy 10 0.882095 2 2
1 5.106975 scipy 10 0.797050 2 2
2 3.020494 scipy 10 1.002957 2 2
3 4.314278 scipy 10 1.233048 2 2
4 2.175172 scipy 10 1.090711 2 2

The violin plot is a graphical data analysis method for direct comparison of two distributions across different values of a grouping variable (number of samples in our case). Let's take a look:

import seaborn as sns
sns.set(style="ticks")
sns.set_context("poster") # this helps when converting to static html for blog

plt.figure(figsize=(15,7))
ax = sns.violinplot(x='sample_size', y='k_estimate', data=estimates_for_one_k, hue='method', palette='muted',
inner='quartile', split=True, hue_order=['mom', 'scipy'], linewidth=1)
sns.despine(offset=10, trim=True)
title_str = 'Estimates of k from ' + str(num_draws) + \
' bootstrap draws; true k=' + str(true_k) + \
', true $\\theta=$' + str(true_theta)
plt.title(title_str)
<matplotlib.text.Text at 0x7f77c717e210>

### Observations on the violin plot

I see that for both MoM and MLE the sampling distribution spread decreases as the number of samples increases. We knew his from the central limit theorem (CLM). I also see that the spread of the sampling distribution for the MoM estimates is a bit wider than for the MLE, which suggests that MLE could buy you a bit more confidence in the estimates. Next I want to look at these differences in spread more closely and test these observations for different values of $k$.

## MoM and MLE: many $k$s

To compare the estimates across $k$, I normalize the error to a fraction between -1 and 1. I stop at k=9 because for higher values the Gamma distribution starts to look like a Gaussian, and a Gaussian model might be sufficient in practical settings. I visualize the results in panels of boxplots, which help hone in on the quartiles of a distribution.

df_list = []
theta_val = 2
for k in [1,2,3,5,7,9]:
tmp = gamma_bootstrap_estimate(k,theta_val, sample_size=num_samples, draws=num_draws)
df_list.append(tmp)

big_df = pd.concat(df_list)
big_df['fractional_error'] = (big_df['k_estimate'] - big_df['true_k'] ) / big_df['true_k']
k_estimate method sample_size theta_estimate true_k true_theta fractional_error
0 1.229787 scipy 10 1.059610 1 2 0.229787
1 0.790053 scipy 10 3.453050 1 2 -0.209947
2 0.975968 scipy 10 1.461941 1 2 -0.024032
3 1.004771 scipy 10 1.284221 1 2 0.004771
4 0.754723 scipy 10 1.668499 1 2 -0.245277
# make and adjust the subplots manually...
true_k = big_df['true_k'].unique()
num_k = len(true_k)
ncol=3
nrow= num_k / ncol

sns.set(style="ticks")
sns.set_context("poster")
f, axarr = plt.subplots(nrow, ncol, sharex=True, sharey=True, figsize=(15,14))
for row in range(nrow):
for col in range(ncol):
idx = row * ncol + col
this_ax = axarr[row,col]
sns.boxplot(ax=this_ax, x="sample_size", y="fractional_error", hue='method', hue_order=['mom', 'scipy'],
data=big_df[big_df['true_k'] == true_k[idx] ], palette="muted",
showfliers=False,  linewidth=1, showmeans=True, meanline=True)
this_ax.set_title('k='+str(true_k[idx]))
if row == 0:
this_ax.set_xlabel('')
if col > 0:
this_ax.set_ylabel('')

sns.despine(offset=10, trim=True)
plt.suptitle('Fractional estimation error across k, for $\\theta$='+str(theta_val))
<matplotlib.text.Text at 0x7f77c459d0d0>

### Observations on the box plots

In the above grid of box plots I notice the following:

1. It seems that the MLE and MoM are not dependent on the true value of $k$, except that for $k=1$, for which the Gamma becomes an exponetial pdf, the MoM gives visually noticeable higher error.
2. MLE gives more robust estimates, which show up as smaller inter-quantile ranges (IQRs, the upper and lower box edges)
3. The median and mean fractional error (black and red lines, respectively, inside the boxes) for both MLE and MoM are consistently greater than 0, which tells me that the sampling distribution is skewed. This effect is particularly noticeable for sample sizes 10 and 25. Mean and median converge toward each other and toward 0 for larger sample sizes, which means that the sampling distributions become more symmetric. We observed this in the violin plots above, too, and it is expected by the central limit theorem (CLT).

## Confidence intervals

I want to eastimate confidence intervals, so I compute quantiles of the estimates of $k$. Again, to facilitate the comparison across different true values of $k$ and across sample sizes I adopt the fractional error metric, but I take its absolute value to simplify the visual exploration of the charts below. In this case taking the absolute value is like assuming that the fractional error is symmetric around 0. We have seen above that this is not the case for small sample sizes, but for sample size 100 and greater it is more plausible. Nonetheless, for the purpose of this blog, please allow me to simplify in this way.

Finally, to avoid visual information overload, I do not color-code the different values of $k$ in the quantile plots below. Instead, estimates for different $k$s are color-coded by estimation method, so the plots will display 6 markers per method per confidence level, color-coded by MoM or MLE. This visualization is clearer and consistent with the observation that the true value of $k$ has a smaller effect on the estimates than the sample size. Here we go!

q = [0.05,0.1,0.2,0.3, 0.4,0.5,0.6,0.7,0.8,0.9, 0.95, 0.975] #quantiles
big_df['abs_fractional_error'] = big_df['fractional_error'].abs()
grouped = big_df.groupby(['method', 'sample_size', 'true_k'])
grouped_quantiles = grouped['abs_fractional_error'].quantile(q)
grouped_quantiles.name='fractional_error_quantile'

# Give a name to the quantile level column
grouped_quantiles.index.names = map(lambda n: n if n is not None else 'confidence_level', grouped_quantiles.index.names)

# Flatten the results for easier plotting: Took me a while poking around
# the pandas doc to find this way to flatten the multi-index created by groupby() above!
quantiles_df = pd.DataFrame( pd.DataFrame(grouped_quantiles).to_records() )
method sample_size true_k confidence_level fractional_error_quantile
0 mom 10 1 0.05 0.034163
1 mom 10 1 0.10 0.062888
2 mom 10 1 0.20 0.132973
3 mom 10 1 0.30 0.211379
4 mom 10 1 0.40 0.312867
sns.set(style="darkgrid")
sns.set_context("poster")
f = plt.figure(figsize=(17,15))
g = sns.FacetGrid(quantiles_df, despine=True, sharey=False, col_wrap=3, col='sample_size', size=4, legend_out=True,
hue='method', hue_order=['mom', 'scipy'], margin_titles=True, palette='muted', xlim=[-0.1, 1.1])
g.map(plt.scatter, "confidence_level", "fractional_error_quantile")

# Adjust ylims and plot vertical line at a given confidence level
conf_level = 0.95
for ax in g.axes.flat:
ylims = ax.get_ylim()
new_ylims = [-0.01, ylims[1]]
ax.set_ylim(new_ylims)
ax.plot([conf_level, conf_level], new_ylims, 'r--', alpha=0.5, linewidth=1)

sns.despine(offset=10, trim=True)
<matplotlib.figure.Figure at 0x7f77c4203050>

### Observations on the quantile plots

1. Our previous observation that MLE gives more robust estimates than MoM across sample sizes and values of $k$ is confirmed: MLE depends less on the value of $k$ (tighter green vertical spreads) and, for equal confidence level, gives less fractional error in the estimated $k$ (green plots consistently lower than blue plots).
2. For sample sizes <=50, at a 95% confidence level (red vertical line) you'd need to tolerate uncertainties in $k$ between about $\pm$ 40% to $\pm$ 200%. Perhaps your application can deal with this range, perhaps not.
3. For sample sizes >= 100, the confidence intervals become more reasonable: for 500 samples the 95% confidence interval is about $\pm$ 12% for MLE, and about $\pm9$% for 1000 samples.

## Conclusions

I explored the link between sampling size, Gamma distribution parameters, and estimation methods using the bootstrap and visualization. What I found is well known, not just for Gamma distributions: sampling effects diminish as the sample size increases and different estimation methods give different results. I was also interested in calculating confidence intervals on the estimates that I could use a guidelines in the future. I now know, for example, that if I want my estimate of $k$ to be within $\pm$15% of true value 95% of the times, I need about 500 samples. In fact, I suggest two guidelines:

1. Prefer MLE over MoM for Gamma distributions because it buys you a bit more confidence.
2. Prefer sample sizes > 100, but 1000, or even 500 may not be necessary, depending on the requirements of your application.

## Relevance: why does it matter?

Sampling introduces uncertainty in addition to the randomness of your chosen probability model. You should have an idea about this additional uncertainty, because it affects the predictions downstream of the estimation and therefore your key performance indicators (KPIs). In a typical data product (recommendation engine, personalized marketing offer, etc.), you have an overall error budget dictated by the allowed tolerances of your problem, and you allocate that error budget to the various steps in your data processing pipeline. For example, say your KPI is average revenue per user (ARPU) and you must estimate it within $\pm5%$, then all steps in your pipeline must guarantee that you will stay within that limit.

It's true that big data give us the luxury of huge sample sizes, compressing the uncertainty down to unreasonably effective ranges, and making sampling effects essentially insignificant. But even when you have big data sets available, you may need to partition it into many, disjoint subsets to run hundreds or thousands of independent experiments, each one requiring some sort of parameter estimation. This is the case of mass personalization, for example, in which finely targeted marketing offers are presented to smallish groups of customers. Determining the appropirate offer requires running many A/B tests, which means reserving target and control groups for each test. If each one requires 100 customers and you have 100 offers to test, then you need 10,000 customers set aside. If you are Google or Facebook that's peanuts, but if you are a startup you may not have that meny customers to experiment with. So, You should strive to minimize the number of samples (in this case customers) needed for eaxh experiment, which means that you must know the additional uncertainty you introduce when you make your sample sizes smaller. This will help you consider more carefully how the uncertainty propagates through the steps of your data analysis and how it affects your KPIs.

License You may use and modify this Jupyter notebook under the terms of the BSD license.


text:
In C++, inliers returned by findHomography will be a vector where each index in the vector corresponds to the correspond srcPoints and dstPoints.
So, if inliers[0] == 0, it means that dstPoints[0] is an outlier.


text:
# How do you find the value of log_0.5 0.0675 using the change of base formula?

${\log}_{0.5} \left(0.0675\right) = \ln \frac{0.0675}{\ln} \left(0.5\right) \approx 3.9$


text:
Challenge Problem bet you can't figure out

1. Oct 21, 2004

SoberSteve2121

For a charged particle the Velocity Vector is in the i direction and the magnetic field is in the -k direction, prove using Newton's Second Law that the trajectory of this charged particle must be circular. (Hint F=q(V x B) this is the magnetic Force equation.)

2. Oct 21, 2004

kuenmao

I suspect that this belongs to the homework help zone.

How hard is that? Think of the direction of the electromagnetic force with respect to the particle's motion.

3. Oct 21, 2004

ZapperZ

Staff Emeritus
Don't tell him that there's an even more "difficult" problem where the charge particle has an initial velocity at an arbitrary angle to the magnetic field. I'm sure we can't solve it to get the helical path that the charge particle makes.

:)

Zz.

4. Oct 21, 2004

Gokul43201

Staff Emeritus
I'm not sure the OP will get the sarcasm in that second statement, so...


text:
# 7. Adding a New Variable¶

This document provides general procedures and an example of how to add a new variable to the UPP code. Please keep in mind it may not be an exhaustive step-by-step depending on your particular situation. While we can provide general assistance for adding a new variable, users should be aware that this requires good knowledge of Fortran and thorough understanding of the code.

We encourage users to contact us via the UPP forum to make us aware of modifications you are making. In some cases, if we determine the changes you are making may be relevant for operational and/or community purposes, we will be interested in incorporating your changes into the code base for support and future release. We would then work with you to make this possible.

The following outlines a brief description of the steps to be taken and are described in more detail with examples in the sections below.

1. Allocate the field: ALLOCATE.f

This file is the instantiation or allocation of the variable. Note that the variables are defined based on the parallel processing capability of UPP - use an example from the file.

2. Deallocate the field: DEALLOCATE.f

All good programmers give back their resources when they are done. Please update this routine to return your resource to the system.

3. Declare the new variable: VRBLS2D_mod.f, VRBLS3D_mod.f, or VRBLS4D_mod.f

The variable is declared in one of these modules defining files depending on its dimension.

4. Define field for grib1: RQSTFLD.f

This file contains a list of all possible fields to be output by UPP, corresponding key-word character string user places in wrf_cntrl.parm file, UPP ID for internal code, and grib IDs.

5. Read model output: INITPOST_GFS_NEMS_MPIIO.f (GFS nemsio), INITPOST_GFS_NETCDF (GFS netcdf), INITPOST_NETCDF (LAM netcdf)

These files are used for reading the model output files. The appropriate one will need to be chosen based off the model and model output format.

6. Add to appropriate routine for filling the new variable: e.g. SURFCE.f, MDLFLD.f, MDL2P.f, etc

This is the place that you will fill the array with the data and output the field.

7. Define table/grib2 parameters for grib2 output: params_grib2_tbl_new

This table contains the necessary parameter information for grib2 fields.

8. Define the field for grib2 output: post_avlbflds.xml

This file is used for defining all available grib2 fields.

9. Define control file entry for output: postcntrl.xml & postxconfig-NT.txt

These files are used for controlling which fields are output by UPP for grib2.

Example Procedure: Steps for adding a new variable ‘TG3’

• This example illustrates adding a new variable from GFS output that will be read into UPP and directly output into the Grib2 output files (i.e. no additional computations/calculations are needed for the field).
• Additions to each of the routines are highlighted.
• Locations of routines are in /EMC_post/sorc/ncep_post.fd unless specified otherwise.
• Sample GFS files for the following procedures are available for download here.
• This data is the 6-hr forecast of a GFS initialization of 2019-06-15_00:00:00

• The new variable, TG3, added in this example is found in the sfcf006.nc; however, both the sfcf006.nc and atmf006.nc output files are required to run UPP for GFS.

• TG3 is the averaged climatology of surface temperature, which the LSMs use to specify bottom soil T, where the depth of the bottom is LSM dependent. For this example, a depth of 500cm is used.

New variable to add:

float tg3(time, grid_yt, grid_xt) ;
tg3:long_name = "deep soil temperature" ;
tg3:units = "K" ;
tg3:missing_value = 9.99e+20 ;
tg3:cell_methods = "time: point" ;
tg3:output_file = "sfc" ;

1. Allocate the new variable in ALLOCATE_ALL.f This file is the instantiation or allocation of the variable. Note that the variables are defined based on the parallel processing capability of UPP - use an example from the file.

User Procedure
• Add in VRBLS2D GFS section as:
allocate(tg3(im,jsta_2l:jend_2u))

2. De-allocate the variable to give the resources back in DEALLOCATE.f All good programmers give back their resources when they are done. Please update this routine to return your resources to the system.

User procedure
• Add in VRBLS2D GFS section as:
deallocate(tg3)

3. Declare the new variable in the appropriate file depending on its dimensions; VRBLS2D_mod.f, VRBLS3D_mod.f or VRBLS4D_mod.f

User procedure
• tg3 is a 2-dimensional field, so declare it in VRBLS2D_mod.f
• Add to the GFS section for adding new fields as:
tg3(:,:)

4. List the new variable in RQSTFLD.F which includes a list of all possible fields to be output by UPP, as well as the corresponding UPP ID for internal code, variable character stings, and grib IDs. Be sure to pick a unique identifier that is not already used for the new variable. Right now, the 900’s are being used for community contributions.

Example Entry

! HWRF addition for v_flux as pass through variable:
DATA IFILV(901),AVBL(901),IQ(901),IS(901),AVBLGRB2(901) &
& /1,’MODEL SFC V WIND STR’,125,001, &
& ‘V_FLX ON surface’/
Where:
• IFILV Identifies field as MASS/VELOCITY point (e.g. 1)
• AVBL is the model output character string variable name for Grib1 (e.g. MODEL SFC V WIND STR)
• IQ is the GRIB PDS OCTET 9 (table 2) - Indicator of parameter and units (e.g. 125)
• IS is the GRIB PDS OCTET 10 (table 3&3a) - Indicator of type of level or layer (e.g. 001)
• AVBLGRB2 is the model output character string variable name for Grib2 (e.g. V_FLX ON surface)
• A UNIQUE array location UPP uses to store this variable in parallel arrays (e.g. 901)
User procedure
DATA IFILV(979),AVBL(979),IQ(979),IS(979),AVBLGRB2(979) &
&          /1,'DEEP SOIL TMP',085,111,                  &
&          'DEEP TSOIL ON depth_bel_land_sfc'/

Note

Since Grib1 is no longer supported, the variable character strings and Grib IDs for Grib1 are not important, but still need to be included here for correct formatting.

5. Read the field from the GFS model output file by adding the new variable into INITPOST_GFS_NETCDF.f. This file is used for reading the GFS model output files in netcdf format.

User procedure
• Add to top section of the routine in ‘use vrbls2d’ to initiate the new variable as:
tg3

• Read in the new variable in the section ‘start reading 2D netcdf file’ using another 2D variable as an example, such as ‘hpbl’. Add as:
! deep soil temperature
VarName='tg3'
call read_netcdf_2d_scatter(me,ncid2d,1,im,jm,jsta,jsta_2l &
,jend_2u,MPI_COMM_COMP,icnt,idsp,spval,VarName,tg3)

6. Determine the correct routine to add the new variable to (e.g. SURFCE.f, MDLFLD.f, MDL2P.f, etc). You will need to determine the correct routine to add your field into; this is the place that you will fill the array with the data and output the field. The correct routine will depend on what your field is. For example, if you have a new diagnostic called foo, and you want it interpolated to pressure levels, you would need to add it to MDL2P.f. If foo was only a surface variable, you would add it to SURFCE.f. If you wanted foo on native model levels, you would add it to MDLFLD.f. If you’re not sure which routine to add the new variable to, choose a similar variable as a template.

Note: This is also where you would add any calculations needed for your new variable, should it be required.

User procedure
• Treat tg3 like a surface field (SURFCE.f), similar to the other soil fields.
• Use another 2D variable, such as ‘SNOW WATER EQUIVALENT’ as a template. This variable is also being read through and output, similar to what we want.
• Add to top section in ‘use vrbls2d, only’ to initiate the new variable as:
tg3

• Add in main section using a template variable as a guide.
! DEEP SOIL TEMPERATURE
IF ( IGET(979).GT.0 ) THEN
ID(1:25) = 0
If(grib=='grib2') then
cfld=cfld+1
fld_info(cfld)%ifld=IAVBLFLD(IGET(979))
!\$omp parallel do private(i,j,jj)
do j=1,jend-jsta+1
jj = jsta+j-1
do i=1,im
datapd(i,j,cfld) = TG3(i,jj)
enddo
enddo
endiF
ENDIF

Note

Since Grib1 is no longer supported, the if-statement for filling the grid for this output type is removed here and is only filled for Grib2 output.

7. Add the new variable to /EMC_post/parm/params_grib2_tbl_new. For all current UPP output fields, this table lists, in order, the:

User Procedure
• Here we could just use TSOIL, which is already in the table; howerver, instead we will add this using a new name, TG3, to demonstrate this step.
• TG3 is a land surface product (discipline=2)
• TG3 is a vegetation/biomass product (category=0)
• Pick an unused parameter number from the table defined by discipline=2 and category=0 (Table 4.2-0-0: https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_table4-2-2-0.shtml). The parameter number should not be in use in table 4.2 or the current params_grib2_tbl_new. In this case, the unused parameter number 231 was chosen.
• Add using the NCEP local table (table=1)
• Choose an abbreviated parameter name to describe your field (e.g. TG3)
• Add as:
2 0 231 1 TG3

8. Add the new variable to the /EMC_post/parm/post_avblflds.xml, which lists all fields available for output in GRIB2 format. This file is generally not modified unless adding a new field or modifying an existing one.

• Post_avblfldidx: the unique array number given in the RQSTFLD.f routine.
• Shortname: name describing the variable and level type
• Pname: the abbreviation for your variable (should match what is used in params_grib2_tbl_new)
• Table info: table used if not standard WMO
• Fixed_sfc1_type: level type
• Level: Generally only used here if it’s a fixed level specific to the variable (e.g. T2m, TSOIL5m)
• Scale: precision of data written out to Grib2 file
User procedure
• Add as:
<param>
<post_avblfldidx>979</post_avblfldidx>
<shortname>DEEP_TSOIL_ON_DEPTH_BEL_LAND_SFC</shortname>
<pname>TG3</pname>
<fixed_sfc1_type>depth_bel_land_sfc</fixed_sfc1_type>
<table_info>NCEP</table_info>
<level>500.</level>
<scale>3.0</scale>
</param>

9. Add the new variable to the /EMC_post/parm/postcntrl_gfs.xml file, which lists all fields and levels you wish to output for GRIB2. Remake the /EMC_post/parm/postxconfig-NT-GFS.txt file (as described in the section Creating the Flat Text File), which is read by UPP and contains the information from the xml.

User procedure
• Add as:
<param>
<shortname>DEEP_TSOIL_ON_DEPTH_BEL_LAND_SFC</shortname>
<scale>4.0</scale>
</param>

10. Build or rebuild the code to include the changes before running your UPP run script.

User procedure IF you already have the code built. Otherwise, see the User’s Guide for instructions on building.

>> cd EMC_post/build
>> make install

11. Assuming the modified code built successfully and you were able to produce Grib2 output, you can check the Grib2 file for your new variable.

GRIB2 output of the new variable from this example procedure (using the wgrib2 utility if available on your system).

• The new variable will not be defined by the variable name. Instead it will be defined using the Grib2 parameter information you entered into params_grib2_tbl_new from step 7 of this procedure.
wgrib2 -V GFSPRS.006

716:37731711:vt=2019061506:500 m underground:6 hour fcst:var discipline=2 center=7 local_table=1 parmcat=0 parm=231:
ndata=73728:undef=0:mean=278.383:min=215.47:max=302.4
grid_template=40:winds(N/S):
Gaussian grid: (384 x 192) units 1e-06 input WE:NS output WE:SN
number of latitudes between pole-equator=96 #points=73728
lat 89.284225 to -89.284225
lon 0.000000 to 359.062500 by 0.937500


text:
# Scheduling Algorithm for Video Player

Background:
In a nutshell. I coded a video player application (on linux). I used a proprietary library/API, with this, video and audio frames comes with well defined format. After decoding (via API), I call scheduling() function for video and audio frames and library does the rest. For argument sake I oversimplified the example.

Now let's say we switched to open source API (like Libav) with this I have everything similar as before except scheduling functions.

The Question:

Short Version:
I need help to devise a scheduling algorithm to use in my video player.

Long Version:
I have video frames and audio frames with timestamps (can be converted to wallclock time via a simple function). Naive approach I did was, rendering frames same order immediately as they arrive. This looks like working but overtime lips sync problem occurs (as expected). I don't quite get it what scheduling function I used before actually doing and since these are closed source (comes as pre-compiled) I can't check it.

Notes:
The original function takes these parameters (if these give some idea/help):

theFrame in frame to display
displayTime in time at which to display the frame in timeScale units
displayDuration in duration for which to display the frame in timeScale units
timeScale in time scale for displayTime and displayDuration

I have all of this parameters/values for each frame.

Update:
What is a scheduling algorithm supposed to do?
What I know is, Scheduling algorithm buffers frames and outputs (video or audio) on scheduled time.

What are its outputs?
Audio and video uses different function but basically does same thing. It outputs video or audio. Simplest terms you see the video and hear audio on the player application thanks to this function correctly in sync.

What are the requirements?
1) Frame to output (video or audio). i.e. YUV Frame Buffer or a PCM packet for audio.
2) Timestamp (stamped on encoder side). i.e. 64bit signed integer, after simple conversion function gives a wall clock kinda time (HH:MM:SS.ms).
3) Timing information (stream time_base and frame duration) i.e. time_base for video : 1(num)/50(den=framerate), duration is tricky let's say it's 1/framerate secs (20 ms in this example)

What is the "overtime lips sync problem"?
Video and audio goes out of sync. In other words, video and audio doesn't match anymore.

What I'm asking is a generic logic for a Scheduling Algorithm, I don't wanna bore with you with details, so I kept is simple.

Think I have a file (like a SRT subtitle file) it has text on every line and timestamp. And I wanna print it on linux terminal line by line according to it's timestamps.

My naive thinking will be:
1) Start a timer when program starts, load the file (SRT) on the memory.
2) Parse lines and timestamps.
3) Find the line with (in the SRT) closest to our timer and print it.
4) Repeat step (3) until EOF

In my original question/problem, I can't load whole media file, it can be a live stream or very big file. I can only buffer few seconds worth of frames (i.e. 25 frames (each for video or audio)).

So what should I do ?

• What is a scheduling algorithm supposed to do? What are its outputs? What are the requirements? What is the "overtime lips sync problem"? – D.W. Jun 26 '18 at 16:21
• Updated the question, please check it again. – the kamilz Jun 27 '18 at 8:04
• is the user able to seek (change the timer) in the middle of of the video? – sunny-lan Jun 28 '18 at 0:07
• No. It's should run on live stream, which is not seekable. – the kamilz Jun 28 '18 at 8:18

If frames are stored in order:

Read the next frame. Delay until the time when you are supposed to display it. Display it. Repeat.

If the timestamp is in the past, you can either display that frame now and immediately read the next frame, or you can drop that frame and display the next frame.

If frames are not stored in order:

Store the frames in a priority queue, with the time when it is supposed to be displayed as the key. Then, repeat the following: extract the next frame from the priority queue (a DeleteMin operation), wait until the time when you are supposed to display it, display it, then repeat.

Or, just sort the frames by the time when they are supposed to appear and apply the simple algorithm at the beginning of my answer.

• It's good to you cover both ordered and unordered cases. Thanks a lot. – the kamilz Jun 29 '18 at 15:37