Hover on the topic to find the sentiment attached to it.
Negative(0) <-----> Positive (1)
% of correlation value among topics required to be clustered into the same cluster
Topics in the same cluster are assign with the same color:
Minimum % of sentences about an aspect required to display the
associated node.
Aspect correlation required to display the associated link.
Double click a node to see the most similar words.
Double click a node to see the most similar
sentences.
Change the center location of the graph.
Change the link length.


class: center, middle .title[Meet a Data Scientist Lecture Series: An Ocean of Data] .author[Shane Elipot] .institution[The Rosenstiel School of Marine and Atmospheric Science, University of Miami] .coauthor[] .institution[] .date[] .note[] .footnote[Created with [{Remark.js}](http://remarkjs.com/) using [{Markdown}](https://daringfireball.net/projects/markdown/) + [{MathJax}](https://www.mathjax.org/)] --- name: foreword class: left, .toc[[✧](#toc)] ## Foreword **Statistics** (*noun, plural in form but singular or plural in construction*) 1. *Merriam-Webster*: a branch of mathematics dealing with the collection, analysis, interpretation, and presentation of masses of numerical data -- 2. *Oxford dictionnary of English*: > a. the practice or science of collecting and analysing numerical data in large quantities, especially for the purpose of inferring proportions in a whole from those in a representative sample. > b. a collection of quantitative data (e.g. *The statistics of the data are unknown*.) -- **Statistic** (*noun*) a single term or datum in a collection of statistics (e.g. *The mean of the data is zero*.) --- name: references class: left, .toc[[✧](#toc)] ## References [1] Bendat, J. S., & Piersol, A. G. (2011). *Random data: analysis and measurement procedures* (Vol. 729). John Wiley & Sons. [2] Thomson, R. E., & Emery, W. J. (2014). *Data analysis methods in physical oceanography*. Newnes. [dx.doi.org/10.1016/B978-0-12-387782-6.00003-X](http://dx.doi.org/10.1016/B978-0-12-387782-6.00003-X) [3] Taylor, J. (1997). *Introduction to error analysis, the study of uncertainties in physical measurements*. [4] Press, W. H. et al. (2007). *Numerical recipes 3rd edition: The art of scientific computing*. Cambridge university press. [5] Kanji, G. K. (2006). *100 statistical tests*. Sage. [6] von Storch, H. and Zwiers, F. W. (1999). *Statistical Analysis in Climate Research*, Cambridge University Press --- class: left, .toc[[✧](#toc)] ## Foreword A quote from *Data Analysis Methods in Physical Oceanography*, Thompson and Emery, Third Edition, 2014: "Statistical methods are essential to determining the value of the data and to decide how much of it can be considered useful for the intended analysis. This statistical approach arises from the fundamental complexity of the ocean, a **multivariate** system with many **degrees of freedom** in which nonlinear dynamics and **sampling** limitations make it difficult to separate scales of **variability**." What do **multivariate**, **degrees of freedom**, **sampling**, and **variability** mean in this context? --- name: toc class: left, .toc[[✧](#toc)] # Lecture 1: Outline 1. [Introduction](#introduction) 1. [Estimation vs Truth](#estimation) 2. [Fundamental Statistics](#fundamentals) 3. [Common Distributions](#distributions) 4. [Errors, Uncertainties, and hypothesis testing](#errors) 5. [Extra slides](#extra) --- name: introduction class: center, middle, .toc[[✧](#toc)] # 1. Introduction --- class: left, .toc[[✧](#toc)] ## Introduction In oceanography and atmospheric science, we have at our disposal a number of physical theories, that is equations, that describe the spatial and temporal variability of the climate system. -- Specifically, in geophysical fluid dynamics, the Navier-Stokes equations describe the motion of a fluid in 2D or 3D. Yet, we do not know if these equations have reasonable physical solutions (If you figure this out, there's a $1M prize from the [Clay Mathematics Institute](http://www.claymath.org/millennium-problems/navier–stokes-equation)). Assuming that they do, then the ocean, as an example, can be seen as being a *deterministic system*, which means that mathematical expressions can be used to describe completely the velocity and pressure field (e.g. `$p(\mathbf{x},t) = p_0 \cos(\omega t - \mathbf{k} \cdot \mathbf{x})$`). -- Yet, even if we do not know the analytical solutions, we can discretize the equations within a computer models to obtain approximate solutions describing the flow deterministically ... (in theory). --- class: left, .toc[[✧](#toc)] ## Introduction A deterministic approach is not realistic because of three commonly acknowledged reasons. The ocean and the atmosphere are *complex*, *nonlinear*, and *unpredictable*. -- As an example, there is an estimated $4.7 \times 10^{46}$ water molecules in the ocean (that's complexity) so that there are too many variables, and too many initial and boundary conditions to be specified, (jointly forming the number of *degrees of freedom* of the system) in order to solve all equations numerically in a computer model. Because many variables cannot be observed, or are unspecified at the start of a simulation, outcomes will appear *random* to the observer (that's *unpredictability*). -- Finally, ocean and atmosphere are *nonlinear* which means that you cannot really find a portion of the system (e.g. surface gravity waves) with a finite number of *degrees of freedom* whose evolution is isolated and can be made deterministic. Unknown perturbations will render the observations to contain randomness, or *noise*. --- class: left, .toc[[✧](#toc)] ## Introduction Once we accept that the climate is not a purely deterministic system, but contain *randomness*, we can rely on a suite of tools especially applicable to *stochastic systems or processes*. * * * **stochastic** (*adjective, technical*) having a random probability distribution or pattern that may be analysed statistically but may not be predicted precisely. * * * As a consequence, in the rest of this lecture, we will often discuss *random variables* (hereafter r.v.), that is variables to which statistical theory can be applied. In addition, we will take the approach that our system, or that our observational data, can be separated into *signal* plus *noise*. As an example, estimation of the seasonal cycle of ocean temperature (the sought after signal) is disturbed by changes due to ocean currents, but also changes due to the imperfections of your temperature sensors, etc. --- name: estimation class: center, middle, .toc[[✧](#toc)] # 2. Estimation vs truth --- class: left, .toc[[✧](#toc)] ## Estimation vs truth We are in the business of *estimation*: we try to describe and/or understand the climate system by estimating the value of a *random variable*. This r.v. may be a physical variable such as air temperature, water vapor, sea ice area, sea surface temperature, sea level, snow cover, glacier volume, CO$_2$ concentration, etc. -- Or it may be a variable derived from one or several other r.v., in essence a *parameter*. This parameter is itself a r.v. As an example ocean heat content, the daily mean temperature, the decadal temperature trend, the acoustic travel time in water, the amplitude of the seasonal cyle of temperature, the adiabatic lapse rate, the power spectral density function of velocity, the precipitation rate, etc. -- The distinction between variable and parameter is maybe semantic. In any case, let's call `$\phi$` a r.v. of interest. --- class: left, .toc[[✧](#toc)] ## Estimation vs truth Unfortunatelly, it is likely that we will never know $\phi$ exactly, but only access an *estimate* that we will note `$\widehat{\phi}$` ($\phi$ "hat"). This estimate means we use a given method or a given instrument to measure or calculate $\phi$. -- As an example, we want to know the temperature of the room. We can: 1. use one temperature sensor at one fixed location (in the middle of the room), repeatedly through time, $N$ times. 2. use $N$ temperature sensors, once. 3. use one temperature sensor, used repeatedly $N$ times, each time in a different corner of the room 4. etc. Each one of these methods leads to one estimate of "the temperature of the room". --- class: left, .toc[[✧](#toc)] ## Expectation of an estimate Let's assume that we design an experiment and obtain `$\widehat{\phi}$`, repeatedly `$N$` times. The *expectation* value of `$\widehat{\phi}$`, denoted `$E[\widehat{\phi}]$`, is `$$ E[\widehat{\phi}] = \lim_{N\to\infty} \frac{1}{N} \sum_{n=0}^N \widehat{\phi}_n $$` where `$\widehat{\phi}_n$` is the estimate from the `$n$`-th experiment. Unfortunatelly, since we must have `$N \rightarrow \infty$`, the expectation cannot be known. -- However, if we can reasonably make some assumptions about the statistics of the r.v. itself, and/or if we know the specifications of our instruments, then we can sometimes derive the expectation of our estimator. -- **Why is this important?** -- **To assess how good our estimate is.** --- name: bias class: left, .toc[[✧](#toc)] ## Expectation of an estimate Let's assume that we have access to the expectation $E[\widehat{\phi}]$ of an estimator $\widehat{\phi}$ of the r.v. ${\phi}$. -- If we are lucky, `$E[\widehat{\phi}] = \phi$`, and the estimator `$\widehat{\phi}$` is said to be *unbiased*. -- Otherwise, it is said to be *biased* and we define *the bias of the estimator*: `$$ b[\widehat{\phi}] = E[\widehat{\phi}] - \phi, $$` which constitutes a *systematic error* of the estimate. -- In addition, the value of the estimator will change from one experiment to the next, so we define the *variance* of the estimator, denoted $\text{Var}[\widehat{\phi}]$, as `$$ \text{Var}[\widehat{\phi}] = E[(\widehat{\phi}-E[\widehat{\phi}])^2], $$` which constitutes the *random error* of the estimate. --- name: MSE class: left, .toc[[✧](#toc)] ## Expectation of an estimate The bias and the variance of the estimator contributes both to its *total error*, which can be assessed by the *mean square error* (MSE): `$$ \begin{eqnarray} MSE[\widehat{\phi}] = E[(\widehat{\phi} - \phi)^2] = \text{Var}[\widehat{\phi}] + (b[\widehat{\phi}])^2,\cr \end{eqnarray} $$` usually reported as the *root mean square error*: `$$ RMS = \sqrt{MSE[\widehat{\phi}]}= \sqrt{\text{Var}[\widehat{\phi}] + (b[\widehat{\phi}])^2}$$` Another sometimes useful quantity is the *normalized rms error*: `$$ \varepsilon[\phi] = \frac{\sqrt{E[(\widehat{\phi} - \phi)^2]}}{\phi} \quad \text{for} \quad \phi \neq 0,$$` which is unitless and can be reported as a percentage. --- class: left, .toc[[✧](#toc)] ### Estimation vs truth From the International Organization for Standardization (ISO) publication [5725-1:1994](https://www.iso.org/obp/ui/#iso:std:iso:5725:-1:ed-1:v1:en) *Accuracy (trueness and precision) of measurement methods and results — Part 1: General principles and definitions* Introduction 0.1 ISO 5725 uses two terms "trueness" and "precision" to describe the accuracy of a measurement method. "Trueness" refers to the closeness of agreement between the arithmetic mean of a large number of test results and the true or accepted reference value. "Precision" refers to the closeness of agreement between test results.
--- name: 911specs class: left, .toc[[✧](#toc)] ###Example .center[Specification sheets of Seabird 911 CTD Plus sensors:
] -- An interpretation is that the accuracy is the total error, or $RMS$ error which is originally only the random error. The stability implies that the bias, originally zero, increases with time. --- name: fundamentals class: center, middle, .toc[[✧](#toc)] # 2. Fundamental statistics --- class: left, .toc[[✧](#toc)] ## Fundamental statistics Let's consider a random variable $x$, for which we obtain (that is measure, calculate) values $X_n$, dependent on an index $n$ along a given dimension, or scale (e.g. temperature as a function of time, sea level along a satellite track, oxygen concentration as a function of depth etc). -- Statistical theory often considers r.v. that are continuous, as in $X(t)$. Since we are typically dealing with digital or numerical data that are discrete, we will take a discrete approach in this course, as in $X_n = X(t_n) = X(n\Delta t) $ where $\Delta t$ is the step of the record. Sometimes, we will need to revert to continuous notations when needed; as an example: `$$ \sum^N_{n=0} X_n \Delta t \Longleftrightarrow \int_0^{T} X(t) dt, \quad T=N\Delta t $$` --- class: left, .toc[[✧](#toc)] ## Mean The first statistical quantity to consider is the *true mean, population mean, or expectation* of $x$: `$$ \mu_x \equiv E[X] = \lim_{N\to\infty} \frac{1}{N}\sum_{n=1}^N X_n $$` -- Unfortunatelly, we only have a finite numbers of estimates `$X_n,\, n = 1,\ldots,N$` so we compute the *sample mean* `$$ \overline{X} \equiv \frac{1}{N}\sum_{n=1}^N X_n = \widehat{\mu}_x $$` where the last equality means that the **sample mean is an estimator of the true mean of $x$**. --- class: left, .toc[[✧](#toc)] ## Variance The next statistical quantity of interest is the *variance* of $x$: `$$ \sigma^2_x \equiv E[(X-\mu_x)^2]. $$` $\sigma_x = \sqrt{\sigma^2_x}$ is called the *standard deviation*. -- An estimator of $\sigma^2_x$ is the *sample variance* $s_x^2$: `$$ s_x^2 = \widehat{\sigma}^2_x = \frac{1}{N-1}\sum_{n=1}^N (X_n-\overline{X})^2 = \frac{1}{N-1}\sum_{n=1}^N \left(X_n - \frac{1}{N}\sum_{n=1}^N X_n\right)^2 $$` Note the factor $\frac{1}{N-1}$ instead of $\frac{1}{N}$ in the previous expression; see section 4.1 of reference [[1]](#1) for an explanation. --- class: left, .toc[[✧](#toc)] ## Mean Let's go back to the estimator $\overline{X}$ of $\mu_x$. It is an estimator, so is it biased? How much does it vary? -- The [expectation](#expectation) is an mathematical operator which is *linear*: `$$ E[aX + bY] = a E[X] + b E[Y] $$` -- Let's use this rule for $\overline{X}$: `$$ E[\overline{X}] = E\left[ \frac{1}{N} \sum_{n=1}^N X_n\right] = \frac{1}{N}\sum_{n=1}^N E[X_n] = \frac{1}{N}(N \mu_x) = \mu_x $$` Note that $E[X_n]=\mu_x$ is a definition, valid for all $n$! -- Since $E[\overline{X}] = \mu_x$ then it is said that *$\overline{X}$ is an unbiased estimator of $\mu_x$* (see slide on [bias](#bias)). This means that the more observations of $x$ we obtain, the more accurate the estimation of the mean will be. -- That does not mean that $\overline{X}$ is free of errors ... --- class: left, .toc[[✧](#toc)] ## Mean How much does the sample mean estimator vary? Recall the definition of the [$MSE$](#MSE) of an estimator; for $\overline{X}$ it is `$$ E[(\overline{X}-\mu_x)^2] = \text{Var}[\overline{X}] + (b[\overline{X}])^2 = \text{Var}[\overline{X}] + 0 $$` -- Under some assumption (that the $X_n$ are *independent*), it can be shown (your homework, or section 4.1 of reference [[1]](#references)) that `$$ \text{Var}[\overline{X}] = \frac{\sigma^2_x}{N} = \frac{\text{Var}[X] }{N} $$` The **variance of the mean estimator** is the **true variance** of the data ($\sigma^2_x$) divided by the number of observation ($N$). -- Since we typically do not know the true variance, we substitute for the sample variance to obtain the *standard error of the mean*, or *random error for the mean*: `$$ \text{s.e.}[\overline{X}] \equiv \sqrt{\text{Var}[\overline{X}]} = \sqrt{\frac{\widehat{\sigma}^2_x}{N}} = \frac{s_x}{\sqrt{N}} $$` --- class: left, .toc[[✧](#toc)] ## Mean $\text{s.e.}[\overline{X}]$ is a measure of the uncertainty, or of our capability of estimating the mean value of $x$. -- .left-column[
Example from .cite[Beal, L. M. et al. (2015), *Capturing the Transport Variability of a Western Boundary Jet: Results from the Agulhas Current Time-series experiment (ACT)*, J. Phys. Oceanogr., 45, 1302-1324, [doi:10.1175/JPO-D-14-0119.1](http://dx.doi.org/10.1175/JPO-D-14-0119.1)] ] .right-column[
] --- class: left, .toc[[✧](#toc)] ## Example Agulhas current boundary transport from .cite[ Beal, L. M. and S. Elipot, Broadening not strengthening of the Agulhas Current since the early 1990s, Nature, 540, 570573, [doi:10.1038/nature19853](http://dx.doi.org/10.1038/nature19853)]
--- class: left, .toc[[✧](#toc)] .center[Depending on your data, your point of view, and your interests, the mean and the variance may tell you a lot, or little, about your data.] -- .center[Thus, you may want to look at the *frequency distribution* plot, or *histogram*, which is a count of your data values in a number of discrete intervals.]
--- class: left, .toc[[✧](#toc)] ## Histogram There is no general rule (only recommendations) on how to choose the size of the bins or the number of bins to be used.
--- class: left, .toc[[✧](#toc)] ## Histogram There is no general rule (only recommendations) on how to choose the size of the bins, or the number of bins to be used.
--- class: left, .toc[[✧](#toc)] ## Histogram The frequency of occurences of a given value $x=a$ is quantity derived from $x$ and can be itself estimated. The red line in this plot shows a *kernel estimate* of the histogram (see practical session this afternoon).
--- class: left, .toc[[✧](#toc)] ### Probability function Let's consider the probability, or relative count of occurences, to obtain a value $X$ in the interval `$[x_{k-1},x_k]$`. This defines a *probability function*: `$$ P^*(x_{k-1}\leq X\leq x_k) = P^*_k = \frac{c_k}{N},\quad c_k \text{ count in } [x_{k-1},x_k]$$` .left-column[
] .right-column[
`$$ \sum_{k} P^*_k = 1, \quad k \text{: interval index}$$` But the overall values of $P^*_k$ still depend on the width $\Delta X$ of the bins. See this example with `$\Delta X = 10$ and $\Delta X = 5$`.] --- class: left, .toc[[✧](#toc)] ### PDF and CFD Let's consider instead the discrete *probability density function*, or *PDF*: `$$P(x_{k-1}\leq X\leq x_k) = P_k = \frac{c_k}{N \Delta X}, \quad \Delta X = x_{k}-x_{k-1}$$` -- and the discrete *cumulative (probability) distribution function*, or *CDF*: `$$F(x_k) = P^*(x_0\leq X\leq x_k) = P^*(X\leq x_k) = \sum_{i \leq k} P^*_i$$` -- Since all the values $X$ are contained between `$\min[X]$` and `$\max[X]$`: `$$ \begin{eqnarray} P(\min[X]\leq X\leq \max[X]) &=& 1 \quad \text{or}\quad \sum_{k} P_k \Delta X = \left(\frac{N}{N\Delta X}\right)\Delta X = 1\cr F(\max[X]) &=& 1\cr \end{eqnarray} $$` --- class: left, .toc[[✧](#toc)] ### PDF and CFD The overall values of the PDF and CDF do not depend on the bin width. However, their resolution (or detailed shapes) do. .left-column[
] .right-column[
] --- class: left, .toc[[✧](#toc)] ### PDF and CDF As one reduces the size of the bins, $\Delta X \rightarrow 0$, the *continuous PDF* and *CDF* are approximated: `$$ P(x\leq X \leq x + \Delta X) \longrightarrow p(x) = \frac{d f(x)}{d x} $$` `$$F(x) = P(X\leq x)\Delta X \longrightarrow f(x) = \int_{-\infty}^x p(x')\,dx'$$` with the property `$$ \sum_k P_k \Delta X = 1 \longrightarrow \int_{-\infty}^{+\infty} p(x)\, dx = f(+\infty) - f(-\infty) = 1 - 0 = 1 $$` --- class: left, .toc[[✧](#toc)] ### PDF and statistics We can now give some formal definitions: `$$ \begin{eqnarray} \mu_x &\equiv& \int_{-\infty}^{+\infty} x p(x)\, dx, \quad \sigma^2_x \equiv \int_{-\infty}^{+\infty} (x - \mu_x)^2 p(x)\, dx \cr \mu_n &\equiv& \int_{-\infty}^{+\infty} (x - \mu_x)^n p(x)\, dx \cr \end{eqnarray} $$` The last expression defines `$\mu_n(x)$` the `$n$`-th *central moment* of `$x$`. -- The discrete equivalent is `$$ \mu_n \equiv E[(X-\mu_x)^n] $$` -- The second central moment `$\mu_2$` is the variance, by definition. The mean is the first moment about the origin (`$0$`), that is `$\mu_x = \int_{-\infty}^{+\infty} (x-0) p(x)\, dx$` --- class: left, .toc[[✧](#toc)] ### 3rd moment: skewness The third normalized central moment is called the *skewness*. It describes the tendency for an *asymmetry* between positive excursions and negative excursions of the PDF: `$$ \gamma_x \equiv \frac{\mu_3}{(\mu_2)^{3/2}} = \frac{\mu_3}{(\sigma^2_x)^{3/2}} $$` One (biased) estimator is `$$ \widehat{\gamma}_x \equiv \frac{\frac{1}{N}\sum_{n=1}^N (X_n - \overline{X})^3} {\left[\frac{1}{N}\sum_{n=1}^N (X_n - \overline{X})^2\right]^{3/2}} $$`
--- class: left, .toc[[✧](#toc)] ### 4th moment: kurtosis The fourth normalized central moment is called the *kurtosis*. It describes the *peakedness* (concentration near `${\mu}_x$`), or a tendency for *long tails* (concentration far from `${\mu}_x$`): `$$ \kappa_x \equiv \frac{\mu_4}{(\mu_2)^{2}} = \frac{\mu_4}{(\sigma^2_x)^{2}} $$` One (biased) estimator is `$$ \widehat{\kappa}_x \equiv \frac{\frac{1}{N}\sum_{n=1}^N (X_n - \overline{X})^4} {\left[\frac{1}{N}\sum_{n=1}^N (X_n - \overline{X})^2\right]^{4/2}} $$` Because the kurtosis of a normal, or Gaussian, distribution is equal to `$3$`, often the *excess kurtosis* `$\kappa_x -3$` is considered. .cite[See Moors (1986), “The Meaning of Kurtosis: Darlington Reexamined”.] --- class: left, .toc[[✧](#toc)] ## Illustration of Kurtosis Distributions corresponding to different values of excess kurtosis.
Positive excess kurtosis corresponds to long tails and peakedness. --- class: left, .toc[[✧](#toc)] ### Kurtosis: example .left-column[
] .right-colum[.cite[Hughes et al. (2010) *Identification of jets and mixing barriers from sea level and vorticity measurements using simple statistics*] They used the statistics and PDF of sea level anomalies and derived relative vorticity to show that strong oceanic jets tend to be identified by a zero contour in skewness coinciding with a low value of kurtosis. ] --- class: left, .toc[[✧](#toc)] ## Why is this useful? I think that plotting the histogram of your data, and further estimating in detail its PDF, gives you a holistic, or global view, of the *data population* from which your sample is drawn. Maybe you will find that the estimated PDF of a sample on a given day is different from the estimated PDF on another day ... -- It also allows you to answer questions such as: what is the most probable value of the data? How often do we observe extreme values? etc. -- In addition, the knowledge of your data distribution, and/or a choice of a *model* for your data distribution will allow you to define *confidence intervals* for your estimated parameters, and to proceed to conduct *hypothesis testing* in your research. -- Before looking at this, we need to review the theory of various probability distribution functions. --- class: left, .toc[[✧](#toc)] ## But first an example Animation (#joyplot) by [Gavin Schmidt](https://twitter.com/ClimateOfGavin) showing global temperature distribution in 10-yr windows, see his blog post on [realclimate.org](http://www.realclimate.org/index.php/archives/2017/07/joy-plots-for-climate-change/#more-20524). Data from the [NASA GISS Surface Temperature Analysis (GISTEMP) dataset](https://data.giss.nasa.gov/gistemp/).
--- name: distributions class: center, middle, .toc[[✧](#toc)] # 3. Common Distributions --- name: uniform class: left, .toc[[✧](#toc)] ## The uniform distribution A random variable `$x$` that is *uniformly distributed* between `$x_1$` and `$x_2$` has for PDF: `$$ \begin{eqnarray} p(x) &=& \frac{1}{x_2-x_1},\quad &x_1\leq x \leq x_2\cr &=& 0, &\text{ otherwise}\cr \end{eqnarray} $$` The mean of this distribution is `$(x_1+x_2)/2$` and its standard deviation is `$(x_2-x_1)/(2\sqrt{3})$` .left-column[
] .right-column[ .center[ `$$\mu_x = 0.5,\quad \sigma_x = \frac{2--1}{2\sqrt(3)} = 0.8660$$` ] ```ruby z = rand(1000,1);x1 = -1; x2 = 2; x = (x2-x1)*z + x1; ``` ] --- name: normal class: left, .toc[[✧](#toc)] ## The normal distribution (or Gaussian) A random variable `$x$` that is normally distributed with mean `$\mu_x$` and standard deviation $\sigma_x$ has for PDF: `$$ p(x) = \frac{1}{\sigma_x \sqrt{2\pi}}\exp\left[{-\frac{(x-\mu_x)^2}{2\sigma^2_x}}\right] \equiv \mathcal{N}(\mu_x,\sigma_x) $$` -- If `$x \sim \mathcal{N}(\mu_x,\sigma_x)$` then the variable `${\displaystyle z=\frac{x-\mu_x}{\sigma_x} \sim \mathcal{N}(0,1)}$` Hereafter, `$\sim$` will mean "distributed like". -- In Matlab, the following generates a data vector `$\mathbf{z}$` containing 1000 samples from a r.v. `$\sim \mathcal{N(0,1)}$`, and a data vector `$\mathbf{x}$` from a r.v. `$\sim \mathcal{N(2.1,1.35)}$` ```ruby z = randn(1000,1); x = 1.35*z + 2.1; ``` --- class: left, .toc[[✧](#toc)] ## The normal distribution The red curve is the theoretical normal PDF `$\mathcal{N(2.1,1.35)}$`. The histogram is computed from a sample of size `$N=1000$`. .center[
] --- class: left, .toc[[✧](#toc)] ## The normal distribution The normal distribution is of particular importance because of the *central limit theorem* which asserts roughly that the normal distribution is the result of the sum of a large number of independent random variable acting together. -- To be more specific, let $x_1, x_2,\ldots,x_i,\ldots,x_N$ be $N$ **independent** r.v. with individual means $\mu_i$ and variances $\sigma_i^2$. Now consider the new r.v. `$$ x = a_1 x_1 + a_2 x_2 + \ldots + a_N x_N. $$` The central limit theorem states that, as $N\rightarrow +\infty$, $x$ will be **normally** distributed with mean `$\sum_k a_k \mu_k$` and variance `$\sum_k a^2_k \sigma^2_k$`. In practice, the CLT is used for `$N$` "large". -- In fact, we have already used the central limit theorem ... --- class: left, .toc[[✧](#toc)] ### The normal distribution and the CLT Recall that the sample mean of the record `$X_1,X_2,\ldots,X_N$` is defined as `$$ \overline{X} = \frac{1}{N}\sum_{n=1}^N X_n = \left(\frac{1}{N}\right)X_1 + \left(\frac{1}{N}\right)X_2 + \ldots + \left(\frac{1}{N}\right)X_N $$` Here, `$\overline{X}$` can be seen as a new r.v. which is the sum of individual r.v. (for which we have only one value) with the same population mean `$\mu_x$`, and same population variance `$\sigma^2_x$`. -- Hence, the CLT states that, for `$N$` large enough, `$\overline{X}$` is normally distributed with mean `$\sum_{n=1}^N (1/N)\mu_x = (N/N)\mu_x = \mu_x$` and variance `$\sum_{n=1}^N (1/N)^2\sigma^2_x = (N/N^2)\sigma^2_x = (1/N)\sigma^2_x$`, where this last result was given previously without explanation. --- name: chi2 class: left, .toc[[✧](#toc)] ## The `$\chi^2_n$` distribution Let `$z_1,z_2,\ldots,z_n$` be `$n$` independent r.v. `$\sim \mathcal{N}(0,1)$`. Let a new r.v. defined as `$$ \chi^2 = z_1^2 + z_2^2 + \ldots + z^2_n $$` -- It is said that this r.v. is a "chi-squared" variable with `$n$` degrees of freedom (DOF). -- Such r.v. has for PDF: `$$ p(x) = \frac{x^{\frac{n}{2}-1} \exp(-\frac{x}{2})}{2^\frac{n}{2}\Gamma(n/2)} \equiv \chi^2(n) \text{ or } \chi^2_n $$` The mean of this distribution is `$n$` and its variance is `$2n$`. -- Examples of `$\chi^2$` variables are power spectral density function estimates (see Lecture 4 on time series analysis) or variance estimates. The sample variance of $x\sim \mathcal{N}(\mu_x,\sigma_x)$ is $ s^2_x \sim \frac{\sigma_x^2}{N-1}\chi^2(N-1)$ --- class: left, .toc[[✧](#toc)] ## The `$\chi^2_n$` distribution In this example, the red curve is the theoretical `$\chi^2_n$` PDF for `$n = 14$`. The histogram is computed from a sample of size `$N=1000$`. .center[
] --- name: F class: left, .toc[[✧](#toc)] ## The F distribution If `$x \sim \chi^2_n$` and `$y \sim \chi^2_m$` then the following variable `$$ \frac{x/n}{y/m} \sim F(n,m) $$` is `$F$` distributed with `$n$` and `$m$` degrees of freedom. The mathematical expression for this distribution is very complicated and not very useful here, see reference [[1]](#references). The mean value of the `$F$` distribution is `$m/(m-2)$` for `$m>2$` and its variance is `$$ \frac{2 m^2(n+m-2)}{n(m-2)^2(m-4)} \text{ for } m>4 $$` The `$F$` distribution arises as an example when testing for the equality of two population variances (see practical this afternoon). --- name: tstudent class: left, .toc[[✧](#toc)] ## The Student's `$t$` distribution Let `$y$` and `$z$` be two independent r.v. with `$y \sim \chi^2_n$` and `$z \sim \mathcal{N}(0,1)$`. Let be a new r.v. defined as `$$ t = \frac{z}{\sqrt{\frac{y}{n}}} $$` It is said that this r.v. is a Student's `$t$` variable with `$n$` degrees of freedom (DOF). -- Such r.v. has for PDF: `$$ p(x) = \frac{\Gamma[(n+1)/2]}{\sqrt{\pi n} \Gamma(n/2)} \left[1+\frac{x^2}{n}\right]^{\frac{n+1}{2}} \equiv t(n ) \text{ or } t_n $$` The mean is `$0$` for `$n>0$` and the variance is `$\frac{n}{n-2}$` for `$n>2$`. An example of $t$ distributed r.v. is the estimate of the mean of a population with unknown variance, as we will see later. --- class: left, .toc[[✧](#toc)] ## The Student's `$t$` distribution In this example, the red curve is the theoretical `$t_n$` PDF for `$n = 10$`. The histogram is computed from a sample of size `$N=1000$`. The black curve is the theoretical PDF `$\mathcal{N}(0,1)$`. .center[
] --- exclude: true name: exponential class: left, .toc[[✧](#toc)] ## The exponential distribution A random variable `$x$` that is *exponentially distributed* with parameter `$\beta$` has for PDF: `$$ p(x) = \frac{1}{\beta} \exp(-x/\beta) $$` The mean for $x$ is `$\mu_x = \beta$` and the variance is `$\sigma^2_x = \beta^2$`. .right-column[
Example: the red curve is the theoretical exponential PDF for `$\beta = 3$`. The histogram is computed from a sample of size `$N=1000$`.] .left-column[
] --- name: gamma class: left, .toc[[✧](#toc)] ## The Gamma ($\Gamma$) distribution family In fact, the `$\chi^2_n$` distribution and the exponential distribution are two particular cases of the Gamma ($\Gamma$) distribution family. A random variable `$x$` that is *Gamma distributed* with parameters `$\alpha$` and `$\beta$` has for PDF: `$$ p(x) = \frac{x^{\alpha-1}\exp[-x/\beta]}{\beta^\alpha \Gamma(\alpha)}, \quad \beta>0;\, 0\leq x \leq +\infty $$` with the $\Gamma$ function defined as `$$ \begin{eqnarray} \Gamma(\alpha) &=& \int_0^{+\infty} x'^{\alpha-1} \exp(-x')\,dx' \cr \Gamma(n) & = & (n-1)! \quad \text{for $n$ integer} \cr \Gamma(\alpha) &=& (\alpha - 1)\Gamma(\alpha - 1) \text{ for $\alpha$ continuous with } \Gamma(1) = 1\cr \end{eqnarray} $$` `$\alpha = 1 \longrightarrow$` exponential distribution `$\alpha = \frac{n}{2},\quad \beta = 2 \longrightarrow$` `$\chi^2_n$` distribution --- name: errors class: center, middle, .toc[[✧](#toc)] # 4. Uncertainties, errors and hypothesis testing --- class: left, .toc[[✧](#toc)] ###Probability statements We use distributions to make probability statements about our r.v. estimates. -- It is useful to consider the following. For any given PDF `$p(z)$`, and associated CDF `$f(z)$`, of the variable `$z$`, let's denote `$z_\alpha$` the value that corresponds to $f(z) = 1-\alpha$, that is `$$ \begin{eqnarray} f(z_\alpha) = \int_{-\infty}^{z_\alpha} p(z)\, dz = \text{Prob}[z \leq z_\alpha] = 1- \alpha \cr \end{eqnarray} $$` .center[
] BEWARE that this the convention used here. It is notably different in Matlab where icdf('normal',1-`$\alpha$`,0,1) returns the value `$z_{\alpha}$` --- class: left, .toc[[✧](#toc)] ## Confidence intervals PDFs are used to derive confidence intervals (CI), the interpretation of which is subtle. What is a CI for you? -- Given an estimate `$\widehat{\phi}$` of a quantity `$\phi$`, and a chosen significance level `$\alpha$`, we construct an interval with lower bound `$\phi_L$` and upper bound `$\phi_U$` so that this interval is expected to cover the true, unknown, but fixed value of `$\phi$`, with probability `$1-\alpha$`. -- In other words, if we could repeat the estimation and calculation of the CI many times, we can expect that the true unknown parameter `$\phi$` is covered by the calculated CI, 95 out of 100 times. -- There is no probability statement about `$\phi$`, only about `$\widehat{\phi}$` and `$[\phi_L,\phi_U]$`. --- class: left, .toc[[✧](#toc)] ## Confidence intervals As a concrete example, consider the sample mean `$\overline{X}$` of `$x \sim \mathcal{N}(\mu_x,\sigma_x)$`. We stated earlier that `$\overline{X} \sim \mathcal{N}(\mu_x,\sigma_x/\sqrt{N})$`. As such, we can state that the new "transformed" variable `$$ z = \frac{\overline{X}-\mu_x}{{\sigma_x}/{\sqrt{N}}} \sim \mathcal{N}(0,1) $$` and that we can find two `$z$` values such that `$$ \text{Prob}\left[z_{1-\alpha/2} < \frac{\overline{X}-\mu_x}{{\sigma_x}/{\sqrt{N}}} \leq z_{\alpha/2}\right] = 1-\alpha $$` --- class: center, .toc[[✧](#toc)] ## Confidence intervals: normal case `$$ \text{Prob}\left[z_{1-\alpha/2} < \frac{\overline{X}-\mu_x}{{\sigma_x}/{\sqrt{N}}} \leq z_{\alpha/2}\right] = 1-\alpha $$` .center[
] Since, the normal distribution is symmetric around zero, `$z_{1-\alpha/2}=-z_{\alpha/2}$` --- class: left, .toc[[✧](#toc)] ## Confidence intervals: normal case As a result, the normalized calculated variable `$z$` is such that `$$ -z_{\alpha/2} < z = \frac{\overline{X}-\mu_x}{{\sigma_x}/{\sqrt{N}}} \leq z_{\alpha/2} $$` with `$1-\alpha$` probability. After rearranging, we can state that the true mean `$\mu_x$` of the r.v. `$x$` is such that `$$ \overline{X} - \frac{\sigma_x z_{\alpha/2}}{\sqrt{N}} \leq \mu_x < \overline{X} + \frac{\sigma_x z_{\alpha/2}}{\sqrt{N}} $$` with a *confidence of $100(1-\alpha)\%$*. In common parlance, a 95% CI for `$\mu_x$` is `$$ \left[\overline{X}- \frac{\sigma_x z_{\alpha/2}}{\sqrt{N}}, \overline{X}+\frac{\sigma_x z_{\alpha/2}}{\sqrt{N}} \right] $$` --- class: left, .toc[[✧](#toc)] ## Confidence intervals: normal case Typical intervals used are: `$90\% \text{ CI}: \quad \alpha = 0.1 \longrightarrow z_{\alpha/2} = 1.6449$` `$95\% \text{ CI}: \quad \alpha = 0.05 \longrightarrow z_{\alpha/2} = 1.9600$` `$99\% \text{ CI}: \quad \alpha = 0.01 \longrightarrow z_{\alpha/2} = 2.5758$` Before the advent of advanced softwares, people relied on statistical tables for the values of `$z$`, such as the ones found in the Appendices of references [[1],[2],[3],[6]](#references). --- class: center, .toc[[✧](#toc)] ## Confidence intervals: normal case Example from Bendat and Piersol (2011): `$95\% \text{ CI}: \quad \alpha = 0.05 \longrightarrow \alpha/2 = 0.0250$` .center[
] --- class: left, .toc[[✧](#toc)] ### Confidence intervals: normal case; example: Using a CTD record of temperature at 24 Hz, we estimate the mean temperature near 70 db pressure level by averaging data points within .5 db of 70 db (falling rate is 1-2 m/s), `$N=11$`. We find `$\overline{T} = 19.21359$`. From the [specification sheet](#911specs) of the CTD 911 Plus, the accuracy of the temperature sensor is `$0.001$`, which we interpret as being the random error or std of $T$, i.e. `$\sigma_T$`, ignoring a possible bias. -- We use `$(\overline{T}-\mu_T)/(\sigma_T/\sqrt{N}) ~\sim \mathcal{N}(0,1)$`, and based on the previous formula, the 95% CI for the true mean `$\mu_{T}$` is: `$$ 19.21359 - \frac{0.001 \times 1.96}{\sqrt{11}} \leq \mu_T < 19.21359 + \frac{0.001 \times 1.96}{\sqrt{11}} $$` `$$ \Rightarrow 19.21300 \leq \mu_T < 19.21418 $$` Alternatively, once can state that the estimate of the mean with 95% uncertainty is `$$ {\mu_T} = 19.21359 \pm 0.00059 $$` --- class: left, .toc[[✧](#toc)] ## Confidence intervals: `$t$` case Now imagine that you obtain the data from the previous example but do not know the specification of the sensor used, that is `$\sigma_T$`. Instead, you can consider the sample standard deviation `$s_T$` as an estimate of the unknown `$\sigma_T$`. -- It can be shown (not obvious), that `$$\frac{\overline{T}-\mu_T}{s_T/\sqrt{N}} ~\sim \mathcal{t}(N-1)$$` -- Thus, a `$100(1-\alpha)$`% CI for the true mean `$\mu_{T}$` is: `$$ \left[\overline{T} - \frac{s_T t_{N-1;\alpha/2}}{\sqrt{N}} \leq \mu_T < \overline{T} + \frac{s_T t_{N-1;\alpha/2}}{\sqrt{N}} \right] $$` where `$t_{N-1;\alpha/2}$` is the value of the `$t_{N-1}$` variable such that `$$ \text{Prob}\left[ t \leq t_{N-1;\alpha/2}\right] = 1 - \frac{\alpha}{2} \quad \text{ or } \quad \text{Prob}\left[ t > t_{N-1;\alpha/2}\right] = \frac{\alpha}{2} $$` The `$t$` distribution is symmetric like the normal distribution so that `$t_{N;1-\beta} = -t_{N;\beta}$` --- class: left, .toc[[✧](#toc)] ## Confidence intervals: `$t$` case Going back to our CTD example, we still have `$\overline{T} = 19.21359$` but now calculate `$s_T = 0.02277$`. Since `$t_{40-1;0.05/2} = 2.0227$`, the 95% CI for $\mu_T$ becomes: `$$ 19.21359 - \frac{0.02277 \times 2.0227}{\sqrt{1}} \leq \mu_T < 19.21359 + \frac{0.02277 \times 2.0227}{\sqrt{11}} $$` `$$ \Rightarrow 19.19829 \leq \mu_T < 19.22889 $$` Alternatively once can state that the estimate of the mean with 95% uncertainty is `$$ {\mu_T} = 19.21359 \pm 0.01530 $$` -- Previously, we stated that `$$ {\mu_T} = 19.21359 \pm 0.00059 $$` So what is the right answer? -- It is arguable ... --- class: left, .toc[[✧](#toc)] To attempt to answer this question, let's look at the data. The blue curve is the 24 Hz temperature data, and the red curve and shading show the 1 db bin averages and 95% CI using the `$t$` distribution. .center[
] --- class: left, .toc[[✧](#toc)] ### Instrumental vs sampling/model errors When we use `$\overline{T}$` as an estimate of the temperature at 70 db, we assumed that the $N=11$ records of temperature at 24 Hz had the same expectation and variance. -- However, we know based on our oceanographic knowledge that the temperature is not necessarily a constant with depth. Here, the obvious temperature gradient with depth makes us think that the expected temperature at 69.5 db is not the same as at 70.5 db. -- Thus, when we calculate an arithmetic average (`$\overline{T}$`) of temperature that is a function depth, it is an estimate of a temperature quantity that is variable because of 1) the accuracy of the sensor, and 2) the varying expectation value. -- Traditionally, this second type of error is called a *sampling error* or a *model error*, which adds to the first type of error called *instrumental error*. -- Part of the analysis of your data is to understand, or model, the sources or variance and hence of errors when calculating derived quantities such as mean, variance etc. --- class: left, .toc[[✧](#toc)] ### Interlude: modeling signal and noise Part of the problem of choosing the appropriate variance to estimate errors is choosing a model for the observations. As an example, the measured "process" `$x$` may be the sum of a given signal `$y$` plus instrumental noise `$\varepsilon$`. `$$ x = y + \varepsilon $$` -- If the signal and noise independent, then the total variance of the process is `$$ \begin{eqnarray} \text{Var}[x] & = & \text{Var}[y] &+& \text{Var}[\varepsilon] \cr \sigma^2_x & = & \sigma^2_y &+& \sigma^2_\varepsilon \cr \end{eqnarray} $$` -- In our previous example of the CTD profile, the sample variance of the measurements was likely the sum of the instrumental error and of the "error" from the background shear of temperature. I would tend to choose the second case (`$t$` distribution with unknown variance) to derive CIs. --- class: left, .toc[[✧](#toc)] ## Confidence intervals: `$\chi^2_n$` case .center[
] `$$ \text{Prob}\left[\chi^2_{n;1-\alpha/2} < \chi^2_n \leq \chi^2_{n;\alpha/2}\right] = 1-\alpha $$` The `$\chi^2$` distribution is defined for positive values only, and is not symmetric: `$\chi^2_{n;1-\beta} \neq -\chi^2_{n;\beta}$` --- class: left, .toc[[✧](#toc)] ## Confidence intervals: `$\chi^2_n$` case example The `$\chi^2$` distribution can be used to derive CIs for variance estimates. It can be shown that for `$N$` samples drawn from a normally distributed r.v. `$x$` with variance `$\sigma^2_x$`, we have `$$ \frac{(N-1)s^2_x}{\sigma_x^2} \sim \chi^2_{N-1} $$` which can be used to derive $100(1-\alpha)$% CI for variance estimates `$s^2_x$` as `$$ \frac{(N-1)s^2_x}{\chi^2_{N-1;\alpha/2}} \leq \sigma^2 < \frac{(N-1)s^2_x}{\chi^2_{N-1;1-\alpha/2}} $$` --- class: left, .toc[[✧](#toc)] ## Hypothesis testing Confidence intervals are particular cases of *hypothesis testing*, a case of data analysis that occurs frequently. See the introduction of *100 statistical tests* by G. K. Kanji (see reference [[5]](#references)). -- Hypothesis testing does **not** consist in proving or disproving hypotheses. Just like we will never know the true value of a r.v., we will never prove in an indeniable fashion that an hypothesis is true. -- Hypothesis testing consists in showing that an hypothesis cannot be supported given its small probability. How small is your own choice, or the difference between getting published or not published, or a stakeholder taking a decision or action or inaction, etc. -- In general, the hypothesis we are trying to denouce, decry, etc, is one with no change (i.e. `$a = b$`, "the mean temperature today is the same as yesterday"), so that it is typically called the *null hypothesis*, `$H_0$`. When `$H_0$` is rejected because of insufficient probability, we accept the *alternatice hypothesis* `$H_1$` (i.e. `$a \neq b$`, "the mean temperature today is different from yesterday"). --- class: left, .toc[[✧](#toc)] ## Hypothesis testing **Step 1** Define your practical problem in terms of simple hypotheses, a *null hypothesis* and an *alternate hypothesis* that typically leads to action. Decide if you are likely to conduct a *one-tailed* or *two-tailed* test. -- As an example, a null hypothesis is that the population mean `$\mu_x$` of a r.v. `$x$` is equal to a given value `$\mu_0$` (maybe `$0$`). Alternative hypotheses may be that `$\mu_x$` is not equal to `$\mu_0$` (case $1$, two-tailed test), or that `$\mu_x$` is greater or smaller than `$\mu_0$` (cases $2,3$, one-tailed tests). `$$ \begin{eqnarray} & 1. & H_0 : \mu_x = \mu_0 \cr & & H_1 : \mu_x \neq \mu_0 \cr & 2. & H_0 : \mu_x = \mu_0 \cr & & H_1 : \mu_x > \mu_0 \cr & 3. & H_0 : \mu_x = \mu_0 \cr & & H_1 : \mu_x < \mu_0 \cr \end{eqnarray} $$` --- class: left, .toc[[✧](#toc)] ## Hypothesis testing **Step 2** Derive a statistic, that is a number, that can be calculated from your data and your assumptions, typically under your null hypothesis `$H_0$`. Make sure that this number is going to be different when `$H_0$` is true or when `$H_1$` is true. -- Following the previous example, we saw that if `$x$` is normally distributed with known variance `$\sigma_x$`, then the statistic `$z = \frac{\overline{X}-\mu_x}{\sigma_x/\sqrt{N}} \sim \mathcal{N}(0,1)$` .center[
] --- class: left, .toc[[✧](#toc)] ## Hypothesis testing **Steps 3 & 4** Choose a *critical region* for your test statistic and a significance level `$\alpha$` that determine the size of your critical region. Critical regions can be of three types; *right-sided* means that you reject `$H_0$` if your test statistic is greater than or equal to some right critical value; *left-sided* you get it; or *both-sided* so that you reject `$H_0$` if your test statistic is either greater than or equal to the right critical value or less than or equal to the left critical value. .center[
] --- class: left, .toc[[✧](#toc)] ## Hypothesis testing **Steps 3 & 4: example** `$$ \begin{eqnarray} & \alpha = 0.05, H_0 : \mu_0 = 4, N = 9, \overline{X} = 4.6, \sigma_x = 1.0 \rightarrow z = \frac{4.6-4}{1/\sqrt{9}} = 1.8 \end{eqnarray} $$` Case 1: `$z_{1-0.05/2} = -1.96 < z = 1.8 < z_{0.05/2} = 1.96$` `$z$` is outside of the critical region! No reason to reject `$H_0$` (i.e. we accept that the mean is not different from `$\mu_0$`) Case 2: `$z = 1.8 > z_{1-0.05} = 1.64$` `$z$` is in the critical region for a right-sided test! We can reject `$H_0$` (in the sense that the mean appears larger than `$\mu_0$`) Case 3: `$z_{0.05} = -1.64 \leq z = 1.8 $` `$z$` is outside the critical region for a left-sided test! No reason to reject `$H_0$` (in the sense that it mean does not appear to be less than `$\mu_0$`). --- class: left, .toc[[✧](#toc)] ## Hypothesis testing Please see the book by G. K. Kanji, *100 Statistical Tests*, (2006)! It is very handy ... --- class: left, .toc[[✧](#toc)] ### One last thing: Error propagation We saw common cases where the statistics were `$x \sim z$`, `$t$`, or `$\chi^2$` r.v. What if we are trying to assess the error or uncertainty for a r.v. `$y$` that is arbitrarily function of `$N$` variables `$x_n$` with *independent* random errors `$\varepsilon_{x_n}$` (maybe the RMS error)? `$$ y = y(x_1,x_2,\ldots,x_N) $$` -- An approximate formula for "small" errors is `$$ \varepsilon^2_y \approx \left(\frac{\partial y}{\partial x_1}\right)^2\varepsilon^2_{x_1} + \left(\frac{\partial y}{\partial x_2}\right)^2\varepsilon^2_{x_2} + \ldots + \left(\frac{\partial y}{\partial x_N}\right)^2\varepsilon^2_{x_N} $$` See reference [[3]](#references). --- class: left, .toc[[✧](#toc)] ## Practical session Please download data at the following link: Please download the Matlab code at the following link: Make sure you have installed and tested the free jLab Matlab toolbox from Jonathan Lilly at [www.jmlilly.net/jmlsoft.html](https://www.jmlilly.net/jmlsoft.html) --- name: extra class: middle, center, .toc[[✧](#toc)] # Extra slides --- class: left, .toc[[✧](#toc)] ## `$t$`-test for two population means (variances unknown and unequal) Following test #9 of Kanji (2006), reference [[5]](#references) The test statistic is `$$ t = \frac{(\overline{X}_1 - \overline{X}_2) - (\mu_1 - \mu_2)} {\left(\displaystyle{ \frac{s^2_1}{n_1} + \frac{s_2^2}{n_2}}\right)^{\frac{1}{2}}} $$` which is used to test `$\mu_1 = \mu_2$`, so that `$t \sim t(0,\nu)$` with `$$ \nu = \frac{\left(\displaystyle{ \frac{s^2_1}{n_1} + \frac{s_2^2}{n_2}}\right)^2} {\displaystyle{\frac{s_1^4}{n_1^2(n_1-1)} + \frac{s_2^4}{n_2^2(n_2-1)}}} $$` --- class: left, .toc[[✧](#toc)] ## Kolmogorov-Smirnov test for distribution The *Kolmogorov-Smirnov* test compares an empirical distribution function `$\widehat{F}$` to a prescribed normal distribution function `${F}$` with mean `$\mu$` and standard deviation `$\sigma$`. It considers the statistic `$$ D = \max_{X_i} |\widehat{F}(X_i) - {F}(\mu,\sigma)| $$` which measures the maximum distance between the two distribution (as seen on a Q-Q plot). The issue is that this test is too conservative when the mean and std of `${F}$` are calculated from the data. An alternative test is called the *Lilliefors test*, which is more stringent. See also test 20 of Kanji (2006), reference [[5]](#references) for another test. In Matlab: ```ruby h = kstest(x); h = lillietest(x); ``` --- exclude: true class: left, .toc[[✧](#toc)] ```ruby plot(t,x) ``` First Header | Second Header ------------ | ------------- Content from cell 1 | Content from cell 2 Content in the first column | Content in the second column ~~this~~


Digitizer - AI on the edge
An ESP32 all inclusive neural network recognition system for meter digitalization
Overview
Settings
Set Previous Value
Configuration
Alignment
Reference Image
Alignment Marks
R
egions
O
f
I
nterest
Digital ROIs
Analog ROIs
Data
Recognition
Data Graph
Data Viewer
Data Files
System
Backup/Restore
OTA Update
Log Viewer
File Server
Reboot
Info
Loading version...


Cleric
Druid
Fighter
Monk
Rogue
Wizard
Thank you for visting Class Cards by Awesome 201
Copyright 2018


HCIPy: High Contrast Imaging for Python
HCIPy is an open-source, modular Python package for high-contrast imaging on current and future telescopes. By integrating atmospheric simulation, wavefront sensors and coronagraphs in a single library, HCIPy enables both rapid prototyping of individual system elements and the full high-contrast imaging system.
Latest version: 0.5.1


|
BrawlCrate v0.40a
Wii File Editor
|
Represents a single TrackInfo segment (with the assumption that there will be only one in a file.) Some unknown data (the Byte Table) is hardcoded in the constructor. More...
Public Member Functions | |
| FSTMTrackInfoStub (byte volume, byte pan) | |
Public Attributes | |
| byte | _volume |
| byte | _pan |
| bshort | _padding |
| FSTMReference | _byteTableReference |
| bint | _byteTableCount |
| bint | _byteTable |
Represents a single TrackInfo segment (with the assumption that there will be only one in a file.) Some unknown data (the Byte Table) is hardcoded in the constructor.
|
inline |
| bint BrawlLib.SSBB.Types.Audio.FSTMTrackInfoStub._byteTable |
| bint BrawlLib.SSBB.Types.Audio.FSTMTrackInfoStub._byteTableCount |
| FSTMReference BrawlLib.SSBB.Types.Audio.FSTMTrackInfoStub._byteTableReference |
| bshort BrawlLib.SSBB.Types.Audio.FSTMTrackInfoStub._padding |
| byte BrawlLib.SSBB.Types.Audio.FSTMTrackInfoStub._pan |
| byte BrawlLib.SSBB.Types.Audio.FSTMTrackInfoStub._volume |


A controller with the stream it controls.
This controller allows sending data, error and done events on its stream. This class can be used to create a simple stream that others can listen on, and to push events to that stream.
It's possible to check whether the stream is paused or not, and whether it has subscribers or not, as well as getting a callback when either of these change.
If the stream starts or stops having listeners (first listener subscribing,
last listener unsubscribing), the onSubscriptionStateChange
callback
is notified as soon as possible. If the subscription stat changes during
an event firing or a callback being executed, the change will not be reported
until the current event or callback has finished.
If the pause state has also changed during an event or callback, only the
subscription state callback is notified.
If the subscriber state has not changed, but the pause state has, the
onPauseStateChange
callback is notified as soon as possible, after firing
a current event or completing another callback. This happens if the stream
is not paused, and a listener pauses it, or if the stream has been resumed
from pause and has no pending events. If the listeners resume a paused stream
while it still has queued events, the controller will still consider the
stream paused until all queued events have been dispatched.
Whether to invoke a callback depends only on the state before and after a stream action, for example firing an event. If the state changes multiple times during the action, and then ends up in the same state as before, no callback is performed.
If listeners are added after the stream has completed (sent a "done" event), the listeners will be sent a "done" event eventually, but they won't affect the stream at all, and won't trigger callbacks. From the controller's point of view, the stream is completely inert when has completed.
- Implements
-
- StreamSink<T>
- Implemented by
Constructors
- StreamController({void onListen(), void onPause(), void onResume(), dynamic onCancel(), bool sync: false })
-
A controller with a stream that supports only one single subscriber.
factory - StreamController.broadcast({void onListen(), void onCancel(), bool sync: false })
-
A controller where stream can be listened to more than once.
factory
Properties
- done → Future
-
Return a future which is completed when the
StreamSink
is finished.read-only, inherited - hashCode → int
-
Get a hash code for this object.
read-only, inherited - hasListener → bool
-
Whether there is a subscriber on the
Stream
.read-only - isClosed → bool
-
Whether the stream controller is closed for adding more events.
read-only - isPaused → bool
-
Whether the subscription would need to buffer events.
read-only - onCancel → ControllerCancelCallback
-
The callback which is called when the stream is canceled.
read / write - onListen → ControllerCallback
-
The callback which is called when the stream is listened to.
read / write - onPause → ControllerCallback
-
The callback which is called when the stream is paused.
read / write - onResume → ControllerCallback
-
The callback which is called when the stream is resumed.
read / write - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited - sink → StreamSink<T>
-
Returns a view of this object that only exposes the
StreamSink
interface.read-only - stream → Stream<T>
-
The stream that this controller is controlling.
read-only
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
add(
T event) → void -
Send a data event to a stream.
inherited -
addError(
Object error, [ StackTrace stackTrace ]) → void -
Send or enqueue an error event.
-
addStream(
Stream<T> source, { bool cancelOnError: true }) → Future -
Receives events from
source
and puts them into this controller's stream. -
close(
) → Future -
Tells the stream sink that no further streams will be added.
inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited


Kill test
Play
Pause
Stop
Basic linear tween loop
Basic linear tween loop (IE-friendly)
Delayed start
Basic eased tween loop
Tween loop with multiple easings
Tween loop with fancy parameters
Tween loop with independent parameters


|
WebWork 2 : Release Notes - 2.1
This page last changed on Dec 14, 2004 by plightbo.
Key Changes
Migration Notes
Changelog
|
| Document generated by Confluence on Dec 14, 2004 16:36 |


Toggle navigation
Brand
Link
(current)
Link
Lumen
Light and shadow
A
B
{{schedule.time}}
{{schedule.action}}
再取得


For questions, comments, and suggestions, please contact NASIC/GSP at<EMAIL_ADDRESS>2016-10-31


Image Container
Beer/Product of Poland
Tyskie-name comes from the brewery located in the Upper Silesia town of Tychy.The brand is brewed by the Princely Brewery Tychy (Polish Tyskie Browary Ksiazece), part of the Kompania Piwowarska brewery group, a former subsidiary of SABMiller since 1999 as a result of the merger of two SABMiller owned Polish breweries, the Lech Browary Wielkopolski (Lech Brewery Greater Poland) in Poznań, and the Tyskie Browary Ksiazece in Tychy.
PromoProducts
PromoProduct1
PromoImage1
The award-winning Polish beer Tyskie, one of the most popular beers in Poland.Tyskie has all the typical characteristics of a pale lager — yellow color, medium carbonation, slight bready malt and grassy hops in the aroma, which carries over into the taste. It produced a white fluffy head that sunk fairly quickly.
About UsPromoProduct2
PromoImage2
Sweeter Tyskie differs from other lagers.In a other word, the main difference between Tyskie and others beers is that it is sweeter.The sweetness is nothing terrible, just different.The sweetness in the 5.3% ABV Tyskie is undercut by some bitterness at the end, which helps balance out the lager.
Know MorePromoProduct3
PromoImage3
The Tyskie family encompasses the following variants: classic, golden lager (Tyskie Gronie), unpasteurized (Tyskie Niepasteryzowane chmielone na zimno), unprocessed served from a tank (14-Day Tyskie Gronie), low-alcohol (Tyskie Jasne Lekkie), mix of beer and the taste of fresh lemons (Tyskie Radler).
Buy Now


Trees have always been considered as "lungs" of the earth. Planting lots of trees helps provide a great deal of oxygen for us to breathe. On average, one tree can provide enough oxygen for four people. At the same time they also absorb C02, ammonia, S02, .. in the world!
Trees have always been considered as "lungs" of the earth.
Trees can slow down the evaporation of water, increasing air humidity.
Planting more trees in densely populated areas will not only make the air there more fresh
One tree can cool down, cool down 10 rooms
Green trees become shade to block the sunlight from the road
Living in a quiet, cool, clean and fresh environment will make your health better
Sapien Libero$150.00
Fringilla Augue 360$200.00 $150.00
Faded Short Sleeves Variable$200.00 $150.00
Purple Floweers$180.00
Adipiscing Cursus Out Of Stock$450.00
Fringilla Augue$320.00
Purple Flowers$200.00 $150.00
Plant$200.00 $150.00
Plant Beautiful$150.00
Pick up all you need to keep your board in optimum condition with Decathlon’s set of surfboard accessories.


onclass
Home
Resources
Tutoring
About Us
Facebook
Instagram
LinkedIn
Watch another video: https://www.youtube.com/
ZV10jqrivYQ
Submit
Watch Together
© onclass


---
layout: post
title: King Club - Wednesday January 4, 2006
date: '2006-01-04T21:49:00.000-06:00'
author: Tom Ray
tags:
modified_time: '2006-01-01T01:43:28.320-06:00'
blogger_id: tag:blogger.com,1999:blog-11319466.post-113608754014545559
blogger_orig_url: http://www.lorenzosmusic.com/2006/01/king-club-wednesday-january-4-2006.html
---
Tapes 'n Tapes
Lorenzo's Music
and Fire Falls
at the King Club in Madison
9:00 pm
Buy the poster here.


Soldier Orbyu:
Thanks to you, we were able to learn vital information about the Seed of Destruction. We are in your debt. But there's one more thing left to do...
"What is it?"


|
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
| def | __init__ |
| def | GetValidator |
| def | Set |
| def | Get |
| def | CheckInitialized |
| def | __setattr__ |
| def | __str__ |
| def | __repr__ |
| def | __eq__ |
| def | __ne__ |
| def | __hash__ |
| def | ToDict |
| Public Member Functions inherited from google.appengine.api.validation.ValidatedBase | |
| def | GetValidator |
| def | SetMultiple |
| def | Set |
| def | CheckInitialized |
| def | ToDict |
| def | ToYAML |
Static Public Attributes | |
| ATTRIBUTES = None | |
Base class for classes that require validation. A class which intends to use validated fields should sub-class itself from this class. Each class should define an 'ATTRIBUTES' class variable which should be a map from attribute name to its validator. For example: class Story(Validated): ATTRIBUTES = {'title': Type(str), 'authors': Repeated(Type(str)), 'isbn': Optional(Type(str)), 'pages': Type(int), } Attributes that are not listed under ATTRIBUTES work like normal and are not validated upon assignment.
| def google.appengine.api.validation.Validated.__init__ | ( | self, | |
| attributes | |||
| ) |
Constructor for Validated classes. This constructor can optionally assign values to the class via its keyword arguments. Raises: AttributeDefinitionError: when class instance is missing ATTRIBUTE definition or when ATTRIBUTE is of the wrong type.
| def google.appengine.api.validation.Validated.__eq__ | ( | self, | |
| other | |||
| ) |
Equality operator. Comparison is done by comparing all attribute values to those in the other instance. Objects which are not of the same type are not equal. Args: other: Other object to compare against. Returns: True if validated objects are equal, else False.
| def google.appengine.api.validation.Validated.__hash__ | ( | self | ) |
Hash function for using Validated objects in sets and maps. Hash is done by hashing all keys and values and xor'ing them together. Returns: Hash of validated object.
| def google.appengine.api.validation.Validated.__ne__ | ( | self, | |
| other | |||
| ) |
Inequality operator.
| def google.appengine.api.validation.Validated.__repr__ | ( | self | ) |
Formatted view of validated object and nested values.
| def google.appengine.api.validation.Validated.__setattr__ | ( | self, | |
| key, | |||
| value | |||
| ) |
Set attribute. Setting a value on an object of this type will only work for attributes defined in ATTRIBUTES. To make other assignments possible it is necessary to override this method in subclasses. It is important that assignment is restricted in this way because this validation is used as validation for parsing. Absent this restriction it would be possible for method names to be overwritten. Args: key: Name of attribute to set. value: Attributes new value. Raises: ValidationError: when trying to assign to an attribute that does not exist.
| def google.appengine.api.validation.Validated.__str__ | ( | self | ) |
Formatted view of validated object and nested values.
| def google.appengine.api.validation.Validated.CheckInitialized | ( | self | ) |
Checks that all required fields are initialized. Since an instance of Validated starts off in an uninitialized state, it is sometimes necessary to check that it has been fully initialized. The main problem this solves is how to validate that an instance has all of its required fields set. By default, Validator classes do not allow None, but all attributes are initialized to None when instantiated. Raises: Exception relevant to the kind of validation. The type of the exception is determined by the validator. Typically this will be ValueError or TypeError.
| def google.appengine.api.validation.Validated.Get | ( | self, | |
| key | |||
| ) |
Get a single value on Validated instance. This method can only be used to retrieve validated attributes. Args: key: The name of the attributes Raises: ValidationError when no validated attribute exists on class.
| def google.appengine.api.validation.Validated.GetValidator | ( | self, | |
| key | |||
| ) |
Safely get the underlying attribute definition as a Validator. Args: key: Name of attribute to get. Returns: Validator associated with key or attribute value wrapped in a validator.
| def google.appengine.api.validation.Validated.Set | ( | self, | |
| key, | |||
| value | |||
| ) |
Set a single value on Validated instance. This method can only be used to assign validated attributes. Args: key: The name of the attributes value: The value to set Raises: ValidationError when no validated attribute exists on class.
| def google.appengine.api.validation.Validated.ToDict | ( | self | ) |
Convert Validated object to a dictionary. Recursively traverses all of its elements and converts everything to simplified collections. Returns: A dict of all attributes defined in this classes ATTRIBUTES mapped to its value. This structure is recursive in that Validated objects that are referenced by this object and in lists are also converted to dicts.


This is the base class for an EasyRoads3D connection/crossing between roads.
...
public bool Destroy()
Removes the connection object
public ERConnectionData[] GetConnectionData()
Returns the currently available connection data of the connection object
public Vector3 GetLocalConnectionPosition(int connectionIndex)
Returns the local position of connectionIndex
public Vector3[] GetLocalConnectionPositions()
Returns the local positions of all the connections of this connection prefab
public string GetName()
Returns the name of the connection object
public void SetPosition(Vector3 position)
Updates the position of the connection object
public void SetName(string name)
Updates the name of the connection object
public void SetRotation(Vector3 euler)
Updates the eulerAngles rotation of the connection object
public void UnConnect(int connectionIndex)
Removes the connection with the road object at connectionIndex.
|


point-polygon is a Common Lisp library to test if a point lies inside or outside a polygon in 2 dimensions coordinates.
Source code is released under a MIT License
and hosted at git repository https://gitlab.com/janduja/point-polygon.git
under branch 1.0
.
A compressed zip package can be downloaded at http://janduja.com/point-polygon/point-polygon-1.0.tar.gz.
Contents:
The library has no dependencies and can be loaded directly or as an ASDF package. First, get the source code or unpack the zip file.
To load directly:
(load "point-polygon.lisp")To load as an ASDF system, ensure that the library source is located in a directory looked by ASDF (ie.
~/common-lisp/point-polygon
),
then in your code:
(asdf:load-system :point-polygon)
[Function] is-inside-or-border point polygon => is-inside
Tells if point is inside or in the border of polygon. point is expected to be a list of two values, the coodinate pair,
while polygon is a list of coordinate pairs such that the first element is pairwise equal to the last element.
A coordinate is expected to be a numeric float, but not necessarly.
Returns T if the point lies inside the polygon, false otherwise.
The following example shows how to test if a point lies inside or outside a trapezoid:
(let ((trapezoid '((-23.24D0 11.87D0) (7.29D0 53.99D0) (29.48D0 32.14D0) (5.07D0 -50.99D0) (-23.24D0 11.87D0)))) (is-inside-or-border '(27.90D0 52.76D0) trapezoid))
The test is implemented by the winding number algorithm.
Using the point to test as reference, traversing the polygon from the first element to the last one we track the number of windings around the point:
if the value is zero the point lies outside, otherwise it lies inside.
Image: winding number tracking, source: Wikipedia. Author: Jim.belk. Released in the public domain.
In the code implementation, the computation of the winding number is tracked by quadrant movements: setting the point to test as origin of a Cartesian plane, traversing the polygon from a point to the next can be identified by an integer quadrant movement:
Tests are collected in file point-polygon-test.lisp
under the test directory and have dependencies on
lisp-unit and jsown.
To run the tests you have to position as current directory in the point-polygon/test
, then launch
your Common Lisp implementation and load the file point-polygon-test.lisp
. A Unit Test report is printed on the
standard output telling the run tests, the passed and failed assertions and the execution errors.
The tests run successfully with the following Common Lisp implementations and hardware configuration:
[uname] Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
[lscpu] CPU(s): 4
[/proc/cpuinfo] model name : Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
[/proc/cpuinfo] cache size : 8192 KB
[/proc/cpuinfo] address sizes : 39 bits physical, 48 bits virtual
[lscpu] CPU MHz 3591.684
[/proc/meminfo] MemTotal: 11418128 kB
raffaele.arecchi {at} gmail {point} com
.


EMAILED ON OCTOBER 9, 2018 BY UNBANKD. Hacker Promises to Livestream a 51% Altcoin Attack Prepare for war Einsteinium In an attempt to educate the crypto community, an anonymous hacker, known by the Twitter username @geocold51, will perform a 51% attack against the altcoin Ei...


The component identified by the given index.
The component identified by the given index.
The area enclosed by the bounding box.
The maximum valued corner of this bounding box.
The maximum valued corner of this bounding box.
The minimum valued corner of this bounding box.
The minimum valued corner of this bounding box.
A method that should be called from every well-designed equals method that is open to be overridden in a subclass.
The center of the bounding box.
Clamp the given point to the bounds of the box.
Builds a new bounding box by apply a function to the corresponding corners of this and another bounding box.
The local coordinate of a world position.
All corners of the bounding box (unordered).
All corners of the bounding box (unordered).
The number of dimensions.
The number of dimensions.
Compares this vector to the specified value for equality.
Compares this vector to the specified value for equality.
Whether another bounding box is within a the standard epsilon of this bounding box.
Whether another bounding box is within a given epsilon of this bounding box.
Tests whether a predicate holds true for the corresponding corners of this and another bounding box.
Tests whether a predicate holds true for both corners this bounding box.
Tests whether a predicate holds true for either of the corresponding corners of this and another bounding box.
Tests whether a predicate holds true for either corner of this bounding box.
Applies a function to both corners of this bounding box.
Create a bounding box which grows (or shrinks) the current bounding box by the given amount.
Create a bounding box which grows the current bounding box to contain the given position.
Returns a hash code value for the object.
Returns a hash code value for the object.
The bounding box of the region shared with the given bounding box, if any.
Whether the given bounding box shares any volume with this bounding box.
Whether the given point in inside of the bounding box.
Whether any components are Not-a-Number (NaN).
Builds a new bounding box by applying a function to each corner of this bounding box.
Builds a new bounding box who's corners are the maximum of the corresponding corners of this and another bounding box.
Builds a new bounding box who's corners are the minimum of the corresponding corners of this and another bounding box.
The world position of a local coordinate.
Generate a random position inside the bounding box.
Generate a random position inside the bounding box.
The range of the bounding box.
Reduces the corners of this bounding box using the specified associative binary operator.
Split a bounding box along the coordinate [0, 1) of the given dimension.
Split a bounding box along the midpoint of the given dimension.
Convert to a 1-dimensional bounding box.
Convert to a 2-dimensional bounding box.
Convert to a 3-dimensional bounding box.
Convert to a more compact String representation.
Convert to a String representation
Convert to a String representation
Create a bounding box which contains the volume of both this and the given bounding box.
A copy of this bounding box in which the corner identified by index has been replaced with the given value.
A copy of this bounding box in which the corner identified by index has been replaced with the given value.
A copy of this bounding box in which the maximum corner has been replaced with the given position.
A copy of this bounding box in which the maximum corner has been replaced with the given position.
A copy of this bounding box in which the minimum corner has been replaced with the given position.
A copy of this bounding box in which the minimum corner has been replaced with the given position.


Bronco's miracle progress
by The Canadian PressThe mother of a hockey player paralyzed in the Humboldt Broncos bus crash says she's stunned by the progress he has made since receiving spinal surgery in Thailand.
Doctors implanted an epidural stimulator in Ryan Straschnitzki's spine earlier this month and a week later injected stem cells above and below the injury in the hope that will help reverse some of the damage.
The 20-year-old from Airdrie, Alta., is to remain in Thailand until early December.
"Hands down I'm 200 per cent behind this. I didn't expect this kind of result this quickly," Michelle Straschnitzki said in an interview. "It's definitely not a quick fix. It's not a cure, but it's certainly progress and it's more than we've had in 19 months."
Tom Straschnitzki, who is also in Thailand, has posted a number of videos of his son's rehab, including one where the young man was able to move a leg. Another video shows him strapped into a harness as physiotherapists slowly help him walk with the use of a machine on wheels.

Straschnitzki was one of 13 players who were injured when an inexperienced truck driver blew through a stop sign and into the path of the Saskatchewan junior hockey team's bus in April 2018. Sixteen others died.
Straschnitzki, who was paralyzed from the chest down, has said he isn't expecting a cure but hopes the implant will restore some muscle movement and things such as bladder control.
A small device like a remote control is to send electrical currents to his spinal cord to try to stimulate nerves and move limbs. The implant is being programmed to stimulate certain nerves mapped out by surgeons and therapists.
The surgery can cost up to $100,000 and isn't covered by public health care or insurance, because the epidural procedure has not been approved by Health Canada. The family is paying for it themselves. It is also performed in countries such as the United States and Switzerland, but it is much cheaper in Thailand.
The player's mother said seeing her boy's progress on the videos stunned her.
"I was just absolutely floored. It obviously brought the tears. I was bawling. It was unreal," she said.
"Tom said the last time Ryan walked was when he walked on the bus and then, to watch him moving his legs, walking essentially, that just rocked me."


This jQuery plug-in is an add-on for mottie’s tablesorter plug-in, more explicitly its pager add-on. It programmatically adds pager controls below a table and applies the pager add-on for large HTML tables, so that you don’t have to insert the controls to the HTML manually any more.
The “normal” usage of the tablesorter’s pager add-on requires you to manually create a user interface (control buttons to skip pages, page size selection and page display) in your HTML document (in addition to the table). The following HTML fragment is taken from an original example page:

<form>

<select class="pagesize">
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="all">All Rows</option>
</select>
</form>

When calling the tablesorterPager
plug-in, you may then “connect” these controls with the pager by setting corresponding options to the classes of the controls. This way, the plug-in is “wired” to your controls and adds the application logic to your UI.
While that is a clear separation of logic (in javascript) and user interface (in HTML) and offers you great freedom of UI design, I personally was looking for a solution which (just like the main tablesorter
functionality) is directly applicable to any table in my web application’s output without requiring the web app itself to include controls into its output.
So, the goal of this plug-in is to get rid of pager-specific HTML mark-up in the document. If you, too, want to dynamically apply a table sorter and pager to one or more tables inside some HTML document via JavaScript, while the HTML really only holds the data table, have a look at this plug-in.
Instead of manually adding controls like those shown above to your HTML document and calling the tablesorterPager
plug-in, you simply call this appendTablesorterPagerControls
plug-in on your jQuery resultset. It automatically appends a div
element beneath the table holding the default controls and then internally applies the tablesorterPager
, ‘wiring’ it to the inserted controls.
<button>…</button>
elements).
pillbuttons.css
stylesheet demonstrating styling capabilities by creating flat buttons with hover effect shaped with semicircles on the left- and righthand side.title
attribute).
outputFiltered
to work. If you don’t use the filter widget or you don’t need a different page display for filtered tables, this should also be compatible with earlier versions of tablesorter.Include the script files for jQuery, tablesorter, the pager and this plug-in to your HTML as well as the desired CSS files (you may use the bundled style sheets or create your own).
Select your tables via jQuery and apply the tablesorter
and appendTablesorterPagerControls
(instead of tablesorterPager
) to the result set.
Your HTML’s head might look like this:
<!DOCTYPE html>

<title>…</title>
<meta charset="utf-8">
<link rel="stylesheet" href="node_modules/tablesorter/dist/css/theme.blue.css" type="text/css">

<link rel="stylesheet" href="css/jquery.tablesorter.pager.appendcontrols.css" type="text/css">

The minified (distribution) script files include the main plug-in code as well as the tooltip definitions in one language. Therefore you’ll find the script file in different versions, named after the tooltip language.
If you want to include the unminified source scripts (e.g. for debugging purposes or if you’ve created a new language file and not yet compiled a new distribution file using it), you’ll have to first load the main script file (jquery.tablesorter.pager.appendcontrols.js
) followed by the various other files like defaults.js
and lastly the language pack file (e.g. jquery.tablesorter.pager.appendcontrols.english.js
).
The appendTablesorterPagerControls()
method optionally takes one or more objects as arguments which each may override default options. This means:
The default options are defined as follows (and may also be globally overwritten):
$.fn.appendTablesorterPagerControls.defaults = {
/**
* The table sizes (number of visible rows) selectable by the user.
* Array of numbers, must be sorted (ascending) and not empty.
*/
sizes: [20, 30, 40, 50, 100],
/**
* Initial table size.
* This must be a single element (number) of the sizes array to be preselected
* when loading the page / applying the plug-ing.
*/
initialSize: 20,
/**
* Prefix string used for generated element IDs.
* The ID for the DIV element holding the pager controls will consist of this prefix plus a number.
* Form elements within that DIV will get an ID starting identically, but with a further suffix:
* "sel" for the table size select box and "pgnr" for the input with the page number display.
*/
prefix: "tableSorterPager",
/**
* Pattern for the arrangement of the control elements.
* {first}, {prev}, {next}, and {last} are placeholders for the navigation buttons,
* {size} will be replaced with the select box for selecting the number of visible rows,
* {display} stands for the status display as formatted with the output option.
*/
controlsOutput: '{first}{prev}{display}{next}{last}{size}',
/**
* This output option is passed directly to the tablesorter pager plug-in.
* Defines the pattern of information to be displayed in the page display.
* (For details see the pager documentation.)
* Please note, that if you change this pattern, it's recommended to also change the
* corresponding tooltip text (see language-specific files).
*/
output: '{page}/{totalPages} ({startRow}-{endRow}/{totalRows})',
/**
* second output pattern only used when the 'filter' widget is applied to the table and the user
* entered a filter, i.e. the table does not show all rows.
* If null, the output pattern will not change for filtered tables. But you may use this option
* to define a separate output pattern containing the {filteredRows} or {filteredPages} placeholders.
*/
outputFiltered: null,
/**
* Size (width) for the input holding the page display. You may change this option
* corresponding to the output option.
* Or set to 0 or null in order to disable the input field completely and render the display
* as styleable text (in a span field).
*/
pagedisplayInputSize: null,
/**
* CSS class for the 'next page' button, defaults to 'next'.
*/
classNext: "next",
/**
* CSS class for the 'previous page' button, defaults to 'prev'.
*/
classPrev: "prev",
/**
* CSS class for the 'first page' button, defaults to 'first'.
*/
classFirst: "first",
/**
* CSS class for the 'last page' button, defaults to 'last'.
*/
classLast: "last",
/**
* CSS class for the span or input for displaying the current page, page count etc. (see output option for formatting this display).
* Defaults to 'pagedisplay'.
* NOTE: If you change this value, the included CSS files will not work completely, but will have to be adapted to the new class name.
*/
classPagedisplay: "pagedisplay",
/**
* CSS class for the page size selection (select element, defaults to 'pagesize').
*/
classPagesize: "pagesize",
/**
* CSS class for a div element wrapped around the table and its pager controls.
* Defaults to 'tablesorterPagerWrapper'.
* May also be space-separated list of class names like in any class attribute of an HTML element.
*/
classWrapper: "tablesorterPagerWrapper",
/**
* CSS class for a div element wrapped around the table and its pager controls within the
* wrapper of class 'classWrapper'. Defaults to null, in which case no inner wrapper is added.
* If non-null, the table and its conrols will be wrapped doubly like:
*

...

...

.
* By default, this inner div won't be added, but it can be used for some CSS tricks: So the outer wrapper
* may be displayed as a block while the inner's display style may be set to 'inline-block' which
* allows for example to align the controls to the right with the table even if the table is not full-width.
* May also be space-separated list of class names like in any class attribute of an HTML element.
*/
classInnerWrapper: null,
/**
* CSS class for a div element wrapped around the table only (inside the optional innerWrapper).
* Defaults to null, in which case no such table wrapper is added.
* If non-null, the table will be wrapped like this:
*

...

...

.
* Or, if the classInnerWrapper is also non-null:
*

...

...

.
* So, by default this table wrapper won't be added, but it may be added for some CSS formatting.
* It's especially useful if you may have very wide table and want them to be horizontally scrollable.
* In this case, you may set this option and introduce a CSS rule setting overflow-x: scroll for the table wrapper.
* That way, the table itself will be scrollable (if wider that the viewport) while the table pager controls beneath
* it (as well as content above the table or beneath the pager controls) will stay fixed and won't scroll left or right
* with the table, i.e. the user will always see and will always be able to operate the pager regardless of
* the horizontal scroll position of the table.
*/
classTableWrapper: null,
/**
* CSS class for a div element containing the table pager controls (inserted below the table).
* Defaults to 'tablesorterPagerControls'.
* NOTE: If you change this value, the included CSS files will not work completely, but will have to be adapted to the new class name.
*/
classControls: "tablesorterPagerControls",
/**
* button label for the 'first page' button.
*/
labelFirst: "<<",
/**
* button label for the 'previous page' button.
*/
labelPrev: "<",
/**
* button label for the 'next page' button.
*/
labelNext: ">",
/**
* button label for the 'last page' button.
*/
labelLast: ">>"
};
As said, you may call the jQuery plug-in with an object as argument holding those options you wish to override. If you want to repeatedly override a whole subset of options, you may aggregate these into template objects. Four predefined templates are included, see templates.js.
The application of these templates is demonstrated in the examples.
If you download the package from GitHub or NPM, you’ll find it includes some example pages.
Online views of these examples can also be found on the project’s home page.
Copyright (c) 2017, Immo Schulz-Gerlach, www.isg-software.de
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.


--- layout: page title: About Us description: Why we love what we do background: '/img/bg-about.jpg' ---
NH Home N' Brew is a product of Mariya and Ian's love for cooking. We truly enjoy the time that we spend together in the kitchen. Trying out new recipes, re-making one of our favorites, or just quickly whipping up dinner, cooking together is one of our favorite shared activities. We live and work on the New Hampshire seacoast with our two cats, CatCat and Rey. They also like to help us cook sometimes, usually adding in some cat fur for good measure.
Ian also has a love for homebrewing, so we decided we couldn't start this website without including a homebrew section. Ian's goal is to share his knowledge of homebrewing with current homebrewers or those who are interested in starting. In their current home, the homebrewery runs out of the garage, but hopefully one day Ian can get a dedicated space that will allow him to upgrade his set up.
 We hope that by sharing some of what we love, we can encourage others to try out something new and excting.


Todo List Application
How to run the application
- Open Command prompt
- cd into the directory of the project
- run the following command:
npm install
- Open index.html using your browser
User Guide
-
Upon running index.html, you will see the following page
-
To add a new task, type the name of the task and press ENTER, as shown below
-
After pressing ENTER, it will show as
-
To mark a task as Completed, you can click on the checkbox on each task item, as highlighted below
-
All the Completed tasks can be seen in the separate "Completed" tab / filter
-
You can check all the "Active" tasks in the Active tab. "All" tab will contain both active and completed tasks
-
On the bottom left you can see the number of tasks which are active. Also, there's a button on bottom right to clear the tasks which are completed
-
To mark all the tasks as "Completed" or "Active" again, you can click this button
-
If you want to edit a task, "double click" on a task and the task will be opened in the edit mode for you to edit it. Pressing ENTER will save the update and ESC will not save it and get out of edit mode
-
If you want to delete a task, hover the mouse over to the desired task and click on the red cross button to delete it
About the Code
MVC:
The codebase is in MVC (Model - View - Controller) structure. This practice got recognised because of it's separation of concerns patterns. This coding practice is widely used by multiple frameworks and technologies, ASP.NET MVC, angular to be few named among those.
It works the way that View, Model and controller and disconnected and they are communicating with each other.
View:
View is what the user sees. It's job is to communicate with the Controller to pass and receive the data to and from the controller. View gets the data from the controller and displays it onto the UI and similarly, it gets user's interactions with the view and pass them onto the controller.
Controller:
Controller is the brain of the application. It takes data from the view and after processing, it saves the data using the model. It passes the required info to the view and gets the data persisted using model
Model:
Model has the job of data persistance. Controller asks the Model to perform database jobs. It can be used to retreive or save data in the database.
How the code is working in the Todo-list application:
-
Upon the application load,
Todo
class is initialized and it's job is to loadStore
,Model
,Template
,View
andController
with the necessory properties.function Todo(name) { this.storage = new app.Store(name); this.model = new app.Model(this.storage); this.template = new app.Template(); this.view = new app.View(this.template); this.controller = new app.Controller(this.model, this.view); }
-
Model
hasStore
object to perform DB operations,View
hasTemplate
object to perform generic rendering changes.Controller
has bothView
andModel
objects because it communicates with bothView
andModel
.model.js:
function Model(storage) { this.storage = storage; } ...
view.cs
... function View(template) { this.template = template; this.ENTER_KEY = 13; this.ESCAPE_KEY = 27; this.$todoList = qs('.todo-list'); this.$todoItemCounter = qs('.todo-count'); this.$clearCompleted = qs('.clear-completed'); this.$main = qs('.main'); this.$footer = qs('.footer'); this.$toggleAll = qs('.toggle-all'); this.$newTodo = qs('.new-todo'); } ...
-
On load,
Controller
usesView
's bind function to bind the UI with it's own methods ascallbacks
so thatView
is connected to theController
upon userevents
.controller.js:
function Controller(model, view) { var self = this; self.model = model; self.view = view; self.view.bind('newTodo', function (title) { self.addItem(title); }); self.view.bind('itemEdit', function (item) { self.editItem(item.id); }); ... }
view.js
... View.prototype.bind = function (event, handler) { var self = this; if (event === 'newTodo') { $on(self.$newTodo, 'change', function () { handler(self.$newTodo.value); }); } else if (event === 'removeCompleted') { $on(self.$clearCompleted, 'click', function () { handler(); }); }; ...
-
Controller
usesView
'srender()
method to update / render the view with the latest changes made byController
usingModel
.controller.js
... Controller.prototype.addItem = function (title) { var self = this; if (title.trim() === '') { return; } self.model.create(title, function () { self.view.render('clearNewTodo'); // NOTE HERE self._filter(true); }); }; ...
view.js
... View.prototype.render = function (viewCmd, parameter) { // viewCmd = "clearNewTodo" here var self = this; var viewCommands = { showEntries: function () { self.$todoList.innerHTML = self.template.show(parameter); }, clearNewTodo: function () { self.$newTodo.value = ''; } ... }; viewCommands[viewCmd](); }; ...
-
View
savesTemplate
s object as its properties.Template
has a central common code that holds generic methods to perform UI operations like addingeventlisteners
, rendering todo item etc -
Overall functionality goes like:
- User does something on the UI
- As on load, controller has binded its methods as callbacks to the View's elements using Template, request comes to the scope of controller.
Controller
executes its method when the request reaches it using user interaction on theView
. This method is responsible for communication with Model to store the data / retrieve the data from the database- Model has a property of store object. Model uses this object to database changes to have central and reusable code.
How to run the Tests
- Go to the test folder existing in the root of the project.
- Run the file SpecRunner.html using your preferred browser.
- If all the tests have passed, then a Green bar will displayed showing total tests and 0 failures and the page will display in Green text. If failed, red bar will error count will be displayed, along with the red text on the page.
How the tests work in the project using Jasmine
-
Testing is using the same MVC framework, upon which the application is built. This is the benefit of the MVC framework; to get the reusability out of the application in the form of separated business logic (Controller).
-
Model and the View are fake and they are setup in a way to replicate the functionality of the application using Controller of our core application to test the working of the business logic.
-
Before any test is executed, we setup our MVC structure in the JavaScript file containing jasmine tests. Model and View are fakes and Controller is real both model and view are passed to it to form a connection between the three. We are using jasmine's
beforeEach
method to achieve thatbeforeEach(function () { model = jasmine.createSpyObj('model', ['read', 'getCount', 'remove', 'create', 'update']); view = createViewStub(); subject = new app.Controller(model, view); });
-
Model object is a jasmine spy object which will check if the model's declared methods are called with specific callback functions or not.
model = jasmine.createSpyObj('model', ['read', 'getCount', 'remove', 'create', 'update']
-
View
is an object withbind
andtrigger
methods, andrender
as a spy object fromjasmine
which will only track calls of theModel
object. (It wont check for thecallback
functions like for the case ofModel
)view = createViewStub(); ... var createViewStub = function () { var eventRegistry = {}; return { render: jasmine.createSpy('render'), bind: function (event, handler) { eventRegistry[event] = handler; }, trigger: function (event, parameter) { eventRegistry[event](parameter); } }; };
-
Subject
is theController
object which hasView
andModel
objects in it. -
A simple test case starts with 1. setting up the Model with some data, 2. setting up the view (2a. AND / OR triggering some event using View object's trigger method) and 3. expecting some output from the Controller and testing it like below:
it('should show entries on start-up', function () { // TODO: write test var todo = [ {title: 'my todo', completed: true}, {title: 'my todo', completed: false}, {title: 'my todo', completed: true} ]; setUpModel(todo); subject.setView(''); expect(view.render).toHaveBeenCalledWith('showEntries', todo); });
-
As the
View
andController
are bind together, we can trigger a certain method usingtrigger
ofView
object, which can act as a fake event that got triggered. This will take the scope to theController
(with some data that we pass on) and hence we can test theModel
's functions or theView
'sRender
being called as acallback
with specific parameters.view.trigger('toggleAll', {completed: true});
-
Thanks to Jasmin, we can validate Controller's business logic using expect method. To validate Model operation occuring in the Controller's business logic, we use:
expect(model.read).toHaveBeenCalledWith({completed: true}, jasmine.any(Function));
-
Similarly, to validate View's render operation occuring in the Controller's business logic, we use:
expect(view.render).toHaveBeenCalledWith('showEntries', {title: 'my todo', completed: true});
Performance Evaluation
Competitor:
The competitor website is todolistme.net is a full fledged solution with a lot other features as well. It has an intuitive UI and it is easy to use. The user interface is very good and it has made the functionalities very easy to understand and use. Some of the features which separate it from our app are:
-
Sorting of the tasks
-
Can create multiple projects and add todos in them.
-
Separation of Today / Tomorrow tasks.
-
Print functionality to print the tasks.
-
New Category and new lists functionality
-
Login / Register
-
Server maintained data and sync able.
Performance Evaluation
Competitor:
Speed index, Time to interactive and Largest contentful paint are three points where improvements can be made
Suggestions to improve:
-
Avoid unnecessary downloads to improve rendering speed
-
Usage of caching as much as possible
-
Optimization of images to use sprites or resized images
-
Limit the number of fonts used in the app.
-
Images which aren’t important at the user’s first contact should lazy load until the user scrolls down.
-
Minify and uglify CSS and JS using gulp and babel
Our Application
Our application is purely client javascript based and since it does not have a server, it is very fast compared to competitor. But not having a server is also its drawback because a user is unable to save its data permanently.
Performance evaluation:
-
Since it is purely Client-JS based and does not have a server, it is very fast
-
To increase load time, CSS and JS should be minified and uglified using gulp and babel.
-
Some of the coding practices should be altered and ES6+ javascript should be used
-
Object Oriented Javascript practices using ES6+ should be used
-
Sprites should be used for images to increase load speed, or image resizing.
Scalability:
We can scale this applciation easily by following some of observations:
-
Having a server side to store the data somewhere
-
Allowing users to register and login
-
Allowing users to create multiple projects and lists which will scale the app throughout
-
Minify JS and CSS and uglify them on production
-
Using lazy loading as much as possible
-
Using sprites for images or using resized images
-
Code should be converted to ES6+ code and OOP power should be used.


Give it a shot and try JavaScript
Give it a shot and try Python 3
Give it a shot and try Ruby on Rails


THE EASIEST WAY TO SEARCH ON THE NEW ZEALAND INTERNET
SEARCH WITH SUCCESS WITH SEARCHNZ Welcome to SearchNZ. A fault-tolerant ("fuzzy") search engine, restricted to New Zealand cyberspace and part of the NZCity group of premium web content for New Zealanders.
SearchNZ allows you to search through the actual text that exists on pages of NZ Web sites, as opposed to a web directory which only lets you search or browse descriptions of submitted sites.
SearchNZ has a great feature not available on most other Web search engines - it's "fuzzy", allowing you to search on words even if you are unsure of the correct spelling.
We recommend you read our search hints to make the most of SearchNZ's superior features.
NZSearch Web Directory Domain name search New Website guide Add SearchNZ to your website
Add Site |
Search Tips |
Advertise |
About Us |
Contact Us |
Web Directory
Search Other Countries:
Australia,
Sweden,
Ireland,
United Kingdom
|


Hello world!
I am Yujie (Ella) Chen, a second year master student from the School of Information at the University of Michigan. My dream is to become an outstanding data scientist. This is my personal website. Welcome!
I am Yujie (Ella) Chen, a second year master student from the School of Information at the University of Michigan. My dream is to become an outstanding data scientist. This is my personal website. Welcome!


Abstract—This electronic document is a live
template and already defines the components of your paper in its style sheet.
Keywords—component; formatting; style; styling; insert
This template shows the basic setup of a printable online IEEE formatted paper. This interface provides support for highlighting Communicating Hardware Processes and Production Rules code blocks using a prism-js plugin. It provides support for simple and clean charts using chartist and a few plugins. And it provides support for IEEE formatting.
inline code may be included using like so *[ L?; R! ]
. Block code, must be surrounded with pre tags. The highlight language may be specified by class="language-chp"
or class="language-prs"
. This is inherited, so as long as any parent tag has this class, code will be highlighted with that language.
*[ [ L.f -> R.f+
[] L.t -> R.t+
]; L.e-;
[~L.f & ~L.t]; R.f-,R.t-;
L.e+
] ||
*[[L.e]; [true->L.f+:true->L.t+]; [~L.e]; L.f-,L.t-] ||
*[[R.f | R.t]; R.e-; [~R.f & ~R.t]; R.e+]
Citations are handled with HTML links to the reference . They are automatically numbered by the template so you can leave their content empty.
On certain integrals of Lipschitz-Hankel type involving products of Bessel functions,Phil. Trans. Roy. Soc. London, vol. A247, pp. 529–551, April 1955. (references) J. Clerk Maxwell, A Treatise on Electricity and Magnetism, 3rd ed., vol. 2. Oxford: Clarendon, 1892, pp.68–73. I. S. Jacobs and C. P. Bean,
Fine particles, thin films and exchange anisotropy,in Magnetism, vol. III, G. T. Rado and H. Suhl, Eds. New York: Academic, 1963, pp. 271–350. K. Elissa,
Title of paper if known,unpublished. Park, T. H., Saxena, A., Jagannath, S., Wiedenbeck, S., and Forte, A. Towards a taxonomy of errors in HTML and CSS. In Proc. ICER 2013, ACM Press (2013), 75-82. R. Nicole,
Title of paper with only first word capitalized,J. Name Stand. Abbrev., in press. Y. Yorozu, M. Hirano, K. Oka, and Y. Tagawa,
Electron spectroscopy studies on magneto-optical media and plastic substrate interface,IEEE Transl. J. Magn. Japan, vol. 2, pp. 740–741, August 1987 [Digests 9th Annual Conf. Magnetics Japan, p. 301, 1982]. M. Young, The Technical Writer’s Handbook. Mill Valley, CA: University Science, 1989.