text:
# Configure vs build presets

I’m trying to express the difference between Configure and Build presets, other than the obvious fact that they are used at configuration and build time.

Is there a good explanation of this in the documentation?

Our typical workflow is:

cmake -G Ninja -D PROJECT_VARIANT= …/…
ninja -v

What is the syntax for replacing these commands with cmake commands that specify presets?

The first line would be a configure preset. You can specify `"generator": "Ninja"` and `"cacheVariables": { "PROJECT_VARIANT": ".../..." }`.

The second line would be a build preset. You can specify `"verbose": true`.

format: plain


text:
# linear_ramp

The Boulder Opal Toolkits are currently in beta phase of development. Breaking changes may be introduced.

linear_ramp(duration, end_value, start_value=None, start_time=0.0, end_time=None)

Create a Signal object representing a linear ramp.

Parameters
• duration (float) – The duration of the signal, $$T$$.

• end_value (float or complex) – The value of the ramp at $$t = t_\mathrm{end}$$, $$a_\mathrm{end}$$.

• start_value (float or complex, optional) – The value of the ramp at $$t = t_\mathrm{start}$$, $$a_\mathrm{start}$$. Defaults to $$-a_\mathrm{end}$$.

• start_time (float, optional) – The time at which the linear ramp starts, $$t_\mathrm{start}$$. Defaults to 0.

• end_time (float, optional) – The time at which the linear ramp ends, $$t_\mathrm{end}$$. Defaults to the given duration $$T$$.

Returns

The linear ramp.

Return type

Signal

signals.linear_ramp_pwc()

Graph operation to create a Pwc representing a linear ramp.

signals.linear_ramp_stf()

Graph operation to create a Stf representing a linear ramp.

signals.tanh_ramp()

Create a Signal object representing a hyperbolic tangent ramp.

Notes

The linear ramp is defined as

$\begin{split}\mathop{\mathrm{Linear}}(t) = \begin{cases} a_\mathrm{start} &\mathrm{if} \quad t < t_\mathrm{start}\\ a_\mathrm{start} + (a_\mathrm{end} - a_\mathrm{start}) \frac{t - t_\mathrm{start}}{t_\mathrm{end} - t_\mathrm{start}} &\mathrm{if} \quad t_\mathrm{start} \le t \le t_\mathrm{end} \\ a_\mathrm{end} &\mathrm{if} \quad t > t_\mathrm{end} \end{cases} .\end{split}$

Examples

Define a linear ramp with start and end times.

>>> signal = qctrl.signals.linear_ramp(
...     duration=4, end_value=2, start_time=1, end_time=3
... )
>>> signal.export_with_time_step(time_step=0.25)
array([-2.  , -2.  , -2.  , -2.  , -1.75, -1.25, -0.75, -0.25,  0.25,
0.75,  1.25,  1.75,  2.  ,  2.  ,  2.  ,  2.  ])


text:
PL EN

Preferencje
Język
Widoczny [Schowaj] Abstrakt
Liczba wyników
Czasopismo

## Discussiones Mathematicae Graph Theory

2002 | 22 | 1 | 159-172
Tytuł artykułu

### On well-covered graphs of odd girth 7 or greater

Autorzy
Treść / Zawartość
Warianty tytułu
Języki publikacji
EN
Abstrakty
EN
A maximum independent set of vertices in a graph is a set of pairwise nonadjacent vertices of largest cardinality α. Plummer [14] defined a graph to be well-covered, if every independent set is contained in a maximum independent set of G. One of the most challenging problems in this area, posed in the survey of Plummer [15], is to find a good characterization of well-covered graphs of girth 4. We examine several subclasses of well-covered graphs of girth ≥ 4 with respect to the odd girth of the graph. We prove that every isolate-vertex-free well-covered graph G containing neither C₃, C₅ nor C₇ as a subgraph is even very well-covered. Here, a isolate-vertex-free well-covered graph G is called very well-covered, if G satisfies α(G) = n/2. A vertex set D of G is dominating if every vertex not in D is adjacent to some vertex in D. The domination number γ(G) is the minimum order of a dominating set of G. Obviously, the inequality γ(G) ≤ α(G) holds. The family $𝓖_{γ=α}$ of graphs G with γ(G) = α(G) forms a subclass of well-covered graphs. We prove that every connected member G of $𝓖_{γ=α}$ containing neither C₃ nor C₅ as a subgraph is a K₁, C₄,C₇ or a corona graph.
Słowa kluczowe
EN
Kategorie tematyczne
Wydawca
Czasopismo
Rocznik
Tom
Numer
Strony
159-172
Opis fizyczny
Daty
wydano
2002
otrzymano
2000-08-04
poprawiono
2001-12-23
Twórcy
autor
• Institut für Informatik, Universität zu Köln, D-50969 Köln, Germany
• Mathematics Department, Aalborg University, DK-9220 Aalborg Ø, Denmark
Bibliografia
• [1] M.O. Albertson, L. Chan and R. Haas, Independence and graph homomorphisms, J. Graph Theory 17 (1993) 581-588, doi: 10.1002/jgt.3190170503.
• [2] X. Baogen, E. Cockayne, T.W. Haynes, S.T. Hedetniemi and Z. Shangchao, Extremal graphs for inequalities involving domination parameters, Discrete Math. 216 (2000) 1-10, doi: 10.1016/S0012-365X(99)00251-4.
• [3] C. Berge, Regularizable graphs, Ann. Discrete Math. 3 (1978) 11-19, doi: 10.1016/S0167-5060(08)70493-X.
• [4] V. Chvátal and P.J. Slater, A note on well-covered graphs, Ann. Discrete Math. 55 (1993) 179-182, doi: 10.1016/S0167-5060(08)70387-X.
• [5] O. Favaron, Very well-covered graphs, Discrete Math. 42 (1982) 177-187, doi: 10.1016/0012-365X(82)90215-1.
• [6] A. Finbow and B. Hartnell, A game related to covering by stars, Ars Combin. 16 (A) (1983) 189-198.
• [7] A. Finbow, B. Hartnell and R.J. Nowakowski, A characterization of well-covered graphs of girth 5 or greater, J. Combin. Theory (B) 57 (1993) 44-68, doi: 10.1006/jctb.1993.1005.
• [8] A. Finbow, B. Hartnell and R.J. Nowakowski, A characterization of well-covered graphs which contain neither 4- nor 5-cycles, J. Graph Theory 18 (1994) 713-721, doi: 10.1002/jgt.3190180707.
• [9] J.F. Fink, M.S. Jacobson, L.F. Kinch and J. Roberts, On graphs having domination number half their order, Period. Math. Hungar. 16 (1985) 287-293, doi: 10.1007/BF01848079.
• [10] O. Ore, Theory of Graphs (Amer. Math. Soc. Colloq. Publ. 38, 1962).
• [11] C. Payan and N.H. Xuong, Domination-balanced graphs. J. Graph Theory 6 (1982) 23-32, doi: 10.1002/jgt.3190060104.
• [12] M.R. Pinter, A class of planar well-covered graphs with girth four, J. Graph Theory 19 (1995) 69-81, doi: 10.1002/jgt.3190190108.
• [13] M.R. Pinter, A class of well-covered graphs with girth four, Ars Combin. 45 (1997) 241-255.
• [14] M.D. Plummer, Some covering concepts in graphs, J. Combin. Theory 8 (1970) 91-98, doi: 10.1016/S0021-9800(70)80011-4.
• [15] M.D. Plummer, Well-covered graphs: a survey, Quaestiones Math. 16 (1993) 253-287, doi: 10.1080/16073606.1993.9631737.
• [16] B. Randerath and L. Volkmann, Characterization of graphs with equal domination and covering number, Discrete Math. 191 (1998) 159-169, doi: 10.1016/S0012-365X(98)00103-4.
• [17] R.S. Sankaranarayanan and L.K. Stewart, Complexity results for well-covered graphs, Networks 22 (1992) 247-262, doi: 10.1002/net.3230220304.
• [18] J. Staples, Ph. D. dissertation (Vanderbilt University, Nashville, TN, 1975).
• [19] L. Szamkołowicz, Sur la classification des graphes en vue des propriétés de leurs noyaux, Prace Nauk. Inst. Mat. i Fiz. Teoret., Politechn. Wrocław., Ser. Stud. Mater. 3 (1970) 15-21.
• [20] J. Topp and L. Volkmann, On domination and independence numbers of graphs, Resultate Math. 17 (1990) 333-341.
• [21] W.T. Tutte, The 1-factors of oriented graphs, Proc. Amer. Math. Soc. 4 (1953) 922-931.
Typ dokumentu
Bibliografia
Identyfikatory


text:
BREAKING NEWS
50,000

## Summary

50,000 (fifty thousand) is the natural number that comes after 49,999 and before 50,001 .

 ← 49999 50000 50001 →
Cardinalfifty thousand
Ordinal50000th
(fifty thousandth)
Factorization24 × 55
Greek numeral${\displaystyle {\stackrel {\epsilon }{\mathrm {M} }}}$
Roman numeralL
Unicode symbol(s)
Binary11000011010100002
Ternary21121202123
Octal1415208
Duodecimal24B2812

## Selected numbers in the range 50001–59999

### 50001 to 50999

• 50069 = 11 + 22 + 33 + 44 + 55 + 66
• 50400 = highly composite number[1]
• 50625 = 154, smallest fourth power that can be expressed as the sum of only five distinct fourth powers, palindromic in base 14 (1464114)
• 50653 = 373, palindromic in base 6 (10303016)

### 51000 to 51999

• 51076 = 2262, palindromic in base 15 (1020115)
• 51641 = Markov number[2]
• 51984 = 2282 = 373 + 113. the smallest square to the sum of only five distinct fourth powers.

### 57000 to 57999

• 57121 = 2392, palindromic in base 14 (16B6114)

### 58000 to 58999

• 58081 = 2412, palindromic in base 15 (1232115)
• 58367 = smallest integer that cannot be expressed as a sum of fewer than 1079 tenth powers
• 58786 = Catalan number[12]
• 58921 = Friedman prime

### 59000 to 59999

• 59049 = 2432 = 95 = 310
• 59051 = Friedman prime
• 59053 = Friedman prime
• 59081 = Zeisel number[4]
• 59263 = Friedman prime
• 59273 = Friedman prime
• 59319 = 393
• 59536 = 2442, palindromic in base 11 (4080411)

There are 924 prime numbers between 50000 and 60000.

## References

1. ^ "Sloane's A002182 : Highly composite numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
2. ^ "Sloane's A002559 : Markoff (or Markov) numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
3. ^ "Sloane's A002997 : Carmichael numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
4. ^ a b "Sloane's A051015 : Zeisel numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
5. ^ Sloane, N. J. A. (ed.). "Sequence A030984 (2-automorphic numbers)". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2021-09-01.
6. ^ "Sloane's A005188 : Armstrong (or Plus Perfect, or narcissistic) numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
7. ^ "Sloane's A195163 : 1000-gonal numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
8. ^ "Sloane's A002201 : Superior highly composite numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
9. ^ "Sloane's A004490 : Colossally abundant numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
10. ^ "Sloane's A001599 : Harmonic or Ore numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
11. ^ "Sloane's A001190 : Wedderburn-Etherington numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.
12. ^ "Sloane's A00108 : Catalan numbers". The On-Line Encyclopedia of Integer Sequences. OEIS Foundation. Retrieved 2016-06-16.


text:
# 9 Session 9: Informative Priors

## 9.1 Priors

### 9.1.1 Learning Objectives

In this lesson you will learn: - Why and when to use informative priors, and how they can be helpful - How to elicit priors from yourself or other experts - How to specify priors from limited data - How to evaluate the sensitivity of your results to priors

### 9.1.2 Background

What are priors?

Even outside of Bayesian statistics, the concept of priors is a core component of the scientific process - building on existing knowledge. Further, the use of informative priors is a way of getting the most out of your statistical analysis.

$\overbrace{P(\theta \mid X)}^{posterior} \propto \overbrace{P(X\mid \theta)}^{likelihood}\,\overbrace{P(\theta)}^{prior}$

### 9.1.3 Conjugate Priors

Probability distributions have useful relationships. For simple models, Bayes’ Theorem can be solved mathematically. This is very appealing when it applies.

The figure below shows some relationships among probability distributions are related. It comes from an interactive website created by John Cook, which brings the paper “A compendium of conjugate priors” by Daniel Fink to life.

Digging into the math is mostly beyond the scope of this lesson, except for the following illustrative example. This example is provided to show how the prior, the sample size, and the variance of data influence the posterior estimate.

Consider the solution to the ‘normal-normal’ conjugate prior and likelihood.

If the prior mean is $$\mu_0$$ and the prior variance is $$\sigma_0^2$$

And the likelihood mean $$\bar{x}$$ and variance $$s^2$$:

Then the posterior mean is

$\frac{1}{\frac{1}{\sigma_0^2}+\frac{n}{\sigma^2}} \left( \frac{\mu_0}{\sigma_0^2}+ \frac{\sum_{i=1}^{n}{x_i}}{\sigma^2}\right)$

And the posterior variance is:

$\left( \frac{1}{\sigma_0^2} +\frac{n}{\sigma^2} \right)^{-1}$

Questions:

• Is that math there just to scare you? (hint: no)
• What happens when the prior variance, $$\sigma^2_0$$ , is very large?
• What happens when the sample size, $$n$$, is very large?

Yes, that is correct. When the sample size and/or the prior variance is large, the influence of the prior diminishes to 0.

### 9.1.4 Uniformative / Weak / Flat Priors

It is common to use what is known as a ‘noninformative’ or ‘flat’ prior. This is often the easiest approach, and is roughly defined by the fact that the priors have no influence on the model.

Some common non-informative priors include a standard normal with large variance, such as $$N(0, 10^4)$$ or a wide uniform distribution - such as $$U(-10^4, 10^4)$$.

Discussion:

• If you were setting a prior on the size of a fish, what would your prior be?
• That was a trick question - is size measured as mass or length? Hint: Consider a spherical fish with radius 1cm and density of 1g/ml. Recall $$V=\frac{4}{3}\pi r^3$$
• When are informative priors useful?
length <- runif(100000, -10000, 10000)
mass <- 4/3 * pi * (length / 2) ^ 3
par(mfrow=c(1,2))
hist(length, probability = TRUE, breaks = 100)
hist(mass, probability = TRUE, breaks = 100)

Correct, even a non-informative prior or ‘flat’ prior on length is not so flat on a different scale. Consider other transformations.

What else do you notice about the range of values? Correct, most of the measurements that we make are greater than zero. At a minimum, it is useful to have a prior with a lower bound at zero. These include the log-Normal, Gamma, Weibull, and many other distributions. But as soon as you specify a prior distribution, you are imposing your understanding on the model. This is okay! This is The Way!

In conclusion, there really is no such thing as a non-informative prior. However, it is often vastly easier to specify a weak prior than to go through the trouble of justifying an informative prior.

### 9.1.5 Regularizing priors

Regularization priors are relatively non-informative, but on a similar scale as the data. These provide a way to assign 0 probability to impossible values (e.g. a boundary at zero) and to down weight extreme outlines.

### 9.1.6 Informative Priors

Informative priors are particularly useful in contexts with limited available data.

In many cases, it will be possible for an expert to use what is already known about a variable to specify a more informative prior. In the ideal case, a posterior from a previous study can be used as the prior for the subsequent study. This is the first step toward iterative forecasting - updating a prediction as new information becomes available.

In practice, however, it is often wise to inflate the variance to account for differences across systems - the specific study system (Delta) and what is generally known about freshwater systems.

There are many sources of information from which you can specify priors, including:

1. Expert knowledge, including biophysical constraints, logical bounds, or reasonable values based on experience (what are the upper and lower bounds for the length of a mouse?)
2. Lots of data from prior studies on the same system.
3. A little bit of data.
4. A lot or a little bit of data, but from a related system
5. Posterior from a related model, or from the same model at a prior time-step.

Prior sensitivity

It is prudent to test the sensitivity of your model to your prior assumptions. Having a model that is sensitive to priors is OK, especially when there is a strong rationale and support from data. However, it is necessary to understand how the use of an informative prior affects your posterior estimates.

It is very common when using strong priors to find that the MCMC chains do not converge, because the posteriors exist where the priors have very low probaility. This often leads you to uncover differences between how you and the computer understand your model (what you think the code says and what it actually says); it can also point to errors in the data (often related to scale, or unexpected factors that differ), and other assumptions.

If applicable, you can plot the data against the prior on Y. Plot the data against The easiest way to do this is to plot the prior PDFs and posterior histograms, and to compare the prior and posterior variances of each parameter. If the ratio of posterior:prior SD > 0.1, you have an informative prior and you should be careful.

Think of this in the same way that you think of model specification. You can compare model posteriors fit with different priors in the same way that you can compare models with different structures or parameters, both visually and statistically.

### 9.1.7Generating Priors based or Expert knowledge:

Package rriskDistributions

The rriskDistributions is useful for estimating priors.

Individual functions for each distribution such as get.<somedist>.par include diagnostic plots that compare chosen points to cdf.

As an example, compute the parameters of a Gamma distribution that fits a median of 2.5 and has a 95%CI of [1, 10]:

library(rriskDistributions)
get.gamma.par(p = c(0.025, 0.50, 0.975), q = c(1, 2.5, 10), tol = 0.1)
## The fitting procedure 'L-BFGS-B' was successful!
## $par ## [1] 6.300745 2.388508 ## ##$value
## [1] 6.942286e-05
##
## $counts ## function gradient ## 26 26 ## ##$convergence
## [1] 0
##
## \$message
## [1] "CONVERGENCE: REL_REDUCTION_OF_F <= FACTR*EPSMCH"

##    shape     rate
## 6.300745 2.388508

The function fit.pecr provides a GUI to explore the fits of a range of distributions, e.g.:

fit.perc(p = c(0.1, 0.5, 0.9), q = c(30, 60, 90), tolConv = 0.1)

Web based elicitation tool

http://optics.eee.nottingham.ac.uk/match/uncertainty.php# (Morris et al 2013)

Work with a partner in your project group

1. Choose a parameter in one of the models that you are developing (e.g. growth rate of a fish population, lag between flooding event and peak phytoplankton concentration);
2. Write down what you know about this based on your experience. Start with plausible ranges (max, min) then location of tails - 95% CI. Estimate most likely values and central tendencies (median, mode) last.
3. Choose one of the tools above and generate a set of flat, weak / regularizing, and a strong prior.

### 9.1.8 Statistical fitting to data

More formal, data driven examples are provided in LeBauer et al 2013. Not always worth the trouble. Some code in https://github.com/PecanProject/pecan/blob/develop/modules/priors/vignettes/priors_demo.Rmd

• Maximum likelihood fitting of parametric distributions to related data

• Bayesian ‘posterior prediction’ of an unobserved class for which data has been collected from other classes.
model{
for (k in 1:length(Y)){
Y[k]  ~ dnorm(beta.ft[ft[k]], tau.y[k])T(0,)
tau.y[k] <- prec.y*n[k]
u1[k] <- n[k]/2
u2[k] <- n[k]/(2*prec.y)
obs.prec[k] ~ dgamma(u1[k], u2[k])
}
for (f in 1:5){
beta.ft[f] ~ dnorm(0, tau.ft)
}
tau.ft ~ dgamma(0.1, 0.1)
prec.y    ~ dgamma(0.1, 0.1)
sd.y      <- 1 / sqrt(prec.y)
## estimating posterior predictive for new C4 species
pi.pavi <- Y[length(Y)]
diff <- beta.ft[1] - beta.ft[2]
}

### 9.1.9 References and further reading

David E. Morris, Jeremy E. Oakley, John A. Crowe, A web-based tool for eliciting probability distributions from experts, Environmental Modelling & Software, Volume 52, February 2014, Pages 1-4, ISSN 1364-8152, http://dx.doi.org/10.1016/j.envsoft.2013.10.010.

Gelman, Lawrence, et al “Prior choice recommendations” Stan Community Wiki https://github.com/stan-dev/stan/wiki/Prior-Choice-Recommendations