text:
# C language

What is the difference between switch statement and if statement?

## Answers and Replies

Borek
Mentor
Let's start from the very beginning. What are they used for? What is the syntax in each case?

Switch: tests the value of a given variable against a list of case values and when a match is found, a block of statements associated with that case is executed.

If Else: If the test value is true, then the true block statements following the if are executed.

Now, the point is that I feel that both are the same and can be used interchangeably.

Am i right?

Here's something you can't do with a switch statement:

Code:
if (x > 10)
{
// Do something
}
else if (x < 0)
{
// Do something else
}
else
{
// etc...
}

So not really interchangeable in quite a few cases. An if can do what a switch can (though maybe less clearly and possibly less easy for the compiler to optimize). But a switch can't do everything an if statement can.

chiro
Switch: tests the value of a given variable against a list of case values and when a match is found, a block of statements associated with that case is executed.

If Else: If the test value is true, then the true block statements following the if are executed.

Now, the point is that I feel that both are the same and can be used interchangeably.

Am i right?

Switch statement compares a result with specific values. The if statement is a more general test that allows you to use more general tests for each if statement and more any subsequent elseif statement.

wow, thanks!


text:
Tag Info

bV diagram of TE modes guided by waveguides with a linearly tapered index profile

You've misunderstood the meaning of $m$ in the book. The following gives the desired plot: ...
• 54.1k
1 vote

Finding a (sufficient) condition for an inequality - Solve takes too long

Take Log of function and Log[10,variable] to have a chance to handle it and show a graphic of solution. Also restrict n>1 for real values of Log[n]. ...
• 16.4k

Is it possible to characterize the sign of the trace and det at the fixed points of a dynamical system using Gröbner, postponing computing the points?

This question was not formulated clearly enough. The now maybe evident answer which emerged after the discussions is that the variety generated by trg==0 (trg = GroebnerBasis[{ss, ifac, tr}, par, X][[...
• 1,110

Lyapunov exponents at a fixed point

After having a look at the code you have and the paper you linked, it seems to me that to get to your goal, you need the following steps (This is too long for a comment): Transform your differential ...
• 1,184

Smallest positive real solution with InverseWeierstrassP

Instead of playing with numerical solvers, we can exploit a canonical exact approach. Since the Weierstrass elliptic function $\wp$ is doubly periodic, taking an inverse of it makes sense only locally ...
• 54.4k

Solve eigen-matrix equation

The first equation yields: ...
• 26.8k

System of equations

Clear["Global*"] eqns = {9*m + 2 == x, 9*n + 3 == x + 631}; To just find examples, use FindInstance ...
• 123k

System of equations

If you replace "Mod" by x== .. + 9 a1 you may use Reduce and solve for x. And as MMA assumes all variables to be complex, you must define the variables as integers E.g. ...
• 26.8k
1 vote

Showing that a Hopf bifurcation exists?

I will make a guess that this system comes from an application involving positive variables and parameters. This "essential nonnegativity" is only possible if the first equation is wrong, ...
• 1,110

How can I solve an equation numerically for a range of x-values and multiple initial root guesses?

Clear["Global*"] F[y_, x_] = 0.5/((y - x)^2 - 0.3*x^2) + 0.5/((y - x)^2 - 0.3*x^2) - 1/x^2 - 1; Solving for y ...
• 123k
1 vote

...
• 61.5k
1 vote

How can I solve an equation numerically for a range of x-values and multiple initial root guesses?

Don't use Grid in Intialguess = Grid[...] , it is only a formating option! Try ...
• 37.9k
1 vote

Why is first substituting for the known variable and then solving for an unknown variable, using Solve[], correct whereas doing the reverse is wrong?

In comments, OP mentioned that the actual problem is to find the second derivative of the function $x=f(\psi)$, and solve cannot find an explicit analytical expression for that function. This, however,...
• 61.5k

Why is first substituting for the known variable and then solving for an unknown variable, using Solve[], correct whereas doing the reverse is wrong?

Mathematica will automatically assume that all quantities are complex, unless explicitly told otherwise. In your case, if you specify that you want the real solutions to your equation, the two ...
• 61.5k

Is it possible to characterize the sign of the trace and det at the fixed points of a dynamical system using Gröbner, postponing computing the points?

My answer does not answer your doubts regarding the Groebner basis, but consider that it is an option to the problem of obtaining non-trivial equilibria. A viable option is to ...
• 4,623

Applying Numerical Differentiation on the solution of a FindRoot problem

One idea is to just augment your FindRoot call with information about the derivative. For your example, this might look like: ...
• 124k
Accepted

Applying Numerical Differentiation on the solution of a FindRoot problem

Here is one solution: ...
• 4,463

mathematica is not able to solve this system

Try NMinimize: ...
• 37.9k
Accepted

Solving logarithmic 2D Nonlinear GPE Equation

It is not clear how in the paper they normalize $\psi$ in Figure 1, may be as in equation (2). Without normalization we have ...
• 34.6k
Accepted

Can't solve an equation

It works if you give Reals domain b = 1/100; a = 1/10; f[x_] = Sin[Pi*a/b*Sin[x]]/(Pi*a/b*Sin[x]); Solve[f[x] == 7/10, x, Reals] ...
• 112k

Can't solve an equation

To avoid the problem with $\frac{0}{0}$ when $\frac{\sin x}{x}$ is evaluated at $x=0$, use Sinc: f[x_]:=Sinc[Pi*a/l*Sin[x]];
• 4,463
Accepted

Why is DSolve unable to solve this second order ode with initial conditions? Any workaround?

I'd report this to WRI. If buried in the DSolve code base is a way to solve this, then the decision tree misses it. Otherwise, they should implement a way. ...
• 219k

Why is DSolve unable to solve this second order ode with initial conditions? Any workaround?

With a bit of assistance, DSolve can obtain the desired solution. ode has a first integral, which is obtained by ...
• 58.6k
1 vote

How to solve equations in Gaussian integers modulo p

Since $p$ is prime, this equation only needs to be solved within finite field. Depending on $p$, if $p \equiv 1 \space mod \space 4$, then $\sqrt{-1}$ has good reduction on $\mathbb{F_p}$, gaussian ...
• 633
Accepted

How did DSolve solve for the constants of integrations in this ode?

Not sure what DSolve did, but I often try Sinc[z] when I see Sin[z]/z or ...
• 219k

Numerical solution of the inverse contour plot

Regard v as function of u, v[u], and differentiate function f[u,v[u]] to be zero with respect to u and generate interpolating function for v[u] with NDSolve. Here shown for two branches. ...
• 16.4k

Numerical solution of the inverse contour plot

Clear["Global`*"] To use FindRoot directly, ...
• 123k

Numerical solution of the inverse contour plot

sol = FindInstance[{BesselJ[3, Sin[u^2 - v]] == 0, -1 <= u <= 1, -1 <= v <= 1}, {u, v}, 1000]; ListPlot[{u, v} /. sol] Replay to comment ...
• 35.7k
Accepted

Numerical solution of the inverse contour plot

The problem appears to be solvable with an exact approach, e.g. ...
• 54.4k

Numerical solution of the inverse contour plot

Take the point pairs from ContourPlot ...
• 37.9k
Accepted

Obtaining numerically and efficiently a large number of zeroes

Intro. This is slow not because of NSolve, but because in OPs code, something like B[100] builds up a huge symbolic expression. ...
• 4,463
1 vote

solving linear systems with parameters

I have made a MatrixRankSym feature with symbolic computation here. And we can use for your this question directly: ...
• 24.5k

How to solve this matrix equation

You get rank == 2, if one row is the linear combination of the two others. ...
• 16.4k

How to solve this matrix equation

I have made a MatrixRankSym feature with symbolic computation here. And we can use for this question directly: ...
• 24.5k

How to solve this equation with rank relation of matrix

I have made a MatrixRankSym feature with symbolic computation here. And we can use it directly: For your first equation: ...
• 24.5k

Asymptotic inverse function?

@Roman's answer is exactly what you asked for, but as a check, here is a second answer using Bessel's series expansion for the solution of the Kepler equation: ...
• 4,463
Accepted

...
• 36.9k
Accepted

Reduce and FullSimplify don't reduce fully -- how to check if candidate solutions hold

Simplify[ x a^2 + y b^2 + (-x - y) a*b == 0, {a == 1/x, b == 1/y, y > x > 1}] True.
• 35.7k
1 vote

Find binary vector within fixed distance to reference vector that maximizes the number of distances to a set of vector that are below a threshold

The following is an adaptation of your code. I just tried to get it to work, still using Maximize, ignoring efficiency. Please ...
• 4,463

Reduce and FullSimplify don't reduce fully -- how to check if candidate solutions hold

Provide the conditions to FullSimplify too. ...
• 16.4k
Accepted

Strange issue with NSolve

@Nasser seems to be correct about different code paths. Personally, I will argue it's a bug, and it definitely should be reported to WRI tech support for them to consider. ...
• 219k
Accepted

How to detect the positive solution to this logistic boundary value problem

Let us try a shooting method. The following code produces the solution for a given value of f[0]: ...
• 4,463

How to code a sum in Mathematica and how to solve it?

This can of course be formulated as a linear-algebraic problem. Using Domen's example: ...
Accepted

How to code a sum in Mathematica and how to solve it?

Let's take a short example with $s=3$. ...
• 7,422

Reduce an expression where the variables can assume only $\pm 1$

If you just want the count: Count[Tuples[{-1, 1}, 8], v_ /; v[[1 ;; 4]] . v[[5 ;; 8]] == 0] (* 96 *) or with a more explicit criterion: ...
• 36.9k
Accepted

Reduce an expression where the variables can assume only $\pm 1$

Could just add the appropriate constraints. I set this up programmatically to save wear and tear on my four typing fingers. ...
Accepted

Problem in getting coefficients list of power series solution of y''[x]*y'[InverseFunction[y][x]] - y'[x] == 0?

The right way to do this is to start with an ansatz (note that the OP has neglected to explicitly declare the y'[0] == 1 condition): ...

Solve conditional term with mathematica

We consider that a[n]=x^n + y^n. To deduce the recurrence relation we compare with x^(n + 2) + y^(n + 2) and ...
• 35.7k

format: plain


text:
# Removing frame/plot borders from plot.im output

I am plotting point density using theplot.imcommand in spatstat, and my output always has a frame around the plotted image that becomes thicker when I increase resolution for export. I triedframe=F,axes=F,plot.frame=FALSE,bty='n'but none of them seem to fix the issue. Anyone know a solution to this?

Usebox=FALSE(see?plot.im: argument box, a logical value specifying whether a box should be drawn.):

Z <- setcov(owin()) tc <- colourmap(rainbow(128), breaks=seq(-1, 2, length=129)) plot(Z, col=tc)

plot(Z, col=tc, box=FALSE)


text:
# Area and Volume of a Sphere

Instructions: Enter the radius $$r$$ of a sphere and the corresponding unit (cm, mt, ft, etc) and the solver will compute the area and volume showing all the steps.

Type the radius of the sphere $$r$$ =

More About the Sphere

In order to compute the area and the volume of a sphere of radius $$r$$ we use the following formulas:

$\text{Area} = 4\pi r^2$ $\text{Volume} = \frac{4}{3}\pi r^3$

Computationally speaking, it is really simple to compute the area and the volume of a sphere, by simply plugging the radius $$r$$ in the above formulas. For example, if the radius is $$r = 3$$, then we compute

$\text{Area} = 4\pi r^2 = 4\pi \cdot 3^2 = 36 \pi$ $\text{Volume} = \frac{4}{3}\pi r^3 = \frac{4}{3}\pi \cdot 3^3 = \frac{108}{3} \pi = 36 \pi$

which completes the calculation.

In case you have any suggestion, or if you would like to report a broken solver/calculator, please do not hesitate to contact us.


text:
Any package (subsequently called 'target package') is enabled to provide its users an easily accessible, user-friendly and human readable text file where key=value pairs (used by functions defined in the target package) can be saved. This settings file lives in a location defined by the user of the target package, and its user-defined values remain unchanged even when the author of the target package is introducing or deleting keys, or when the target package is updated or re-installed. In order to enable the target package to make use of the functionality offered by package 'uniset', three files have to be exported by 'uniset' and placed into the target package.

## Details

There are two ways to generate the files required for the target package to make use of 'uniset':

-) Export and move manually

Use uniset_getFiles, then move the 'xxx_settings.R' file ('xxx' for the name of the target package) into the 'inst' folder (create one if not already done) of the target package. Move the files 'uniset_globals.R' and 'uniset_functions.R' into the 'R' folder of the target package.

-) Write directly to target package

(Recommended) Use uniset_copyFilesToPackage to copy the required files directly into the target package.

Every variable defined in the xxx_settings.R file is accessible in the code of the target package.
The target package has to list 'uniset' as an 'import', and then uniset_updateSettings or uniset_autoUpS can be used to manually or automatically update the settings,i.e. to read in the key=value pairs stored in the xxx_settings.R file. For an introduction and more detailed information please see https://bpollner.github.io/uniset/.

The most imminent advantage of the 'uniset' settings-file system over using any static file for permanently storing settings for any package is the fact that the key=value pairs in the xxx_settings.R file get updated (added / deleted) dynamically.
So the developer of a package can delete keys or introduce new ones, and the new key=value pairs will be automatically added to or deleted from the local xxx_settings.R file. Values changed by the user of the target package will be preserved.
So the author of the target package can add or delete keys from the xxx_settings.R file without worrying that this will cause any effort or troubles for the user of the target package.

Please see https://bpollner.github.io/uniset/ for a practical example; bug reports can be made at https://github.com/bpollner/uniset/issues.

## Maintainer

Bernhard Pollner bernhard.pollner@mac.com

## Functions for preparing the target package

uniset_copyFilesToPackage, uniset_getFiles

## Functions to be called from within the target package

uniset_autoUpS, uniset_updateSettings, uniset_test, uniset_getstn, and only once: uniset_setup.

## Examples

As the functions to update the settings file and to (automatically) source this settings are intended to be called from within the (installed) target package, please go to https://bpollner.github.io/uniset/ for a walk-through and for a real-life demonstration and examples how to use these functions in the code of the target package.

## Author

Bernhard Pollner, Zoltan Kovacs


text:
Subjects -> STATISTICS (Total: 130 journals)
 Showing 1 - 151 of 151 Journals sorted alphabetically Advances in Complex Systems       (Followers: 10) Advances in Data Analysis and Classification       (Followers: 61) Annals of Applied Statistics       (Followers: 39) Applied Categorical Structures       (Followers: 4) Argumentation et analyse du discours       (Followers: 10) Asian Journal of Mathematics & Statistics       (Followers: 8) AStA Advances in Statistical Analysis       (Followers: 4) Australian & New Zealand Journal of Statistics       (Followers: 13) Bernoulli       (Followers: 9) Biometrical Journal       (Followers: 10) Biometrics       (Followers: 51) British Journal of Mathematical and Statistical Psychology       (Followers: 18) Building Simulation       (Followers: 1) Bulletin of Statistics       (Followers: 4) CHANCE       (Followers: 5) Communications in Statistics - Simulation and Computation       (Followers: 9) Communications in Statistics - Theory and Methods       (Followers: 11) Computational Statistics       (Followers: 14) Computational Statistics & Data Analysis       (Followers: 37) Current Research in Biostatistics       (Followers: 8) Decisions in Economics and Finance       (Followers: 11) Demographic Research       (Followers: 16) Electronic Journal of Statistics       (Followers: 8) Engineering With Computers       (Followers: 5) Environmental and Ecological Statistics       (Followers: 7) ESAIM: Probability and Statistics       (Followers: 5) Extremes       (Followers: 2) Fuzzy Optimization and Decision Making       (Followers: 8) Geneva Papers on Risk and Insurance - Issues and Practice       (Followers: 13) Handbook of Numerical Analysis       (Followers: 5) Handbook of Statistics       (Followers: 7) IEA World Energy Statistics and Balances -       (Followers: 2) International Journal of Computational Economics and Econometrics       (Followers: 6) International Journal of Quality, Statistics, and Reliability       (Followers: 17) International Journal of Stochastic Analysis       (Followers: 3) International Statistical Review       (Followers: 12) International Trade by Commodity Statistics - Statistiques du commerce international par produit Journal of Algebraic Combinatorics       (Followers: 4) Journal of Applied Statistics       (Followers: 20) Journal of Biopharmaceutical Statistics       (Followers: 20) Journal of Business & Economic Statistics       (Followers: 39, SJR: 3.664, CiteScore: 2) Journal of Combinatorial Optimization       (Followers: 7) Journal of Computational & Graphical Statistics       (Followers: 20) Journal of Econometrics       (Followers: 82) Journal of Educational and Behavioral Statistics       (Followers: 6) Journal of Forecasting       (Followers: 17) Journal of Global Optimization       (Followers: 7) Journal of Interactive Marketing       (Followers: 10) Journal of Mathematics and Statistics       (Followers: 8) Journal of Nonparametric Statistics       (Followers: 6) Journal of Probability and Statistics       (Followers: 10) Journal of Risk and Uncertainty       (Followers: 32) Journal of Statistical and Econometric Methods       (Followers: 5) Journal of Statistical Physics       (Followers: 13) Journal of Statistical Planning and Inference       (Followers: 8) Journal of Statistical Software       (Followers: 20, SJR: 13.802, CiteScore: 16) Journal of the American Statistical Association       (Followers: 72, SJR: 3.746, CiteScore: 2) Journal of the Korean Statistical Society       (Followers: 1) Journal of the Royal Statistical Society Series C (Applied Statistics)       (Followers: 31) Journal of the Royal Statistical Society, Series A (Statistics in Society)       (Followers: 26) Journal of the Royal Statistical Society, Series B (Statistical Methodology)       (Followers: 43) Journal of Theoretical Probability       (Followers: 3) Journal of Time Series Analysis       (Followers: 16) Journal of Urbanism: International Research on Placemaking and Urban Sustainability       (Followers: 30) Law, Probability and Risk       (Followers: 8) Lifetime Data Analysis       (Followers: 7) Mathematical Methods of Statistics       (Followers: 4) Measurement Interdisciplinary Research and Perspectives       (Followers: 1) Metrika       (Followers: 4) Modelling of Mechanical Systems       (Followers: 1) Monte Carlo Methods and Applications       (Followers: 6) Monthly Statistics of International Trade - Statistiques mensuelles du commerce international       (Followers: 2) Multivariate Behavioral Research       (Followers: 5) Optimization Letters       (Followers: 2) Optimization Methods and Software       (Followers: 8) Oxford Bulletin of Economics and Statistics       (Followers: 34) Pharmaceutical Statistics       (Followers: 17) Probability Surveys       (Followers: 4) Queueing Systems       (Followers: 7) Research Synthesis Methods       (Followers: 7) Review of Economics and Statistics       (Followers: 124) Review of Socionetwork Strategies Risk Management       (Followers: 15) Sankhya A       (Followers: 2) Scandinavian Journal of Statistics       (Followers: 9) Sequential Analysis: Design Methods and Applications Significance       (Followers: 7) Sociological Methods & Research       (Followers: 37) SourceOCDE Comptes nationaux et Statistiques retrospectives SourceOCDE Statistiques : Sources et methodes SourceOECD Bank Profitability Statistics - SourceOCDE Rentabilite des banques       (Followers: 1) SourceOECD Insurance Statistics - SourceOCDE Statistiques d'assurance       (Followers: 2) SourceOECD Main Economic Indicators - SourceOCDE Principaux indicateurs economiques       (Followers: 1) SourceOECD Measuring Globalisation Statistics - SourceOCDE Mesurer la mondialisation - Base de donnees statistiques SourceOECD Monthly Statistics of International Trade       (Followers: 1) SourceOECD National Accounts & Historical Statistics SourceOECD OECD Economic Outlook Database - SourceOCDE Statistiques des Perspectives economiques de l'OCDE       (Followers: 2) SourceOECD Science and Technology Statistics - SourceOCDE Base de donnees des sciences et de la technologie SourceOECD Statistics Sources & Methods       (Followers: 1) SourceOECD Taxing Wages Statistics - SourceOCDE Statistiques des impots sur les salaires Stata Journal       (Followers: 9) Statistica Neerlandica       (Followers: 1) Statistical Applications in Genetics and Molecular Biology       (Followers: 5) Statistical Communications in Infectious Diseases Statistical Inference for Stochastic Processes       (Followers: 3) Statistical Methodology       (Followers: 7) Statistical Methods and Applications       (Followers: 6) Statistical Methods in Medical Research       (Followers: 27) Statistical Modelling       (Followers: 19) Statistical Papers       (Followers: 4) Statistical Science       (Followers: 13) Statistics & Probability Letters       (Followers: 13) Statistics & Risk Modeling       (Followers: 2) Statistics and Computing       (Followers: 13) Statistics and Economics       (Followers: 1) Statistics in Medicine       (Followers: 191) Statistics, Politics and Policy       (Followers: 6) Statistics: A Journal of Theoretical and Applied Statistics       (Followers: 14) Stochastic Models       (Followers: 3) Stochastics An International Journal of Probability and Stochastic Processes: formerly Stochastics and Stochastics Reports       (Followers: 2) Structural and Multidisciplinary Optimization       (Followers: 12) Teaching Statistics       (Followers: 7) Technology Innovations in Statistics Education (TISE)       (Followers: 2) TEST       (Followers: 3) The American Statistician       (Followers: 24) The Annals of Applied Probability       (Followers: 8) The Annals of Probability       (Followers: 10) The Annals of Statistics       (Followers: 34) The Canadian Journal of Statistics / La Revue Canadienne de Statistique       (Followers: 11) Wiley Interdisciplinary Reviews - Computational Statistics       (Followers: 1)
Similar Journals
 Statistical Methods and ApplicationsJournal Prestige (SJR): 0.466 Citation Impact (citeScore): 1Number of Followers: 6      Hybrid journal (It can contain Open Access articles) ISSN (Print) 1613-981X - ISSN (Online) 1618-2510 Published by Springer-Verlag  [2626 journals]
• Bootstrap confidence intervals for correlation between continuous repeated
measures
• Abstract: Abstract Repeated measures designs are widely used in practice to increase power, reduce sample size, and increase efficiency in data collection. Correlation between repeated measurements is one of the first research questions that needs to be addressed in a repeated-measure study. In addition to an estimate for correlation, confidence interval should be computed and reported for statistical inference. The asymptotic interval based on the delta method is traditionally calculated due to its simplicity. However, this interval is often criticized for its unsatisfactory performance with regards to coverage and interval width. Bootstrap could be utilized to reduce the interval width, and the widely used bootstrap intervals include the percentile interval, the bias-corrected interval, and the bias-corrected with acceleration interval. Wilcox (Comput Stat Data Anal 22:89–98,1996) suggested a modified percentile interval with the interval levels adjusted by sample size to have the coverage probability close to the nominal level. For a study with repeated measures, more parameters in addition to sample size would affect the coverage probability. For these reasons, we propose modifying the percentiles in the percentile interval to guarantee the coverage probability based on simulation studies. We analyze the correlation between imaging volumes and memory scores from the Alzheimer’s Disease Neuroimaging Initiative (ADNI) study to illustrate the application of the considered intervals. The proposed interval is exact with the coverage probability guaranteed, and is recommended for use in practice.
PubDate: 2021-01-21

• The sufficiency of the evidence, the relevancy of the evidence, and
quantifying both with a single number
• Abstract: Abstract Consider a data set as a body of evidence that might confirm or disconfirm a hypothesis about a parameter value. If the posterior probability of the hypothesis is high enough, then the truth of the hypothesis is accepted for some purpose such as reporting a new discovery. In that way, the posterior probability measures the sufficiency of the evidence for accepting the hypothesis. It would only follow that the evidence is relevant to the hypothesis if the prior probability were not already high enough for acceptance. A measure of the relevancy of the evidence is the Bayes factor since it is the ratio of the posterior odds to the prior odds. Measures of the sufficiency of the evidence and measures of the relevancy of the evidence are not mutually exclusive. An example falling in both classes is the likelihood ratio statistic, perhaps based on a pseudolikelihood function that eliminates nuisance parameters. There is a sense in which the likelihood ratio statistic measures both the sufficiency of the evidence and its relevancy. That result is established by representing the likelihood ratio statistic in terms of a conditional possibility measure that satisfies logical coherence rather than probabilistic coherence.
PubDate: 2021-01-01

• An alternative semiparametric model for spatial panel data
• Abstract: Abstract We propose a semiparametric P-Spline model to deal with spatial panel data. This model includes a non-parametric spatio-temporal trend, a spatial lag of the dependent variable, and a time series autoregressive noise. Specifically, we consider a spatio-temporal ANOVA model, disaggregating the trend into spatial and temporal main effects, as well as second- and third-order interactions between them. Algorithms based on spatial anisotropic penalties are used to estimate all the parameters in a closed form without the need for multidimensional optimization. Monte Carlo simulations and an empirical analysis of regional unemployment in Italy show that our model represents a valid alternative to parametric methods aimed at disentangling strong and weak cross-sectional dependence when both spatial and temporal heterogeneity are smoothly distributed.
PubDate: 2020-12-01

• Monitoring rare categories in sentiment and opinion analysis: a Milan mega
• Abstract: Abstract This paper proposes a new aggregated classification scheme aimed to support the implementation of semantic text analysis methods in contexts characterized by the presence of rare text categories. The proposed approach starts from the aggregate supervised text classifier developed by Hopkins and King and moves forward, relying on rare event sampling methods. In detail, it enables the analyst to enlarge the number of estimated sentiment categories, both preserving the estimation accuracy and reducing the working time to unconditionally increase the size of the training set. The approach is applied to study the daily evolution of the web reputation of one of the last mega-event taking place in Europe: Expo Milano. The corpus consists of more than one million tweets in both Italian and English, discussing about the event. The analysis provides an interesting portrayal of the evolution of the Expo stakeholders’ opinions over time and allows the identification of the main drivers of the Expo reputation. The algorithm will be implemented as a running option in the next release of the R package ReadMe.
PubDate: 2020-12-01

• A copula-based method of classifying individuals into binary disease
categories using dependent biomarkers
• Abstract: Abstract Classification of a disease often depends on more than one test, and the tests can be interrelated. Under the incorrect assumption of independence, the test result using dependent biomarkers can lead to a conflicting disease classification. We develop a copula-based method for this purpose that takes dependency into account and leads to a unique decision. We first construct the joint probability distribution of the biomarkers considering Frank’s, Clayton’s and Gumbel’s copulas. We then develop the classification method and perform a comprehensive simulation. Using simulated data sets, we study the statistical properties of joint probability distributions and determine the joint threshold with maximum classification accuracy. Our simulation study results show that parameter estimates for the copula-based bivariate distributions are not biased. We observe that the thresholds for disease classification converge to a stationary distribution across different choices of copulas. We also observe that the classification accuracy decreases with the increasing value of the dependence parameter of the copulas. Finally, we illustrate our method with a real data example, where we identify the joint threshold of Apolipoprotein B to Apolipoprotein A1 ratio and total cholesterol to high-density lipoprotein ratio for the classification of myocardial infarction. We conclude, the copula-based method works well in identifying the joint threshold of two dependent biomarkers for an outcome classification. Our method is flexible and allows modeling broad classes of bivariate distributions that take dependency into account. The threshold may allow clinicians to classify uniquely individuals at risk of developing the disease and plan for early intervention.
PubDate: 2020-12-01

• Regression for compositions based on a generalization of the Dirichlet
distribution
• Abstract: Abstract The simplex is the geometrical locus of D-dimensional positive data with constant sum, called compositions. A possible distribution for compositions is the Dirichlet. In Dirichlet models, there are no scale parameters and the D shapes are assumed dependent on auxiliary variables. This peculiar feature makes Dirichlet models difficult to apply and to interpret. Here, we propose a generalization of the Dirichlet, called the simplicial generalized Beta (SGB) distribution. It includes an overall shape parameter, a scale composition and the D Dirichlet shapes. The SGB is flexible enough to accommodate many practical situations. SGB regression models are applied to data from the United Kingdom Time Use Survey. The R-package SGB makes the methods accessible to users.
PubDate: 2020-12-01

• Statistical and probabilistic analysis of interarrival and waiting times
of Internet2 anomalies
• Abstract: Abstract Motivated by the need to introduce design improvements to the Internet network to make it robust to high traffic volume anomalies, we analyze statistical properties of the time separation between arrivals of consecutive anomalies in the Internet2 network. Using several statistical techniques, we demonstrate that for all unidirectional links in Internet2, these interarrival times have distributions whose tail probabilities decay like a power law. These heavy-tailed distributions have varying tail indexes, which in some cases imply infinite variance. We establish that the interarrival times can be modeled as independent and identically distributed random variables, and propose a model for their distribution. These findings allow us to use the tools of of renewal theory, which in turn allows us to estimate the distribution of the waiting time for the arrival of the next anomaly. We show that the waiting time is stochastically substantially longer than the time between the arrivals, and may in some cases have infinite expected value. All our findings are tabulated and displayed in the form of suitable graphs, including the relevant density estimates.
PubDate: 2020-12-01

• A general piecewise multi-state survival model: application to breast
cancer
• Abstract: Abstract Multi-state models are considered in the field of survival analysis for modelling illnesses that evolve through several stages over time. Multi-state models can be developed by applying several techniques, such as non-parametric, semi-parametric and stochastic processes, particularly Markov processes. When the development of an illness is being analysed, its progression is tracked periodically. Medical reviews take place at discrete times, and a panel data analysis can be formed. In this paper, a discrete-time piecewise non-homogeneous Markov process is constructed for modelling and analysing a multi-state illness with a general number of states. The model is built, and relevant measures, such as survival function, transition probabilities, mean total times spent in a group of states and the conditional probability of state change, are determined. A likelihood function is built to estimate the parameters and the general number of cut-points included in the model. Time-dependent covariates are introduced, the results are obtained in a matrix algebraic form and the algorithms are shown. The model is applied to analyse the behaviour of breast cancer. A study of the relapse and survival times of 300 breast cancer patients who have undergone mastectomy is developed. The results of this paper are implemented computationally with MATLAB and R.
PubDate: 2020-12-01

• A weighted $$\chi ^2$$ χ 2 test to detect the presence of a major change
point in non-stationary Markov chains
• Abstract: Abstract The problem of detecting a major change point in a stochastic process is often of interest in applications, in particular when the effects of modifications of some external variables, on the process itself, must be identified. We here propose a modification of the classical Pearson $$\chi ^2$$ test to detect the presence of such major change point in the transition probabilities of an inhomogeneous discrete time Markov Chain, taking values in a finite space. The test can be applied also in presence of big identically distributed samples of the Markov Chain under study, which might not be necessarily independent. The test is based on the maximum likelihood estimate of the size of the ’right’ experimental unit, i.e. the units that must be aggregated to filter out the small scale variability of the transition probabilities. We here apply our test both to simulated data and to a real dataset, to study the impact, on farmland uses, of the new Common Agricultural Policy, which entered into force in EU in 2015.
PubDate: 2020-12-01

• Multivariate power series interpoint distances
• Abstract: Abstract We establish (a) the probability mass function of the interpoint distance (IPD) between random vectors that are drawn from the multivariate power series family of distributions (MPSD); (b) obtain the distribution of the IPD within one sample and across two samples from this family; (c) determine the distribution of the MPSD Euclidean norm and distance from fixed points in $${\mathbb {Z}}^d$$ ; and (d) provide the distribution of the IPDs of vectors drawn from a mixture of the MPSD distributions. We present a method for testing the homogeneity of MPSD mixtures using the sample IPDs.
PubDate: 2020-12-01

• Nearest neighbors estimation for long memory functional data
• Abstract: In this paper, we consider the asymptotic properties of the nearest neighbors estimation for long memory functional data. Under some regularity assumptions, we investigate the asymptotic normality and the uniform consistency of the nearest neighbors estimators for the nonparametric regression models when the explanatory variable and the errors are of long memory and the explanatory variable takes values in some abstract functional space. The finite sample performance of the proposed estimator is discussed through simulation studies.
PubDate: 2020-12-01

• Context-specific independencies in hierarchical multinomial marginal
models
• Abstract: Abstract This paper focuses on studying the relationships among a set of categorical (ordinal) variables collected in a contingency table. Besides the marginal and conditional (in)dependencies, thoroughly analyzed in the literature, we consider the context-specific independencies holding only in a subspace of the outcome space of the conditioning variables. To this purpose we consider the hierarchical multinomial marginal models and we provide several original results about the representation of context-specific independencies through these models. The theoretical results are supported by an application concerning the innovation degree of Italian enterprises.
PubDate: 2020-12-01

• Modified LASSO estimators for time series regression models with dependent
disturbances
• Abstract: Abstract This paper applies the modified least absolute shrinkage and selection operator (LASSO) to the regression model with dependent disturbances, especially, long-memory disturbances. Assuming the norm of different column in the regression matrix may have different order of observation length n, we introduce a modified LASSO estimator where the tuning parameter $$\lambda$$ is not a scalar but vector. When the dimension of parameters is fixed, we derive the asymptotic distribution of the modified LASSO estimators under certain regularity condition. When the dimension of parameters increases with respect to n, the consistency on the probability of the correct selection of penalty parameters is shown under certain regularity conditions. Some simulation studies are examined.
PubDate: 2020-12-01

• PC priors for residual correlation parameters in one-factor mixed models
• Abstract: Abstract Lack of independence in the residuals from linear regression motivates the use of random effect models in many applied fields. We start from the one-way anova model and extend it to a general class of one-factor Bayesian mixed models, discussing several correlation structures for the within group residuals. All the considered group models are parametrized in terms of a single correlation (hyper-)parameter, controlling the shrinkage towards the case of independent residuals (iid). We derive a penalized complexity (PC) prior for the correlation parameter of a generic group model. This prior has desirable properties from a practical point of view: (i) it ensures appropriate shrinkage to the iid case; (ii) it depends on a scaling parameter whose choice only requires a prior guess on the proportion of total variance explained by the grouping factor; (iii) it is defined on a distance scale common to all group models, thus the scaling parameter can be chosen in the same manner regardless the adopted group model. We show the benefit of using these PC priors in a case study in community ecology where different group models are compared.
PubDate: 2020-12-01

• Sliced inverse median difference regression
• Abstract: Abstract In this paper we propose a sufficient dimension reduction algorithm based on the difference of inverse medians. The classic methodology based on inverse means in each slice was recently extended, by using inverse medians, to robustify existing methodology at the presence of outliers. Our effort is focused on using differences between inverse medians in pairs of slices. We demonstrate that our method outperforms existing methods at the presence of outliers. We also propose a second algorithm which is not affected by the ordering of slices when the response variable is categorical with no underlying ordering of its values.
PubDate: 2020-12-01

• Bayesian inference of multiple structural change models with asymmetric
GARCH errors
• Abstract: Abstract Structural change in any time series is practically unavoidable, and thus correctly detecting breakpoints plays a pivotal role in statistical modelling. This research considers segmented autoregressive models with exogenous variables and asymmetric GARCH errors, GJR-GARCH and exponential-GARCH specifications, which utilize the leverage phenomenon to demonstrate asymmetry in response to positive and negative shocks. The proposed models incorporate skew Student-t distribution and prove the advantages of the fat-tailed skew Student-t distribution versus other distributions when structural changes appear in financial time series. We employ Bayesian Markov Chain Monte Carlo methods in order to make inferences about the locations of structural change points and model parameters and utilize deviance information criterion to determine the optimal number of breakpoints via a sequential approach. Our models can accurately detect the number and locations of structural change points in simulation studies. For real data analysis, we examine the impacts of daily gold returns and VIX on S&P 500 returns during 2007–2019. The proposed methods are able to integrate structural changes through the model parameters and to capture the variability of a financial market more efficiently.
PubDate: 2020-11-26

• A measure of interrater absolute agreement for ordinal categorical data
• Abstract: Abstract A measure of interrater absolute agreement for ordinal scales is proposed capitalizing on the dispersion index for ordinal variables proposed by Giuseppe Leti. The procedure allows to overcome the limits affecting traditional measures of interrater agreement in different fields of application. An unbiased estimator of the proposed measure is introduced and its sampling properties are investigated. In order to construct confidence intervals for interrater absolute agreement both asymptotic results and bootstrapping methods are used and their performance is evaluated. Simulated data are employed to demonstrate the accuracy and practical utility of the new procedure for assessing agreement. Finally, an application to a real case is provided.
PubDate: 2020-11-24

• Unified Bayesian conditional autoregressive risk measures using the skew
exponential power distribution
• Abstract: Abstract Conditional Autoregressive Value-at-Risk and Conditional Autoregressive Expectile have become two popular approaches for direct measurement of market risk. Since their introduction several improvements both in the Bayesian and in the classical framework have been proposed to better account for asymmetry and local non-linearity. Here we propose a unified Bayesian Conditional Autoregressive Risk Measures approach by using the Skew Exponential Power distribution. Further, we extend the proposed models using a semiparametric P-Spline approximation answering for a flexible way to consider the presence of non-linearity. To make the statistical inference we adapt the MCMC algorithm proposed in Bernardi et al. (2018) to our case. The effectiveness of the whole approach is demonstrated using real data on daily return of five stock market indices.
PubDate: 2020-11-18

• A unified approach to permutation testing for equivalence
• Abstract: Abstract The notion of testing for equivalence of two treatments is widely used in clinical trials, pharmaceutical experiments, bioequivalence and quality control. It is traditionally operated within the intersection–union principle (IU). According to this principle the null hypothesis is stated as the set of effects the differences $$\delta$$ of which lie outside a suitable equivalence interval and the alternative as the set of $$\delta$$ that lie inside it. In the literature related solutions are essentially based on likelihood techniques, which in turn are rather difficult to deal with. A recently published paper goes beyond most of likelihood limitations by using the IU approach within the permutation theory. One more paper, based on Roy’s union–intersection principle (UI) within the permutation theory, goes beyond some limitations of traditional two-sided tests. Such UI approach, effectively a mirror image of IU, assumes a null hypothesis where $$\delta$$ lies inside the equivalence interval and an alternative where it lies outside. Since testing for equivalence can rationally be analyzed by both principles but, as the two differ in terms of the mirror-like roles assigned to the hypotheses under study, they are not strictly comparable. The present paper’s main goal is to look into these problems and provide a sort of comparative analysis of both by highlighting the related requirements, properties, limitations, difficulties, and pitfalls so as to get practitioners properly acquainted with their correct use in practical contexts.
PubDate: 2020-11-10

• Recurrence relations and Benford’s law
• Abstract: Abstract There are now many theoretical explanations for why Benford’s law of digit bias surfaces in so many diverse fields and data sets. After briefly reviewing some of these, we discuss in detail recurrence relations. As these are discrete analogues of differential equations and model a variety of real world phenomena, they provide an important source of systems to test for Benfordness. Previous work showed that fixed depth recurrences with constant coefficients are Benford modulo some technical assumptions which are usually met; we briefly review that theory and then prove some new results extending to the case of linear recurrence relations with non-constant coefficients. We prove that, for certain families of functions f and g, a sequence generated by a recurrence relation of the form $$a_{n+1} = f(n)a_n + g(n)a_{n-1}$$ is Benford for all initial values. The proof proceeds by parameterizing the coefficients to obtain a recurrence relation of lower degree, and then converting to a new parameter space. From there we show that for suitable choices of f and g where f(n) is nondecreasing and $$g(n)/f(n)^2 \rightarrow 0$$ as $$n \rightarrow \infty$$ , the main term dominates and the behavior is equivalent to equidistribution problems previously studied. We also describe the results of generalizing further to higher-degree recurrence relations and multiplicative recurrence relations with non-constant coefficients, as well as the important case when f and g are values of random variables.
PubDate: 2020-10-29

JournalTOCs
School of Mathematical and Computer Sciences
Heriot-Watt University
Edinburgh, EH14 4AS, UK
Email: journaltocs@hw.ac.uk
Tel: +00 44 (0)131 4513762


text:
# How do you know if x^2-10x-y+18=0 is a hyperbola, parabola, circle or ellipse?

Aug 7, 2018

This is a parabola.

#### Explanation:

Given:

${x}^{2} - 10 x - y + 18 = 0$

Note that the only term of degree $> 1$ is ${x}^{2}$.

Since the multiplier of $y$ is non-zero, we can deduce that this equation represents a parabola.

In fact, adding $y$ to both sides and transposing, it becomes:

$y = {x}^{2} - 10 x + 18$

which clearly expresses $y$ as a quadratic function of $x$, and hence a parabola with vertical axis.

We can also complete the square to find:

$y = {\left(x - 5\right)}^{2} - 7$

allowing us to identify the vertex $\left(5 , 7\right)$ and axis $x = 5$.

graph{(x^2-10x-y+18)(x-5+0.0001y)((x-5)^2+(y+7)^2-0.01) = 0 [-6.455, 13.545, -7.88, 2.12]}


text:
# Antilog Calculator

## Introduction to the Antilog Calculator

An antilog formula calculator is an online tool that can compute the antilog of a log value of a number. It applies the inverse log formula to the given log value of a function. It finds the antilog of a number with the base 2, and e.

In mathematics, we mainly use logarithm and antilogarithm to solve many problems. You can use a logarithm table for this. Sometimes finding logarithm and antilogarithm with a table is difficult because you may forget to see any entry in the common log table. We introduce a tool that can help you find the antilog of a number quickly.

## Formula used by Antilog Online Calculator

The term antilog is the inverse process of finding the logarithm of the same number. Consider x is the log of a number as:

$$x \;=\; y$$

Then the antilog of x will be calculated by applying antilog on both sides.

$$antilog \;x \;=\; antilog(y) \;=\; log^{-1} (y)$$ $$antilog \;x \;=\; y$$

Where b is the base of log.

The antilog solver applies this formula to find antilog of a log value of a number.

## How to use an Antilogarithm Calculator?

The easiest way to find the antilog and log is by using a tool such as a calculator. Since the antilog calculator is an online tool, you can use it by following the given steps:

1. In the first step, you need to enter the log value of the number in the “Number” box.
2. You can also use the “Load Example” option.
3. Click on the “Calculate” button.

You will get the antilog of the given number within a few seconds after using the calculate button.

## Benefits of using Antilog Formula Calculator with steps

Since you are familiar with the concept of the logarithm, the antilog is the inverse of the log. Antilog can be found by applying inverse log on the log value of a number. We usually do this with the use of a table book. But it is a time-consuming and tricky method. You can find the antilog with the help of an antilog solver online because it has many beneficial uses.

Some benefits of this tool are:

1. You will never be confused with the mantissa and the decimal point using an antilog calculator.
2. Antilogarithm calculator can also handle negative log values efficiently.
3. It provides the result faster than calculating the antilog by hand.
4. Antilog of negative number gives the antilog of a number with the base values 2, 10 and e.
5. If you want to calculate the logarithm of a number first, you can also use the Log Calculator because this website also offers many other tools.

## How to Calculate the Antilog of a Negative Number?

The antilog of a negative number is the same as the antilog of a positive number. The difference is that the negative sign indicates the zeros before the nonzero values after the decimal point. For example,

$$x \;=\; -2.6040$$

We have to find the antilog of x, can be found as:

$$y \;=\; antilog \;x \;=\; antilog(-2.6040)$$

The mantissa is .2489. The number -2 indicates the number of zeros after the decimal point. So,

$$y \;=\; 0.002489$$

### Shaun Murphy

Last Updated March 28, 2022

A professional content writer who likes to write on science, technology and education.


text:
# Android Custom View 102 (Part I)

The basics of drawing stuff

If 101 is like a crash course, then this 102 will provide much more detail.

In this 1st part, we focus on only one thing: how to draw things.

# Draw Color

Draw the entire view with one color.

public class DrawColorView extends View {

...

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawColor(Color.YELLOW);
}
}

# Draw Circle

Draw a circle on the view.

Pay attention that all drawXXX() functions use pixel as unit. But we can convert dp to px with this utils function.

public class Utils {

public static float convertDpToPx(Context context, float dp) {
return dp * context.getResources().getDisplayMetrics().density;
}
}
public class DrawCircleView extends View {

...

paint1 = new Paint();
paint1.setAntiAlias(true);
cx1 = convertDpToPx(context, 50);
cy1 = convertDpToPx(context, 50);
radius1 = convertDpToPx(context, 20);

paint2 = new Paint();
paint2.setAntiAlias(true);
paint2.setStyle(Paint.Style.STROKE);
cx2 = convertDpToPx(context, 120);
cy2 = convertDpToPx(context, 50);
radius2 = convertDpToPx(context, 20);

paint3 = new Paint();
paint3.setAntiAlias(true);
paint3.setColor(Color.BLUE);
cx3 = convertDpToPx(context, 190);
cy3 = convertDpToPx(context, 50);
radius3 = convertDpToPx(context, 20);

paint4 = new Paint();
paint4.setAntiAlias(true);
paint4.setStyle(Paint.Style.STROKE);
paint4.setStrokeWidth(convertDpToPx(context, 10));
cx4 = convertDpToPx(context, 260);
cy4 = convertDpToPx(context, 50);
radius4 = convertDpToPx(context, 20);

...

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawCircle(cx1, cy1, radius1, paint1);
canvas.drawCircle(cx2, cy2, radius2, paint2);
canvas.drawCircle(cx3, cy3, radius3, paint3);
canvas.drawCircle(cx4, cy4, radius4, paint4);
}
}

The above code draws 4 circles in the view:

This is simple, cx, cy and radius determine the position of the circle and how big it is. The paint determines the styles.

# Draw Rectangle

Draw a rectangle in the view.

public class DrawRectView extends View {

...

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawRect(left, top, right, bottom, paint);
}
}

# Draw Point

Draw a point in the view.

public class DrawPointView extends View {

...

float strokeWidth = convertDpToPx(context, 20);

paint1 = new Paint();
paint1.setStrokeWidth(strokeWidth);
paint1.setStrokeCap(Paint.Cap.ROUND);

paint2 = new Paint();
paint2.setStrokeWidth(strokeWidth);
paint2.setStrokeCap(Paint.Cap.BUTT);

x1 = convertDpToPx(context, 100);
y1 = convertDpToPx(context, 100);

x2 = convertDpToPx(context, 200);
y2 = convertDpToPx(context, 100);

...

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawPoint(x1, y1, paint1);
canvas.drawPoint(x2, y2, paint2);
}
}

The shape of the point is determined by the paint’s Cap. There are 3 values: BUTT, ROUND and SQUARE. Both BUTT and SQUARE will draw a square point, ROUND will draw a round point.

There are many other methods that can draw different shapes, like drawArc(), drawOval, etc. The usages of them are similar, so I will not talk them in detail here. But there is one more complex method called drawPath() which is worth mentioning.

# Draw Path

Using path we can draw any shape.

Let’s try something simple.

path.lineTo(100, 100);
path.rLineTo(100, 0);
canvas.drawPath(path, paint);

lineTo(x, y) will draw a line from (0, 0) to (x, y). Then, rLineTo(dx, dy) means take the current (x, y), draw a line to (x + dx, y + dy). r means relative.

Now let’s try combine a line with an arc.

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Path path = new Path();
path.lineTo(100, 100);
path.arcTo(100, 100, 300, 300, -90, 90, true);
canvas.drawPath(path, paint);
}

We can see that there are two parts, the line and the arc. But what is about the last param which now is set to true in arcTo()? It is forceMoveTo. The easiest way to understand this is think of the drawing process as drawing with a pen. When the line and arc are seperate, after you draw the line, there are two ways to draw the arc: lift up and move the pen to the starting point of the arc and draw it, or drag the pen to the starting point of the arc and draw it. Let’s try to set it to false and see what it looks like:

So if forceMoveTo equals true, the pen is lifted. Otherwise the pen is dragged.

# Draw Heart

OK, let’s try to draw a heart.

@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
path.addArc(200, 200, 400, 400, -225, 225);
path.arcTo(400, 200, 600, 400, -180, 205, false);
path.lineTo(400, 542);
canvas.drawPath(path, paint);
}

This concludes part 1, in part 2 we will take a closer look at the paint class.

To be continued …


text:
# Air temperature in tunnel at z

Air temperature in the tunnel at the point z in the cable route.

Symbol
$\theta_{at,z}$
Unit
°C
Formulae
$\theta_{at,0}+\left(\theta_a+\left(T_t+T_e\right) N_{sys} N_c W_{tot}-\theta_{at,0}\right) \left(1-e^{\frac{-z}{L_0}}\right)$
Related
$L_0$
$T_e$
$T_t$
$\theta_a$
$\theta_{at,0}$
$W_{tot}$
Used in
$\theta_{o,z}$
$\theta_{t,z}$
$W_{a,z}$


text:
aivika-5.9: A multi-method simulation library

Copyright Copyright (c) 2009-2017 David Sorokin BSD3 David Sorokin experimental None Haskell2010

Simulation.Aivika.Queue.Base

Description

Tested with: GHC 8.0.1

This module defines an optimised finite queue, which has no counters nor signals.

Synopsis

Queue Types

A type synonym for the ordinary FIFO queue also known as the FCFS (First Come - First Serviced) queue.

A type synonym for the ordinary LIFO queue also known as the LCFS (Last Come - First Serviced) queue.

A type synonym for the SIRO (Serviced in Random Order) queue.

A type synonym for the queue with static priorities applied when storing the elements in the queue.

data Queue si sm so a Source #

Represents a queue using the specified strategies for enqueueing (input), si, internal storing (in memory), sm, and dequeueing (output), so, where a denotes the type of items stored in the queue.

Creating Queue

Create a new FCFS queue with the specified capacity.

Create a new LCFS queue with the specified capacity.

Create a new SIRO queue with the specified capacity.

Create a new priority queue with the specified capacity.

Arguments

 :: (QueueStrategy si, QueueStrategy sm, QueueStrategy so) => si the strategy applied to the enqueueing (input) processes when the queue is full -> sm the strategy applied when storing items in the queue -> so the strategy applied to the dequeueing (output) processes when the queue is empty -> Int the queue capacity -> Simulation (Queue si sm so a)

Create a new queue with the specified strategies and capacity.

Queue Properties and Activities

enqueueStrategy :: Queue si sm so a -> si Source #

The strategy applied to the enqueueing (input) processes when the queue is full.

enqueueStoringStrategy :: Queue si sm so a -> sm Source #

The strategy applied when storing (in memory) items in the queue.

dequeueStrategy :: Queue si sm so a -> so Source #

The strategy applied to the dequeueing (output) processes when the queue is empty.

queueNull :: Queue si sm so a -> Event Bool Source #

Test whether the queue is empty.

See also queueNullChanged and queueNullChanged_.

queueFull :: Queue si sm so a -> Event Bool Source #

Test whether the queue is full.

See also queueFullChanged and queueFullChanged_.

queueMaxCount :: Queue si sm so a -> Int Source #

The queue capacity.

queueCount :: Queue si sm so a -> Event Int Source #

Return the current queue size.

See also queueCountStats, queueCountChanged and queueCountChanged_.

Dequeuing and Enqueuing

Arguments

 :: (DequeueStrategy si, DequeueStrategy sm, EnqueueStrategy so) => Queue si sm so a the queue -> Process a the dequeued value

Dequeue suspending the process if the queue is empty.

Arguments

 :: (DequeueStrategy si, DequeueStrategy sm, PriorityQueueStrategy so po) => Queue si sm so a the queue -> po the priority for output -> Process a the dequeued value

Dequeue with the output priority suspending the process if the queue is empty.

Arguments

 :: (DequeueStrategy si, DequeueStrategy sm) => Queue si sm so a the queue -> Event (Maybe a) the dequeued value of Nothing

Try to dequeue immediately.

Arguments

 :: (EnqueueStrategy si, EnqueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> a the item to enqueue -> Process ()

Enqueue the item suspending the process if the queue is full.

Arguments

 :: (PriorityQueueStrategy si pi, EnqueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> pi the priority for input -> a the item to enqueue -> Process ()

Enqueue with the input priority the item suspending the process if the queue is full.

Arguments

 :: (EnqueueStrategy si, PriorityQueueStrategy sm pm, DequeueStrategy so) => Queue si sm so a the queue -> pm the priority for storing -> a the item to enqueue -> Process ()

Enqueue with the storing priority the item suspending the process if the queue is full.

Arguments

 :: (PriorityQueueStrategy si pi, PriorityQueueStrategy sm pm, DequeueStrategy so) => Queue si sm so a the queue -> pi the priority for input -> pm the priority for storing -> a the item to enqueue -> Process ()

Enqueue with the input and storing priorities the item suspending the process if the queue is full.

Arguments

 :: (EnqueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> a the item which we try to enqueue -> Event Bool

Try to enqueue the item. Return False in the monad if the queue is full.

Arguments

 :: (PriorityQueueStrategy sm pm, DequeueStrategy so) => Queue si sm so a the queue -> pm the priority for storing -> a the item which we try to enqueue -> Event Bool

Try to enqueue with the storing priority the item. Return False in the monad if the queue is full.

Arguments

 :: (Eq a, DequeueStrategy si, DeletingQueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> a the item to remove from the queue -> Event Bool whether the item was found and removed

Remove the item from the queue and return a flag indicating whether the item was found and actually removed.

Arguments

 :: (Eq a, DequeueStrategy si, DeletingQueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> a the item to remove from the queue -> Event ()

Remove the specified item from the queue.

Arguments

 :: (DequeueStrategy si, DeletingQueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> (a -> Bool) the predicate -> Event (Maybe a)

Remove an item satisfying the specified predicate and return the item if found.

Arguments

 :: (DequeueStrategy si, DeletingQueueStrategy sm, DequeueStrategy so) => Queue si sm so a the queue -> (a -> Bool) the predicate -> Event ()

Remove an item satisfying the specified predicate.

Arguments

 :: (Eq a, DeletingQueueStrategy sm) => Queue si sm so a the queue -> a the item to search the queue for -> Event Bool whether the item was found

Detect whether the item is contained in the queue.

Arguments

 :: DeletingQueueStrategy sm => Queue si sm so a the queue -> (a -> Bool) the predicate -> Event (Maybe a) the item if it was found

Detect whether an item satisfying the specified predicate is contained in the queue.

Arguments

 :: (DequeueStrategy si, DequeueStrategy sm) => Queue si sm so a the queue -> Event ()

Clear the queue immediately.


text:
Monday
November 24, 2014

Posted by Anonymous on Tuesday, March 26, 2013 at 7:39pm.

How would you go about making 250ml of a 20X stock solution of NaCl to dilute later to a final concentration of 50mM? I know that the molecular weight of NaCl is 58.44 but I am not sure where to start. I need to figure out the amount of NaCl and water needed. Thank you!

I got 0.73 grams of NaCl is this correct?

Related Questions

Math - How would you go about making 250ml of a 20X stock solution of NaCl to ...
Microbiology - You need 3.5L of 50mM NaCl from your 20X stock. How would you ...
chemistry - Hey, I am having a real hard time getting the answers to the ...
Chemistry - You have a stock solution of 14.4 M NH3. how many mililiters of this...
Chemistry 2 - You have a stock solution of 15.0 M NH3 . How many milliliters of ...
science-chem - first, thanks so much Bob for helping me!!!! Q4.you will be asked...
chemistry - If you dilute 27.0$${\rm mL}$$ of the stock solution to a final ...
chemistry - If you dilute 10.0mL of the stock solution to a final volume of 0....
Chem - If you take a 15.0-mL portion of the stock solution and dilute it to a ...
Chemistry - If you take a 10.0-{mL} portion of the stock solution and dilute it ...

Search
Members


text:
# What happens in string theory beyond the Hagedorn temperature?

What happens in string theory when the temperature exceeds the Hagedorn temperature? Is that even possible? If yes, what is the nature of the phase transition and the phase beyond that? What happens to spacetime in the new phase?

-

This depends a bit what you mean by string theory. I will take this to mean perturbative string theories. Also, my opinion below does not reflect a complete consensus, but I think it is the majority view. There is also lots of work on this, quite a bit of it before my time, I might be missing something.

So, in free string theories, there is exponential density of states at high energies. This means there is a “Hagedorn” temperature, a temperature beyond which the partition function $Tr(e^-{\beta H})$ does not exist. The same appears to be happening in QCD, where there is an exponential density of almost stable resonances in some limit (the large N limit) - this is the context in which Hagedorn was discussing this temperature.

It is an interesting question what happens as you heat up the system and approach this temperature. One has to distinguish two cases: the string coupling is precisely zero, or the string coupling is small but finite (which of course is the more sensible case).

At zero coupling, as you heat the system, you have competition between two situations. One is the conventional picture: gas of strings with different energy levels which are thermally distributed. On the other hand you can have a single excited string, which as a single object does not have a thermodynamic description. The reason you can have competition between such situations is because the single string has many “internal” degrees of freedom, so it can individually have large density of states. What happens near the Hagedorn temperature is that as you put more energy into the system, you excite a single string rather than change the thermal distribution of many strings. You can see the breakdown of the thermodynamic description because the specific heat of the system, which is a measure of the strength of the thermal fluctuations, diverges near the Hagedorn temperature.

If the coupling is finite, no matter how small, we have to consider interactions between the strings. The results of the classic paper by Atick and Witten suggest that well before you reach the Hagedorn temperature, the system will go through a first order phase transition and never really reach the Hagedorn temperature. The nature of the new phase was not clarified in that paper, and it probably depends on which string theory it is precisely. One universal expectation is that since strings attract gravitationally, the phase transition involves gravitational collapse of the system.

-

The density of states for a string with respect to modes n is $$\eta(n)~\sim~ exp(4\pi n \sqrt{\alpha’})$$ that defines a partition function $$Z~\simeq~\int\eta(n)exp(-n/T)dn.$$ The temperature is computed by $1/T~=~\partial Z/\partial n$ and the path integral diverges for a temperature greater than $$T_H~=~4\pi\sqrt{\alpha’}$$ which is the Hagedorn temperature. This is proportional to the reciprocal of the string length. The entropy of the system is the logarithm of the density of states the $S~\sim~ 1/nT_H$, which in the large $n$ limit is zero. The modes number is given by $n~=~1/(\sqrt{d}M_s)$, for $d$ the number of degrees of freedom and $M_s$ the string mass

At this point there is new physics. Hagedorn temperature occurs when physics scales below the string length, and pertains to a domain between the string length and the Planck length. This the UV limit of string theory, which has correspondences with the IR limit by holography. A gas of strings percolate into a single system (one large string), which has a correspondence with the Lorentz contraction and “spreading”of strings on the event horizon of a black hole at the IR limit. At or near the Hagedorn temperature there is likely to be quantum fluctuations which exchange the various string types. This in M-theory corresponds to the wrapping-mode T-duality, modular S-duality and such structures which exchange string types.

I would conjecture that just as with the meson string, two quarks connected by a chromodynamic flux tube, strings are similar, and above the Hagedorn temperature become “gas” of D0-branes or particles. The endpoints of strings (Chan-Paton factors or Dirichlet conditions on Dp-branes) become a plasma of D0-partons.

-
I have just found this nice answer when wanting to know about the Hagedorn temperature. It should get much more +1s than the one from me now! –  Dilaton Jun 1 '13 at 10:51
+1 Dilaton...Now it is +2... ;) –  riemannium Nov 26 '14 at 19:30


text:
# Linear charge

1. Sep 17, 2012

### Mdhiggenz

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

Positive charge Q is distributed uniformly along the x-axis from x=0 to x=a. A positive point

charge q is located on the positive x-axis at x=a+r , a distance to the right of the end of Q.

Observe the figure below

My goal is to try to explain the problem to make sure I understand it since a similar one will be on my exam, and also get some questions that I don't understand addressed. (:

1. Calculate the x-component of the electric field produced by the charge distribution Q at points on the positive x-axis where x>a.

$\lambda$= $\stackrel{Q}{a}$

dQ=$\-lambda$ dx (I dont know why lambda is negative)

dq=-$\stackrel{Q}{A}$

First things First I know that the distance of Q is a and the distance from Q to a test point q+ is = a+r which the problem statement sets to x for simplicity.

-$\aintx$ $\stackrel{Q}{a}$dx

Here is where I get confused I dont understand why the insert $\stackrel{k}{x^2}$
not including the point charge q?

after that it is just simple integrals and algebra.

Ultimately getting an answer of $\stackrel{Qk}{a}$($\stackrel{1}{a}$-$\stackrel{1}{a+r}$)

2. Calculate the magnitude of the force that the charge distribution that Q exerts on q.

Here i'm also confused isn't the answer just a simplified version of part 1?

$\stackrel{kQa}{r(a+r)}$

Thanks for the help!


text:
URL https://opencores.org/ocsvn/forwardcom/forwardcom/trunk

Subversion Repositoriesforwardcom

[/] [forwardcom/] [manual/] [fwc_conclusion.tex] - Rev 142

% chapter included in forwardcom.tex
\documentclass[forwardcom.tex]{subfiles}
\begin{document}
\RaggedRight

\chapter{Conclusion}
The ForwardCom instruction set architecture is a consistent, modular,
flexible, orthogonal, scalable, and expansible instruction set offering a good compromise between the RISC principle that gives fast decoding and efficient pipelining, and the CISC principle that gives a more compact code and more work done per instruction. Support for efficient out-of-order execution and vector processing is a basic part of the design rather than a suboptimal patch added later as we have seen in other systems.
\vv

There are relatively few instructions, but each instruction can be coded in many different variants with integer operands of different sizes and floating point operands of different precisions. The operands can be scalars or vectors of any length. Operands can be registers, immediate constants in various compact forms, or memory operands with different addressing modes.  Instructions can have predicates or masks with specified fallback values. Vectors have variable lengths with unlimited room for future expansions.
\vv

All in all, the same basic instruction can have many different variants with the same operation code where other instruction sets have many different instructions to cover the same diversity. Everything fits into a consistent template format that simplifies the hardware implementation. The design also has plenty of space for single-format instructions with fewer variants.
\vv

The instruction format is designed so that the microprocessor pipeline can be simple and efficient. All instructions fit into the same format templates and the same pipeline structure to facilitate an efficient hardware design. It is possible to make complex instructions with complex functionality, but only if this fits into the pipeline system and the timing constraints. Microcode is preferably not used.
\vv

The decoder front-end can load multiple instructions per clock cycle because it is easy to detect the length of each instruction, and the decoder needs only distinguish between a few different instruction sizes. Actually, it is
possible to make a working program with only single-word (32 bits) instructions, but it is highly recommended to also support double-word and triple-word instructions. \vv

It is possible to add support for longer instructions in future extensions, but the priority has been to avoid any bottleneck in the decoding of instruction length (which is a serious bottleneck in the x86 architecture).
\vv

The code format is designed to be compact in order to save code cache space. This compactness is obtained in several ways. The same instruction can be coded in different sizes with two- and three-operand forms, different sizes of immediate constants, shifted immediate constants, and relative addresses with different sizes of offsets and scale factors, while avoiding absolute addresses that would require 64 bits for the address alone. It is always possible to choose the smallest version of an instruction that fits the particular need. The load on the data cache can be reduced by storing immediate constants in the code rather than in memory operands.
\vv

Most instructions can have a mask register which is used for predication in scalar instructions and for masking in vector instructions. The same mask register is also used for specifying various options such as rounding mode, exception handling, etc., that would otherwise require extra bits in the instruction code.
\vv

The introduction of vector registers with variable length is an important improvement over the most common current architectures. The ForwardCom vector system has the following advantages:

\begin{itemize}
\item The system is scalable. Different microprocessors can have different maximum vector lengths with no upper limit. It can be used for small embedded systems as well as large supercomputers with very long vectors.

\item The same code can run on different microprocessors with different maximum vector lengths and automatically utilize the full vector capabilities of each microprocessor.

\item The code does not have to be recompiled when a new microprocessor version with longer vectors becomes available. Software developers do not have to maintain multiple versions of their software for different vector lengths.

\item The software can save and restore a vector register in a way that is guaranteed to work with future processors with longer vectors. The inability to do so is a big problem in current architectures.

\item Only the part of a vector register that is actually used needs to be saved and restored. Each vector register includes information about how many bytes of it are used. Therefore, no unnecessary resources are wasted on saving a full-length vector if it is unused or only partially used.

\item A special addressing mode supports a very efficient loop structure that will automatically use the maximum vector length on all but the last iteration of an array loop. The last iteration will automatically use a shorter vector to handle the remaining array elements in case the array size is not divisible by the maximum vector length. There is no need to handle the remaining elements separately outside the main loop and no need to make separate versions of the loop for different special cases.

\item Functions can have variable-length vector registers as parameters. This makes it easy for the compiler to vectorize loops that contain function calls.

\item Instructions with vector register operands need no extra information about the vector length because this information is included in the vector registers. This makes these instructions more compact. Instructions with vector memory operands do need this extra information, though.

\item The design takes into account the hardware requirements of microprocessors with very long vectors where transport delays across a vector may depend on the vector length.

\item A new efficient system with re-linkable function libraries eliminates the need for dynamic link libraries and shared objects.

\item Strong security features are built into the design.

\item Software standards guarantee compatibility between different compilers, programming languages, user interface frameworks, and operating systems.

\end{itemize}

The memory model is flexible with relative addresses. Everything is position-independent. Memory management is simpler than in many current systems.
There is little or no need for virtual address translation. The preferred implementation has no translation lookaside buffer (TLB) and no memory paging, but a simple on-chip memory map with variable-size memory sections. Problems with stack overflow, memory fragmentation, etc. can be avoided completely in most cases. Task switches will be fast because of the small memory map and because of the efficient mechanism for saving vector registers.
\vv

The principle that a fundamental redesign enables us to learn from history and integrate late additions into the basic design also applies to the whole ecosystem of ABI standard, function libraries, compilers, linkers, and operating system. By defining not only an instruction set, but also ABI standard, binary file format, interface library standard, etc. we get the further advantage that different compilers and different programming languages will be compatible with each other. It will be possible to write different parts of a program in different programming languages and to use the same function libraries with all compilers. Even different operating systems will be compatible to some degree. A feature for re-linking an executable file makes it possible to run the same binary program file in different operating systems or on different platforms where the appropriate user interface framework is selected when the program is installed.
\vv

We have also learned from past mistakes that it is difficult to predict future needs. While the ForwardCom instruction set is intended to be flexible with room for future extensions, we may ask whether the future will bring needs for new features that are difficult to integrate into our design and standards. The best way to prevent such unforeseen problems is to allow input and suggestions from the entire community of hardware and software developers. It is important that the design and standards are developed through an open process that allows everybody to comment and make suggestions. We have often seen the problems of leaving this to a commercial industry. The industry often makes short-term decisions for marketing reasons. Patents, license restrictions, and trade secrets harm competition and prevent niche operators from entering the market. The microprocessor industry often keeps new features and instruction set extensions secret for competitive reasons until it is too late to change them in case the IT community comes up with better proposals.
\vv

The ForwardCom project is being developed in an open process with contributions and ideas from various people based on the philosophy that the problems mentioned above can best be avoided through openness and collaboration.
\end{document}


text:
# Introducing omnsplit

2009-06-17

After a bit of struggle, I now have another literate OWL tool working, along the lines discussed in a previous blog post. Rather than generating the OWL documentation, I now split a Manchester syntax file up, so that I can refer to bits of it. I have this working with OBI, using Protege to produce a single merged ontology file, in Manchester syntax.

The current implementation is rather simple; it produces one file-per-entity in the OWL file which I don't think is entirely good. When run on OBI, it creates over 1400 files which is a lot. The other problem is that I've had to do some dubious hacking to get the file names work out. Firstly, I have to remove spaces and "\"'s, as wel as ":" which is illegal on NTFS.

There's also a problem with some of the OWL. Unfortunately, the OBI to OWL conversion process has a reification step which I don't quite understand the purpose of. This comes out as this sort of anonymous individual. I'm not sure at all how the definition has come out as the rdfs:label, but, for sure, you can't use this as a filename!

Individual: relationship:genid7

Annotations:
rdfs:label "C located_in C' if and only if: given any c that
instantiates C at a time t, there is some c' such that: c' instantiates
C' at time t and c *located_in* c'. (Here *located_in* is the
instance-level location relation.)"@en,
oboInOwl:hasDbXref relationship:genid8

Types:
oboInOwl:Definition
------------------------------

I think I might change the implementation a bit, though. Having 1400 files in
one directory is not good. My idea is to serialize the entire file out as
latex, with lots of macros, autogenerated.

[source,latex]
------------------------------
%% this would appear in the generated file
\newcommand{\OwlClassowlthing}{
\begin{omn}
Class: owl:Thing
\end{omn}
}

%% then in your latex file you would do
\owlclass{owl}{Thing}

%% which would just resolve to the class above
------------------------------

The only worry with this is that latex would then have to read a large file
into latex, even if most of the macros are not used. This might be really,
really slow. Well, we can but try.

As before, the current version is available at
git://github.com/phillord/literate_omn.git.


text:
# Why the player is not rotating to the opposite direction?

This is before rotating the player is facing the target :

Then rotating but not facing me the player it seems like it's not finishing the rotating ?

In the script in the Update :

private void Update()
{
if(rot)
{
StartCoroutine(ScaleOverSeconds(player.localScale,
new Vector3(0, 180, 0), player.localPosition, 1.5f));
rot = false;
}
}

Then :

public IEnumerator ScaleOverSeconds(Vector3 scaleTo, Vector3 rotateTo, Vector3 moveTo, float seconds)
{
float elapsedTime = 0;
Vector3 startingScale = player.localScale;
Vector3 startingRotation = player.localEulerAngles;
Vector3 startingPosition = player.localPosition;

while (elapsedTime < seconds)
{
player.localScale = Vector3.Lerp(startingScale, scaleTo, (elapsedTime / seconds));
player.localEulerAngles = Vector3.Lerp(startingRotation, rotateTo, (elapsedTime / seconds));
player.localPosition = Vector3.Lerp(startingPosition, moveTo, (elapsedTime / seconds));

elapsedTime += Time.deltaTime;

yield return null;
}
player.localScale = scaleTo;
player.localEulerAngles = rotateTo;
player.localPosition = moveTo;
}

In this case, I want the player only to rotate without scaling or changing position so I used layer.localScale and the player.localPosition when starting the Coroutine.

• Are you sure you start the rotation from 0,0,0. If your initial orientation is not 0, 0, 0 then it will rotate less than 180degrees. – Nikaas May 4 at 6:18
• @Nikaas Let's assume that the rotation is no 0,0,0 is there a way to make it always rotate to facing the camera or the player? or only if it's starting at 0,0,0 it will be accurate? – Haim Hadad May 4 at 6:52
• If you want to rotate a certain amount (as opposed how it's now, toward certain hardcoded direction) you need to pass current rotation + delta rotation for your rotateTo parameter. In your case localRotation + new Vector3(0,180,0) will always turn 180 degrees. If your camera is not always at the character back you can take camera (using say Camera.main) and pass its rotation as rotateTo. But you probably will have to look how to do world to local rotation conversion. BTW I would change the coroutine to accept not local but absolute values. – Nikaas May 4 at 7:27


text:
View Single Post
 Sci Advisor P: 2,853 Hi, I have a question regarding the foliation of space-time by slices of constant "time". I know that such a foliation is possible given a globally hyperbolic manifold, and one can define a "time function" t, the level sets of which are 3-D Cauchy surfaces which foliate the spacetime. My question is, if we define a "time vector" to this foliation by the requirement that $t^\mu\nabla_\mu t=1$, why is this "time vector" not (in general) orthogonal to the space-like Cauchy surfaces? The lapse function and shift vector measure the amount by which this time vector fails to be orthogonal to the Cauchy surfaces, but it seems to me that due to that requirement above, the vector should always be orthogonal shouldn't it? My logic is such: since t is a scalar function, the covariant derivative of it is nothing other than its (one form) gradient, and the (vector) gradient of a function is always orthogonal to the level sets of the function is it not?


text:
BMO maximum

Algebra Level 4

If the maximum value of the expression $$x^2y-y^2x$$ with $$0\leq x\leq1$$ and $$0\leq y\leq1$$ can be expressed as $$\frac{m}{n}$$ with $$m$$ and $$n$$ co-prime integer numbers find the value $$m+n$$

×