text:
## Found 3,571 Documents (Results 1–100)

100
MathJax

Full Text:

Full Text:

### Corrigenda to: ”$$\omega b$$-topological vector spaces”. (English)Zbl 07579600

MSC:  46A19 54C08
Full Text:

### Fixed point results of $$(\phi,\psi)$$-weak contractions in ordered $$b$$-metric spaces. (English)Zbl 07578207

MSC:  54H25 54E40 54F05
Full Text:

### Fixed point theorems in generalized convex metric space and an application to the solution of Volterra integral equations. (English)Zbl 07576917

MSC:  45D05 47H09
Full Text:

Full Text:

Full Text:

Full Text:

### Souslin quasi-orders and bi-embeddability of uncountable structures. (English)Zbl 07573745

Memoirs of the American Mathematical Society 1365. Providence, RI: American Mathematical Society (AMS) (ISBN 978-1-4704-5273-5/pbk; 978-1-4704-7097-5/ebook). vii, 189 p. (2022).
Full Text:

### New fixed point results in extended $$b$$-metric-like spaces via simulation functions with applications. (English)Zbl 07570259

MSC:  54H25 54E40 34A08
Full Text:

### Equivariant coarse (co-)homology theories. (English)Zbl 07569537

MSC:  51F30 55N35 46L85
Full Text:

### Some fixed point results of $$(\phi, \psi,\theta)$$-contractive mappings in ordered $$b$$-metric spaces. (English)Zbl 07568089

MSC:  54H25 54E40 54F05
Full Text:

### New results on generalized $$c$$-distance without continuity in cone $$b$$-metric spaces over Banach algebras. (English)Zbl 07568032

MSC:  54H25 47H10
Full Text:

### Fixed point theorems for weakly contractive mappings in ordered metric spaces with an application. (English)Zbl 07568028

MSC:  54H25 54E40 54F05
Full Text:

### Split continuity: a different perspective. (English)Zbl 07567866

MSC:  54E40 54E50 54C08
Full Text:

### Robust grouped variable selection using distributionally robust optimization. (English)Zbl 07565452

MSC:  90C47 62J07 62J12
Full Text:

Full Text:

Full Text:

### Invariant submanifolds of $$N(k)$$-Contact metric manifolds with generalized Tanaka Webster connection. (English)Zbl 07564647

MSC:  30D35 32A22
Full Text:

### On the flag curvature of a homogeneous Finsler space with generalized $$m$$-Kropina metric. (English)Zbl 07563940

MSC:  53C30 53C60 22E60
Full Text:

Full Text:

Full Text:

MSC:  46B20
Full Text:

### Quadruple fixed-point techniques for solving integral equations involved with matrices and the Markov process in generalized metric spaces. (English)Zbl 07562122

MSC:  47H10 54H25
Full Text:

### On the $$p$$-Bergman theory. (English)Zbl 07557166

MSC:  32A37 32A36 35J96
Full Text:

### Fixed point results of almost generalized $$(\phi, \psi, \theta)_s$$-contractive mappings in ordered $$b$$-metric spaces. (English)Zbl 1491.54155

MSC:  54H25 54E40 54F05
Full Text:

Full Text:

### Coupled fixed points theorems for generalized weak contractions in ordered $$b$$-metric spaces. (English)Zbl 1487.54064

MSC:  54H25 54E40 54F05
Full Text:

Full Text:

### Best proximity point of cyclic generalized $$\phi$$-weak contraction mapping in metric spaces. (English)Zbl 1491.54103

MSC:  54H25 54E40
Full Text:

### Some common fixed point theorems for four mapping in generalized metric spaces. (English)Zbl 1491.54085

MSC:  54H25 54E40
Full Text:

Full Text:

### Componentwise perturbation analysis for the generalized Schur decomposition. (English)Zbl 1490.15029

MSC:  15A42 15A18 47A55
Full Text:

Full Text:

### Generalized $$( \psi, \theta, \varphi)$$-contraction with application to ordinary differential equations. (English)Zbl 1491.54084

MSC:  54H25 54E40 54F05
Full Text:

Full Text:

### Canonical metrics on generalized Hartogs triangles. (English)Zbl 1487.32127

MSC:  32Q02 32Q20 53C55
Full Text:

Full Text:

### Some remarks on $$\alpha$$-admissibility in $$S$$-metric spaces. (English)Zbl 07512189

MSC:  47H10 54H25
Full Text:

### Determining the edge metric dimension of the generalized Petersen graph $$P(n, 3)$$. (English)Zbl 1490.05063

MSC:  05C12 05C85 68Q17
Full Text:

### On generic continuity of maps to posets with metrics. (English)Zbl 07506894

MSC:  54C08 54C60 06F30
Full Text:

MSC:  54H25
Full Text:

Full Text:

### Generalized Ricci solitons on contact metric manifolds. (English)Zbl 07492775

MSC:  53C15 53C25
Full Text:

### A note on generalized contraction theorems. (English. Russian original)Zbl 1484.54059

Math. Notes 111, No. 2, 211-216 (2022); translation from Mat. Zametki 111, No. 2, 211-218 (2022).
MSC:  54H25 47H10 54E35
Full Text:

### On uniqueness and existence of conformally compact Einstein metrics with homogeneous conformal infinity. (English)Zbl 07488397

MSC:  53C25 53C30 34B15
Full Text:

### $$\beta$$-type and generalized $$\beta$$-$$\gamma$$-type multi-valued contractive mappings in a Menger PbM-space. (English)Zbl 1482.47097

MSC:  54H25 54E40 54E70
Full Text:

Full Text:

### Gradient generalized $$\eta$$-Ricci soliton and contact geometry. (English)Zbl 1487.53099

MSC:  53D10 53D15 53C25
Full Text:

Full Text:

### $$b$$-metrics. (English)Zbl 1484.54027

MSC:  54E35 54E15
Full Text:

### Complex Einstein-Finsler doubly twisted product metrics. (English)Zbl 1487.53032

MSC:  53B40 53C25 53C56
Full Text:

### A class of Einstein submanifolds of Euclidean space. (English)Zbl 1486.53058

MSC:  53C25 53C40 53C42
Full Text:

### Fractal set of generalized countable partial iterated function system with generalized contractions via partial Hausdorff metric. (English)Zbl 07471576

MSC:  28A80 28A78 47H10
Full Text:

### Common fixed point theorems for weakly contractions in rectangular $$b$$-metric spaces with supportive applications. (English)Zbl 1490.54060

MSC:  54H25 54E40
Full Text:

### A multiple fixed point result for $$(\theta, \phi, \psi)$$-type contractions in the partially ordered $$s$$-distance spaces with an application. (English)Zbl 07466788

MSC:  54H25 54E40 54F05
Full Text:

### Bilinear $$\theta$$-type generalized fractional integral operator and its commutator on some non-homogeneous spaces. (English)Zbl 07465724

MSC:  47B90 42B35
Full Text:

### Separately polynomial functions. (English)Zbl 07463841

MSC:  22A20 54E45 54E52
Full Text:

### On (local) analysis of multifunctions via subspaces contained in graphs of generalized derivatives. (English)Zbl 07461312

MSC:  90C30 90C53
Full Text:

Full Text:

Full Text:

Full Text:

Full Text:

### On the existence problem for a fixed point of a generalized contracting multivalued mapping. (Russian. English summary)Zbl 07562612

MSC:  47H10 47H04
Full Text:

Full Text:

### Common fixed points of $$w$$-compatible maps in modular $$A$$-metric spaces. (English)Zbl 07555080

MSC:  47H10 54H25
Full Text:

### Study of $$\Gamma$$-simulation functions, $$Z_\Gamma$$-contractions and revisiting the $$\mathscr{L}$$-contractions. (English)Zbl 07550110

MSC:  54H25 47H10 54C30
Full Text:

Full Text:

### Some remarks on Higgs bundles over compact generalized Kähler manifolds. (English)Zbl 07543492

MSC:  53C07 58E15
Full Text:

### Local fixed point theorems and open mapping principles for generalized contractions. (English)Zbl 1491.54168

MSC:  54H25 54E40

MSC:  94B05
Full Text:

MSC:  54H25
Full Text:

### The existence of fixed points for Ćirić’s almost generalized contractive condition mappings in complete metric spaces via $$w_0$$-distances. (English)Zbl 1491.54134

MSC:  54H25 54E40 54E50
Full Text:

### Coupled fixed point theorems of weakly $$C$$-contraction with mixed monotone property in ordered modular metric spaces. (English)Zbl 1491.54089

MSC:  54H25 54E40 54F05
Full Text:

### Coincident and common fixed point theorems using comparison and admissible function in w-distance metric space. (English)Zbl 1491.54043

MSC:  54H25 54E40
Full Text:

### A fixed point theorem for generalized $$(\psi,\varphi)$$-weak contractions in Branciari type generalized metric spaces. (English)Zbl 07525605

MSC:  47H10 54H25
Full Text:

### Generalized metric properties on hyperspaces with the Vietoris topology. (English)Zbl 07524101

MSC:  54B20 54D99 54E20
Full Text:

### Set-valued maps and some generalized metric spaces. (English)Zbl 07518382

Reviewer: Shou Lin (Ningde)
Full Text:

### Some fixed point results on generalized metric spaces. (English)Zbl 1484.54028

MSC:  54E40 54H25 47H10
Full Text:

### Fixed point results of a generalized reversed $$F$$-contraction mapping and its application. (English)Zbl 1485.54046

MSC:  54H25 54E40 45G10
Full Text:

### Existence of $$\varphi$$-fixed point for generalized contractive mappings. (English)Zbl 1484.47091

MSC:  47H09 47H10 45G10
Full Text:

### Best proximity point theorems for $$\alpha$$-Geraghty contraction type maps in metric spaces. (English)Zbl 1491.54140

MSC:  54H25 54E40
Full Text:

### Modified generalized $$\alpha$$-$$\psi$$-Geraghty contraction type maps in metric space and related fixed points. (English)Zbl 1491.54161

MSC:  54H25 54E40
Full Text:

### $$LP$$-Sasakian manifolds with generalized symmetric metric connection. (English)Zbl 1490.53040

MSC:  53C15 53C25 53C40
Full Text:

### On probabilistic $$(\epsilon,\lambda)$$-local contraction mappings and a system of integral equations. (English)Zbl 1491.54081

MSC:  54H25 54E40 54E70
Full Text:

### Some fixed point theorems in $$b$$-metric spaces with $$b$$-simulation functions. (English)Zbl 1482.54078

MSC:  54H25 47H10
Full Text:

### Some fixed point theorems in generalized complex valued metric spaces. (English)Zbl 07489178

MSC:  54H25 54E40
Full Text:

### A new common fixed point theorem for Suzuki generalized $$(\psi, \varphi)$$-weak contractions in ordered metric spaces. (English)Zbl 1485.58007

Reviewer: Bing Tan (Chengdu)
MSC:  58C30 47H10 20M12
Full Text:

Full Text:

Full Text:

### Application and fixed point theorems for orthogonal generalized $$F$$-contraction mappings on $$O$$-complete metric space. (English)Zbl 1482.54069

MSC:  54H25 47H10
Full Text:

### Some estimates for commutators of Littlewood-Paley $$g$$-functions. (English)Zbl 1490.42023

MSC:  42B25 42B35 30L99
Full Text:

MSC:  54H25
Full Text:

### Stability of a system of Euler-Lagrange type cubic functional equations in non-Archimedean 2-normed spaces. (Persian. English summary)Zbl 07481970

MSC:  39B72 46S10 54E70
Full Text:

### New fixed point results in fuzzy metric space. (English)Zbl 07481084

MSC:  54H25 54A40 54E40
Full Text:

### Generic convergence of powers of generalized nonexpansive mappings. (English)Zbl 07476166

MSC:  47H09 47H10 54E50
Full Text:

MSC:  54H25
Full Text:

Full Text:

### Strong convergence theorems under shrinking projection methods for split common fixed point problems in two Banach spaces. (English)Zbl 07470568

MSC:  47J25 47H05 47H09
Full Text:

all top 5

all top 5

all top 5

all top 3

all top 3


text:
# A machine depreciates 5%, 8% and 10% respectively in three consecutive years. If the current value of the machine is Rs. 1,00,000, find the value at the end of the third year.

This question was previously asked in
PGCIL DT Civil 2018 Official Paper
View all PGCIL Diploma Trainee Papers >
1. Rs. 75,840
2. Rs. 78,660
3. Rs. 77,200
4. Rs. 77,000

Option 2 : Rs. 78,660

## Detailed Solution

Given:

Rate of Depreciation = 5%, 8% and 10%

Current value =  Rs. 1,00,000

Formulae Used:

Effective Value = Current value (1 - $${R_1 \over 100}$$)(1 - $${R_2 \over 100}$$)(1 - $${R_3 \over 100}$$)

Calculation:

Effective Value = 1,00,000 (1 - $${5 \over 100}$$)(1 - $${8 \over 100}$$)(1 - $${10 \over 100}$$)

Effective Value = 1,00,000 × 0.95 × 0.92 × 0.9

Effective Value = Rs. 78660

format: plain


text:
# 2 different methods of calculating possibilities of people sitting at round table

I have 2 different problems that seem identical:

8 men and 8 women are going to sit at a round table where there are 16 seats. They take their seats randomly. How many ways can the 16 seats be taken so that no 2 women are sitting next to each other?

I solved this by doing $$2 * 8!8!$$

The method I used was that $8*8*7*7*6*6*5*5*4*4*3*3*2*2*1*1= 8!8!$ is all the ways you can sit these 8 women alternating them with the 8 men.

I then multiplied by two because you have 2 possibilities: the women can be sitting at the odd numbered seats, or at the even numbered ones.

Then I have this other problem:

In how many ways can a party of 4 men and 4 women be seated at a circular table so that no two women are adjacent?

(I took the problem from here: http://www.imsc.res.in/~kamalakshya/cupboard/comb_mag.pdf)

And the solution, according to the website, is:

Answer: The 4 men can be seated at the circular table such that there is a vacant seat between every pair of men in (4-1)! =3! Ways. Now 4 vacant seats can be occupied by 4 women in 4! Ways. Hence the required number of seating arrangements = 3!4! = 144

However, I can't seem to use the method from the 1st problem on this one. All the possible combinations of men and women, sitting alternated with men, would be $4!4!$ Then, multiplying by 2 the solution would be $2 * 4!4! = 1152$

If I use the method from the answer of the 2nd problem with the 1st one, I get $7!8!$, which is different from $2 * 8!8!$

My question is, how can this be? Is there any difference between these 2 problems that I am not seeing?

EDIT: I believe the 1st solution is correct. Check here Probability of men and women sitting at a table alternately

• You are assuming that the seats are labeled. The answer to the second problem assumes the seats are not labeled and takes rotational invariance into account. – N. F. Taussig Oct 16 '16 at 1:29
• Take into account circular permutations. The 1st solution is wring 2nd is correct. – Navin Oct 16 '16 at 1:30
• @navinstudent math.stackexchange.com/questions/1969572/… – SilenceOnTheWire Oct 16 '16 at 1:32
• @N.F.Taussig That makes sense, but how do you infer which method to use from reading the problems, without looking at their solutions? Neither problem mentions anything about the seats being labeled. – SilenceOnTheWire Oct 16 '16 at 1:52
• If the seats are not described as labeled, I would assume that they are unlabeled and that rotational invariance applies, as in the second problem. – N. F. Taussig Oct 16 '16 at 2:57


text:
How to define a new copula distribution family

The function CopulaDistribution can be used with the most well known kernels. I was wondering how I can add a new family of kernels in a way that it works in the same way as the current function. For example as the documentation explains:

CopulaDistribution can be used with such functions as Mean, PDF, and RandomVariate, etc.

Do I need to define all these functions myself or is there a smart way of using the functions which are already defined in Mathematica?

I wonder if anyone has done something similar and would like to share his/her experience on this.

-
@Szabolcs. Thanks for editing my question. I guess I need to read this page (mathematica.stackexchange.com/editing-help#comment-formatting)? –  Mikael Anderson Feb 12 '12 at 13:26
You can read the guide here, but I myself prefer using the editor toolbar when I can, or keyboard shortcuts (the shortcuts are shown in button tooltips, e.g. selecting a piece of text then pressing ctrl-k to format as code is what I use most often) –  Szabolcs Feb 12 '12 at 14:03
Could you maybe give a concrete example of what you want to do? –  Ｊ. Ｍ. Feb 12 '12 at 14:38

2 Answers

The function ProbabilityDistribution allows you to define your own distribution functions that can be used with all distribution-related functions. The following example is from the documentation.

Define a custom probability distribution giving its pdf:

  dD = ProbabilityDistribution[ Piecewise[{{x^2/9, 0 < x <= 3}}], {x, -\[Infinity], \[Infinity]}];

Then you can use the built-in functions CDF, Mean etc with it just like any other built-in distribution function. For example:

  CDF[dD,x]

gives:

Documentation also contains examples of how construct your own multivariate distributions. There are no specific examples of custom copulas in the documentation but the same principle should apply: you need to use ProbabilityDistribution to define such things in order to be able to use built-in function like CDF, PDF, RandomVariate... with them.

-
thanks I appreciate your point that I can use ProbabilityDistribution to define a new multivariate distribution. However, as far as I can see now, it would not be straightforward to construct new multivariate distributions by changing the marginals (as one can do with CopulaDistribution) for that distribution unless one use functions like TransformedDistribution or alike. Is that right? –  Mikael Anderson Feb 12 '12 at 13:13
@Mikael, you are right; and that's the essential "beauty" of the copula approach/representation. The built-in CopulaDistribution function works with built-in kernels listed in the More Information section; there is not documented mechanism to cosntruct your own kernel and use it as the first argument of the CopulaDistribution function. If these standard copulas are not sufficient for your needs, then you need to use ProbabilityDistribution. Regarding TransformedDistribution I am not sure it allows you to specify the marginal distributions and the copula kernel separately. –  kguler Feb 12 '12 at 13:48
@Mikael, bumped into two related questions in SO: this and this ; and Sasha's answers to both might apply for the case of defining custom copula kernels too. –  kguler Feb 12 '12 at 16:03
... also in response to a different question in SO, Sjoerd mentions that RandomVariate does not work with custom multivariate distributions created via ProbabilityDistribution. –  kguler Feb 12 '12 at 16:13
Many thanks @kguler indeed for very useful links. Regarding TransformedDistributionI should clarify that I was thinking one could transform the marginal distribution of say X from uniform to an arbitrary distribution, say G, by considering the distribution of G(X) using TransformedDistribution. –  Mikael Anderson Feb 12 '12 at 16:36

The following page contains some tips on enabling custom distributions (i.e. written from scratch without TransformedDisribution or ProbabilityDistribution) for use in CopulaDistribution, RandomVariate, etc: Efficient Generation of Random Variates from a Copula Distribution

-


text:
# Using other reagent gases for Chemical Ionization (CI) operation - Applies to 5973A/N MSD

This document describes the use of reagent gases for chemical ionization (CI) use other than the typical Methane reagent gas. In particular this will describe the use of Isobutane and Ammonia as the reagent gas. Before attempting the use of these alternate reagent gases, the user should be familiar with CI operations of the 5973 MSD with Methane gas since the system should initially be tuned using Methane.


text:
A survey flow can usefully be considered a directed graph. edges shows its edge pairs, and nodes gives its nodes.

edges(design_object)

nodes(design_object)

## Arguments

design_object A qualtrics_design-class object retrieved from Qualtrics by design.

plot_flow, render_flow


text:
# greybox package for R

I am delighted to announce a new package on CRAN. It is called “greybox”. I know, what my American friends will say, as soon as they see the name – they will claim that there is a typo, and that it should be “a” instead of “e”. But in fact no mistake was made – […]

# Comparing additive and multiplicative regressions using AIC in R

One of the basic things the students are taught in statistics classes is that the comparison of models using information criteria can only be done when the models have the same response variable. This means, for example, that when you have $$\log(y_t)$$ and calculate AIC, then this value is not comparable with AIC from a […]

# “smooth” package for R. Common ground. Part II. Estimators

UPDATE: Starting from the v2.5.1 the cfType parameter has been renamed into loss. This post has been updated since then in order to include the more recent name. A bit about estimates of parameters Hi everyone! Today I want to tell you about parameters estimation of smooth functions. But before going into details, there are […]

# Multiplicative State-Space Models for Intermittent Time Series

John Boylan and I have been working on a paper about state-space models for intermittent data. We have had some good progress in that direction and have submitted the paper to IJF. Although it is still under review, we decided to publish the working paper in order to promote the thing. Here’s the abstract: Intermittent […]

# Old dog, new tricks: a modelling view of simple moving averages

Fotios Petropoulos and I have recently written a paper about a statistical model, underlying Simple Moving Average. Although we are usually taught in Forecasting courses, that there is no such thing, we found one. We have submitted this paper to International Journal of Production Research, and it has been recently accepted (took us ~4 months). […]

# “smooth” package for R. es() function. Part IV. Model selection and combination of forecasts

Mixed models In the previous posts we have discussed pure additive and pure multiplicative exponential smoothing models. The next logical step would be to discuss mixed models, where some components have additive and the others have multiplicative nature. But we won’t spend much time on them because I personally think that they do not make […]

# “smooth” package for R. es() function. Part III. Multiplicative models

Theoretical stuff Last time we talked about pure additive models, today I want to discuss multiplicative ones. There is a general scepticism about pure multiplicative exponential smoothing models in the forecasters society, because it is not clear why level, trend, seasonality and error term should be multiplied. Well, when it comes to seasonality, then there […]

# “smooth” package for R. es() function. Part II. Pure additive models

A bit of statistics As mentioned in the previous post, all the details of models underlying functions of “smooth” package can be found in extensive documentation. Here I want to discuss several basic, important aspects of statistical model underlying es() and how it is implementated in R. Today we will have a look at basic […]

# 19th IIF Workshop presentation

An IIF workshop “Supply Chain Forecasting for Operations” took place at Lancaster University on 28th and 29th of June. I have given a presentation on a topic that John Boylan and I are currently working on. We suggest a universal statistical model, that allows uniting standard methods of forecasting (for example, for fast moving products) […]

# True model

In the modern statistical literature there is a notion of “true model”, by which people usually mean some abstract mathematical model, presumably lying in the core of observed process. Roughly saying, it is implied that data we have has been generated by some big guy with a white beard sitting in mathematical clouds using some […]


text:
Volume 10, Issue 1
A New Post-Processing Technique for Finite Element Methods with $L^2$-Superconvergence

East Asian J. Appl. Math., 10 (2020), pp. 40-56.

Published online: 2020-01

Cited by

Export citation
• Abstract

A simple post-processing technique for finite element methods with $L$2-superconvergence is proposed. It provides more accurate approximations for solutions of two- and three-dimensional systems of partial differential equations. Approximate solutions can be constructed locally by using finite element approximations $u$$h provided that u$$h$ is superconvergent for a locally defined projection $\widetilde{P}$$h$$u$. The construction is based on the least-squares fitting algorithm and local $L$2-projections. Error estimates are derived and numerical examples illustrate the effectiveness of this approach for finite element methods.

65N30, 65N15

512442593@qq.com (Wei Pi)

wangh@scu.edu.cn (Hao Wang)

xpxie@scu.edu.cn (Xiaoping Xie)

• BibTex
• RIS
• TXT
@Article{EAJAM-10-40, author = {Pi , WeiWang , Hao and Xie , Xiaoping}, title = {A New Post-Processing Technique for Finite Element Methods with $L^2$-Superconvergence}, journal = {East Asian Journal on Applied Mathematics}, year = {2020}, volume = {10}, number = {1}, pages = {40--56}, abstract = {

A simple post-processing technique for finite element methods with $L$2-superconvergence is proposed. It provides more accurate approximations for solutions of two- and three-dimensional systems of partial differential equations. Approximate solutions can be constructed locally by using finite element approximations $u$$h provided that u$$h$ is superconvergent for a locally defined projection $\widetilde{P}$$h$$u$. The construction is based on the least-squares fitting algorithm and local $L$2-projections. Error estimates are derived and numerical examples illustrate the effectiveness of this approach for finite element methods.

}, issn = {2079-7370}, doi = {https://doi.org/10.4208/eajam.170119.200519}, url = {http://global-sci.org/intro/article_detail/eajam/13577.html} }
TY - JOUR T1 - A New Post-Processing Technique for Finite Element Methods with $L^2$-Superconvergence AU - Pi , Wei AU - Wang , Hao AU - Xie , Xiaoping JO - East Asian Journal on Applied Mathematics VL - 1 SP - 40 EP - 56 PY - 2020 DA - 2020/01 SN - 10 DO - http://doi.org/10.4208/eajam.170119.200519 UR - https://global-sci.org/intro/article_detail/eajam/13577.html KW - Finite element method, post-processing, least-square fitting, $L^2$-superconvergence. AB -

A simple post-processing technique for finite element methods with $L$2-superconvergence is proposed. It provides more accurate approximations for solutions of two- and three-dimensional systems of partial differential equations. Approximate solutions can be constructed locally by using finite element approximations $u$$h provided that u$$h$ is superconvergent for a locally defined projection $\widetilde{P}$$h$$u$. The construction is based on the least-squares fitting algorithm and local $L$2-projections. Error estimates are derived and numerical examples illustrate the effectiveness of this approach for finite element methods.

WeiPi, HaoWang & XiaopingXie. (2020). A New Post-Processing Technique for Finite Element Methods with $L^2$-Superconvergence. East Asian Journal on Applied Mathematics. 10 (1). 40-56. doi:10.4208/eajam.170119.200519
Copy to clipboard
The citation has been copied to your clipboard


text:
# What is the molarity of 3 hydrogen peroxide?

molarity = $\left(\text{number of moles of Hydrogen Peroxide") / ("volume of solvent (liter)}\right)$


text:
# Using Zeta Zeros to Compute the Chebyshev Psi Function

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram CDF Player or other Wolfram Language products.

Requires a Wolfram Notebook System

Edit on desktop, mobile and cloud with any Wolfram Language product.

Chebyshev's psi () function is important in number theory. It is defined as the logarithm of the least common multiple of the integers from 1 through . The graph of is an irregular step function.

[more]

This Demonstration illustrates the remarkable fact that we can approximate the jumps of this step function by using a sum that involves zeros of the Riemann zeta function .

[less]

Contributed by: Robert Baillie (March 2011)
Open content licensed under CC BY-NC-SA

## Details

Snapshot 1: the graphs of the step function and the formula using no zeta zeros

Snapshot 2: the graphs of and the formula using 30 pairs of zeta zeros

Snapshot 3: in order to hit the small jump in at , at least 70 zeta zeros are needed

can be defined as , where the sum is over the primes , and denotes the floor function. For example,

=

= .

Note that 2520 is the least common multiple of the integers 1 through 10.

behaves as follows: when reaches a prime power , then increases by . After that, remains constant until reaches the next prime power. This means the graph of is a step function that jumps up at powers of primes.

This Demonstration uses von Mangoldt's formula to calculate :

,

where is the complex zero of the Riemann zeta function. See [1] for general information about the function. See p. 104 of [2] for a proof of this formula.

is a constant that simplifies to , which is about 1.837877; is the dominant term in the formula. It can be proven that as approaches , the ratio approaches 1. This fact is equivalent to the prime number theorem, which states that as approaches , the ratio approaches 1, where is the number of primes less than or equal to .

If you use the slider to choose, say, one pair of zeta zeros, then the first sum in the above formula, in effect, combines two terms corresponding to the first conjugate pair of zeta zeros and . So, when these terms are added, their imaginary parts cancel while their real parts add. The applied to the first sum is simply an efficient way to combine the two terms for each pair of zeta zeros.

Notice that the second sum has the same form as the first, except that the second sum extends over the so-called "trivial" zeros of the zeta function, namely, . The second sum is small when is large.

All known zeta zeros have multiplicity 1, which is assumed in the formula. At those values of where jumps from to , the formula converges to the midpoint, , as approaches infinity. You can see this in the graphs.

As we include more zeta zeros in the first sum, we more closely replicate the jumps in the step function . Since jumps up by at powers of the prime , this means that the zeta zeros contain information about which numbers are primes or powers of primes.

In Mathematica notation, can be written as psi[x_] := Sum[Floor[Log[Prime[k], x]] Log[Prime[k]], {k, 1, PrimePi[x]}].

In number theory, the von Mangoldt lambda function is defined as follows: If is a power of a prime, say , where , then is defined as . For other values of , is 0. Using the von Mangoldt function, we can also write as

.

The von Mangoldt function was introduced in Version 7 of Mathematica. Using this function, can be written more simply as psi[x_] := Sum[MangoldtLambda[n], {n, 1, x}].

References:

[1] Wikipedia, "Chebyshev Function."

[2] H. Davenport, Multiplicative Number Theory, 3rd ed., New York: Springer, 2000.

## Permanent Citation

Robert Baillie

 Feedback (field required) Email (field required) Name Occupation Organization Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback. Send


text:
# Groupe de Physique Statistique

## Equipe 106, Institut Jean Lamour

 •  •  •  •  •

### Articles dans des revues à comité de lecture

 Cluster Monte Carlo and dynamical scaling for long-range interactions Flores-Sola E., Weigel M., Kenna R., Berche B. Eur. Phys. J. Special Topics 226 (2017) 581-594 DOI : 10.1140/epjst/e2016-60338-3 ArXiv : arxiv:1611.05659 [PDF] Many spin systems affected by critical slowing down can be efficiently simulated using cluster algorithms. Where such systems have long-range interactions, suitable formulations can additionally bring down the computational effort for each update from $O(N^2)$ to $O(N \ln N)$ or even $O(N)$, thus promising an even more dramatic computational speed-up. Here, we review the available algorithms and propose a new and particularly efficient single-cluster variant. The efficiency and dynamical scaling of the available algorithms are investigated for the Ising model with power-law decaying interactions.


text:
Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫  π  -¹ ² ³ °

You are not logged in.

## #51 2013-01-12 12:05:07

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

Hi bob.

Write please a formula: [math ]V_ {cylinder} = \int... continue further [/math]. I want to look at it!!!

.

21122012 wrote:

bob bundy wrote:

You didn't prove to me that a formula

Bob

21122012 wrote:

It is a special case of a general view:

bob bundy wrote:

hi 21122012

Here you say

How can this be from o to r ?  The variable is h.

Bob

P.S.

Is analog:

Last edited by 21122012 (2013-01-12 12:10:37)

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #52 2013-01-12 19:10:25

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #53 2013-01-13 06:22:16

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

Hi Bob!

You recognize an error of calculus which calls cylinder volume as volume a cone or give me a formula of uncertain integral for cylinder volume. But there can be at you such science which can't give a formula of volume of the cylinder? Then your science is necessary to nobody!

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #54 2013-01-13 07:56:28

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

hi 21122012,

Oh thank you.  I am so pleased you have decided to ask me to explain integration.

To work out a volume you divide the solid into thin slices, each one dh in thickness and add them up

For a cylinder each slice is a circle with a radius of r.

Now, and this is the important bit, for a cylinder, every slice is the same size, so the pi r^2 term is constant as h varies.

If V = 0 when h = 0 then C = 0

For a cone each slice is again a circle with a radius of r.

But the circles are not all the same size.  As h increases from o to H, the radius changes from 0 to R.

So \pi r^2 is not constant.

So the result is different.

Do you understand now how integration works ?

Add up the slices but take account of whether they are all the same size, or change as h changes.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #55 2013-01-13 08:56:50

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

bob bundy wrote:

hi 21122012,

Oh thank you.  I am so pleased you have decided to ask me to explain integration.

To work out a volume you divide the solid into thin slices, each one dh in thickness and add them up

For a cylinder each slice is a circle with a radius of r.

Now, and this is the important bit, for a cylinder, every slice is the same size, so the pi r^2 term is constant as h varies.

Everything is up to this point  all is  correct

bob bundy wrote:

If V = 0 when h = 0 then C = 0

I don't understand this thought!

bob bundy wrote:

For a cone each slice is again a circle with a radius of r.

But the circles are not all the same size.  As h increases from o to H, the radius changes from 0 to R.

So \pi r^2 is not constant.

Gallantly!

bob bundy wrote:

STOP!!!

Here mistake!!! I constantly speak to you about it, but you don't hear me!!!

It not algebra! At the left you have two independent variables therefore the result will be one. On the right two dependent variables therefore the result will be another. These two expressions aren't EQUAL! Use WolframAlfa, it will yield to you two various results!

Look this. You equate two red areas to which shooters point. These areas aren't equal.

bob bundy wrote:

So the result is different.

Do you understand now how integration works ?

Add up the slices but take account of whether they are all the same size, or change as h changes.

Bob

Bob you don't make laugh me. I and WolframAlpha we know as integration works.

P.S.

bob bundy wrote:

hi 21122012,

...

...

Bob

BECAUSE:

bob bundy wrote:

Do you understand now how integration works ?

Bob

P.P.S.

Bob!

It already amused me. Let's talk about the serious. Here one from the most important keys to Structural Analysis. You here understand everything?

from left to right:
1. The segment of line.
2. The rectangular system of coordinates (for drawing of charts and schedules of independent sizes).
3. Cartesian coordinate system (for schedules of dependent sizes)
4.Cartesian coordinate system

Last edited by 21122012 (2013-01-13 14:13:12)

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #56 2013-01-14 01:48:56

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

hi 21122012

Look this. You equate two red areas to which shooters point. These areas aren't equal.

I think I have worked out why you keep getting this wrong.

It is true: integration can work out areas

Definition:

Integration is a summation process.

dictionary.com = "ʃ  the limit of an increasingly large number of increasingly smaller quantities"

You can add areas to get volumes, or velocities to get distance, or moments about a point to get the total moment.

I am not integrating to get the area under a graph.

I am working out the volume of a small slice of the shape with 'dh' representing the variable I am integrating with respect to.

To do this the function to be integrated must be a function of 'h'.

And you either put in upper and lower limits for h, or put in a constant of integration.

Only when you understand and accept this, will you be able to do integration properly.

Note:  The integration symbol  ∫  is a stylised letter 's' to stand for 'sum'

Now you seem to have a continuing problem with r = kh.

'r' and 'h' are variables.  As you add up successive volumes, r may vary.  If it does then you must write r in terms of h.

You referred to wikipedia.  Here is the full text from the bit you quoted:

If (for some arbitrary reason) the cone's proportions have to stay the same, and the height and radius are in a fixed ratio k,

This gives the total derivative with respect to r:

Which simplifies to:

Similarly, the total derivative with respect to h is:

Note:  I used r = kh.  Wiki used h = kr.  So our values of k are reciprocals of each other.  Of course, this doesn't alter my calculus.

The picture below is from Wolfram Alpha. It shows that, for a cone, r and h are related.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #57 2013-01-14 08:43:13

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

bob bundy wrote:

...

...

Similarly, the total derivative with respect to h is:

...

Bob

Wikipedia:

Identical type of expressions - decide differently. On the ode of a variable the derivative undertakes, other letter registers.

bob bundy wrote:
2122012 wrote:

.

I do not understand you.

total derivative.  What do you want me to differentiate with respect to?

Two functions, each function of two variables, in one option dependent are given, in the other - of the independent - is unclear on what function to consider a total derivative...

This is cardsharpering instead of exact science.

Last edited by 21122012 (2013-01-14 12:53:46)

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #58 2013-01-14 10:42:18

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

2122012 wrote:

Write please the total and partial derivatives for these two cases.

I do not understand you.

total derivative.  What do you want me to differentiate with respect to?

1.

u = pi r^2 ≠ f(h)

OK?

2. Say u = pi r^2 = pi (kh)^2

What now?

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #59 2013-01-14 12:55:51

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

Hi bob!

You here understand everything?

from left to right:
1. The segment of line.
2. The rectangular system of coordinates (for drawing of charts and schedules of independent sizes).
3. Cartesian coordinate system (for schedules of dependent sizes)
4.Cartesian coordinate system

Last edited by 21122012 (2013-01-14 12:57:04)

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #60 2013-01-14 16:45:36

anonimnystefy
Real Member
From: Harlan's World
Registered: 2011-05-23
Posts: 16,016

### Re: The Structural Analysis - mathematics of the future

Hi Bob

I think I finally understand what he means by schedule- graph!

Here lies the reader who will never open this book. He is forever dead.
Taking a new step, uttering a new word, is what people fear most. ― Fyodor Dostoyevsky, Crime and Punishment
The knowledge of some things as a function of age is a delta function.

Offline

## #61 2013-01-14 17:09:38

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

anonimnystefy wrote:

Hi Bob

I think I finally understand what he means by schedule- graph!

Yes but it not I am the robot so translates.
Here so it translated your phrase:

On English: "I think I finally understand what he means by schedule- grap"

->

On Russian: "Я думаю, что наконец понимаю то, что он подразумевает графиком - граф!"

Last edited by 21122012 (2013-01-14 17:13:21)

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #62 2013-01-14 20:26:14

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

21122012 wrote:

You here understand everything?

No.  We still have not resolved post 22

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #63 2013-01-15 07:33:53

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

bob bundy wrote:
21122012 wrote:

You here understand everything?

No.
Bob

Hi bob

General view of these two expressions the identical:

You could teach me to that how to define the rule for integration. From where it is known that in one case one of variables for other variable is a constant and in other case they depend from each other. How to you it is prompted by a formula? Or each person establishes calculation rules itself voluntarily. After all answers turn out different.

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #64 2013-01-15 07:57:45

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

You could teach me to that how to define the rule for integration.

Not to define the rules.  Other before me have already done that.

But I will teach you to use the rules properly.

For both the cylinder and the cone, the slice is (pi r^2) and the thickness or width is 'dh'.

So

works for both.

But the difference is that a cylinder has the same radius throughout its length => pi r^2 is constant,

whereas for the cone the radius changes along the axis.  pi r^2 is not constant.  It varies with h

So when you integrate you must change the 'r' into a function of 'h'.

If you do not do this you calculate the volume of a cylinder not a cone.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #65 2013-01-15 10:23:26

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

bob bundy wrote:

But I will teach you to use the rules properly.

works for both.

Bob

You didn't explain to me as it is possible using to receive ONE formula TWO various answers one of which is 3 times more than another.

This is THREE volumes !!!

So in Structural Analysis.

Write as it looks at you:

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #66 2013-01-15 11:24:29

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

hi 21122012

I will make it as simple as I can.

I have a cone.  The base radius is 4 cm.  The height (from the vertex downward) is 8 cm.

I have a cylinder.  The base radius is 4 cm.  The height (from the top downward) is 8 cm.

I will calculate the volume of the cylinder in 4 slices.

I will calculate the volume of the yellow slices for the cone.

I will calculate the volume of the green slices for the cone.

Note:

For the cone

I chose my values for R and H but they are related by a formula.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #67 2013-01-15 13:14:20

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

I understand nothing. I ask you about integrals, and you write me algebra. You to me write how your cone has the same formula as the cylinder though is its part. And smaller part. All of you time act as the illusionist: you tell only that that is necessary for you but you don't answer my questions.

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline

## #68 2013-01-15 20:17:55

bob bundy
Moderator
Registered: 2010-06-20
Posts: 7,651

### Re: The Structural Analysis - mathematics of the future

hi 21122012,

When I am asked to explain something I go back to the basic theory.

What I have shown you is an explanation of integration.

I have offered to teach you calculus but you say you are already an expert.  ?? You do not recognise what I have shown.  ??

I think this is the end of this thread for me.

You misuse calculus but cannot understand my explanation of what is wrong.

I offer to help and you insist you need no help.

My opinion is that your theories will never be accepted by other mathematicians for these reasons:

(i)  You say calculus has many errors, but all the examples you have given show only that you do not understand calculus.

(ii)  Nevertheless, you use calculus to start a new theory.

(iii)  Your explanations of the new theory are incomplete because you introduce functions, equations and graphs without explanation and that contradict known facts.

eg.  Tangent lines have no direction.

eg.  Opposite sides of a rectangle have different lengths.

eg.  The radius and the height of a cone are not related.

I am sorry to have to say this, because you have clearly put a lot of effort into your ideas.  I have spent many hours trying to understand these, but I am no clearer than I was at the start.

Sorry.

Bob

Children are not defined by school ...........The Fonz
You cannot teach a man anything;  you can only help him find it within himself..........Galileo Galilei

Offline

## #69 2013-01-16 14:50:04

21122012
Member
Registered: 2012-11-16
Posts: 278

### Re: The Structural Analysis - mathematics of the future

bob bundy wrote:

I am sorry to have to say this, because you have clearly put a lot of effort into your ideas.  I have spent many hours trying to understand these, but I am no clearer than I was at the start.

Sorry.

Bob

Hi bob!

Here initial postulate of STRUCTURAL ANALYSIS:

I don't decide to translate it into English not to lose meaning.

Hi to All
The Fundamental Theorem of Calculus proves that:
1. That differentiation and antidifferentiation are essentially inverse processes:

2. How to evaluate a definite integral using the antiderivative of the integrand:

where F is an antiderivative of f (i.e., F' = f).
I think that on it the correct theory comes to an end.

Nobody proved it and it doesn't make sense.

Because:

"The conditions imposed on functions, become a source of difficulties which will manage to be avoided only by means of new researches about the principles of integral calculus"

Thomas Ioannes Stiltes. ...                                                 I made it!

Offline


text:
# Difference between revisions of "User:Timothee Flutre/Notebook/Postdoc/2012/08/16"

Project name  Main project page
Previous entry      Next entry

## Variational Bayes approach for the mixture of Normals

• Motivation: I have described on another page the basics of mixture models and the EM algorithm in a frequentist context. It is worth reading before continuing. Here I am interested in the Bayesian approach as well as in a specific variational method (nicknamed "Variational Bayes").

• Data: we have N univariate observations, , gathered into the vector .

• Assumptions: we assume the observations to be exchangeable and distributed according to a mixture of K Normal distributions. The parameters of this model are the mixture weights (), the means () and the precisions () of each mixture components, all gathered into . There are two constraints: and .

• Observed likelihood:

• Latent variables: let's introduce N latent variables, , gathered into the vector . Each is a vector of length K with a single 1 indicating the component to which the observation belongs, and K-1 zeroes.

• Augmented likelihood:

• Priors: we choose conjuguate ones
• for the parameters: and
• for the latent variables: and


text:
Home » Calculate cumulative sum (cumsum) by group in R

# Calculate cumulative sum (cumsum) by group in R

In this blog post, I tackle a question that you recurringly see on a lot of boards. We are going to calculate the cumulative sum, but within a group that the rows belong to.

Thanks to vegetableagony for pointing out that, depending on the size of the dataset, other conclusions can be drawn. That’s why edited this post and benchmarked several solutions on a small and large dataset.

## Small datasets

First, let’s create the data and load the packages we’ll be using throughout this post.

library(dplyr)
library(data.table)

data('mtcars')

dt <- data.table(mtcars)
df <- copy(mtcars)

We will try to get the cumulative sum of the column hp, grouped by cyl and gear. (I know, it makes no sense)

First, let’s try to do it with only base functions. The underused function ave will return the cumulative sum by group in a single vector. So you’ll have to concatenate it to your data frame. The median time is 425 microseconds.

with(
df[order(df$hp),], ave(hp, cyl, gear, FUN = cumsum) ) Next, we’ll use ddply from the plyr package. This will return the data frame with the cumulative sum by group as a new column of the data frame. When we test this, we can clearly see that this is ten times slower: 4500 microseconds. ddply( df[order(df$hp),],
.(cyl, gear),
.fun = transform,
cumulative_sum = (cumsum(hp))
)

Next up, dplyr. The following chain of functions will return with the cumulative sum by group as a new column. Not as fast as the first solution, but still a lot faster than ddply(): 830 microseconds.

df %>%
arrange(hp) %>%
group_by(hp) %>%
mutate(cumulative_sum = cumsum(hp))

Finally, let’s go with data.table. I propose two solutions. The first one returns the cumulative sum by group and the columns it was grouped by. The second column adds the cumulative sum by group as a new column to the data frame. Both solutions are somewhat slow (2200 microseconds), which isn’t what we expect from data.table.

dt[order(hp)][,.(cumulative_sum = cumsum(hp)), by = .(cyl, gear)]
dt[order(hp)][,cumulative_sum := cumsum(hp), by = .(cyl, gear)]

## Large datasets

library(nycflights13)

dt <- data.table(flights)
df <- copy(flights)

Let’s try the ave solution first. Given the size of the dataset, this is a lot slower. A median time of 1160 microseconds.

with(
df[order(df$dep_delay),], ave(dep_delay, carrier, year, FUN = cumsum) )  So, let’s go with the ddply solution now. Compared to ave, it’s five to six stimes slower: 6170 microseconds. For small datasets, it was a factor 10, now it’s only factor 6, so that’s an improvement, I guess? 🙂 ddply( df[order(df$dep_delay),],
.(carrier, year),
.fun = transform,
cumulative_sum = (cumsum(dep_delay))
)

Next up is dplyr. For the small dataset, it took double the time to generate the result. Now, it’s a little faster than the ave solution: 980 microseconds.

df %>%
arrange(dep_delay) %>%
group_by(carrier, year) %>%
mutate(cumulative_sum = cumsum(dep_delay))

Finally, I’m going for data.table again. Surprisingly, it gets the job done in 600 microseconds. This is what we expect, given the advertised speed of data.table.

dt[order(dep_delay)][,.(cumulative_sum = cumsum(dep_delay)), by = .(carrier, year)]
dt[order(dep_delay)][,cumulative_sum := cumsum(dep_delay), by = .(carrier, year)]

## Conclusion

Conclusion, for small datasets, the base function ave is the fastest solution. As you can see, sometimes you have to kill your darlings. Yet for big datasets, nothing beats data.table.

By the way, if you’re having trouble understanding some of the code and concepts, I can highly recommend “An Introduction to Statistical Learning: with Applications in R”, which is the must-have data science bible. If you simply need an introduction into R, and less into the Data Science part, I can absolutely recommend this book by Richard Cotton. Hope it helps!

Great succes!

### Say thanks, ask questions or give feedback

Technologies get updated, syntax changes and honestly… I make mistakes too. If something is incorrect, incomplete or doesn’t work, let me know in the comments below and help thousands of visitors.

## 2 thoughts on “Calculate cumulative sum (cumsum) by group in R”

1. Thanks, Rob. I’m going to update the blog post to elaborate on your findings!


text:
# Changes/Release Notes¶

On this page we provide a summary of the main API changes, new features and examples for each release of libCEED.

## Current main branch¶

### New features¶

• CeedScalar can now be set as float or double at compile time.

### Maintainability¶

• Refactored preconditioner support internally to facilitate future development and improve GPU completeness/test coverage.

## v0.9 (Jul 6, 2021)¶

### Interface changes¶

• Minor modification in error handling macro to silence pedantic warnings when compiling with Clang, but no functional impact.

### New features¶

• Add CeedVectorAXPY() and CeedVectorPointwiseMult() as a convenience for stand-alone testing and internal use.

• Add CEED_QFUNCTION_HELPER macro to properly annotate QFunction helper functions for code generation backends.

• Add CeedPragmaOptimizeOff macro for code that is sensitive to floating point errors from fast math optimizations.

• Rust support: split libceed-sys crate out of libceed and publish both on crates.io.

### Examples¶

• Solid mechanics mini-app updated to explore the performance impacts of various formulations in the initial and current configurations.

• Fluid mechanics example adds GPU support and improves modularity.

### Deprecated backends¶

• The /cpu/self/tmpl and /cpu/self/tmpl/sub backends have been removed. These backends were intially added to test the backend inheritance mechanism, but this mechanism is now widely used and tested in multiple backends.

## v0.8 (Mar 31, 2021)¶

### Interface changes¶

• Error handling improved to include enumerated error codes for C interface return values.

• Installed headers that will follow semantic versioning were moved to include/ceed directory. These headers have been renamed from ceed-*.h to ceed/*.h. Placeholder headers with the old naming schema are currently provided, but these headers will be removed in the libCEED v0.9 release.

### Performance improvements¶

• New HIP MAGMA backends for hipMAGMA library users: /gpu/hip/magma and /gpu/hip/magma/det.

• New HIP backends for improved tensor basis performance: /gpu/hip/shared and /gpu/hip/gen.

### Examples¶

• example updated with traction boundary conditions and improved Dirichlet boundary conditions.

• example updated with Neo-Hookean hyperelasticity in current configuration as well as improved Neo-Hookean hyperelasticity exploring storage vs computation tradeoffs.

• example updated with isentropic traveling vortex test case, an analytical solution to the Euler equations that is useful for testing boundary conditions, discretization stability, and order of accuracy.

• example updated with support for performing convergence study and plotting order of convergence by polynomial degree.

## v0.7 (Sep 29, 2020)¶

### New features¶

• New HIP backend: /gpu/hip/ref.

• CeedQFunction support for user CUfunctions in some backends

### Performance improvements¶

• OCCA backend rebuilt to facilitate future performance enhancements.

• Petsc BPs suite improved to reduce noise due to multiple calls to mpiexec.

### Deprecated backends¶

• The /gpu/cuda/reg backend has been removed, with its core features moved into /gpu/cuda/ref and /gpu/cuda/shared.

## v0.6 (Mar 29, 2020)¶

libCEED v0.6 contains numerous new features and examples, as well as expanded documentation in this new website.

### New features¶

• New Python interface using CFFI provides a nearly 1-1 correspondence with the C interface, plus some convenience features. For instance, data stored in the CeedVector structure are available without copy as numpy.ndarray. Short tutorials are provided in Binder.

• Linear QFunctions can be assembled as block-diagonal matrices (per quadrature point, CeedOperatorAssembleLinearQFunction()) or to evaluate the diagonal (CeedOperatorAssembleLinearDiagonal()). These operations are useful for preconditioning ingredients and are used in the libCEED’s multigrid examples.

• The inverse of separable operators can be obtained using CeedOperatorCreateFDMElementInverse() and applied with CeedOperatorApply(). This is a useful preconditioning ingredient, especially for Laplacians and related operators.

• Make public accessors for various attributes to facilitate writing composable code.

• New backend: /cpu/self/memcheck/serial.

• QFunctions using variable-length array (VLA) pointer constructs can be used with CUDA backends. (Single source is coming soon for OCCA backends.)

• Fix some missing edge cases in CUDA backend.

### Examples¶

libCEED-0.6 contains greatly expanded examples with . Notable additions include:

• Standalone (examples/ceed/ex2-surface): compute the area of a domain in 1, 2, and 3 dimensions by applying a Laplacian.

• PETSc (examples/petsc/area.c): computes surface area of domains (like the cube and sphere) by direct integration on a surface mesh; demonstrates geometric dimension different from topological dimension.

• examples/petsc/bpsraw.c (formerly bps.c): transparent CUDA support.

• examples/petsc/bps.c (formerly bpsdmplex.c): performance improvements and transparent CUDA support.

• (examples/petsc/bpssphere.c): generalizations of all CEED BPs to the surface of the sphere; demonstrates geometric dimension different from topological dimension.

• (examples/petsc/multigrid.c): new p-multigrid solver with algebraic multigrid coarse solve.

• (examples/fluids/navierstokes.c; formerly examples/navier-stokes): unstructured grid support (using PETSc’s DMPlex), implicit time integration, SU/SUPG stabilization, free-slip boundary conditions, and quasi-2D computational domain support.

• (examples/solids/elasticity.c): new solver for linear elasticity, small-strain hyperelasticity, and globalized finite-strain hyperelasticity using p-multigrid with algebraic multigrid coarse solve.

## v0.5 (Sep 18, 2019)¶

For this release, several improvements were made. Two new CUDA backends were added to the family of backends, of which, the new cuda-gen backend achieves state-of-the-art performance using single-source . From this release, users can define Q-Functions in a single source code independently of the targeted backend with the aid of a new macro CEED QFUNCTION to support JIT (Just-In-Time) and CPU compilation of the user provided code. To allow a unified declaration, the API has undergone a slight change: the QFunctionField parameter ncomp has been changed to size. This change requires setting the previous value of ncomp to ncomp*dim when adding a QFunctionField with eval mode CEED EVAL GRAD.

Additionally, new CPU backends were included in this release, such as the /cpu/self/opt/* backends (which are written in pure C and use partial E-vectors to improve performance) and the /cpu/self/ref/memcheck backend (which relies upon the Valgrind Memcheck tool to help verify that user have no undefined values). This release also included various performance improvements, bug fixes, new examples, and improved tests. Among these improvements, vectorized instructions for code compiled for CPU were enhanced by using CeedPragmaSIMD instead of CeedPragmaOMP, implementation of a gallery and identity Q-Functions were introduced, and the PETSc benchmark problems were expanded to include unstructured meshes handling were. For this expansion, the prior version of the PETSc BPs, which only included data associated with structured geometries, were renamed bpsraw, and the new version of the BPs, which can handle data associated with any unstructured geometry, were called bps. Additionally, other benchmark problems, namely BP2 and BP4 (the vector-valued versions of BP1 and BP3, respectively), and BP5 and BP6 (the collocated versions—for which the quadrature points are the same as the Gauss Lobatto nodes—of BP3 and BP4 respectively) were added to the PETSc examples. Furthermoew, another standalone libCEED example, called ex2, which computes the surface area of a given mesh was added to this release.

Backends available in this release:

CEED resource (-ceed)

Backend

/cpu/self/ref/serial

Serial reference implementation

/cpu/self/ref/blocked

Blocked reference implementation

/cpu/self/ref/memcheck

Memcheck backend, undefined value checks

/cpu/self/opt/serial

Serial optimized C implementation

/cpu/self/opt/blocked

Blocked optimized C implementation

/cpu/self/avx/serial

Serial AVX implementation

/cpu/self/avx/blocked

Blocked AVX implementation

/cpu/self/xsmm/serial

Serial LIBXSMM implementation

/cpu/self/xsmm/blocked

Blocked LIBXSMM implementation

/cpu/occa

Serial OCCA kernels

/gpu/occa

CUDA OCCA kernels

/omp/occa

OpenMP OCCA kernels

/ocl/occa

OpenCL OCCA kernels

/gpu/cuda/ref

Reference pure CUDA kernels

/gpu/cuda/reg

Pure CUDA kernels using one thread per element

/gpu/cuda/shared

Optimized pure CUDA kernels using shared memory

/gpu/cuda/gen

Optimized pure CUDA kernels using code generation

/gpu/magma

CUDA MAGMA kernels

Examples available in this release:

User code

Example

ceed

• ex1 (volume)

• ex2 (surface)

mfem

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

petsc

• BP1 (scalar mass operator)

• BP2 (vector mass operator)

• BP3 (scalar Laplace operator)

• BP4 (vector Laplace operator)

• BP5 (collocated scalar Laplace operator)

• BP6 (collocated vector Laplace operator)

• Navier-Stokes

nek5000

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

## v0.4 (Apr 1, 2019)¶

libCEED v0.4 was made again publicly available in the second full CEED software distribution, release CEED 2.0. This release contained notable features, such as four new CPU backends, two new GPU backends, CPU backend optimizations, initial support for operator composition, performance benchmarking, and a Navier-Stokes demo. The new CPU backends in this release came in two families. The /cpu/self/*/serial backends process one element at a time and are intended for meshes with a smaller number of high order elements. The /cpu/self/*/blocked backends process blocked batches of eight interlaced elements and are intended for meshes with higher numbers of elements. The /cpu/self/avx/* backends rely upon AVX instructions to provide vectorized CPU performance. The /cpu/self/xsmm/* backends rely upon the LIBXSMM package to provide vectorized CPU performance. The /gpu/cuda/* backends provide GPU performance strictly using CUDA. The /gpu/cuda/ref backend is a reference CUDA backend, providing reasonable performance for most problem configurations. The /gpu/cuda/reg backend uses a simple parallelization approach, where each thread treats a finite element. Using just in time compilation, provided by nvrtc (NVidia Runtime Compiler), and runtime parameters, this backend unroll loops and map memory address to registers. The /gpu/cuda/reg backend achieve good peak performance for 1D, 2D, and low order 3D problems, but performance deteriorates very quickly when threads run out of registers.

A new explicit time-stepping Navier-Stokes solver was added to the family of libCEED examples in the examples/petsc directory (see ). This example solves the time-dependent Navier-Stokes equations of compressible gas dynamics in a static Eulerian three-dimensional frame, using structured high-order finite/spectral element spatial discretizations and explicit high-order time-stepping (available in PETSc). Moreover, the Navier-Stokes example was developed using PETSc, so that the pointwise physics (defined at quadrature points) is separated from the parallelization and meshing concerns.

Backends available in this release:

CEED resource (-ceed)

Backend

/cpu/self/ref/serial

Serial reference implementation

/cpu/self/ref/blocked

Blocked reference implementation

/cpu/self/tmpl

Backend template, defaults to /cpu/self/blocked

/cpu/self/avx/serial

Serial AVX implementation

/cpu/self/avx/blocked

Blocked AVX implementation

/cpu/self/xsmm/serial

Serial LIBXSMM implementation

/cpu/self/xsmm/blocked

Blocked LIBXSMM implementation

/cpu/occa

Serial OCCA kernels

/gpu/occa

CUDA OCCA kernels

/omp/occa

OpenMP OCCA kernels

/ocl/occa

OpenCL OCCA kernels

/gpu/cuda/ref

Reference pure CUDA kernels

/gpu/cuda/reg

Pure CUDA kernels using one thread per element

/gpu/magma

CUDA MAGMA kernels

Examples available in this release:

User code

Example

ceed

• ex1 (volume)

mfem

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

petsc

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

• Navier-Stokes

nek5000

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

## v0.3 (Sep 30, 2018)¶

Notable features in this release include active/passive field interface, support for non-tensor bases, backend optimization, and improved Fortran interface. This release also focused on providing improved continuous integration, and many new tests with code coverage reports of about 90%. This release also provided a significant change to the public interface: a can take any number of named input and output arguments while connects them to the actual data, which may be supplied explicitly to CeedOperatorApply() (active) or separately via CeedOperatorSetField() (passive). This interface change enables reusable libraries of CeedQFunctions and composition of block solvers constructed using . A concept of blocked restriction was added to this release and used in an optimized CPU backend. Although this is typically not visible to the user, it enables effective use of arbitrary-length SIMD while maintaining cache locality. This CPU backend also implements an algebraic factorization of tensor product gradients to perform fewer operations than standard application of interpolation and differentiation from nodes to quadrature points. This algebraic formulation automatically supports non-polynomial and non-interpolatory bases, thus is more general than the more common derivation in terms of Lagrange polynomials on the quadrature points.

Backends available in this release:

CEED resource (-ceed)

Backend

/cpu/self/blocked

Blocked reference implementation

/cpu/self/ref

Serial reference implementation

/cpu/self/tmpl

Backend template, defaults to /cpu/self/blocked

/cpu/occa

Serial OCCA kernels

/gpu/occa

CUDA OCCA kernels

/omp/occa

OpenMP OCCA kernels

/ocl/occa

OpenCL OCCA kernels

/gpu/magma

CUDA MAGMA kernels

Examples available in this release:

User code

Example

ceed

• ex1 (volume)

mfem

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

petsc

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

nek5000

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

## v0.21 (Sep 30, 2018)¶

A MAGMA backend (which relies upon the MAGMA package) was integrated in libCEED for this release. This initial integration set up the framework of using MAGMA and provided the libCEED functionality through MAGMA kernels as one of libCEED’s computational backends. As any other backend, the MAGMA backend provides extended basic data structures for , , and , and implements the fundamental CEED building blocks to work with the new data structures. In general, the MAGMA-specific data structures keep the libCEED pointers to CPU data but also add corresponding device (e.g., GPU) pointers to the data. Coherency is handled internally, and thus seamlessly to the user, through the functions/methods that are provided to support them.

Backends available in this release:

CEED resource (-ceed)

Backend

/cpu/self

Serial reference implementation

/cpu/occa

Serial OCCA kernels

/gpu/occa

CUDA OCCA kernels

/omp/occa

OpenMP OCCA kernels

/ocl/occa

OpenCL OCCA kernels

/gpu/magma

CUDA MAGMA kernels

Examples available in this release:

User code

Example

ceed

• ex1 (volume)

mfem

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

petsc

• BP1 (scalar mass operator)

nek5000

• BP1 (scalar mass operator)

## v0.2 (Mar 30, 2018)¶

libCEED was made publicly available the first full CEED software distribution, release CEED 1.0. The distribution was made available using the Spack package manager to provide a common, easy-to-use build environment, where the user can build the CEED distribution with all dependencies. This release included a new Fortran interface for the library. This release also contained major improvements in the OCCA backend (including a new /ocl/occa backend) and new examples. The standalone libCEED example was modified to compute the volume volume of a given mesh (in 1D, 2D, or 3D) and placed in an examples/ceed subfolder. A new mfem example to perform BP3 (with the application of the Laplace operator) was also added to this release.

Backends available in this release:

CEED resource (-ceed)

Backend

/cpu/self

Serial reference implementation

/cpu/occa

Serial OCCA kernels

/gpu/occa

CUDA OCCA kernels

/omp/occa

OpenMP OCCA kernels

/ocl/occa

OpenCL OCCA kernels

Examples available in this release:

User code

Example

ceed

• ex1 (volume)

mfem

• BP1 (scalar mass operator)

• BP3 (scalar Laplace operator)

petsc

• BP1 (scalar mass operator)

nek5000

• BP1 (scalar mass operator)

## v0.1 (Jan 3, 2018)¶

Initial low-level API of the CEED project. The low-level API provides a set of Finite Elements kernels and components for writing new low-level kernels. Examples include: vector and sparse linear algebra, element matrix assembly over a batch of elements, partial assembly and action for efficient high-order operators like mass, diffusion, advection, etc. The main goal of the low-level API is to establish the basis for the high-level API. Also, identifying such low-level kernels and providing a reference implementation for them serves as the basis for specialized backend implementations. This release contained several backends: /cpu/self, and backends which rely upon the OCCA package, such as /cpu/occa, /gpu/occa, and /omp/occa. It also included several examples, in the examples folder: A standalone code that shows the usage of libCEED (with no external dependencies) to apply the Laplace operator, ex1; an mfem example to perform BP1 (with the application of the mass operator); and a petsc example to perform BP1 (with the application of the mass operator).

Backends available in this release:

CEED resource (-ceed)

Backend

/cpu/self

Serial reference implementation

/cpu/occa

Serial OCCA kernels

/gpu/occa

CUDA OCCA kernels

/omp/occa

OpenMP OCCA kernels

Examples available in this release:

User code

Example

ceed

ex1 (scalar Laplace operator)

mfem

BP1 (scalar mass operator)

petsc

BP1 (scalar mass operator)


text:
# Capacitor problem

1. The problem statement, all variables and given/known data
A $5.0$$\mu$$F$ capacitor is charged to $12 V$ . The positive plate of this capacitor is now connected to the negative terminal of a $12 V$ battery and vice versa. Calculate the heat developed in the connecting wires.

2. Relevant equations
$W = QV$

$E = 0.5CV^2$

3. The attempt at a solution

I know from the above 2 equations that half of the energy supplied by the battery should be lost as heat . But I don’t know how to proceed with this problem ?

http://ift.tt/1qSIWbO


text:
Prof. Dr.-Ing. Bert Arnrich

# Federated Learning

### Bjarne Pfitzner

We are currently looking for a master student interested in writing his thesis in cooperation with Philips in Hamburg. If you want to learn more about this opportunity, please feel free to call or send an email.

## Introduction

Machine learning algorithms, and especially deep models, benefit significantly from large datasets. While it is not a problem in some application domains to combine datasets from different locations and use a central data store for model training, some other domains such as medicine prohibit this procedure. This is due to people's rights to their personal data defined in the General Data Protection Regulation (GDPR) [1] for EU citizens. The federated learning paradigm of leaving sensitive data where it was collected and only sharing models between multiple parties thus enables research across institutional borders without violating the patients' rights.

### Security Concepts of Federated Learning

Although federated learning improves data privacy for its participants, there is still the possibility to infer sensitive data from the transmitted model updates, which is called reconstruction attack [3][4]. To prevent those types of attacks, a number of defence concepts are routinely employed in federated learning systems.

##### Differential Privacy

This method was developed in the data science and database domain and describes the introduction of noise into a system which prevents conclusions about particular single samples in a database by repeatedly querying it [5]. It has been transferred to the federated learning domain to cloud the impact of client-specific data in finding the updated model weights. Specificially, participants add mostly Gaussian noise which has been scaled for their local data to their model updates. Repeated selection of the same client for training increases the so-called privacy spending which has to remain below a certain threshold in order to guarantee data privacy.

Another layer of security can be added by further encrypting the model updates. There exist some encryption schemes, such as the Paillier Encryption [6], that enable mathematically correct computation with encrypted values. These are called homomorphic encryption (HE) schemes, and additive HE is a subset thereof, only guaranteeing valid addition of cyphertext and in consequence also multiplication between unencrypted values and encrypted ones, such that the server can still aggregate model weights and clients can decrypt and use the actual model.

##### Secure Multi-Party Computation

The third security concept relies on clients working together to pre-aggregate their model updates, so that the server or other clients cannot distinguish between the impact their datasets have on the updates. Of course, it has to be ensured, that also the collaborating parties cannot invade each others privacy. As a solution, secure multi-party computation schemes are a combination of encryption, random value addition and back–and-forth transmissions that build a final defence against reconstruction attacks.

## Current Research

### Generating Synthetic Medical Data

A major use of federated learning is the (virtual) aggregation of distributed datasets in order to have enough data to train deep networks. This could possibly be circumvented by generating synthetic data, which is then not private, personal data in the sense that it does not fit any particular individual, and using this dataset as basis for model training. Generative models such as Variational Autoencoders (VAEs) [7] or Generative Adversarial Nets (GANs) [8] have shown promise in creating high quality image data from noise. Utilising the federated learning framework, it is possible to train these models without violating medical data privacy.

My focus so far is on GAN models, which consist of two networks working against each other. The generator takes a noise vector as input and generates an output in the data space. The discriminator receives this generated sample and actual data and produces a probability of the presented sample coming from the real dataset. During training both components participate in a min-max game, where the discriminator gets better at identifying real samples, and the generator improves its capability of generating data that is mistaken as being real. Formally this is formulated as $$\min_G\max_D V(G, D) = \mathbb{E}_{\mathbf{x}\sim p_{data}(\mathbf{x})}[\log D(\mathbf{x})] + \mathbb{E}_{\mathbf{z}\sim \mathcal{N}(0,1)}[\log (1-D(G(\mathbf{z}))]$$

In practice, I am using the optimised formulation GANs, called Wasserstein GAN with Gradient Penalty (WGAN-GP) [9], which has better properties during training. Regular GANs can fall into cases of vanishing gradients, which halts training progress due to gradients close to zero. Another problem of GAN training is mode collapse, meaning the generator is not able to generate samples with high variance, such that the output looks almost the same for any noise input. The WGAN-GP circumvents these issues by changing the components' loss functions and restructuring the discriminator to a so-called critic, where the only difference is the output layer having no activation function (instead of sigmoid). Now a positive output means that the critic has identified a real sample, and a negative output corresponds to a fake sample.

For federated training of the model, there are two approaches. Either both components are locally trained and centrally aggregated like shown by [10]. Alternatively, one can use the fact that the generator training does not require real data, but is only reliant on the critic. Consequently, only the discriminator has to be trained in a federated manner and the generator training can be done solely by the server [11]. Both approaches have not been evaluated against each other so far, which is something I am currently working on.

The first use case is the generation of high resolution chest xray images. After successful federated training of a WGAN model, it can be further parameterised with a data label to make it possible to generate images showing healthy patients and those of sick patients with different diseases. I opted for image generation, since this is the main application domain of GAN models and works well as a proof of concept, however looking at usability, it is better to generate tabular medical data, so-called Electronic Health Records (EHRs). There already exist large public databases of medical image data, because they are comparably easy to anonymise. EHRs, on the other hand, are highly sensitive and patient-specific. An additional challenge is the interdependence of EHR columns: in order to be plausible, records need to include values that match together. A person cannot be 20 years old and also have been a smoker for 30 years (as a very simplified example of this). Thus, a specific model structure has to be used, that takes these constraints into consideration, like the previously proposed TableGAN [12].

The evaluation of the approach has multiple facets. First and foremost, there needs to be a guarantee that no exact matches between real patient data and generated data exist. This can be done by employing the aforementioned differential privacy method, which includes a trade-off between security and usability of generated samples that will be investigated. On the other hand, the generator has to have sufficient variance in generated samples in order to generated a large enough dataset that can be used for machine learning (not including duplicate samples).

## References

1. General Data Protection Regulation (GDPR) – Official Legal Text", General Data Protection Regulation (GDPR), 2020. [Online]. Available: https://gdpr-info.eu/. [Accessed: 28- Sep- 2020]
2. H. Brendan McMahan, Eider Moore, Daniel Ramage, and Blaise Agüeray Arcas. 2016. Federated Learning of Deep Networks using Model Averaging. CoRR abs/1602.05629 (2016). arXiv:1602.05629 http://arxiv.org/abs/1602.05629

3. Zhibo Wang, Mengkai Song, Zhifei Zhang, Yang Song, Qian Wang, and Hairong Qi. 2018. Beyond Inferring Class Representatives: User-Level Privacy Leakage From Federated Learning. CoRR abs/1812.00535 (2018). arXiv:1812.00535 http://arxiv.org/abs/1812.00535

4. Briland Hitaj, Giuseppe Ateniese, and Fernando Pérez-Cruz. 2017. Deep Models Under the GAN: Information Leakage from Collaborative Deep Learning. CoRR abs/1702.07464 (2017). arXiv:1702.07464 http://arxiv.org/abs/1702.07464

5. Martin Abadi, Andy Chu, Ian Goodfellow, H. Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. 2016. Deep Learning with Differential Privacy. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security (Vienna, Austria) (CCS ’16). ACM, New York, NY, USA, 308–318. https://doi.org/10.1145/2976749.2978318

6. Pascal Paillier. 1999. Public-key Cryptosystems Based on Composite Degree Residuosity Classes. In Proceedings of the 17th International Conference on Theory and Application of Cryptographic Techniques (Prague, Czech Republic) (EUROCRYPT’99). Springer-Verlag, Berlin, Heidelberg, 223–238. http://dl.acm.org/citation.cfm?id=1756123.1756146

7. Pu, Y., Gan, Z., Henao, R., Yuan, X., Li, C., Stevens, A., & Carin, L. 2016. Variational autoencoder for deep learning of images, labels and captions. In Advances in neural information processing systems. 2352-2360. https://papers.nips.cc/paper/6528-variational-autoencoder-for-deep-learning-of-images-labels-and-captions.pdf
8. Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. 2014. Generative Adversarial Nets. In Advances in Neural Information Processing Systems 27, Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (Eds.). Curran Associates, Inc., 2672–2680. http://papers.nips.cc/paper/5423-generative-adversarial-nets.pdf

9. Gulrajani, Ishaan, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C. Courville. 2017. Improved training of wasserstein gans. In Advances in neural information processing systems. 5767-5777. arXiv:1704.00028 https://arxiv.org/abs/1704.00028

10. Fan, Chenyou, and Ping Liu. 2020. Federated Generative Adversarial Learning. CoRR abs/2005.03793 (2020). arXiv:2005.03793 https://arxiv.org/abs/2005.03793

11. Augenstein, Sean, H. Brendan McMahan, Daniel Ramage, Swaroop Ramaswamy, Peter Kairouz, Mingqing Chen, and Rajiv Mathews. 2019. Generative models for effective ml on private, decentralized datasets. CoRR abs/1911.06679 (2019). arXiv:1911.06679 https://arxiv.org/abs/1911.06679

12. Park, Noseong, Mahmoud Mohammadi, Kshitij Gorde, Sushil Jajodia, Hongkyu Park, and Youngmin Kim. 2018. Data synthesis based on generative adversarial networks. CoRR abs/1806.03384 (2018). arXiv:1806.03384 https://arxiv.org/abs/1806.03384


text:
# Thread: Partial Fractions with e^x on Top

1. ## Partial Fractions with e^x on Top

To put it bluntly, how do I go about solving:

$\frac{e^{-10s}}{(s + 3)(s+2)}$

I'm doing a Laplace Transform of the below, and can't work out how to solve the partial fraction I get (i.e. the above partial fraction). I know how to solve partial fractions normally, it's just the $e^{-10s}$ that's giving me trouble.

$x'' + 5x' + 6x(t) = \delta(t-10)$

2. Hello,

$\frac{e^{10s}}{(s+3)(s+2)}=e^{10s} \cdot \left(\frac{1}{(s+3)(s+2)}\right)$

Now you can do the partial fractions decomposition ^^

3. Interesting. Probably the stupidest I've felt for months now :P

Wait, in which case, I can't factor out $e^{s}$ here:

$\frac{e^{-s} + 2s + 7} {(s+1)^2}$

Is there a general method when you have a non-polynomial function on top?

4. Originally Posted by bumcheekcity
Interesting. Probably the stupidest I've felt for months now :P
haha ! it happens to everybody to forget easy stuff !


text:
# Overview: Sorting Version Codes

Overview

## Problem statement

Different versions of software are traditionally described using version codes. These codes contain usually numerical values and subsequent versions increment these codes, allowing them to be sorted. The standard is to use “semantic versioning”, where codes are in the form of “major.minor.patch”; the bigger the update, the more important number is incremented.

However, not all software obey semantic versioning standard.

Suppose we have a vector of version codes:

codes <- c("1.2", "1.10", "1.1")

We’d expect them to be ordered as 1.1, 1.2, 1.10. If you try to order version codes using base sort() functionality…

sort(codes)
## [1] "1.1"  "1.10" "1.2"

…oh. Where did something go wrong?

This is what’s called “alphabetical sorting”. It checks characters one by one, including digits. “1” is before “2”, so “10” goes before “2”, no matter the value. Thus, it cannot compare numbers, if they have a different number of digits.

Numerous software uses the following trick to have it sort correctly: it pads the numbers with leading 0’s until a certain length. For example, your old camera could name photos like 00034.jpg, 00164.jpg, etc. But this is not the approach to use here. We need a different one.

Sorting version codes requires using something called “natural sort”, where numbers are detected and ordered according to their value (with letters still sorted alphabetically, thus placing e.g. “a99” before “b51”). This is a more intuitive sorting for humans than pure alphabetical sort.

## Solutions

Several packages allow natural sorting of character vectors. There’s even a base R solution! However, not all natural sorting algorithms are adapted to handle version codes, which (usually) have a particular structure with dots and/or dashes. Let’s have a look at the options.

### Using base R

There’s a facility in base R allowing the user to handle (numeric) version codes. While there is no simple “sort these strings like they were version codes” function, you can wrap your vector in numeric_version() and use associated methods, like comparison operators (<, ==, >=…), as well as sort() method for this class. This is what it looks like:

sort(numeric_version(codes))
## [1] '1.1'  '1.2'  '1.10'

There are two main problems with this approach, however. But first, let’s quote the documentation:

Numeric versions are sequences of one or more non-negative integers, usually (…) represented as character strings with the elements of the sequence concatenated and separated by single . or - characters.

This means that version codes cannot have any string components or non-standard separators. As described in the semantic versioning standard, letters are allowed in pre-release identifiers and build metadata, so the base solution cannot even handle all valid cases of semantic versioning, much less the variety of version codes that don’t fit these rules.

### Using gtools

gtools is a collection of functions to help with simple tasks when writing R packages. It has a mixedsort() function that detects embedded numbers in strings. However…

gtools::mixedsort(codes)
## [1] "1.10" "1.1"  "1.2"

…it is not suited to sorting version codes. The use case here is different, it’s detecting numbers like these in “Aspirin 50mg” and “Aspirin 100mg” (examples taken from the documentation). Dots in version codes are treated as decimal separators, that’s why "1.10" and "1.1" are considered equal.

### Using naturalsort

naturalsort isn’t written specifically for sorting version codes either, but…

naturalsort::naturalsort(codes)
## [1] "1.1"  "1.2"  "1.10"

…it gets the job done. The difference lies in not treating dots as decimal separators (in fact, naturalsort doesn’t recognize decimals at all). Instead, the code detects numbers and non-numbers, then splits the strings into continuous pieces of numbers and non-numbers. If we were to For example, "1.10-a" would be split like that:

split_like_naturalsort("1.10-a")
## [1] "1"  "."  "10" "-a"

These pieces are then used to sort version codes either alphabetically or by value, depending on whether it’s a number or not. Accidentally, this works well for almost all version codes. The only case where it’s working a little weird is when there’s an inconsistency in separators:

weird_codes <- c("1.3-6", "1.3-2", "1.3.4")
naturalsort::naturalsort(weird_codes)
## [1] "1.3-2" "1.3-6" "1.3.4"

I like that naturalsort has decreasing and na.last parameters, implemented just like in base sort(). There’s also a naturalfactor() function that could be useful for long vectors of repeated version codes.

naturalsort isn’t developed since 2016, but this shouldn’t be considered a problem, since the package is in an already stable state. There’s one pet peeve of mine about this package and it’s the implicit coercion of parameters. Let’s say we accidentally made this call:

naturalsort::naturalsort(codes,
decreasing = c("true", "dat"))
## [1] "1.10" "1.2"  "1.1"

Turns out c("true", "dat") was coerced to logical, then the first element was taken. It should raise an error saying that the arguments are wrong, but – instead – it tries to work at all costs, over-interpreting the parameters. A similar thing would happen with a vector of logical values.

### Using stringr/stringi

You’ve probably already installed stringr and/or stringi if you’ve been using R for a while. Both these packages can do way, way more to strings than just some natural sorting, but we’ll focus on just that. There’s a parameter called numeric in stri_sort(), where we can pass TRUE to sort digits numerically:

# There's analogous stringr::str_sort() function
stringi::stri_sort(codes, numeric = TRUE)
## [1] "1.1"  "1.2"  "1.10"

The overall implementation seems to base on the same idea of separating numbers and non-numbers, and it has the same behavior on inconsistent separators:

stringi::stri_sort(weird_codes, numeric = TRUE)
## [1] "1.3-2" "1.3-6" "1.3.4"

There are decreasing and na_last parameters just like in naturalsort() and base sort(); and again, there’s silent argument coercion I despise. At least I can give half a point for raising a warning when only the first element is used.

### Using versionsort

versionsort is our solution to this problem. I’ve implemented, documented, tested, and submitted it to CRAN within 24 hours when working on implementing a feature in deepdep; obviously, it has changed a bit since then.

There’s a ver_sort() function that’s of the main interest here:

versionsort::ver_sort(codes)
## [1] "1.1"  "1.2"  "1.10"

It works a little differently than other sorts I’ve mentioned before, as it splits the string on separators first (which are sequences of anything that is not a number or a letter), only then separating numbers and non-numbers (i.e. letters). All separators are equal, which gives a little more predictable behavior with inconsistent separators:

versionsort::ver_sort(weird_codes)
## [1] "1.3-2" "1.3.4" "1.3-6"

versionsort is still a Work-In-Progress, which means that it lacks decreasing and na_last parameters, but this whole analysis serves partially to define requirements for future development (more in soon-to-be-published versionsort Dev Plan).

There’s one convenient utility versionsort has, though – the pair of functions named ver_latest() and ver_oldest(). They return max() and min() for version codes, respectively, without the need for sorting the whole vector:

versionsort::ver_latest(codes)
## [1] "1.10"
versionsort::ver_oldest(codes)
## [1] "1.1"

Stay tuned for the new, improved versionsort!

## Semantic version codes

All these solutions have one thing in common – they don’t detect semantic version codes. There are, however, R packages with this functionality; I’ve found two, described below.

### Using semver

semver is the most used R package for handling semantic version codes. It relies heavily on C++ semver implementation under the hood, but it results in a wide range of functionalities: there are many methods for parsed semantic codes, sort() included:

semver_codes <- semver::parse_version(
c("1.6.0-dev", "1.5.10", "1.5.1", "1.6.0")
)
sort(semver_codes)
## [1] Maj: 1 Min: 5 Pat: 1
##
## [2] Maj: 1 Min: 5 Pat: 10
##
## [3] Maj: 1 Min: 6 Pat: 0 Pre: dev
##
## [4] Maj: 1 Min: 6 Pat: 0

Operators as well:

semver_codes[1:3] < semver_codes[2:4]
## [1] FALSE FALSE  TRUE

We can use max() and min() too:

max(semver_codes)
## Maj: 1 Min: 6 Pat: 0

This package has the most functionality of them all…

semver::parse_version("1.0-10")
## Error in parse_ptr(version): invalid character encountered: -

…but is nonetheless limited to semantic version codes.

### Using semverutils

Sorting numeric codes is not possible in semverutils. You can only check if a version code is higher than others by calling:

v_code <- semverutils::semVer$new(c("1.6.0-dev")) v_code$higherThanAll(c("1.5.10", "1.6.0", "1.5.1"))
## [1] TRUE

Unfortunately, the answer isn’t even correct, since "1.6.0-dev" precedes "1.6.0" due to being a pre-release version.

## Conclusion

There are a few ways to sort version codes. If your version codes are simple and well-behaved, base::numeric_version() should be enough. If you need to handle semantic version codes, use semver. Otherwise, there is no best solution, but versionsort is the closest you can get, especially after the next big update is published.


text:
# Numerical optimization with nonlinear equality constraints

A problem that often comes up is minimizing a function $f(x_1,\ldots,x_n)$ under a constraint $g(x_1\ldots,x_n)=0$. In general this problem is very hard. When $f$ is convex and $g$ is affine, there are well known algorithms to solve this. In many cases however, $g$ is not affine. For general $g$ this problem is hopelessly hard to solve, but what if the constraint is easy to solve on its own? In particular, suppose that if we are given $x_1,\ldots,x_{n-1}$, then Newtons method on the constraint $g(x_1,\ldots,x_n)=0$ can easily find $x_n$. Are there effective algorithms to solve the constrained optimization problem in that case?

To solve these kinds of problems I have tried to use Lagrange multipliers, and directly apply Newtons method to solve those (nonlinear) equations, but this does not converge. Something that does work is to add a penalty term for violating the constraint to the objective function, similar to how the barrier method handles inequalities. Unfortunately (but as expected) this is not very fast at getting an accurate answer.

-
The fact that it is easy to solve for $x_n$ given all other variables reminds me of coordinate descent method. You can write the full cost function (including the constraint) and then apply coordinate descent. Doesn't it work? –  emrea Sep 22 '12 at 22:09
If you have a single equality constraint you might try to rewrite your constraint $g(x_1,...,x_n)$ as:
$x_i = h(x_1,...x_{i-1},x_{i+1},...x_n)$
and then substitute for the $i$th variable in your objective function and solve the problem as an unconstraint optimiation problem.