text:
# NodeJS CLI script to create React apps

### Background

I crated a CLI tool which executes an npm command (to create a react app) and modifies the contents of the generated files. It was a practice attempt at creating CLI tools for NodeJS and a chance for me to experience publishing NPM packages.

### What I set out to do

My plan was to create something which follows the below workflow (in order):

1. user invokes the cli command
2. user inputs the name of their project
3. program calls create-react-app to create an app based on project name
4. program deletes the existing .gitignore file when project has been created
5. program downloads the latest .gitignore file for nodejs

I got used to prototyping a lot with create-react-app and got tired of modifying the .gitignore file every time I wanted to add .env or code coverage files. So I created this tool to do this for me. In the future I hope to also modify the README.md file and allow the users to open the project in vscode when everything has been generated and all files have been modified etc.

### The code

The tool, in it's entirety is here:

#!/usr/bin/env node
const chalk = require("chalk");
const figlet = require("figlet");
const exec = require("child_process").exec;
const Ora = require("ora");
const fs = require("fs");
const https = require("https");

// create an input interface
input: process.stdin,
output: process.stdout
});

function execShellCommand(cmd) {
return new Promise((resolve, reject) => {
exec(cmd, (error, stdout, stderr) => {
if (error) {
console.warn(error);
console.warn(stdout);
console.warn(stderr);
}
resolve(stdout ? stdout : stderr);
});
});
}

// 1. clear the console
process.stdout.write("\x1Bc");

// 2. print some fancy text
console.log(
chalk.green(figlet.textSync("My CLI Tool", { horizontalLayout: "full" }))
);

// 3. ask user for a project name
readline.question(What is your project name? , name => {
console.log(\n); // add a space
let firstSpinner = new Ora(
Creating a new React project named: ${name} ... this may take a while\n ); firstSpinner.start(); // 4. Create a create-react-app project execShellCommand(npx create-react-app${name}).then(() => {
firstSpinner.succeed();
console.log(Project ${name} created!\n\n); // 5. Remove the existing .gitignore file from that project folder let secondSpinner = new Ora( Removing the original${name}/.gitignore file...\n
);

secondSpinner.start();

fs.unlink(./${name}/.gitignore, err => { if (err) { console.error(err); return; } //file removed secondSpinner.succeed(); console.log(Original${name}/.gitignore file removed!\n\n);

// 6. Place new .gitignore file in that project directory
let thirdSpinner = new Ora(Placing new .gitignore file...\n);
thirdSpinner.start();

let newGitignore = fs.createWriteStream(./${name}/.gitignore); // cannot declare anywhere else as the folder has not been created before this point https .get( https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore, res => { res.pipe(newGitignore); newGitignore.on("finish", () => { newGitignore.close(); thirdSpinner.succeed(); console.log( New${name}/.gitignore created!\n\n\nClosing CLI tool\n
);
process.exit();
});
}
)
.on("error", err => {
console.error(err);
process.exit();
});
});
});

});

### Reflection

After I created the tool, I realised there are several ways in which I can enhance the user's experience - e.g. adding yargs to implement a help function or parsing of arguments into my CLI tool.

### Questions

I was wondering how I could improve my code to be more efficient. Perhaps I could learn some best practices before I publish this as an npm package. In particular, I'd like to know if there is any other way for me to create, start and stop my spinners which doesn't involve creating 3 separate ones for various 'checkpoint' sections of my code. And whether my use of exec() is efficient/ best suited for this kind of CLI app.

# Preliminary thoughts

The script looks decent and makes good use of features like arrow functions and template literals. I like the use of the chalk and Ora plugins.

# Main questions

I'd like to know if there is any other way for me to create, start and stop my spinners which doesn't involve creating 3 separate ones for various 'checkpoint' sections of my code.

I admit that I wasn't familiar with the library ora but after reading over the API I see that a single spinner can be used for all three lines. See the sample below, where the first spinner is re-used in place of secondSpinner:

const spinner = new Ora(
Creating a new React project named: ${name} ... this may take a while\n ); spinner.start(); // 4. Create a create-react-app project execShellCommand(npx create-react-app${name}).then(() => {
spinner.succeed();
console.log(Project ${name} created!\n\n); // 5. Remove the existing .gitignore file from that project folder spinner.start(Removing the original${name}/.gitignore file...\n);

And then after the gitignore file is unlinked, that spinner can be referenced again

  spinner.succeed();
console.log(Original \${name}/.gitignore file removed!\n\n);

// 6. Place new .gitignore file in that project directory
spinner.start(Placing new .gitignore file...\n);

And whether my use of exec() is efficient/ best suited for this kind of CLI app.

I looked at this post which mentions using exec() as well as spawn():

### When to use exec and spawn?

The key difference between exec() and spawn() is how they return the data. As exec() stores all the output in a buffer, it is more memory intensive than spawn(), which streams the output as it comes.

Generally, if you are not expecting large amounts of data to be returned, you can use exec() for simplicity. Good examples of use-cases are creating a folder or getting the status of a file. However, if you are expecting a large amount of output from your command, then you should use spawn(). A good example would be using command to manipulate binary data and then loading it in to your Node.js program.

You could consider switching the code to using spawn() but it appears the argument handling may need to be altered.

Another thing to consider would be instead of deleting the gitignore file, just overwrite it with the contents of the downloaded file - then if that happens to fail then it wouldn't be deleted.

# Other feedback

## Error handling

It would be wise to add error handling functions - for example, chain on a .catch() after the execShellCommand.then() call.

## Callback hell

The code becomes not-so-shallow i.e. has a few indentation levels towards the final steps. CallbackHell.com has some tips to avoid this - e.g. naming those anonymous callback functions, just as you did with execShellCommand(). This may require passing parameters - can be done with Function.bind().

## Constants

These can be used for values that never change

https://raw.githubusercontent.com/github/gitignore/master/Node.gitignore,

This seems like a good candidate for a constant declared at the beginning of the code. While it appears it is only used in one spot, it is a bit long to have sitting in the code, and if it ever needs to be updated in the future, it would be easier to find it at the top of the code instead of buried in the code.

I would call that constant something like GITHUB_NODE_GITIGNORE_PATH - which isn't exactly brief but it is shorter than the entire URL.

## Other uses for const

Other variables that don't get re-assigned can be declared with const as well, even if they aren't really a constant - e.g. arrays that get pushed into, objects that get mutated. This helps avoid accidental re-assignment. Notice in the sample code I gave above to re-use a single spinner I used const spinner.

## Readline closed in two spots

I see readline.close(); in two spots - one within the callback function to newGitignore.on("finish") as well as one at the end of the callback function to

readline.question(What is your project name?

Perhaps only one call should exist - possibly in a .finally() callback.


text:
# Waves and Wave equation

1. Jan 23, 2013

### Stealth849

1. The problem statement, all variables and given/known data

Hello all,

stuck on a question involving a formula for a wave that doesn't make much sense to me.

Assuming that a wave on a string is represented by:

y(x,t) = y_i*sin((2∏/λ)(vt-x))

Where y is transverse displacement at time t of the piece of string at x. The other symbols have their "usual meaning". Find the velocity and acceleration of the small piece of string at x = 10m, as a function of time.

Making use of the fact that the piece of string satisfies Newton's second law, show that the piece of string is acted on by a Hooke's Law force.

2. Relevant equations

y(x,t) = y_i*sin((2∏/λ)(vt-x))

y(x,t) = A*sin(kx - ωt)

k = 2∏/λ

3. The attempt at a solution

I'm a bit confused by the format of the formula...

I know that to find velocity and acceleration, I can take the derivative of the equation once for velocity and again for acceleration. Looking at the set up, it looks like if we replace 2∏/λ with k and expand, we see in the brackets

(kvt - kx)

where kv could equal ω?

I don't know if this is at all valid. I also don't understand why the variable "v" is used in the equation, but from the question i can assume that it is analogous to omega ω.

So

y(10,t) = y_i*sin((2∏/λ)(vt-10))

v(10,t) = y_i*cos((2∏/λ)(vt-10))*???

I'm having trouble knowing how to take the derivative of this when I don't know λ and v.
Unless they are constants and I can ignore them?

Any help will be appreciated... Thanks.

2. Jan 23, 2013

### cepheid

Staff Emeritus
The usual form for a wave is something like sin(kx - ωt). The phase is given by kx - ωt, so that if x is constant (i.e. you're sitting at a particular point in space as the wave passes by you) the variation of wave intensity with time is sinusoidal with angular frequency ω. When t = T, where T is one period of the oscillation ($T \equiv 1/f = 2\pi /\omega$), then ωt = ωT = 2π. The phase increments by 2π as expected after one cycle. Note: f is the frequency of the wave, and ω = 2πf is the angular frequency.

You can rewrite kx - ωt as k[x - (ω/k)t] $$= k\left(x - {2\pi f}\frac{\lambda}{2\pi}t\right)$$ $$= k(x -f\lambda t)$$

Of course, there is just the standard relation that wave speed = frequency*wavelength: $v = f\lambda$ so this becomes k(x - vt). This form of the wave function is actually kind of intuitive, because it says that at time t, the amplitude of the wave at a distance vt ahead of a point x is the same as what the amplitude was at point x back at time 0.

EDIT: And yes, of course f and λ (and hence v) are constant for a given wave. Don't confuse "v" (the wave propagation speed, in the x direction) with dy/dt, the speed of a point oscillating in the y direction as the wave passes by, which you are asked to compute.

Last edited: Jan 23, 2013
3. Jan 24, 2013

### tms

$v$ is just the speed of the wave, as distinct from the transverse speed of the bits of string.
For a given wave, they are constant.

4. Jan 24, 2013

### Stealth849

Okay..

So considering that λ and v are constants, the equations should look, hopefully, something like:

y(10,t) = y0*sin[k(vt-10)]

v(10,t) = y0*cos[k(vt-10)]*k

a(10,t) = -k2y0*sin[k(vt-10)]

I assume this is as far as I can go? I am given nothing else but distance x = 10m, so I cannot find the amplitude, or any of the constants, can I?

I also don't understand what the second part of the question is asking, when it asks to show the string is acted on by a Hooke's Law force knowing that the string follows Newton's second law.

What do the two equations have in common, and how can I show that the string is modeled by F = -kx, from F = ma?

5. Jan 24, 2013

### tms

Check your derivatives again. Remember the chain rule.

As for the second part, you have just calculated the acceleration, and you already know the displacement. Just set $ma = -kx$, or $y$ in this case. And be sure to keep the two $k$s straight; use a different letter for one of them, perhaps.

6. Jan 24, 2013

### Stealth849

Is the chain rule not just multiplying the initial derivative by the derivative of what is in the brackets of the sin function?

where k(vt-10) is a product rule?

if k is a constant, derivative is zero, derivative of (vt - 10) should be v (which I forgot to put in... argh)

So equations should be:

y(10,t) = y0*sin[k(vt-10)]

v(10,t) = y0*cos[k(vt-10)]*k*v

a(10,t) = -k2v2y0*sin[k(vt-10)]

and if a(10,t) = -k2v2y0*sin[k(vt-10)]

I set that equation, multiplied by m, to y? y being the initial displacement equation..?

Also what do you mean by keeping the k's straight, are they not the same value as a constant..?

thanks

7. Jan 24, 2013

### tms

Easier to just multiply it out in this case: $kvt - 10k$.
That's it.
Start with $F = ma$, with $a$ as derived above. Then look at that equation and compare it to your equation for $y$. The answer should jump out at you.
The $k$ in Hooke's law and the $k$ in the equation for the wave are entirely different entities that just happen to use the same letter.

8. Jan 24, 2013

### Stealth849

Ah, thought you were referring to the k's in the derived equation. Sorry!

Anyway, if

F = ma = -kx

Would x in this case be y? and thus y0sin[k(vt-10)]

so ultimately we see

-mk2v2y0*sin[k(vt-x)] = -Ky0sin[k(vt-x)]

where uppercase K is spring constant, the amplitudes cancel, the sin functions cancel, and were left with

mk2v2 = K

But I don't see how that actually says anything..? Nothing jumped out at me. :(

9. Jan 24, 2013

### tms

You've got all the parts, you just have to put them together correctly.

Think of the form of Hooke's law: the force equals -1 times a constant times the displacement. Now take your force: $F = ma = m$ times the acceleration you've derived. How can you put that in the form of Hooke's law? Remember that you also have an expression for the displacement, that is $y$.

Last edited: Jan 24, 2013
10. Jan 24, 2013

### Stealth849

Well, if we replace the y0sin[k(vt-10)] portion of the F = ma equation, that would give

F = -mk2v2y

This somewhat models Hooke's law, if we can consider m, k, and v to be all constants and serve as the constant in the Hooke's law equation.

Is this more on the right track..?

11. Jan 24, 2013

### tms

You've got it. $m$, $k$, and $v$ are all constants in this situation.

format: plain


text:
## 1. Introduction

The acoustic properties of speech are shaped in large part by the movements of the upper vocal tract and the vibrations and turbulence set up by the flow of air through the larynx and vocal tract constrictions. In addition to the controlled movements of the upper vocal tract, speech acoustics are determined by the overall size of the vocal tract and larynx.

Vowels differ primarily in the two lowest resonances of the vocal tract—the first and second ‘formants’ (F1 and F2). For instance, the vowel [i] has a low F1 and a high F2, while [a] has a high F1 and a low F2. The acoustic vowel space that is defined by a talker’s range of F1 and F2 values is shifted up or down in average F1 and F2 frequency as a function of vocal tract length. Longer vocal tracts have lower average resonant frequencies. This vocal tract length effect creates a practical challenge for automatic speech recognition, and for the phonetic comparison of speakers, dialects, and languages, as well as a ‘normalization’ problem for listeners who must recognize vowels produced by a range of different talkers.

This paper will introduce the ΔF method of vocal tract length normalization. In two studies, the paper will evaluate ΔF vowel normalization as a practical technique for acoustic analysis of language data, and also gauge the feasibility of vocal tract length normalization as a perceptual mechanism.

### 1.1. Vocal tract length

According to the acoustic theory of speech production (Fant, 1960) it is theoretically possible to remove vocal tract length differences from our descriptions of speech acoustics (Nordström & Lindblom, 1975). Once we have measurements of the vocal tract resonant frequencies (F1-F4) we can use the talker-specific vowel formant distributions to estimate normalization factors. Several normalization methods have been proposed, with more or less reference to acoustic theory (Gerstman, 1968; Lobanov, 1971; Nordström & Lindblom, 1975; Nearey, 1978; Watt & Fabricius, 2002). The aim of acoustic vowel normalization is to make it possible to express the formant frequencies using a measurement scale that is independent of talker differences, for use in comparing dialects and languages with each other. Vowel normalization may also be a part of the cognitive process of speech perception.

Whether listeners make use of vocal tract length in speech perception is an open question (Johnson, 1997). It has been argued that perceptual compensation for talker differences must be more than simply a vocal tract length normalization, because acoustic differences between men and women (who tend to differ in vocal tract length) is language-specific; male/female differences depend in part on the language or dialect that they speak (Johnson, 2005). This language-specificity of gender differences suggests that there is more involved than just vocal tract length difference. Instead, there appears to be a performative aspect of gender that is overlaid on physical sex differences in vocal tract length. Secondly, it has been observed that perceptual talker normalization effects are conditioned to some degree on higher-level factors that are given by prior phonetic context (Ladefoged & Broadbent, 1957; Johnson, 1990), visual context (Strand & Johnson, 1996), or even experimenter suggestion (Johnson, Strand, & D’Imperio, 1999).

Despite these observations about speech perception, there are a couple of reasons to suppose that vocal tract length normalization might be a component of the speech perception process. First, the perception of a conspecific individual’s body size is important for social organization in many species (e.g., Harrington & Mech, 1979), and there is evidence that vocalizations are used to convey individual characteristics such as size (Reby & McComb, 2003). This suggests that the perception of vocal tract length may be evolutionarily prior to linguistic communication, so language processing may be overlaid on a cognitive structure that already included vocal tract length perception. Second, there are regions of the brain involved in talker perception that do not overlap with regions involved in speech perception (e.g., Van Lanker, Kreiman, & Cummings, 1989; Johnson & Sjerps, to appear), suggesting that the perceptual system may include processes that compute talker information that can be mixed with phonetic information in a stream that produces ‘talker neutral’ phonetic information.

### 1.2. Extrinsic normalization

One reason to believe that vocal tract length normalization is not a viable mechanism for speech perception is that, as usually formulated, it relies on information that is extrinsic to the vowel. That is, it is usually assumed that the estimation of vocal tract length is computed over a collection of vowel tokens—information beyond what is available intrinsically in the vowel to be classified. Common experience, and controlled experimentation confirm that isolated vowels are accurately recognized (Nearey, 1989; Strange, Jenkins, & Johnson, 1983). This suggests that each vowel contains the information that is needed for its own recognition, and this intrinsic information is usually sufficient for vowel recognition.

Lammert and Narayanan’s (2015) finding is relevant for this discussion. Building on earlier work in speech engineering (Paige & Zue, 1970; Kirlin, 1978; Wakita, 1977), they devised a regression method using the frequencies of formants F1-F4 to estimate vocal tract length over short stretches of speech. Vocal tract length normalization using four formants F1-F4 should be less reliant on the specific vowel tokens that are used to calculate normalization parameters than methods like z-score normalization (Lobanov, 1971) that normalize F1 (for example) on the basis of information about the distribution of F1 in a set of vowel measurements. Obviously, you cannot accurately estimate the distribution of a formant’s frequencies from a single token, so the Lobanov normalization method cannot be a model of how listeners identify (and normalize) isolated vowels. On the other hand, in vocal tract length normalization, information from F1-F4 determines a normalization scale factor, so each vowel contains a formant pattern within which to evaluate (and normalize) the formants.

### 1.3. Descriptive normalization

Regardless of whether vocal tract length normalization is done in speech perception, descriptive studies of language phonetic systems rely on vowel normalization algorithms to compare speech produced by different talkers or groups of talkers (Disner, 1980; Adank, Smits, & van Hout, 2004). Methods used in these studies are sometimes based on general-purpose statistical normalization techniques such as range normalization (Gerstman, 1968), or z-score normalization (Lobanov, 1971), but more specialized methods using what could be called ‘mean normalization’ (the ratio of x to the mean of x) are also widely used (Nearey, 1978; Watt & Fabricius, 2002).

In vocal tract length normalization (Nordström & Lindblom, 1975), a single normalization scale factor is derived from an estimate of the length of the speaker’s vocal tract. An acoustic factor related to vocal tract length is ϕ, the fundamental frequency of vocal tract resonances in an unconstricted vocal tract (Paige & Zue, 1970; Kirlin, 1978; Lammert & Narayanan, 2015). The factor ϕ is equal to F1 and the other formants are on odd harmonics of this value: F2 = 3ϕ, F3 = 5ϕ, F4 = 7ϕ. ΔF is simply 2ϕ, and is an estimate of formant spacing in an unconstricted vocal tract (Reby & McComb, 2003), where F1 = ½*ΔF; F2 = 1½*ΔF; F3 = 2½*ΔF, etc. Because a single normalization scale factor is used to scale the formants (rather than a separate factor for each formant), this method is called a ‘uniform’ normalization method.

Despite its basis in the acoustic theory of speech production and the interpretation of the normalization scale factor in terms of a physical characteristic of the talker, vocal tract length normalization was rejected almost as soon as Nordström and Lindblom (1975) proposed it, because it did not seem to work very well. However, there has been significant progress in deriving more accurate vocal tract length estimates from the acoustic vowel spectrum, so a reconsideration of vocal tract length normalization is due.

### 1.4. Organization

This paper will introduce the ΔF method of vocal tract length normalization in Section 2. Section 3 will describe the methods used in two studies of vowel normalization techniques. The results of the studies are presented in Section 4, and the paper concludes with recommendations in Section 5. The aims of the paper are to evaluate ΔF vowel normalization as a practical technique for acoustic analysis of language data, and also to gauge the feasibility of vocal tract length normalization as a perceptual mechanism.

## 2. Methods for vocal tract length normalization

The earliest use of vocal tract length as a normalization factor was by Nordström and Lindblom (1975). They calculated the average third formant (F3) frequency in open vowels (where the frequency of F3 is easily distinguished from F2) and used this to estimate the talker’s vocal tract length. Vocal tract length was then used to scale a talker’s vowel formant measurements onto a ‘standard’ (i.e., male) vocal tract. We can avoid the male-centric bias of this approach by using a talker-independent measurement scale—an estimate of formant spacing in an unconstricted vocal tract, the ΔF.

Speech engineers have devised measures of vocal tract length from vowel acoustics (Paige & Zue, 1970; Wakita, 1977; Kirlin, 1978) for use in automatic speech recognition and speaker identification (Eide & Gish, 1996; Lee & Rose, 1998). For example, Kirlin (1978) used information from the four lowest formants and estimates of formant variances to weight the contributions of formants. He treated “each formant as a noisy estimator” of vocal tract length, so in his calculation, because F2 has large variance, it contributes less to the vocal tract length estimate. Lammert and Narayanan (2015) published an important study in this line. They compared the vocal tract length predicted from acoustic measures to estimates of vocal tract length measured from magnetic resonant imaging (MRI) of the vocal tract, as well as computer simulated vocal tracts of known length. They found a family of regression formulas that predict vocal tract length from the first four formant frequencies of vowels, weighting formants as Kirlin did but finding the weights by regression to known vocal tract length.

Following the analysis outlined by Lammert and Narayanan (2015) and building on the line-fitting approach of Reby and McComb (2003; see Figure 1), a talker’s ΔF is directly estimated by scaling formant frequencies by their formant number (F1, F2, F3, F4, etc.) as in formula (1). Note that each formant (F1-F4) of each vowel provides an estimate of ΔF. The sum in (1) can be taken over all of the vowels for a talker that are available in a dataset so missing values have a limited impact on the estimate. It is important to note that even though F1 and F2 vary substantially for different vowels, averaged over a representative dataset they approximate the frequencies of an unconstricted vocal tract—a uniform tube. Section 3 will compare the direct estimation of ΔF using the average formant spacing method in (1) with the optimized empirical method presented by Lammert and Narayanan (2015). Kirlin’s (1978) a posteriori method was also implemented and results from this method of vocal tract length estimation will also be reported. Once we have calculated ΔF, then the talker’s vocal tract length can be calculated from ΔF by formula (2), and the normalized vowel formants are calculated using ΔF as in (3).

Figure 1

An illustration of Reby and McComb’s (2003) direct estimation approach for finding ΔF from formant measurements. The average spacing between vowel formants (ΔF) is the slope of the line that relates formant number to formant frequency. The figure shows the formant frequencies of a vocal tract that is 17.5 cm long with no constrictions (a uniform tube). ΔF is 1000 Hz, and F1 is 500 Hz, F2 is 1500 Hz, etc.

1. (1)
1. where i = formant number (1…4), and j is token number
1. (2)
1. $\mathit{\text{VTL}}=c\text{/}2\mathit{\text{ΔF}}$ , c = 34000 cm/s, the speed of sound, warm moist air
1. (3)
1. , normalized formant frequencies

This average formant spacing method of estimating vocal tract length (VTL) is essentially perfectly correlated with Lammert and Narayanan’s (2015; henceforth L&N) estimated VTL on the Hillenbrand, Getty, Clark, and Wheeler (1995) dataset (r2 = 0.998, Figure 2 below), while the Nordström and Lindblom (1975) estimate which was based on F3 alone, is much less strongly correlated with L&N (r2 = 0.829). Kirlin’s (1978) method was also closely correlated with the L&N method (r2 = 0.963). The strong correlations between the average spacing (formula 1) and L&N methods is an indication that with a full sample of vowels for a talker, the average spacing method is a valid measure of apparent vocal tract length. The key difference between L&N’s data-driven approach and the average spacing approach is that the average spacing approach assumes that the formant values will, on average, be equally spaced (as in Figure 1). The high correlation between the methods can be seen as a validation of this assumption for a typical phonetic dataset. As seen in Figure 2, the length estimated by the average formant spacing method is consistently about 0.8 cm longer than the length estimated by the L&N method.

Figure 2

Vocal tract length estimates for the talkers in Hillenbrand et al. (1995), as calculated using the average spacing formula (4) and the two formulas calculated by Lammert and Narayanan (2015): formula (8) with no zero intercept, and formula (11), which does have a zero intercept. The dashed line is the identity line, y = x.

Formula (3) shows that ΔF can be used as a unit of measure for vowel formant frequencies, putting vowel formants from all vocal tracts on the same measurement scale. The normalized F1’ value is given as F1/ΔF and is expected to be equal to 0.5 for a uniform tube of any length, the normalized F2’ is F2/ΔF and is expected to be equal to 1.5 for any uniform tube, and so on. This is ΔF vocal tract length normalization, where ΔF can be estimated in several different ways—from F3 alone (Nordström & Lindblom, 1975), using the average formant spacing approach (formula 1), or using Lammert and Narayanan’s (2015) regression fits, or Kirlin’s (1978) weight by variance method. This use of ΔF as a vowel normalization factor, which has not been proposed before, is the main practical contribution of this paper.

## 3. Methods

### 3.1. Data sets

The data analyzed in this paper are the published American English vowel production data from Peterson and Barney (1952) and Hillenbrand et al. (1995), as distributed by Santiago Barreda in his ‘phonTools’ package for the R statistical programming language.

### 3.2. Normalization formulas

The data were analyzed in the R statistical programming language, and the normalization algorithms were implemented as illustrated in Table 1. As the variable names in the last four rows of the table make clear, the normalizing factor ΔF can be calculated by any method that provides an estimated vocal tract length from the acoustic vowel formants. The Watt & Fabricius method prescribes taking the mean of formants from particular judiciously selected vowel qualities to ensure that the center of the talker’s acoustic vowel space is adequately captured, to provide a cross-linguistically consistent scale. The implementation here used the mean of the entire sample as the estimate of the center of the acoustic vowel space. This works just as well for vowel classification within language, and avoids subjectivity or other mistakes in the selection of the exemplary vowel tokens.

Table 1

Some details, in R, of how the normalization algorithms were implemented. In these code snippets ‘f1,’ ‘f2,’ ‘f3’ are arrays of vowel formant measurements for a particular talker. The first three rows are non-uniform methods and the last four rows are uniform methods.

Method R code
Lobanov, z-score F1’ = scale(f1);
Watt & Fabricius F1’ = f1/mean(f1);
Nearey 1, non-uniform F1’ = exp(log(f1) – mean(log(f1)));
Nearey 2, uniform mf = mean(c(log(f1),log(f2),log(f3)));
F1’ = exp(log(f1)-mf);
Nordström & Lindblom ΔF = mean(f3[f1>600]/2.5);
F1’ = f1/ΔF;
Kirlin x = mean(f1/146^2) + 3*mean(f2/485^2) + 5*mean(f3/322^2) + mean(f1)/40^2;
ΔF = 2(x*1051.2);
F1’ = f1/ΔF;
Lammert & Narayanan ΔF = 2*(262 + mean(0.14*f1) + mean((0.16*f2)/3) + mean((0.25*f3)/5));
F1’ = f1/ΔF;
average spacing ΔF ΔF = mean(c(f1/0.5, f2/1.5, f3/2.5));
F1’ = f1/ΔF;

### 3.3. Vocal tract length coefficients

The regression coefficients used in this paper for the Lammert & Narayanan (2015) method are different from the ones they published because the datasets used here only include the first three formants, while L&N used F1–4 to estimate vocal tract lengths. Dr. Lammert was kind enough to provide two sets of coefficients for regressions fitted from F1–3 for simulated data. Without an intercept (β1 = 0.28, β2 = 0.31, β3 = 0.47) the RMS error in estimated vocal tract length is 1.91 cm. A regression formula that includes an intercept term (β0 = 262, β1 = 0.14, β2 = 0.16, β3 = 0.25) leads to a smaller error of estimated vocal tract length (1.22 cm).1 The classification studies in the next section used the second formula, the one with an intercept term. The ΔF estimates of the intercept formula tend to be regulated, drawn away from extremely short or long estimates, by the β0 constant, as further discussed below.2

The comparison of the Lammert and Narayanan (2015) coefficients to the average spacing coefficients, formula (1), is complicated by a slight difference in how they are presented and calculated. Formula (1) is reproduced here as (4) and can be expanded as (5) in the case where we have three formants per vowel. Simplifying (5) into an expression similar to the form used by L&N, we get (7).

1. (4)
1. where i = formant number
1. (5)
1. (6)
1. $\mathit{\text{ΔF}}=1\text{/}3\text{\hspace{0.17em}}\left(2*F1+0.666*F2+0.4*F3\right)$
1. (7)
1. $\mathit{\text{ΔF}}=0.6667*F1+0.222*F2+0.1333*F3$

Lammert and Narayanan’s no-intercept expression for ΔF with three vowel formant measurements is in (8). Simplifying, we get equation (10).

1. (8)
1. $\mathit{\text{ΔF}}=2\left(0.28*F1+\left(0.31*F2\right)\text{/}3+\left(0.47*F3\right)\text{/}5\right)$
1. (9)
1. $\mathit{\text{ΔF}}=2\left(0.28*F1+0.10333*F2+0.094*F3\right)$
1. (10)
1. $\mathit{\text{ΔF}}=0.56*F1+0.20666*F2+0.188*F3$

Now we can compare the coefficients used in the Lammert and Narayanan (2015) calculation for three formant vowels (10) with the average spacing formula (7). The L&N formula has a larger coefficient for F3 and smaller coefficients for F1 and F2, than are found in the average spacing expression. This is likely to lead to better vocal tract length estimates when only one or two vowel tokens are available because the frequency of F3 is less variable across vowels than are F1 and F2. However, as seen in the left panel of Figure 2, with a full set of data, this method (formula 8) produces vocal tract length estimates that differ from the estimates given by the average-spacing formula (4) by only a constant (probably due to the difference between the acoustic effective length of the vocal tract versus the actual length of the vocal tract; Johnson, 2011, p. 42).

Lammert and Narayanan (2015) also fit a formula for estimating vocal tract length that includes an intercept term. This provides a slightly more accurate measure of vocal tract length with a small set of vowel tokens, by regularizing the estimated vocal tract length. This is illustrated in the right panel of Figure 2, which compares the Lammert and Narayanan VTL estimates (formula 2) using a regression formula with an intercept term (11), to the VTL estimates produced by average spacing (4) for the Hillenbrand et al. data. The main thing to notice is that the range of VTL estimates for formula (11) is smaller (min=13.6 cm, max=16.75cm) than the range given by the non-regularized formula (8).

1. (11)
1. $\mathit{\text{ΔF}}=2\left(262+0.14*F1+\left(0.16*F2\right)\text{/}3+\left(0.25*F3\right)\text{/}5\right)$
1. (12)
1. $\mathit{\text{ΔF}}=524+0.28*F1+0.10666*F2+0.1*F3$

The regression formula is simplified as (12). Notice that the coefficients for F1-3 are about half as large as in the no-intercept formula (10). If we enter F1=500, F2=1500, and F3=2500 into formula (12) we get 1074 Hz. So, about one half of the value of ΔF is determined by the formant frequencies and the rest is determined by the intercept (β0 = 524). This will tend to shrink the range of ΔF, and with it the range of estimated vocal tract lengths. The formula in (11) results in better vowel classification when vocal tract length is estimated from only a few vowel tokens and was used in the analyses reported here. Unsurprisingly, using Lammert and Narayanan’s no-intercept estimate of ΔF (formula 8) resulted in classification accuracy that was almost identical to that reported for the average-spacing ΔF method.

### 3.4. Study 1: Classification performance

For each normalization method, normalization factors (ΔF, log(mean), SD, etc.) were calculated over all vowel tokens for a talker, and then the talker’s vowel formant frequencies were normalized using the code in Table 1. After all of the vowel formant frequencies in the dataset were normalized, support vector machines (SVM, Cortes & Vapnik, 1995) were used to classify the vowels. SVM is a supervised machine learning technique that, in this case, can be used to find optimal classification boundaries between the vowel categories given the data. The results of SVM classification can be used to infer an objective estimate of the level of vowel separation in the data. The classifiers built in this study used a radial basis function with gamma = 0.5. These are the default parameters for the R function svm(). Classification performance was evaluated by using the trained model to predict the category membership of each item in the training set and the percent correct vowel classification was computed from these predictions.

The normalized vowels were also used to build SVM classifiers to identify the talker group (male, female, child) of each token. Assuming that the goal in normalization is to remove talker differences, then a lower percent correct talker classification is an indication of better normalization performance.

The studies in this paper neglect two sources of vowel intrinsic information that have been shown to be useful both in automatic speech recognition and human speech perception—fundamental frequency of voicing (Fujisaki & Kawashima, 1968), and vowel inherent spectral change (Nearey & Assman, 1986). Thus, the classification results here are a minimal baseline.

### 3.5. Study 2: Effects of sample size

As in study 1, the vowel formant data to be classified in the second study were the full Hillenbrand et al. (1995) or the Peterson and Barney (1952) datasets. However, where in study 1 the normalization factors were calculated over all of the tokens for a talker, in this study the vowels were normalized with scale factors that were computed from randomly selected subsets of the available vowel data.

Different tests were conducted with normalization based on different numbers of vowel tokens per talker. Subsets of size 1, 2, 4, 6, or 9 tokens per talker were tested in the Hillenbrand data set, and subsets of size 1, 2, 5, 10, 15, and 20 tokens per talker were tested in the Peterson and Barney data set. In each test, a random subset of vowel tokens was selected and then normalization scale factors for each of the several normalization methods were computed from the randomly selected tokens. These normalization scale factors were then used to normalize the full set of vowel tokens (all of the tokens in the corpus), and as in study 1, SVM vowel classifiers were then built and the classification accuracy over the test data set was noted. This process was repeated 50 times in each test to give an estimate of the variability of the accuracy scores for a given normalization subset size.

When the subset was a single token, the formant ‘mean’ that was used in the non-uniform normalization methods was set equal to the value of that formant in the selected token. The standard deviation in the Lobanov method was also set equal to the formant value when only a single token was the basis for normalization parameters.

Two additional tests were conducted. In one, a single token of the vowel [ə] was used to calculate normalization factors, and in the second, formants of the corner vowels [i, u, ɑ] were used to define the normalization statistics.

## 4. Results

### 4.1. Study 1: Classification accuracy

As shown in Table 2, vowel classification with ΔF (average-spacing or Kirlin’s VTL method) is close to state of the art, with vowel classification accuracy approaching 90% correct for the Peterson and Barney (1952) data set, and about 80% correct for the Hillenbrand et al. (1995) data set. Also, reduction of talker information in vowels was comparable to the state of the art achieved by the non-uniform normalization methods proposed by Nearey (1978), Lobanov (1971), and Watt & Fabricius (2002). The Lammert & Narayanan (2015) method of VTL estimation (with intercept) is less accurate. The Lammert & Narayanan no-intercept method (not shown in the table) is virtually the same as the average spacing method.

Table 2

SVM percent correct identification of vowels and talker group (man, woman, child [MWC], or man, woman, boy, girl [MWBG]) in the vowel formant data reported by Peterson and Barney (1952; PB52) and Hillenbrand et al. (1995; H95) by different vowel normalization methods. Non-uniform vowel normalization refers to methods that use a different normalization factor for each formant. Uniform normalization refers to methods that use a single uniform scaling factor (such as vocal tract length) for all of the formants produced by a person.

Method Type Vowels Talker Group
PB52 H95 PB52 H95
Chance 12.5% 10% 40% 30%
No normalization (F1 & F2) NONE 77.3 62.9 66.7 53.2
ΔF (Nordström & Lindblom) Uniform 82.5 72.7 49.8 41.9
ΔF (Lammert & Narayanan) Uniform 86.3 73.4 59.6 47
Mean log Fs (Nearey 2) Uniform 87.9 77.8 52.0 43.2
ΔF (Kirlin) Uniform 88 78.4 52.2 41.7
ΔF (average-spacing) Uniform 88.2 78.1 50.9 42.9
Mean log F (Nearey 1) Non-uniform 90.9 80.1 51.6 42.4
Mean F, ratio (Watt & Fabricius) Non-uniform 90.8 80.7 50.8 41.4
Z-score normalization (Lobanov) Non-uniform 92.6 84.4 49.3 39.8

Vowel classification with average-spacing ΔF normalization is much better than with Nordström & Lindblom’s (1975) method of VTL estimation, but not quite as good as the best non-uniform normalization methods. The ΔF method is also quite comparable with the other models in removing much of the talker group information (e.g., man, woman, child). It is worth noting, however, that chance ‘talker group’ identification (calculated with 1000 random permutations of the datasets) is 40% correct in the Peterson and Barney (1952) corpus, and 31% correct in the Hillenbrand et al. (1995) corpus, so none of the methods fully ‘normalize out’ this information. This is a neglected point in vowel normalization studies (but see the recent insightful discussion in Barreda & Nearey, 2018, who reference a discussion in Hindle, 1978). We ‘normalize’ vowel formant measurements, but gender and age differences are not fully removed. Knowing when a method ‘over-normalizes’ and removes talker variability that actually ‘should’ remain because it is sociolinguistically significant, is an important problem. This highlights the need for a principled approach, grounded in acoustic theory, and also means that regardless of the normalization method used, the residue of talker variation left behind by normalization should be statistically modeled, because we can be sure that some talker information remains.

Figure 3 shows plots of normalized and unnormalized vowel formants for the Hillenbrand et al. (1995) data set. These plots show that vocal tract length normalization using the ΔF method results in a normalized vowel space that is remarkably similar to spaces obtained with non-uniform methods that require more, and less interpretable, parameters. Note that the center of the vowel space is marked by the horizontal and vertical lines. For the Nearey, Lobanov, and Watt & Fabricius methods these lines mark the mean F1 and F2; for the ΔF methods they mark the resonances of the uniform tube.

Figure 3

Upper left: F1 and F2 vowel formant frequencies from Hillenbrand et al. (1995). Other panels: the same data normalized by several of the methods identified in the text.

This analysis indicates that vocal tract length normalization using a single interpretable normalization parameter (ΔF—an estimate of formant spacing in a vocal tract with no constrictions) is comparable to other vowel normalization methods. The talker-independent dimension that is used in this normalized representation is derived from both the formants being normalized (F1 and F2), as well as higher formants (F3 in this case, and also F4; Lammert & Narayanan, 2015), which are less likely to vary as a function of the particular inventory of vowels found in a language. Higher formants, F3 and F4, are sometimes not measured. This study suggests that they should be, and that this additional information about the talker’s vocal tract could be extremely valuable in interpreting the F1/F2 vowel space.

Because the normalization factor ΔF is directly interpretable in terms of a physical property of the talker, vocal tract length normalization is valid for cross-linguistic comparison of vowel spaces. In addition, it is remarkable that the state of the art in vowel formant normalization is almost entirely reducible to normalization in terms of the talker’s vocal tract length. This has not been observed before because phoneticians have not used a measure calibrated to vocal tract length in our vowel normalization schemes. Arguably, Nearey’s (1978) uniform normalization technique, with mean logF*, uses a measure that reflects vocal tract length, although because it is not calibrated to vocal tract length it is a problematic measure, giving incomparable measurement scales for values normalized over mean logF* (F1..F4) versus values normalized over mean logF* (F1..F3). The ΔF measurement scale is the same whether ΔF is estimated from three formants or four.

### 4.2. Study 2: Effects of sample size

Beyond the practicalities of having a workable vowel normalization scheme for comparing dialects and languages, the discovery that vocal tract length normalization is a powerful method for reducing some of the talker variability found in speech leads one to wonder whether vocal tract length normalization might play a role in speech perception. Study 2 tested this by limiting the amount of information available to the normalization algorithms in tests of vowel classification using the Hillenbrand et al. (1995) and Peterson and Barney (1952) datasets. Limiting the information available for normalization creates a situation that Barreda and Nearey (2018) call ‘type B’ over-normalization which is “due to noise in the estimated speaker parameters used for normalization.”

Figure 4 shows the results of study 2 on the Hillenbrand et al. (1995) data set, with normalization based on different numbers of randomly selected vowels (1, 2, 4, 6, or 9 tokens), or basing vowel normalization on the corner vowels [i], [u], and [ɑ], on schwa [ə], or on the entire set of observations from each talker (12 tokens). For these later models (12 tokens, schwa, or corner vowels) there was no repeated random selection of a basis for extrinsic normalization, so only one SVM was fit for each normalization method.

Figure 4

Results of SVM vowel classification of the Hillenbrand et al. (1995) vowels when the vowel normalization statistics are calculated over different numbers of randomly selected vowel tokens, or sets designed to be uniquely informative about the vowel space (the corner vowels) or the vocal tract (schwa). The order of the bars within each panel is indicated in the legend, reading top to bottom for the bars from left to right—e.g., Lobanov normalization is the leftmost bar in each panel. Classification with no normalization results in 62.9% correct vowel identification (see Table 2), which is indicated by the dashed horizontal line.

Figure 5 shows analogous results for the Peterson and Barney (1952) dataset. With both the HIllenbrand et al. (1995) data and the Peterson and Barney (1952) data, the results show that uniform scaling techniques (Nearey’s uniform scaling method, the ΔF methods—Kirlin, Ave-spacing, and Lammert & Narayanan) improve vowel classification accuracy over unnormalized classification even with a very small random sample of speech. While non-uniform methods, i.e., those that scale each formant using information in the corpus about that formant (z-score normalization [Lobanov], mean ratio [Watt & Fabricius], or log mean difference [Nearey], non-uniform), are more dependent upon the particular vowel tokens that are used to calculate the vowel normalization factors, and need either a carefully chosen sample, or a large sample. Random selection of vowel tokens, as done here, has a catastrophic effect on the non-uniform methods if only a few vowel tokens are taken to represent the talker. In practice, where a large corpus of vowel measurements is available, this does not matter, and in fact the non-uniform methods may reduce talker differences better than the uniform methods in corpus analysis. But these methods are brittle and are generally inappropriate as models of the perceptual process.

Figure 5

Results of SVM vowel classification of the Peterson and Barney (1952) vowels when the vowel normalization statistics are calculated over different numbers of randomly selected vowel tokens, or sets designed to be maximally informative about the vowel space (the corner vowels) or the vocal tract (schwa). Classification with no normalization results in 77.3% correct vowel identification (see Table 2), which is indicated by the dashed horizontal line.

Testing the Watt & Fabricius method with randomly selected vowel tokens, as done here, especially goes against the spirit of that method because its main feature is a judicious selection of vowel tokens to represent the full possible range of F1 and F2 for a talker. However, random selection of tokens is justified in this study because it is designed to evaluate the plausibility of extrinsic normalization as a component of speech perception. Listeners are not presented with a judicious selection of vowel tokens, but have to deal with whatever the talker says. It is worth noting that even without judicious selection of vowel tokens, Watt & Fabricius’ mean ratio representation has very good vowel classification performance when a large sample of tokens is taken; however the normalization scale may depend on the specific vowel inventory. Regardless, the Watt & Fabricius method was not designed as a model of perceptual vowel normalization and is clearly not a feasible one.

## 5. Conclusion

This study introduced a new method of vowel normalization, the ΔF method. This is explicitly a vocal tract length normalization method, and represents vowels on a talker-independent measurement scale—the average formant spacing of the talker, their ΔF. Using a metric that is closely related to the length of the talker’s vocal tract, we are able to produce a vowel space in which vocal tract length effects have been removed. The resulting vowel space is largely equivalent to Nearey’s (1978) log-mean uniform vowel normalization method, but is explicitly rationalized in terms of vocal tract length and has a consistent unit of measure whether 3 formant or 4 formant measurements are used. ΔF normalization based on Lammert and Narayanan’s (2015) intercept method of vocal tract length estimation is more robust when only a few tokens are available for a talker, but provides less vowel category separation in models built over a larger corpus.

This study has also shown that non-uniform methods, that rely on within-formant scale factors (Nearey’s log-mean non-uniform method, Lobanov’s z-score normalization, and Watt & Fabricius’ mean ratio method) are highly sensitive to the vowel tokens that are chosen as the basis for calculating the normalization scale factors. This leads to the conclusion that these methods are not plausible as models of the cognitive processes involved in speech perception. Also, in practical phonetic description of languages this dependence on particular vowel tokens for calculating normalization scale factors complicates cross-linguistic or cross-dialect comparisons of vowels spaces. If languages have different vowel inventories, then the unit of measure for normalized vowels will not be comparable across languages. This leads one to try to determine formant ranges indirectly (Fabricius, Watt, & Johnson, 2009) in order to have normalized values that can be cross-linguistically compared. Vocal tract length normalization does not have as much of a problem with this because it is less sensitive to the composition of the vowel inventory, and not very sensitive to the particular vowel tokens that represent a talker.

The practical conclusion is that ΔF normalization likely has advantages over other methods for speech researchers. It produces good classification accuracy, is robust to sample size variation across talkers, is independent of the vowel inventory or phonetic vowel realizations in the language or dialect studied, puts all talkers, regardless of language or dialect, on the same measurement scale, and is rationalized in terms of the acoustic theory of speech production.

Finally, the results of this study also encourage us to think that listeners may be able to employ a type of vocal tract length normalization with very little extrinsic context. Non-uniform normalization schemes are untenable when faced with a single isolated vowel, but a normalization scheme in which vocal tract length is estimated from the entire spectrum of a vowel (see e.g., Wakita, 1977; Bladon, Henton & Pickering, 1984; Lee & Rose, 1998), does seem to be a plausible perceptual mechanism even with isolated vowels. Future research may bear this out.

## Notes

1. The measurement errors reported for these estimates of vocal tract length are about 10% of the length of a typical vocal tract, which may seem a bit large. It is, however, a small enough error to be able to correctly classify speakers in the Hillenbrand et al. (1995) data set as ‘male,’ ‘female,’ or ‘child’ with 90% accuracy based on the L&N estimate of vocal tract length (formula 8). This was measured using the methods for support vector machine classification that are described below for study 1. [^]
2. Though the coefficients for four formant data using Lammert & Narayanan’s (2015) method are published in their paper, for completeness and ease of reference they are repeated here: with intercept (formula 11): β0 = 52, β1 = 0.078, β2 = 0.099, β3 = 0.101, β4 = 0.609, and without intercept (formula 8): β1 = 0.089, β2 = 0.102, β3 = 0.121, β4 = 0.669. [^]

## Acknowledgements

This paper is dedicated to Mary Beckman. Thanks to Adam Lammert for sharing VTL estimation coefficients for three-formant vowel data and for extensive comments on an earlier version of the manuscript. Thanks also to Santiago Barreda and two anonymous reviewers for comments on an earlier version of the manuscript. The work here was made possible in part by Barreda’s collection of datasets and analysis/visualization tools that he has made available in the phonTools R package.

## Competing Interests

The authors have no competing interests to declare.

## References

Adank, P., Smits, R., & van Hout, R. (2004). A comparison of vowel normalization procedures for language variation research. Journal of the Acoustical Society of America, 116, 3099–3107. DOI:  http://doi.org/10.1121/1.1795335

Barreda, S., & Nearey, T. M. (2018). A regression approach to vowel normalization for missing and unbalanced data. Journal of the Acoustical Society of America, 144, 500–520. DOI:  http://doi.org/10.1121/1.5047742

Bladon, R. A. W., Henton, C. G., & Pickering, J. B. (1984). Towards an auditory theory of speaker normalization. Language & Communication, 4, 59–69. DOI:  http://doi.org/10.1016/0271-5309(84)90019-3

Cortes, C., & Vapnik, V. N. (1995). Support-vector networks. Machine Learning, 20(3), 273–297. DOI:  http://doi.org/10.1007/BF00994018

Disner, S. (1980). Evaluation of vowel normalization procedures. Journal of the Acoustical Society of America, 67, 253–261. DOI:  http://doi.org/10.1121/1.383734

Eide, E., & Gish, H. (1996). A parametric approach to vocal tract length normalization. 1996 IEEE International Conference on Acoustics, Speech, and Signal Processing Conference Proceedings, 1, 346–348. Atlanta, GA, USA. DOI:  http://doi.org/10.1109/ICASSP.1996.541103

Fabricius, A., Watt, D., & Johnson, D. E. (2009). A comparison of three speaker-intrinsic vowel formant frequency normalization algorithms for sociophonetics. Language Variation and Change, 21, 413–35. DOI:  http://doi.org/10.1017/S0954394509990160

Fant, G. (1960). Acoustic Theory of Speech Production. The Hague: Mouton.

Fujisaki, H., & Kawashima, T. (1968). The roles of pitch and higher formants in the perception of vowels. IEEE Transactions on Audio and Electroacoustics, 16, 73–77. DOI:  http://doi.org/10.1109/TAU.1968.1161952

Gerstman, L. (1968). Classification of self-normalized vowels. IEEE Transactions on Audio and Electroacoustics, 16, 78–80. DOI:  http://doi.org/10.1109/TAU.1968.1161953

Harrington, F. H., & Mech, L. D. (1979). Wolf howling and its role in territory maintenance. Behaviour, 68, 207–249. DOI:  http://doi.org/10.1163/156853979X00322

Hillenbrand, J., Getty, L. A., Clark, M. J., & Wheeler, K. (1995). Acoustic characteristics of American English vowels. Journal of the Acoustical Society of America, 97(5), 3099–3111. DOI:  http://doi.org/10.1121/1.411872

Hindle, D. (1978). Approaches to vowel normalization in the study of natural speech. In D. Sankoff (Ed.), Linguistic variation: Models and methods (pp. 161–171) New York: Academic Press.

Johnson, K. (1990). The role of perceived speaker identity in F0 normalization of vowels. Journal of the Acoustical Society of America, 88, 642–654. DOI:  http://doi.org/10.1121/1.399767

Johnson, K. (1997). Speech perception without speaker normalization: An exemplar model. In K. Johnson & J. W. Mullennix (Eds.), Talker variability in speech processing. (pp. 145—166). San Diego, CA: Academic Press.

Johnson, K. (2005). Speaker Normalization in speech perception. In D. B. Pisoni & R. Remez, (Eds.), The handbook of speech perception (pp. 363—389). Oxford: Blackwell Publishers. DOI:  http://doi.org/10.1002/9780470757024.ch15

Johnson, K. (2011). Acoustic and Auditory Phonetics, 3rd Edition. Boston: Wiley-Blackwell.

Johnson, K., & Sjerps, M. (to appear). Speaker Normalization in Speech Perception.

Johnson, K., Strand, E. A., & D’Imperio, M. (1999). Auditory-visual integration of talker gender in vowel perception. Journal of Phonetics, 27, 359–384. DOI:  http://doi.org/10.1006/jpho.1999.0100

Kirlin, R. L. (1978). A posteriori estimation of vocal tract length. IEEE Transactions on Acoustics, Speech, and Signal Processing, 26, 571–574. DOI:  http://doi.org/10.1109/TASSP.1978.1163151

Ladefoged, P., & Broadbent, D. E. (1957). Information conveyed by vowels. Journal of the Acoustical Society of America, 39, 98–104. DOI:  http://doi.org/10.1121/1.1908694

Lammert, A. C., & Narayanan, S. S. (2015). On Short-Time Estimation of Vocal Tract Length from Formant Frequencies. PLoS ONE, 10(7): e0132193. DOI:  http://doi.org/10.1371/journal.pone.0132193

Lee, L., & Rose, R. C. (1998). A frequency warping approach to speaker normalization. IEEE Transactions on Speech & Audio Processing, 6(1), 49–60. DOI:  http://doi.org/10.1109/89.650310

Lobanov, B. M. (1971). Classification of Russian vowels spoken by different speakers. Journal of the Acoustical Society of America, 49, 606–608. DOI:  http://doi.org/10.1121/1.1912396

Nearey, T. M. (1978). Phonetic Feature Systems for Vowels. Bloomington, Indiana: Indiana University Linguistics Club.

Nearey, T. M. (1989). Static, dynamic, and relational properties in vowel perception. Journal of the Acoustical Society of America, 85, 2088–2113. DOI:  http://doi.org/10.1121/1.397861

Nearey, T. M., & Assmann, P. F. (1986). Modeling the role of inherent spectral change in vowel identification. Journal of the Acoustical Society of America, 80, 1297–1308. DOI:  http://doi.org/10.1121/1.394433

Nordström, P. E., & Lindblom, B. (1975). A normalization procedure for vowel formant data. Proceedings of the 8th international congress of phonetic sciences. Leeds, England.

Paige, A., & Zue, W. Z. (1970). Calculation of vocal tract length. IEEE Transactions on Audio and Electroacoustics, 18, 268–270. DOI:  http://doi.org/10.1109/TAU.1970.1162113

Peterson, G. E., & Barney, H. L. (1952). Control methods used in the study of vowels. Journal of the Acoustical Society of America, 24, 175–184. DOI:  http://doi.org/10.1121/1.1906875

Reby, D., & McComb, K. (2003). Anatomical constraints generate honesty: Acoustic cues to age and weight in the roars of red deer stags. Animal Behavior, 65, 519–530. DOI:  http://doi.org/10.1006/anbe.2003.2078

Strand, E. A., & Johnson, K. (1996). Gradient and visual speaker normalization in the perception of fricatives. In D. Gibbon (Ed.), Natural Language Processing and Speech Technology. Results of the 3rd KOVENS Conference, Bielefeld, October, 1996 (pp. 14–26). Berlin: Mouton de Gruyter. DOI:  http://doi.org/10.1515/9783110821895-003

Strange, W., Jenkins, J. J., & Johnson, T. L. (1983). Dynamic specification of coarticulated vowels. Journal of the Acoustical Society of America, 74(3), 695–705. DOI:  http://doi.org/10.1121/1.389855

Van Lanker, D. R., Kreiman, J., & Cummings, J. (1989). Voice perception deficits: Neuroanatomical correlates of phonagnosia. Journal of Clinical and Experimental Neuropsychology, 11(5), 665–674. DOI:  http://doi.org/10.1080/01688638908400923

Wakita, H. (1977). Normalization of vowels by vocal-tract length and its application to vowel identification. IEEE Transactions on Acoustics, Speech, and Signal Processing, 25, 183–192. DOI:  http://doi.org/10.1109/TASSP.1977.1162929

Watt, D., & Fabricius, A. (2002). Evaluation of a technique for improving the mapping of multiple speakers’ vowel spaces in the F1-F2 plane. Leeds Working Papers in Linguistics and Phonetics, 9, 159–173. Retrieved from http://www.leeds.ac.uk/linguistics/WPL/WP2002/Watt_Fab.pdf


text:
Constant-Expansion Suffices for Compressed Sensing with Generative Priors. In the
Generative neural networks have been empirically found very promising in providing effective structural priors for compressed sensing, since they can be trained to span low-dimensional data manifolds in high-dimensional signal spaces. Despite the non-convexity of the resulting optimization problem, it has also been shown theoretically that, for neural networks with random Gaussian weights, a signal in the range of the network can be efficiently, approximately recovered from a few noisy measurements. However, a major bottleneck of these theoretical guarantees is a network expansivity condition: that each layer of the neural network must be larger than the previous by a logarithmic factor. Our main contribution is to break this strong expansivity assumption, showing that constant expansivity suffices to get efficient recovery algorithms, besides it also being information-theoretically necessary. To overcome the theoretical bottleneck in existing approaches we prove a novel uniform concentration theorem for random functions that might not be Lipschitz but satisfy a relaxed notion which we call "pseudo-Lipschitzness." Using this theorem we can show that a matrix concentration inequality known as the Weight Distribution Condition (WDC), which was previously only known to hold for Gaussian matrices with logarithmic aspect ratio, in fact holds for constant aspect ratios too. Since more »
Authors:
; ;
Award ID(s):
Publication Date:
NSF-PAR ID:
10228234
Journal Name:
34th Annual Conference on Neural Information Processing Systems (NeurIPS), NeurIPS 2020


text:
# zbMATH — the first resource for mathematics

Non-archimedean Arakelov theory. (English) Zbl 0866.14011
This lengthy paper deals with a non-Archimedean analogue of Arakelov theory. While Arakelov theory starts with a variety $$X$$ over a number field (say $$\mathbb{Q})$$ and tries to add data to the usual archimedean fibres $$X(\mathbb{C})$$ so that one obtains Chow rings and intersection pairings one can go back and try to see what one gets if one mimicks the Archimedean constructions at the finite fibres. S. Zhang obtained interesting results in his paper ‘Adimissible pairing on a curve’ [Invent. Math. 112, No. 1, 171-193 (1993; Zbl 0795.14015)] constructing the Arakelov metric at the finite places. Here the authors are planning a bigger enterprise and set up a number of basic ingredients. They define the analogs of the groups of closed $$C^\infty$$ forms of type $$(p,p)$$ and the group of $$C^\infty$$ forms of type $$(p,p)$$ modulo the image of $$\partial$$ and $$\overline \partial$$ as certain limits over regular models. They prove a regularity result for such forms and introduce the groups $$CH^p$$ and prove that such groups can be seen as a limit over models. Then they extend some well-known results from the classical case to the new setting. In the last section they deal with the case of curves and obtain results close to those of Zhang. The authors point out that a non-Archimedean analogue of the arithmetic Riemann-Roch theorem is still lacking. There is an appendix on operational Chow-cohomology.

##### MSC:
 14G40 Arithmetic varieties and schemes; Arakelov theory; heights 14G20 Local ground fields in algebraic geometry


text:
Definitions

# betatron

[bey-tuh-tron or, especially Brit., bee-]
betatron: see particle accelerator.
A betatron is a cyclotron developed by Donald Kerst at the University of Illinois in 1940 to accelerate electrons. The betatron is essentially a transformer with a torus-shaped vacuum tube as its secondary coil. An alternating current in the primary coils accelerates electrons in the vacuum around a circular path.

## How it works

In a betatron, the magnetic field spins the injected electrons and accelerates them at the center where there is a ring-shaped vacuum tube changing the magnetic field and producing an electric field in the vacuum ring.

The stable orbit for the electrons satisfies $theta_0=2pi r_0^2 H_0$ where $theta_0$ is the flux with the orbit at $r_0$ is the radius and $H_0$ is the magnetic field at $r_0$. In other words, the magnetic field at the orbit must be half the average magnetic field over its circular cross section.

## Etymology

The name "betatron" (a reference to the beta particle, a fast electron) was chosen during a departmental contest. Other proposals were rheotron, inductron, and even Ausserordentlichhochgeschwindigkeitelektronenentwickelndenschwerarbeitsbeigollitron, supposedly German for "extraordinarily high-speed electron producing hard work by golly-tron.".

## Applications

Betatrons were historically employed in particle physics experiments to provide high energy beams of electrons—up to about 300 MeV. If the electron beam is directed at a metal plate, the betatron can be used as a source of energetic x-rays or gamma rays; these x-rays may be used in industrial and medical applications (historically in radiation oncology).

The Radiation Center, the first private medical center to treat cancer patients with a betatron was opened by Dr. O. Arthur Stiennon, in a suburb of Madison, Wisconsin in the late 1950s.

## Limitations

Because the mass of the electron increases at relativistic speeds, the cyclotron becomes less efficient at higher energies, placing an upper limit on its beam energy. These relativistic effects are accommodated in the next generation of accelerators, the Synchrotrons.

## In Popular Culture

• In the Frank Black song "Los Angeles", the betatron is referenced in the line "I met a man; he was a good man, sailing and shoring; he got a betatron, man."


text:
# Book-to-Bill Ratio

« Back to Glossary Index

## What Is the Book-to-Bill Ratio?

A book-to-bill ratio is the ratio of orders received to units shipped and billed for a specified period, generally a month or quarter. It is a widely used metric in the technology industry, specifically in the semiconductor equipment sector.

Investors and analysts closely watch this ratio for an indication of the performance and outlook for individual companies and the technology sector as a whole. A ratio above one implies more orders were received than filled, indicating strong demand, while a ratio below one implies weaker demand.

## The Formula for the Book-to-Bill Ratio Is:

Book to Bill=Orders ReceivedOrders Shipped\text{Book to Bill} = \frac{\text{Orders Received}}{\text{Orders Shipped}}Book to Bill=Orders Shipped


text:
# Is there a way to calculate mean curvature of a triangular mesh?

So I've written a script which does this:

Before:

After:

The code is:

#fname - filename of imported .stl
#thic - required thickness of output model
#txt - ascii or binary stl
#cyc - cycles of smoothing
#cut - times triangle divided
#fac - smoothing factor
#per - smoothing reps
#bbX - bounding box X
#bbY - bounding box Y
#bbZ - bounding box Z
#trX, trY, trZ - count of elements in array
def s_surface(fname, thic, txt, cyc, cut, fac, rep, bbX, bbY, bbZ, trX, trY, trZ ):
bb = [[(bbX/2, 0, 0), (1,0,0), True, False],
[(-1*bbX/2, 0, 0), (1,0,0), False, True],
[(0, bbY/2, 0), (0,1,0), True, False],
[(0,-1*bbY/2, 0), (0,1,0), False, True],
[(0, 0, bbZ/2), (0,0,1), True, False],
[(0, 0, -1*bbZ/2), (0,0,1), False, True]
]
tr = [trX, trY, trZ]
bpy.ops.import_mesh.stl(filepath=fname)
ob_new = bpy.context.selected_objects[0]
bpy.context.scene.objects.active = ob_new
bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.normals_make_consistent(inside=False)
bpy.ops.mesh.remove_doubles(threshold=0.02)
for i in range(cyc):
bpy.ops.mesh.subdivide(number_cuts=cut)
bpy.ops.mesh.vertices_smooth(factor=fac, repeat=rep, xaxis=True, yaxis=True, zaxis=True)
bpy.ops.mesh.normals_make_consistent(inside=False)
for i in range(len(bb)):
bpy.ops.mesh.bisect(plane_co=bb[i][0],plane_no=bb[i][1], clear_outer=bb[i][2],clear_inner=bb[i][3])
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.normals_make_consistent(inside=False)
bpy.ops.object.mode_set(mode='OBJECT')
for i in range(3):
bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')
bpy.context.object.modifiers["Array"].count = tr[i]
bpy.context.object.modifiers["Array"].relative_offset_displace[0] = 0
bpy.context.object.modifiers["Array"].relative_offset_displace[i] = 1
bpy.context.object.modifiers["Array"].use_merge_vertices = True
bpy.context.object.modifiers["Array"].merge_threshold = 0.01
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Array")
bpy.ops.object.origin_set(type='GEOMETRY_ORIGIN')
bpy.context.object.modifiers["Solidify"].thickness = thic
bpy.context.object.modifiers["Solidify"].use_quality_normals = True
bpy.context.object.modifiers["Solidify"].use_even_offset = True
bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Solidify")
nfname = ""
nfname = fname[0:-4] + ".stl"
bpy.ops.export_mesh.stl(filepath=nfname, ascii = txt)

Surfaces I am trying to smooth are supposed to be triply periodic minimal surfaces, so it means that after smoothing is applied mean curvature is meant to be 0 in all vertexes of a mesh. How can I calculate mean curvature to check if smoothing is done right?

• If the code is not relevant, he could simply strip it from the question. – Leander Aug 1 at 13:17
• Sounds like you're looking for an algorithm, in which case you may be better off asking on math.se or computergraphics.se. As far as I know Blender doesn't come with any tool which does what you're looking for. – gandalf3 Aug 1 at 22:09
• @gandalf3 Thank you! This sounds like a reasonable method: computergraphics.stackexchange.com/questions/1718/… – Robert Roth Aug 2 at 7:00
• As with all things "bad" is probably not the most correct description, there are cases where you want to use bpy.ops. Most coders write blender scripts without bpy.ops, since it is slower, context-sensitive and more difficult to read. This answer provides some generalized explanation. Every bpy.ops triggers a scene update. – Leander Aug 2 at 7:29
• It seems that you have found a solution already. Please add it as an answer instead of into the question. It is not uncommon to answer your own question once you have found your solution. Adding it as an answer makes it easier for others to find it and enables them to upvote it. – Leander Aug 2 at 10:32

This is an answer based on this Computer Graphics SE indicated in the comments (the one by Nathan Reed).

The math is described in this answer, but in short the curvature is calculated by vertex so:

• Get all edges from this vertex
• And for each edge compare the projection along the edge of the normals at it extremities
• Take the mean of all that

Now, as didn't want to just code a copy of it, I propose a little enhancement:

The calculation is also vertex centered, but we go along each of its surrounding face (need to be triangulated), to calculate a curvature weighted by the angle of this face at the vertex we are calculating around.

Once the sum done over all faces, we mean this sum by the total angle around the vertex.

Making so, the curvature of a large angle will be more important than for a small angle. This is like taking the integral of the curvatures around the vertex.

I think this may be close to the theoretical calculus as it consist of taking the curvature for each cutting plane turning around the vertex normal.

In both algorithms, the base calculus is the same and this corresponds to the CGSE answer:

def curvature_along_edge( vert, other ):
normal_diff = other.normal - vert.normal
vert_diff = other.co - vert.co
return normal_diff.dot( vert_diff ) / vert_diff.length_squared

But in the case we want to use angles, we need to organize a surrounding loop (ring) over the vertex for which we want the curvature, to have the several angles with the good signs.

For instance here:

We want the ring/loop:

• For vertex 0: 5, 8, 4
• For vertex 8: 1, 6, 3, 7, 2, 4, 0, 5, (1)

etc.

These loops are counterclockwise, as vertices of Blender's polygons are.

This is done by:

# Get vertices in the face order but starting from a given vert
def following_verts_of_vert( vert, face ):
i0 = index_of( vert, face.verts )
i1 = (i0 + 1) % 3
i2 = (i0 + 2) % 3
return face.verts[i0], face.verts[i1], face.verts[i2]

# Create the oriented ring around vert
def ring_from_vert( vert ):
vertices = []
i0, i1, i2 = following_verts_of_vert( vert, face )
vertices.append( [i1, i2] )
result = vertices[0]
prev = search_link( result[0], vertices, 1 )
if prev:
result = [prev[0]] + result
vertices.remove( prev )
next = search_link( result[-1], vertices, 0 )
if next and next[1] not in result:
result.append( next[1] )
vertices.remove( next )
return result

(this code above is not really needed, or could be optimized, but was my first though to have a constant orientation reference for the curvature)

So that finally, the mean curvature around a vertex is calculated by:

def angle_between_edges( vert, other1, other2 ):
edge1 = other1.co - vert.co
edge2 = other2.co - vert.co
product = edge1.cross( edge2 )
sinus = product.length / (edge1.length * edge2.length)
return asin( min(1.0, sinus) )

def mean_curvature_vert( vert ):
ring = ring_from_vert( vert )
ring_curvatures = [curvature_along_edge( vert, other ) for other in ring]
total_angle = 0.0
curvature = 0.0
for i in range(len(ring)-1):
angle = angle_between_edges( vert, ring[i], ring[i+1] )
total_angle += angle
curvature += angle * (ring_curvatures[i] + ring_curvatures[i+1])

return curvature / (2.0 * total_angle)

Here is the compared results:

They are close, but the comparison I've used needs some explanation: the resulting curvatures are normalized so that they fit to the interval for vertex groups [0, 1]:

In short, this vertex group assignment compares the contrasts but not the values.

This is done so:

def assign_to_vertex_group( obj, group_name, curvatures ):
vertex_group = ensure_vertex_group( obj, group_name )

curvatures = [abs(c) for c in curvatures]

min_curvature = min( curvatures )
max_curvature = max( curvatures )
vg_fac = 1.0 / (max_curvature - min_curvature) if max_curvature != min_curvature else 1.0

for i, vert in enumerate( obj.data.vertices ):
vertex_group.add( [vert.index], (curvatures[i] - min_curvature) * vg_fac, 'REPLACE' )

Here is the blend file with the 2 scripts named : cgseSimple and cgseSimple2.

Note:

Also included Mike's implementation (mike text) + the same rewritten a bit (mikesPaper), for understanding and comparison purpose. But from all that, it is hard to know what is the more accurate (how to determinate which is true?). I was not able to understand how this algo is able to determinate curvature orientation (convex vs. concave inclinations).

Also tested all that on big meshes (not included due to the blend file size limit). But that accentuate the diff between the different approaches.

• Thank you @lemon! :) I will try it out tomorrow! – Robert Roth Aug 4 at 16:41
• @RobertRoth, you're welcome. Do you have meshes with known curvatures for testing? – lemon Aug 4 at 17:32
• Your code works extremely well! It is also very fast! You might want to post a comment on CG-SE with a link to your answer, as i'm certain that they will also like it! Here are some surfaces with known curvatures: imgur.com/a/UYxGIoP – Robert Roth Aug 5 at 15:14
• @RobertRoth, thanks. Could be optimized a bit (a part is unnecessary, that's indicated in the answer). Thank you for the image. Will try to check that when possible. For CGSE... maybe will ask them if this 'angle' is of some mean in their opinion... (I think all that is really dependent of the accuracy we need to have). – lemon Aug 5 at 15:43
• Excellent answer and extremely useful code, thank you @lemon – nantille Oct 12 at 15:26

So I found an article on computing curvatures of triangular meshes.

And wrote this piece:

import bpy
import math
import mathutils

def create_pairs(k):
tr = []
bpy.ops.object.mode_set(mode='OBJECT')
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_mode(type="VERT")
bpy.ops.mesh.select_all(action='DESELECT')
bpy.ops.object.mode_set(mode='OBJECT')
obj.data.vertices[k].select = True
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_more()
bpy.ops.object.mode_set(mode='OBJECT')
polys = [i.index for i in bpy.context.active_object.data.polygons if i.select]

polys2 =[]
for i in polys:
tr = [obj.data.polygons[i].vertices[0],
obj.data.polygons[i].vertices[1],
obj.data.polygons[i].vertices[2]]
tr.insert(0,tr.pop(tr.index(k)))
polys2.append(tr)
triang = []
tr = []
for i in range(len(polys2)):
for j in range(len(polys2)):
if len(set(polys2[i])&set(polys2[j])) == 2 and i != j:
if  i not in triang:
triang.append(i)
triang.append(j)
tr.append([polys2[i], polys2[j]])
return tr

def cot(pair):
obj = bpy.context.active_object
p = list(set(pair[0]) & set(pair[1]))
ab = list(set(pair[0]) - set(pair[1])) + list(set(pair[1]) - set(pair[0]))
vec_a1 = obj.data.vertices[p[0]].co - obj.data.vertices[ab[0]].co
vec_a2 = obj.data.vertices[ab[0]].co - obj.data.vertices[p[1]].co
vec_b1 = obj.data.vertices[p[0]].co - obj.data.vertices[ab[1]].co
vec_b2 = obj.data.vertices[ab[1]].co - obj.data.vertices[p[1]].co
cos_a = (vec_a1.x * vec_a2.x + vec_a1.y * vec_a2.y + vec_a1.z * vec_a2.z)/(math.sqrt(vec_a1.x**2 + vec_a1.y**2 + vec_a1.z**2)* math.sqrt(vec_a2.x**2 + vec_a2.y**2 + vec_a2.z**2))
cos_b = (vec_b1.x * vec_b2.x + vec_b1.y * vec_b2.y + vec_b1.z * vec_b2.z)/(math.sqrt(vec_b1.x**2 + vec_b1.y**2 + vec_b1.z**2)* math.sqrt(vec_b2.x**2 + vec_b2.y**2 + vec_b2.z**2))
alpha = cos_a/(math.sqrt(1-cos_a**2))
beta = cos_b/(math.sqrt(1-cos_b**2))
return alpha + beta

def sq_norm(pair):
obj = bpy.context.active_object
p = list(set(pair[0]) & set(pair[1]))
return (obj.matrix_world * (obj.data.vertices[p[0]].co - obj.data.vertices[p[1]].co)).length**2

def com_edge(pair):
obj = bpy.context.active_object
p = list(set(pair[0]) & set(pair[1]))
return (obj.matrix_world * (obj.data.vertices[p[0]].co - obj.data.vertices[p[1]].co))

def v_area(ring):
v_a = 0
for i in range(len(ring)):
v_a = v_a + cot(ring[i]) * sq_norm(ring[i])
v_a = 0.125*v_a
return v_a

def mean_curvature(k):
ring = create_pairs(k)
v_area(ring)
mean = mathutils.Vector((0,0,0))
for i in range(len(ring)):
mean = mean + cot(ring[i]) * com_edge(ring[i])
mean = 0.5 * (0.5 * v_area(ring) * mean).length
return mean

obj = bpy.context.active_object
for k in range(len(obj.data.vertices)):
print(mean_curvature(k))

Computes mean curvature at each vertex of a mesh, needs tweaking - not working with obtuse triangles, other than that seems to get the job done.

Edit: fixed bugs, beatified code

• Two questions... what is the mean using obj.matrix_world (all is fine if the object is centered to origin, but if not...)? second point but more important: in a mesh like in the question, borders should have a big mean curvature, I think (in the way this algorithm is done), but how are they (border vertices) considered here, I don't see the point? – lemon Aug 2 at 17:42
• The code didn't work for me just yet. I added a small part which sets vertex weights depending on the calculated value but all i get is noise as seen in the picture. imgur.com/a/878bwcH Am i using the code wrongly? This is the code i used with your functions: obj = bpy.context.active_object vg = obj.vertex_groups.new("VertexGroup") for k in range(len(obj.data.vertices)): meanCurvature = mean_curvature(k) print(meanCurvature) bpy.ops.object.mode_set(mode='OBJECT') vg.add([k], meanCurvature/10, "ADD") – Robert Roth Aug 2 at 18:39
• @RobertRoth, the randoms you have are due to 'obj.matrix_world *' which should be removed. No mean here to consider the object transformation matrix (except for scales but?) as we talk about vectors here, not locations. – lemon Aug 3 at 14:21
• @RobertRoth, ok, noticed matrix changes all is the object is not at the center. I've done few experiments and the DMSB_III paper is not so simple (for me). But CGSE answers are more simple and the first one gives coherent results. Mike, all this is nothing against your answer, just try to understand things. – lemon Aug 3 at 17:00
• @RobertRoth I don't understand what causing this noise, and I get the same result: here I am looking for what causing this issue – Mike Aug 3 at 17:13


text:
# Normalizing [data-structures]?

I feel that something should be done about . For instance, this question appears to include the tag just because it uses data structures. Also, we already have many specific tags for data structures (, , , ...), so this one seems to be added to such questions as well.

Are there still legitimate uses for this tag? If so, should we just untag it from open questions (no need to touch closed ones) that aren't specifically about data structures?

• I'm voting to close this tag as too broad. Sep 22 '16 at 1:53
• possibly interesting search Sep 22 '16 at 6:24
• @SimonForsberg: Fortunately, at a glance, not very many of those questions may need a separate tag.
– Jamal Mod
Sep 22 '16 at 13:08
• – Jamal Mod
Sep 22 '16 at 17:32
• 0 post records had empty tags; retagged to [untagged] Great job. Sep 29 '16 at 20:28

I agree with abolishing .

The tag can currently be used in three ways:

1. Redundantly along with some other tag, such as or . I think that in these cases, adds no value.
2. When the problem to be solved calls for some efficient data structure, but the author is unsure what kind of data structure to use. In these cases, would already cover the issue.
3. When the question is about an implementation of a data structure for which we do not already have a tag (such as a union-find data structure, a skip list, a Fenwick tree, etc.).

I think we should create specific tags for the more unusual data structures, then burninate .

• Agreed. I'll also look through Simon's search query (minus closed questions) and tag as needed. There were already some locked questions (which are somehow immune to Trogdor's powers), and I've already taken care of them.
– Jamal Mod
Sep 22 '16 at 16:38


text:
## Chemistry 9th Edition

Given the reaction, we see that the photosynthesis process takes $CO_2$, a greenhouse gas, and converts it into $O_2$. Therefore, the cutting down of forests, therefore, limits this process and the amount of $CO_2$ which can be converted into $O_2$. As a result, the cutting down of forests exacerbates the greenhouse effect by allowing less $CO_2$ to be converted into $O_2$.


text:
Web Results

## Eigenvalues and eigenvectors - Wikipedia

en.wikipedia.org/wiki/Eigenvalues_and_eigenvectors

In linear algebra, an eigenvector or characteristic vector of a linear transformation is a non-zero vector that does not change its direction when that linear ...

## Eigenvalue -- from Wolfram MathWorld

mathworld.wolfram.com/Eigenvalue.html

Eigenvalues are a special set of scalars associated with a linear system of equations (i.e., a matrix equation) that are sometimes also known as characteristic ...

## Eigenvectors and Eigenvalues explained visually

setosa.io/ev/eigenvectors-and-eigenvalues/

Eigenvalues/vectors are instrumental to understanding electrical circuits, mechanical systems, ecology and even Google's PageRank algorithm. Let's see if ...

## Computation of Eigenvalues - SOS Math

www.sosmath.com/matrix/eigen1/eigen1.html

This is a linear system for which the matrix coefficient is $A - \lambda I_n$ . We also know that this system has one solution if and only if the matrix coefficient is ...

## Eigenvalues and Eigenvectors - HMC Calculus Tutorial

www.math.hmc.edu/calculus/tutorials/eigenstuff/

We review here the basics of computing eigenvalues and eigenvectors. Eigenvalues and eigenvectors play a prominent role in the study of ordinary differential ...

## Differential Equations - Review : Eigenvalues & Eigenvectors

tutorial.math.lamar.edu/Classes/DE/LA_Eigen.aspx

I apologize for the site being down yesterday (October 26) and today (October 27 ). There was a network issue here that caused the site to only be accessible ...

## Eigenvalues and Eigenvectors - Swarthmore College

lpsa.swarthmore.edu/MtrxVibe/EigMat/MatrixEigen.html

Also, this page typically only deals with the most general cases, there are likely to be special cases (for example, non-unique eigenvalues) that aren't covered at ...

Aug 16, 2012 ... Help me by being a mathematical patron! https://www.patreon.com/patrickjmt?ty= c Part 2: Finding Eigenvalues and Eigenvectors: ...

## Eigen: Eigenvalues module

eigen.tuxfamily.org/dox/group__Eigenvalues__Module.html

Detailed Description. This module mainly provides various eigenvalue solvers. ... Computes eigenvalues and eigenvectors of general complex matrices. More.

## Eigen: EigenSolver< _MatrixType > Class Template Reference

eigen.tuxfamily.org/dox/classEigen_1_1EigenSolver.html

The eigenvalues and eigenvectors of a matrix $A$ are scalars $\lambda$ and vectors $v$ such that $Av = \lambda v$ . If $D$ is a diagonal matrix with the ...

### Introduction to eigenvalues and eigenvectors | Eigen-everything ...

What eigenvectors and eigenvalues are and why they are interesting.

### Eigenvalues and Eigenvectors

math.mit.edu

Eigenvalues and Eigenvectors. 6.1 Introduction to Eigenvalues. Linear equations Ax D b come from steady state problems. Eigenvalues have their greatest.

### Eigenvalues and Eigenvectors: An Introduction - SOS Math

www.sosmath.com

The eigenvalue problem is a problem of considerable theoretical interest and wide-ranging application. For example, this problem is crucial in solving systems of ...


text:
The Annals of Statistics

Generalized fiducial inference for normal linear mixed models

Abstract

While linear mixed modeling methods are foundational concepts introduced in any statistical education, adequate general methods for interval estimation involving models with more than a few variance components are lacking, especially in the unbalanced setting. Generalized fiducial inference provides a possible framework that accommodates this absence of methodology. Under the fabric of generalized fiducial inference along with sequential Monte Carlo methods, we present an approach for interval estimation for both balanced and unbalanced Gaussian linear mixed models. We compare the proposed method to classical and Bayesian results in the literature in a simulation study of two-fold nested models and two-factor crossed designs with an interaction term. The proposed method is found to be competitive or better when evaluated based on frequentist criteria of empirical coverage and average length of confidence intervals for small sample sizes. A MATLAB implementation of the proposed algorithm is available from the authors.

Article information

Source
Ann. Statist., Volume 40, Number 4 (2012), 2102-2127.

Dates
First available in Project Euclid: 30 October 2012

https://projecteuclid.org/euclid.aos/1351602538

Digital Object Identifier
doi:10.1214/12-AOS1030

Mathematical Reviews number (MathSciNet)
MR3059078

Zentralblatt MATH identifier
1257.62075

Citation

Cisewski, Jessi; Hannig, Jan. Generalized fiducial inference for normal linear mixed models. Ann. Statist. 40 (2012), no. 4, 2102--2127. doi:10.1214/12-AOS1030. https://projecteuclid.org/euclid.aos/1351602538

References

• Burch, B. D. (2011). Assessing the performance of normal-based and REML-based confidence intervals for the intraclass correlation coefficient. Comput. Statist. Data Anal. 55 1018–1028.
• Burch, B. D. and Iyer, H. K. (1997). Exact confidence intervals for a variance ratio (or heritability) in a mixed linear model. Biometrics 53 1318–1333.
• Burdick, R. K. and Graybill, F. A. (1992). Confidence Intervals on Variance Components. Statistics: Textbooks and Monographs 127. Dekker, New York.
• Casella, G. and Berger, R. L. (2002). Statistical Inference, 2nd ed. Wadsworth and Brooks/Cole Advanced Books and Software, Pacific Grove, CA.
• Chopin, N. (2002). A sequential particle filter method for static models. Biometrika 89 539–551.
• Chopin, N. (2004). Central limit theorem for sequential Monte Carlo methods and its application to Bayesian inference. Ann. Statist. 32 2385–2411.
• Cisewski, J. and Hannig, J. (2012). Supplement to “Generalized fiducial inference for normal linear mixed models.” DOI:10.1214/12-AOS1030SUPP.
• Del Moral, P., Doucet, A. and Jasra, A. (2006). Sequential Monte Carlo samplers. J. R. Stat. Soc. Ser. B Stat. Methodol. 68 411–436.
• Diaconis, P. and Freedman, D. (1986a). On inconsistent Bayes estimates of location. Ann. Statist. 14 68–87.
• Diaconis, P. and Freedman, D. (1986b). On the consistency of Bayes estimates (with discussion). Ann. Statist. 14 1–67.
• Douc, R., Cappé, O. and Moulines, E. (2005). Comparison of resampling schemes for particle filtering. In 4th International Symposium on Image and Signal Processing and Analysis 64–69.
• Douc, R. and Moulines, E. (2008). Limit theorems for weighted samples with applications to sequential Monte Carlo methods. Ann. Statist. 36 2344–2376.
• Doucet, A., de Freitas, N. and Gordon, N., eds. (2001). Sequential Monte Carlo Methods in Practice. Springer, New York.
• E, L., Hannig, J. and Iyer, H. (2008). Fiducial intervals for variance components in an unbalanced two-component normal mixed linear model. J. Amer. Statist. Assoc. 103 854–865.
• Elster, C. (2000). Evaluation of measurement uncertainty in the presence of combined random and analogue-to-digital conversion errors. Measurement Science and Technology 11 1359–1363.
• Fisher, R. A. (1930). Inverse probability. Math. Proc. Cambridge Philos. Soc. xxvi 528–535.
• Fisher, R. A. (1933). The concepts of inverse probability and fiducial probability referring to unknown parameters. Proc. R. Soc. Lond. Ser. A 139 343–348.
• Fisher, R. A. (1935). The fiducial argument in statistical inference. Annals of Eugenics VI 91–98.
• Fraser, D. A. S. (1961a). The fiducial method and invariance. Biometrika 48 261–280.
• Fraser, D. A. S. (1961b). On fiducial inference. Ann. Math. Statist. 32 661–676.
• Fraser, D. A. S. (1966). Structural probability and a generalization. Biometrika 53 1–9.
• Fraser, D. A. S. (1968). The Structure of Inference. Wiley, New York.
• Frenkel, R. B. and Kirkup, L. (2005). Monte Carlo-based estimation of uncertainty owing to limited resolution of digital instruments. Metrologia 42 L27–L30.
• Gelman, A. (2006). Prior distributions for variance parameters in hierarchical models (comment on article by Browne and Draper). Bayesian Anal. 1 515–533 (electronic).
• Gelman, A., Carlin, J. B., Stern, H. S. and Rubin, D. B. (2004). Bayesian Data Analysis, 2nd ed. Chapman & Hall/CRC, Boca Raton, FL.
• Ghosal, S., Ghosh, J. K. and van der Vaart, A. W. (2000). Convergence rates of posterior distributions. Ann. Statist. 28 500–531.
• GUM (1995). Guide to the Expression of Uncertainty in Measurement. International Organization for Standardization (ISO), Geneva, Switzerland.
• Hannig, J. (2009). On generalized fiducial inference. Statist. Sinica 19 491–544.
• Hannig, J. (2012). Generalized fiducial inference via discretizations. Statist. Sinica. To appear.
• Hannig, J., Iyer, H. and Patterson, P. (2006). Fiducial generalized confidence intervals. J. Amer. Statist. Assoc. 101 254–269.
• Hannig, J., Iyer, H. K. and Wang, J. C. M. (2007). Fiducial approach to uncertainty assessment: Accounting for error due to instrument resolution. Metrologia 44 476–483.
• Hannig, J. and Lee, T. C. M. (2009). Generalized fiducial inference for wavelet regression. Biometrika 96 847–860.
• Hartley, H. O. and Rao, J. N. K. (1967). Maximum-likelihood estimation for the mixed analysis of variance model. Biometrika 54 93–108.
• Hernandez, R. P., Burdick, R. K. and Birch, N. J. (1992). Confidence intervals and tests of hypotheses on variance components in an unbalanced two-fold nested design. Biom. J. 34 387–402.
• Hernandez, R. P. and Burdick, R. K. (1993). Confidence intervals and tests of hypotheses on variance components in an unbalanced two-factor crossed design with interactions. J. Stat. Comput. Simul. 47 67–77.
• Jasra, A., Stephens, D. A. and Holmes, C. C. (2007). On population-based simulation for static inference. Stat. Comput. 17 263–279.
• Jeyaratnam, S. and Graybill, F. A. (1980). Confidence intervals on variance components in three-factor cross-classification models. Technometrics 22 375–380.
• Jiang, J. (2007). Linear and Generalized Linear Mixed Models and Their Applications. Springer, New York.
• Khuri, A. I. (1987). Measures of imbalance for unbalanced models. Biom. J. 29 383–396.
• Khuri, A. I. and Sahai, H. (1985). Variance components analysis: A selective literature survey. Internat. Statist. Rev. 53 279–300.
• Kong, A., Liu, J. S. and Wong, W. H. (1994). Sequential imputations and Bayesian missing data problems. J. Amer. Statist. Assoc. 89 278–288.
• Laird, N. M. and Ware, J. H. (1982). Random-effects models for longitudinal data. Biometrics 38 963–974.
• Le Cam, L. (1986). Asymptotic Methods in Statistical Decision Theory. Springer, New York.
• Lee, Y. and Nelder, J. A. (1996). Hierarchical generalized linear models. J. R. Stat. Soc. Ser. B Stat. Methodol. 58 619–678.
• Lee, Y., Nelder, J. A. and Pawitan, Y. (2006). Generalized Linear Models with Random Effects: Unified Analysis via $H$-Likelihood. Monographs on Statistics and Applied Probability 106. Chapman & Hall/CRC, Boca Raton, FL.
• Lindley, D. V. (1958). Fiducial distributions and Bayes’ theorem. J. R. Stat. Soc. Ser. B Stat. Methodol. 20 102–107.
• Lira, I. H. and Woger, W. (1997). The evaluation of standard uncertainty in the presence of limited resolution of indicating devices. Measurement Science and Technology 8 441–443.
• Liu, J. S. and Chen, R. (1995). Blind deconvolution via sequential imputations. J. Amer. Statist. Assoc. 90 567–576.
• Liu, J. S. and Chen, R. (1998). Sequential Monte Carlo methods for dynamic systems. J. Amer. Statist. Assoc. 93 1032–1044.
• Liu, J. and West, M. (2001). Combined parameter and state estimation in simulation-based filtering. In Sequential Monte Carlo Methods in Practice 197–223. Springer, New York.
• Mossman, D. and Berger, J. O. (2001). Intervals for posttest probabilities: A comparison of 5 methods. Medical Decision Making 21 498–507.
• O’Connell, A. A. and McCoach, D. B., eds. (2008). Multilevel Modeling of Educational Data. Information Age Publishing, Charlotte, NC.
• Schweder, T. and Hjort, N. L. (2002). Confidence and likelihood. Scand. J. Stat. 29 309–332.
• Searle, S. R., Casella, G. and McCulloch, C. E. (1992). Variance Components. Wiley, New York.
• Taraldsen, G. (2006). Instrument resolution and measurement accuracy. Metrologia 43 539–544.
• Ting, N., Burdick, R. K., Graybill, F. A., Jeyaratnam, S. and Lu, T.-F. C. (1990). Confidence intervals on linear combinations of variance components that are unrestricted in sign. J. Stat. Comput. Simul. 35 135–143.
• Tsui, K.-W. and Weerahandi, S. (1989). Generalized $p$-values in significance testing of hypotheses in the presence of nuisance parameters. J. Amer. Statist. Assoc. 84 602–607.
• van der Vaart, A. W. (2007). Asympotitc Statistics. Statististical and Probabilistic Mathematics 8. Cambridge Univ. Press, New York.
• Wandler, D. V. and Hannig, J. (2012). Generalized fiducial confidence intervals for extremes. Extremes 15 67–87.
• Weerahandi, S. (1993). Generalized confidence intervals. J. Amer. Statist. Assoc. 88 899–905.
• Willink, R. (2007). On the uncertainty of the mean of digitized measurements. Metrologia 44 73–81.
• Wolfinger, R. D. and Kass, R. E. (2000). Nonconjugate Bayesian analysis of variance component models. Biometrics 56 768–774.
• Xie, M., Singh, K. and Strawderman, W. E. (2011). Confidence distributions and a unifying framework for meta-analysis. J. Amer. Statist. Assoc. 106 320–333.
• Zabell, S. L. (1992). R. A. Fisher and the fiducial argument. Statist. Sci. 7 369–387.

Supplemental materials

• Supplementary material: Additional simulation results. The asymptotic stability of the algorithm, with respect to the sample size and the particle sample size, was tested, and the simulation results are included in this document. The raw results for the simulation study in Section 3 are also displayed, along with additional summary figures.