text:
# Melee Touch Attack + Natural Weapons

So, I have a character that will be making many, many melee touch attacks. The melee touch attacks come from the dread class (Unleashed Psionics). This is the ability:

Devastating Touch (Su): A dread is able to channel psionic energy from fear and nightmares into a touch that causes pain. To use this ability, a dread must make a melee touch attack on a living target. If the attack hits, it deals 1d6 points of damage plus 1 point per class level.

Damage is actually 1d6/level due to playing Mythic in this campaign (endbringer's touch ability).

Now, my question is how this correlates with natural attacks? The weapon in question is a fleshwarped scorpion's tail that has been grafted on (thereby becoming a natural sting attack). Specific questions:

1. What damage will be dealt? Just the damage from the devastating touch (plus relevant class abilities like channel terror, endbringer's touch, etc.)?

2. If an ability/feature/feat/etc. states that it gives a "bonus to damage rolls," would those apply?

3. Would this allow me to apply the poison with this attack?

4. Would elemental damage that merely applies to any attack using the weapon itself apply here? Note: this is from the graveknight's "channel destruction"

5. For the purpose of maneuvers or other actions/features that merely require "an attack" or "a successful attack," could this attack count?

• Edited my answer. – Ifusaso Jan 22 '18 at 19:10

First of all, you need to discuss with your GM whether and how this works in the first place: RAW, you can only deliver a touch attack through a natural weapon if you are holding the charge, that is, you decline (or fail) to discharge the touch attack during its own action, and are left with the charge. Moreover, again, RAW, the rules for holding the charge all specify spells, and so would not apply to a supernatural touch attack like devastating touch. So RAW, you cannot do it at all, and even if we ignore that, having to waste a round holding the charge is simply not viable: don’t bother.

Many (myself included) consider this situation a mere accident of how they decided to organize the rules, not an intentional limitation. The rules come from D&D 3.5e, and in that game the Complete Arcane supplement updated them to cover more situations (though still not all of them—unarmed strikes can replace the original touch attacks without first holding the charge, but natural weapons go unmentioned and so RAW would not be eligible until the charge is held). When Pathfinder was based on the core rules of 3.5e, it copied the original rules but not the update in the (non-open content) Complete Arcane supplement. I am not aware of any direct commentary on the matter by Paizo.

So discuss with your GM whether or not you will be allowed to do this at all. In my opinion, non-spell touch attacks should be hold-able, and both unarmed strikes and natural attacks should be able to deliver touch attack effects regardless of whether or not you’ve held the charge first. But I am not your GM and I cannot make that call in your game.

If your GM does nix it, you can get around that with a conductive fleshwarped scorpion’s tail, since the conductive property explicitly allows this kind of thing.

Assuming the GM allows it or you use conductive,

1. What damage will be dealt? Just the damage from the devastating touch (plus relevant class abilities like channel terror, endbringer's touch, etc.)?

Assuming you are Medium, the fleshwarped scorpion’s tail deals damage as a scorpion whip, i.e. $1\mathrm{d}4+Str$ slashing damage. To that base you would add:

• $1\mathrm{d}6 \times level$ damage due to endbringer’s touch.

• If you have used a terror that is channeled through the devastating touch, it would apply.

• If you choose to use the poison effect of the fleshwarped scorpion’s tail, $1\mathrm{d}3$ Constitution damage per round for 6 rounds or until ended with a Fortitude save.

1. If an ability/feature/feat/etc. states that it gives a "bonus to damage rolls," would those apply?

Yes, it would. You could even make the case that it would apply several times, for instance once to the damage roll for the fleshwarped scorpion’s whip itself, once to the damage roll for devastating touch, once for the damage roll of the terror you used, if it has one, and once again for the poison effect’s damage roll. My guess is most GMs would nix that, though, unless it’s a particularly small or particularly expensive bonus. Many bonuses will prevent themselves from working, either by limiting how many rolls they apply to or specifying something about the roll that rules out one or more of the above (for instance, only the base damage of the fleshwarped scorpion’s tail is “weapon damage” here).

1. Would this allow me to apply the poison with this attack?

As already mentioned, yes.

1. Would elemental damage that merely applies to any attack using the weapon itself apply here? Note: this is from the graveknight's "channel destruction"

If you had a flaming fleshwarped scorpion’s whip (I see nothing immediately that suggests you could not, though I am not very familiar with the fleshwarping rules and that may be blocked), that would certainly apply. The graveknight’s channel destruction ability would also apply.

1. For the purpose of maneuvers or other actions/features that merely require "an attack" or "a successful attack," could this attack count?

Yes, this is an attack, and it’s successful as long as you hit and deal damage.

## You may either attack with your Sting or touch attack. Even if you deliver the touch attack through your Sting, you are not performing a Sting attack.

Unfortunately, the Dread Devastating Touch ability does not list an action type in the ability; fortunately we know any Supernatural Ability that does not specify ("when you hit with a melee attack", "as a Standard Action", "as a Swift Action", etc.) defaults to a Standard Action.

In order to 'prepare' and deliver your Devastating Touch, you have to take a couple seconds... perhaps you're congealing the fear and nightmares into something that would cause damage. Unlike Touch Spells, Devastating Touch does not indicate that you can hold the charge to use later.

A touch attack does not indicate that you're puncturing skin or other soft places... so your Sting would not do its normal damage, nor apply its poison. Even attempting a touch attack indicates that you're not seeking to deliver a martial attack, but simply make contact with the target. Even if you beat their armored AC (barring GM homerule), you do not deal (natural) weapon damage. Therefore, unfortunately, you cannot deliver your Devastating Touch with your natural attack; you much choose one or the other.

• Specifically:

What damage will be dealt? Just the damage from the devastating touch (plus relevant class abilities like channel terror, endbringer's touch, etc.)?

• Just Devastating Touch damage (1d6 + 1/level + 1d6/level Endbringer's Touch) or Sting (1d4 + 1.5xSTR if you're Medium and its your only natural attack)

If an ability/feature/feat/etc. states that it gives a "bonus to damage rolls," would those apply?

• If the damage applies to your Devastating Touch, then yes. If it's bonus Sting damage then it only applies to your natural attack.

Would this allow me to apply the poison with this attack?

• No, as discussed, your Devastating Touch would not apply Sting Poison RAW.

Would elemental damage that merely applies to any attack using the weapon itself apply here? Note: this is from the graveknight's "channel destruction"

• The Graveknight ability seems to indicate wielded weapons (not natural weapons). It is likely also supposed to apply to Natural weapons, but consult your GM to make sure how they'll rule it. It would not apply to Devastating Touch (which is not a weapon attack).

For the purpose of maneuvers or other actions/features that merely require "an attack" or "a successful attack," could this attack count?

• Without knowing what you feat/ability you're talking about, yes a touch attack would be a successful attack action.

## But! You can get a Conductive Amulet of Mighty Fists to do what you want!

Conductive weapons allow you to deliver melee or ranged touch (Su)'s though them. It's a valid choice to place on an Amulet of Might Fists (which applies to Naturally Attacks). It specifies that it costs two uses of the ability, but if there's no limit on the ability, you can use it once every round.

The drawback is that, like a Magus, you must hit full AC to deal any of this. You could freely switch between Touch and Sting (plus Devastating damage) attacks between rounds, depending on how hard your opponent is to hit.

• With Conductive:

What damage will be dealt? Just the damage from the devastating touch (plus relevant class abilities like channel terror, endbringer's touch, etc.)?

• You will deal Sting damage plus Devastating Touch (and all its modifiers). Even with more than one Conductive (or natural) weapon, you will only activate Devastating Touch once per round.

If an ability/feature/feat/etc. states that it gives a "bonus to damage rolls," would those apply?

• Generally speaking, all of these benefits will apply once.

Would this allow me to apply the poison with this attack?

• Yes, poison would apply.

Would elemental damage that merely applies to any attack using the weapon itself apply here? Note: this is from the graveknight's "channel destruction"

• Probably. Make sure your GM is OK with natural weapons counting for the Graveknight's feature which describes 'any weapon wielded'.

For the purpose of maneuvers or other actions/features that merely require "an attack" or "a successful attack," could this attack count?

• Yes, this is a type of attack and would work with feats like Vital Strike, etc.

• I think just accepting the strict-RAW here without commentary is, quite simply, wrong. That said, conductive is an excellent point, but I think you ought to go into more detail about what happens when you have it (i.e. the numbered list of questions). – KRyan Jan 22 '18 at 19:42
• I'm confused what you mean by strict RAW without commentary (I frequently point to places a GM might disagree) and RAW is generally how you pay the game. Regardless, I'll add the numbered section using a Conductive weapon shortly. – Ifusaso Jan 22 '18 at 20:05
• “Unlike Touch Spells, Devastating Touch does not indicate that you can hold the charge to use later,” “Therefore, unfortunately, you cannot deliver your Devastating Touch with your natural attack;” are both true, strict-RAW, but only because of the awkward organization of the rules and the choice to put discussions of those things in the section on spells and in the section on holding the charge. I do not believe either is really a considered and intended restriction here. – KRyan Jan 22 '18 at 20:07
• I disagree with your sentiment and that interpretation is already covered in your own answer. If readers want to propose homerules about holding SU charges they can – Ifusaso Jan 22 '18 at 20:12

(Su) abilities, when it is not specified (like it is the case for Devastating Touch), take by default a standard action to activate. In the case of Devastating Touch you can as a part of this action touch your target to deliver the touch.

This attack can't be at the same time a "natural attack": it is simply an act of touching your target, like playing tag, so you can't apply the specificities of your natural weapon for this attack. It is still considered an attack though as your target will probably try to avoid being touched.

1. The damage would be the one of Devastating Touch, boosted by Endbringer's touch. Channel Terror is not useful here but Terrors you apply to your Devastating Touch would trigger too. No bonus from the tail.

2. Bonus to damage rolls would apply (unless they specifically don't, like "bonus to damage rolls with manufactured weapons" or "bonus to damage roll with natural attacks" (as this is not considered a natural attack)).

3. No poison, because you are not doing your natural attack.

4. No. This is not a weapon you wield so this ability don't trigger.

5. This is an attack, so if your opponent has an ability with a line like "when you are hit by a melee attack, ..." it will trigger. You can't use the same attack to perform other things that are supposed to have their own attack (like an Antipaladin touch of corruption). RAW it seems like it would be possible to forgo the attack to replace it by a maneuver but I don't see why you would do that (as you would just loose the benefits of Devastating Touch).


text:
# Thoughts on Semantic Styling vs Visual Styling

After reading this rebuttal to Jeffrey Zeldman’s Kiss my classname what came up on my mind is I think everyone’s doing this wrong. This is the main problem with the industry. Impatience to accept and learn why opinions that differ from yours could be relevant.

I’d agree with Thierry Koblentz for the most part as he doesn’t totally dismiss what others consider the right way. However, I think referencing Lea Verou’s tweet and Sara Soueidan’s as a thing leaders should not do is wrong. From skimming through Atomic CSS, it does look terrible and those tweets are their opinions. It might have some advantages that they aren’t aware of. They probably could have given it a try and not found it to be solving any problems for them. Seriously, look at this

Doesn’t it look like trimming Satan’s pubic hair?

Semantic styling does have its good usecases but it doesn’t mean visual styling should be ditched. While I’d agree that the C in CSS doesn’t mean Component, I find using a component based SoC to be great as most of our web apps structure are components anyway ( filters, buttons, accordions).

With separation of components, the styles stay reusable and maintanable. While components help at a large scale, not everything can fit in a component. CSS wasn’t built to be OOP and that’s what most component structure look like especially if you’re following a pattern like BEM or rscss. These component misfits are called utilities and they should have a place too.

A utility classes file can be managed with a documentation to avoid repetition and they may get visual in most cases. I use the u- namespace with them and here’s an example u-txtcenter, u-fr. Which are my utility classes for text-align center and float right like many other CSS frameworks have them. They can be really helpful yet so dangerous. But there’s room for them in our stylesheets when used properly. I believe documentation as Zeldman said does help reduce the trouble of dealing with terrible stylesheets and it can be especially useful with utility classes. They shouldn’t be so much but if they grow, it’d prevent different developers from adding already used utility classes.

In the end we have both visual and semantic styles.

Share

format: plain


text:
prelims of 3D motion

+ 0 like - 0 dislike
76 views

A projectile is projected down an inclined plane with an initial speed v=20m/s in horizontal direction.Inclined plane makes an angle of 37 degree with horizontal If plane of motion makes an angle of 30 degree with line of greatest slope(straight line along inclined horizontal to its plane),find range and time of flight of projectile. Since the question involves visualising things in 3D, i would first want someone to provide a bit of explanation regarding what's going on(honestly speaking, 3D visualization is what pisses me most).Next, i already have a solution of this problem but not much helpful because again most of it depends upon visuAlising things in 3D.So,if someone can provide a mathematical solution of the same (maybe involving a bit of elementary 3D geometry)which could somewhat reduce this 3D visualisation to the barest minimum.Thanks.

share edit delete flag

asked Jul 12, 2018 in Meta

 Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead. To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL. Please consult the FAQ for as to how to format your post. This is the answer box; if you want to write a comment instead, please use the 'add comment' button. Live preview (may slow down editor)   Preview Your name to display (optional): Email me at this address if my answer is selected or commented on: Privacy: Your email address will only be used for sending these notifications. Anti-spam verification: If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:p$\hbar$ysicsO$\varnothing$erflowThen drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds). To avoid this verification in future, please log in or register.


text:
# How heavy is the Siberut macaque? A Bayesian phylogenetic approach

September 30, 2013
By

(This article was first published on Ecology in silico, and kindly contributed to R-bloggers)

Among-species comparisons can include phylogenetic information to account for non-independence arising from shared evolutionary history. Often, phylogenetic topologies and branch lengths are not known exactly, but are estimated with uncertainty. This uncertainty can be accounted for using methods recently described in a neat paper called Bayesian models for comparative analysis integrating phylogenetic uncertainty by Villemereuil et al. Here, I’ll demonstrate the method by estimating the body mass of the Siberut macaque (Macaca siberu).

(I don’t study macaques, but they’re cute enough to warrant a toy example)

### Building the phylogeny

First, I downloaded a nexus file with DNA sequences from A molecular phylogeny of living primates by Polina Perelman et al., available here on TreeBASE. I culled the nexus file to include only the 14 species in the genus Macaca, and saved it as macaques.nex.

I used MrBayes to estimate the macaque phylogeny with the following file (analysis.nex):

Calling MrBayes from within R:

Here is the unrooted consensus tree:

### Body mass data

Macaque weight data are available as part of a (much) larger dataset on the body mass of late quaternary mammals, by Smith and colleagues. I extracted the log body mass data for the 13 available macaque species. No body mass data were available for the Siberut macaque (M. siberu).

### Body mass model

We will account for phylogenetic non-independence by considering average species weights to be multivariate normally distributed around a within-genus mean, with a covariance matrix $\Sigma$ that reflects phylogenetic distance (see Villemereuil et al.). The off-diagonal elements of this matrix are scaled by Pagel’s $\lambda$, which reflects the degree of phylogenetic signal in the data.

With the help of the ape and MASS packages, covariance and precision matrices can be constructed for the trees comprising the posterior phylogeny.

Then we can fit the model with OpenBUGS, estimating the missing body mass of M. siberu.

Here is our phylogenetically informed estimate of the body size for M. siberu. Pagel’s $\lambda$ indicates a weak but non-zero phylogenetic signal with mean = 0.417 and 95% BCI = (0.0156, 0.949). It should go without saying this is a toy example, and it may be better to go out and weigh some actual Siberut macaques (at a minimum, this would be a good excuse for a vacation).

### References & further reading

• Blomberg et al.): Independent contrasts and PGLS regression estimators are equivalent. Systematic Biology 2012.

• Pagel: Inferring the historical patterns of biological evolution. Nature 1999.

• Perelman et al.: A molecular phylogeny of living primates. PLoS Genetics 2011.

• Smith et al.: Body mass of late quaternary mammals. Ecology 2003.

• de Villemereuil et al.: Bayesian models for comparative analysis integrating phylogenetic uncertainty. BMC Evolutionary Biology 2012


text:
# What is the atomic number of an electron, and why is its symbol $\sideset{_{-1}^{\phantom{-}0}}{}{\text{e}}$ in $\beta^{-}$ decay equations?

I'd assume that the atomic number, i.e. the proton number, of an electron is $$0$$ given that it doesn't have any protons.

However, to balance beta minus decay equations, this source seems to claim that the atomic number an electron is $$-1 :$$

### Beta Particle (electron)

Symbols for a beta negative particle. Note that the first is preferable when balancing equations as it has an atomic number of -1 shown.

I understand that charge is conserved in these equations as well as baryon/lepton numbers, but I don't understand how/why "atomic number" would be conserved.

Questions:

1. What is the atomic number of an electron?

2. Why does this source claim that the atomic number of an electron is $$-1 ?$$

• I looked at the link, it seems a private rule counting up charges instead of protons . Apr 17, 2019 at 4:06
• It's misleading - the electron, proton and neutron are not atoms. And atomic numbers aren't conserved. What is conserved is the lepton number, for instance, the electron is a lepton. Apr 17, 2019 at 4:15
• The atomic number of an electron is a category mistake. See: en.wikipedia.org/wiki/Category_mistake
– ACat
Apr 17, 2019 at 16:30

The electron doesn't have an atomic number. If it did, would you say that a neutral atom, with equal numbers of protons and electrons, has atomic number zero? That's just not what people say.

Physicists (well, nuclear physicists) refer to the "proton number" of a nucleus, rather than to the atomic number, even though the two numbers are identical for all nuclei. The electric charge quantum number for a nucleus with $$Z$$ protons is also always the same as the proton number. For a nucleus, it makes sense to talk about the atomic number, because the nucleus will eventually find enough electrons to become neutral and behave chemically in a certain way.

For the electron, it makes sense to say that its electric charge quantum number is $$-1$$, and that its proton number is zero. But a free electron can make its way into any kind of atom, so it doesn't make sense to give it a label like "atomic number" that suggests particular chemical properties.

The equation for a beta decay might be written in terms of atoms (and ions) as follows

$$\rm ^{14}_{\;6}C \to {}^{14}_{\;7}N^+ + {}^{\;\;0}_{-1}\beta^- + {}^{0}_{0}\bar \nu$$

A reason for doing this is that when evaluating the Q-value of such a decay the masses of atoms (and electrons) rather than nuclei are used.
That being the case it is important to keep tracks of both the constituents of the nuclei and the numbers of orbiting electrons.

$$\rm N^+$$ indicates that it is a single positively charged ion of nitrogen and together with the the negatively charged $$\beta^-$$ the right had side of the equation has a net zero charge commensurate with the neutral carbon atom on the right hand side.
That labeling also helps keep track of the numbers of electrons on the right hand side of the equation so that in terms of mass, the nitrogen ion and the beta can be assumed to have the mass of a nitrogen atom (assuming that the binding energy of the seventh electron in the nitrogen atom is very small compared with the nuclear binding energies).

The $$-1$$ label for the beta can be thought of as being useful in evaluating the number of protons in the resulting nitrogen nucleus.
This is done by saying that a beta minus emission results in an increase of one proton in the nucleus which in terms of an algebraic calculation can be written as $$6=7+(-1)+0$$.
That $$-1$$ label can be thought of as an aid to help "balance" a beta minus decay equation.

Think of the $$-1$$ label as a useful aid which by extension can be used to predict what happens when the label is $$+1$$ as in a $${}^{0}_{1}\beta^+$$ decay?

The atomic number is -1 because as you have said; it is more convenient if we can balance the equation. Since in a Beta decay a neutron decays to a proton and releases an electron and its anti neutrino, total number of charge and lepton number is conserved. But then to balance the numbers of the mass and atomic number, the atomic number of electron is -1 for convenience.


text:
# How does the Apriori Algorithm work?

The Apriori algorithm tries to learn association rules, i.e. logical relationships, from transactions in a database. The goal is to find frequently occurring itemsets, e.g. the products that frequently occur in the database.

### An Example of Association Rule Search

In everyday life, we often encounter product combinations that can be bought cheaper in a bundle. In many fast-food restaurants, for example, the main course is sold together with a side dish and a drink at a discounted price. The principle behind this is always the same: products that are often bought together are offered at a lower price if they are bought directly as a bundle. This has not only caught on in fast-food restaurants. It can now also be found in supermarkets and fashion online stores, as it makes shopping easier for the customer and leads to higher sales for the seller.

To be able to find such bundles, the Apriori algorithm is used, among other things. For this purpose, the order databases of the providers are searched and an attempt is made to establish association rules. Before we can continue with the exact procedure of the algorithm, we have to clarify a few terms that are used in this context.

### Explanation of the Terms

The Apriori algorithm uses some concepts and rules which are not really common in our linguistic usage. Therefore, we explain the most important ones briefly here, before we can devote ourselves to the flow of the algorithm.

#### What is an Itemset?

A set of elements is called an itemset. A set with k elements is also called a k-itemset. The itemset must consist of at least two elements and can represent, for example, the shopping cart during purchase. For example, shopping at the supermarket would have the itemset consisting of bread, butter, milk, and eggs.

#### How are Support and Confidence related?

Before we can look for frequently occurring bundles, we need metrics that measure how often certain itemsets are bought together. For this purpose, we use confidence and support.

Support measures how often a product is purchased relatively:

 $\text{Support (A)} = \frac{\text{Number of Transactions in which A occurs}}{\text{Number of all Transactions}}$

Confidence, on the other hand, measures the support for all transactions containing elements A and B, and divides them by the support for A:

 $\text{Confidence (A + B)} = \frac{\text{Support (A∪B)}}{\text{Support (A)}} = \frac{\text{Number of Transactions in which A and B occur}}{\text{Number of Transactions in which A occurs}}$

For a supermarket, these ratios would be calculated as follows:

Assume the database includes 500 purchases in total. In 300 cases, the purchase included a chocolate bar. So the support for chocolate is:

 $\text{Support (Chocolate)} = \frac{300}{500} = 60 %$

In turn, in 100 purchases in which chocolate was bought, milk was also bought. The confidence in milk and chocolate thus results from:

 $\text{Confidence (Milk + Chocolate)} = \frac{100}{300} = 33,3 %$

This means that chocolate is purchased in 60% of all transactions. Again, in one-third of the “chocolate – transactions” milk is also purchased.

#### What is an Association Rule?

An association rule tries to find certain regularities between two or more elements that reach a given level of support and confidence.

#### What is a Frequent Itemset?

A frequent itemset is a set of items that occur frequently together and reach a predefined level of support and confidence. Frequent itemsets can be found using association rules.

### How does the Apriori Algorithm work?

The Apriori algorithm is one of the methods to find frequent item sets in a dataset. It works in two steps, namely “Join” and “Prune”, which are executed iteratively, i.e. several times in a row.

Join: In this step, itemsets of the set K are formed. K stands for the repetition step.

Prune: In this step, all itemsets that do not reach the predefined support threshold and are therefore considered rare are removed.

The Apriori algorithm makes use of the so-called antimonotonic property. In simple words, it means that if an itemset consisting of several elements does not reach the minimum support, then all supersets (all sets consisting of elements of the itemset) do not reach the minimum support either. In our example, it means that if the milk and cookies itemset does not reach the minimum support, then the milk, cookies, and chocolate itemset cannot exceed the minimum support.

In each new iteration, the itemset is extended by one element, and the “Join” and “Prune” steps are executed again. The algorithm terminates if no new itemset is found in an iteration, but only itemsets from the previous step remain.

### Apriori by Example

For our example, let’s come back to our supermarket. There are a total of six transactions in its database.

For our association rule, we want to achieve a support of 50% and a confidence of 70%. These values are completely arbitrary.

Step 1 (K=1): In the first step we search for itemsets with quantity 1, i.e. we count how often the individual products have been purchased in total. This corresponds to the join step in the first stage.

Step 2 (K=1): The Join step is followed by the Prune step, in which we remove all itemsets that do not reach the minimum support. We have chosen support of 50%. Due to the formality of calculating the support, it means that in six transactions the itemset must occur at least three times for the support to be fulfilled. All other itemsets can be dropped:

Therefore, the product/itemset “Bread” falls out, because it occurs only twice.

Step 3 (K=2): After doing the Join and Prune step, we move to the second stage. Here, the itemset size is now 2. The possible itemsets are the combination of all the remaining products from the previous stage.

Step 4 (K=2): In the Prune step, the item sets that do not reach the minimum support of three are removed again. Thus, the combinations (milk, rice) and (noodles, rice) are dropped:

Step 5 (K=3): In this step, we form the itemsets with the quantity 3, which are the quantities that can be formed from the remaining products:

We don’t have a single purchase for these itemsets, but you can still check if the itemsets would reach support. For this purpose, we make use of the Antimonoton property. Here we notice that the itemset (Milk, Chocolate, Rice) consists of the subsets (Milk, Chocolate), (Chocolate, Rice), and (Milk, Rice). However, the itemset (milk, rice) could not reach the support, so the larger itemset (milk, chocolate, rice) cannot be frequent either, even though there are no numbers for it.

With the same reasoning, the itemsets (milk, noodles, rice) and (noodles, chocolate, rice) are also dropped because the itemset (noodles, rice) does not occur often enough. The last remaining itemset can now be used to derive association rules using confidence.

Step 6: We can check the following association rules:

(Milk, Chocolate) -> Noodles:

 $\text{Confidence (Milk, Chocolate)} = \frac{\text{Support (Milk, Chocolate, Noodles)}}{\text{Support(Milk, Chocolate)}} = \frac{3}{4} = 75 %$

(Milk, Noodles) -> Chocolate:

 $\text{Confidence (Milk, Noodles)} = \frac{\text{Support (Milk, Chocolate, Noodles)}}{\text{Support(Milk, Noodles)}} = \frac{3}{3} = 100 %$

(Chocolate, Noodles) -> Milk:

 $\text{Confidence (Chocolate, Noodles)} = \frac{\text{Support (Milk, Chocolate, Noodles)}}{\text{Support(Chocolate, Noodles)}} = \frac{3}{4} = 75 %$

(Milk) -> (Chocolate, Noodles):

 $\text{Confidence (Milk)} = \frac{\text{Support (Milk, Chocolate, Noodles)}}{\text{Support(Milk)}} = \frac{3}{4} = 75 %$

(Chocolate) -> (Milk, Noodles):

 $\text{Confidence (Chocolate)} = \frac{\text{Support (Milk, Chocolate, Noodles)}}{\text{Support(Chocolate)}} = \frac{3}{5} = 60 %$

Noodles -> (Milk, Chocolate):

 $\text{Confidence (Noodles)} = \frac{\text{Support (Milk, Chocolate, Noodles)}}{\text{Support(Noodles)}} = \frac{3}{4} = 75 %$

After running the Apriori algorithm, a total of five association rules emerge that withstand our confidence level of 70%. These include the rule “(milk, chocolate) -> (noodles)”. This means that if milk and chocolate have already been purchased, then the purchase of noodles is also very likely.

### What are the Advantages and Disadvantages of using the Apriori Algorithm?

The Apriori algorithm is a good way to find association rules in large databases with many transactions. Furthermore, the join and prune steps are relatively easy to develop in programming languages such as Python. In addition, there are also modules that further simplify the import of the Apriori algorithm.

However, the algorithm becomes very computationally intensive for large databases. As has already become clear in our example, many combinations and steps have to be calculated, which take up a lot of time and resources even in our simple example. Before implementation, therefore, it must be ensured that the effort is worthwhile.

### What Applications use this Algorithm?

There are several applications in which association rules are searched and thus the Apriori algorithm is used. Here are some topics in which associations are searched:

• Education: In education, associations are sought, for example, when trying to find out why some students do better in subjects than others.
• Medicine: In the development of new drugs, association rules are studied to determine how a new drug interacts with physical characteristics. To do this, the sample that tested the drug is studied in more detail.
• Biology: Around the world, forest fires are becoming more frequent. Therefore, we are currently investigating which early warning factors, such as extreme drought or high temperatures, are associated with forest fires in order to be able to detect and prevent them as early as possible.
• E-commerce & Recommendation: We learned about the classic example of the Apriori algorithm in this article: shopping cart analysis. Based on the purchasing behavior of previous customers, it attempts to identify associations between products and then uses these for product recommendations.

### How can the Apriori Algorithm be improved?

With a large database, the Apriori algorithm can be very inefficient and take a lot of time. Therefore, there are currently some methods to help make the algorithm more efficient and faster. These include:

1. Hash-based Itemset Counting: This method tries to speed up the creation of itemsets. For this purpose, a so-called hash table is used, which gives each product or transaction a unique number. This means that memory-intensive strings do not have to be included and processed, but rather the more efficient hashes.
2. Transaction Reduction: Before the Apriori algorithm is executed, the database is searched for repeated transactions, which are then excluded. In the same way, rare transactions are filtered out at an early stage, since they do not play a role in the calculation of the algorithm.
3. Partitioning: For this method, the number of database scans is significantly reduced. The basic idea here is that an itemset can only be frequent if it occurs in at least one of two database partitions. This means that the entire database only has to be scanned twice, which can be much more efficient.
4. Sampling: Instead of searching for frequent itemsets in the entire database, this approach takes only one examination unit of the database and examines it. However, there is a risk of losing itemsets that are actually frequent. To avoid this risk, comparatively low support should be used.
5. Dynamic Itemset Counting: With this method, new potential itemsets can already be found while scanning the database.

### This is what you should take with you

• The Apriori algorithm tries to learn association rules, i.e. logical relationships, from transactions in a database. The goal is to find frequently occurring itemsets, e.g. the products that frequently occur in the database.
• The Apriori algorithm works in two steps (“Join” and “Prune”), which are executed iteratively one after the other.
• In each step, an itemset is created, which is larger by one product than in the previous step (“Join”). Then it is examined which of these itemsets fulfills the previously defined support and thus remains.
• Although the Apriori algorithm is relatively easy to understand and implement, it can be very inefficient for large databases and require a lot of computing power. Therefore, there are already some approaches to improve the performance of the algorithm.
• In practice, the Apriori algorithm is used whenever association rules are sought. This includes, for example, medicine, biology, or e-commerce.

### Other Articles on the Topic of Apriori

• An interesting paper on improving the Apriori algorithm can be found here.


text:
# Alignment of equation number with the end of the line

I' trying to reproduce this equation array from an IEEE paper

you can see that the equation numbers are aligned at the end of the line same as the above statement.

my code:

\begin{IEEEeqnarray}{rCl}
%
I(\lambda)\;\;\; &= &\;\;\;\int_{}^{}\int_{D}^{} g(x,y) e^{i \lambda h (x,y)}dx\,dy.\\
\prod_{j\geq0}^{}\bigg(\sum_{k\geq0}^{}a_{jk} z^k\bigg)\;\;\;\; &=&\;\;\;\;\sum_{n\geq0}^{}z^n \Bigg(\sum_{\substack{k_0,k_1,...\geq0\\k_0+k_+...=n}}^{}a_{0k_0}a_{1k_1} \, . \, . \, . \,\Bigg).\IEEEeqnarraynumspace\\
%
\end{IEEEeqnarray}

It produces:

you can see that the equation numbers shifted to the left and aren't aligned with the above statement.

If I add spaces more, the numbers shift and start to interleave with the statement of the second column in the paper.

So, I want to know how to force the equation numbers to be aligned at the end of the line.

Any help is appreciate. Thanks.

• use the align environment from amsmath and everything will be fine. – user2478 Mar 16 '16 at 8:19

The problem is that the second equation is too wide for the column. However, you just need to fix the wrong things inside it:

1. the \; commands around = should be removed
2. use \iint instead of \int\int
3. \Bigg should be \biggl and \biggr
\documentclass{IEEEtran}
\usepackage{amsmath}

\usepackage{lipsum,xcolor} % just for the example

\begin{document}

%% the line below is a trick to show the margin
\hspace*{\fill}\rlap{\color{red}\smash{\vrule depth 8cm width 0.2pt}}

\lipsum*[2]
\begin{IEEEeqnarray}{rCl}
I(\lambda) &=& \iint_{D} g(x,y) e^{i \lambda h (x,y)}dx\,dy.\\
\prod_{j\geq0}\biggl(\,\sum_{k\geq0}^{}a_{jk} z^k\biggr) &=&
\sum_{n\geq0} z^n
\biggl(
\sum_{\substack{k_0,k_1,\dotsc\geq0\\k_0+k_1+\dotsb=n}}a_{0k_0}a_{1k_1} \dotsm
\biggr).
\IEEEeqnarraynumspace
\end{IEEEeqnarray}
\lipsum[3]

\end{document}


text:
# Statistical analysis of binary outcome

I am trying to figure out the best statistical test for a data set I've collected. I presented a group of adults (n=9) with a 21 different auditory cues. For each cue I asked them to choose the corresponding word from list of four words, one which was "correct" and three "incorrect." I then had them take the test again (I would have run more trials, but I didn't have enough time).

Mainly I want to test if their answers show that they recognized the cue and assigned meaning to it, or if they chose it by chance. But I'm getting caught up in the details and it has been a while since I took a stats course.

I want to compare the number of correct choices to the theoretical amount of correct choices (1/4). Should I use a binomial test or Chi-squared? Or do you recommend something totally different? Also should I look at each patient's individual data or the aggregate?

I also wanted to analyze the amount "recognized" for each patient - the amount of times the patient chose the same word for both the test and retest (despite if it was right or wrong). This is where I am really lost - could I simply compare the total "recognized" to the expected 1/4? (I got 1/4 by looking at the probability of selecting the correct twice [1/4*1/4=1/16] and selecting the same wrong twice [3/4*1/4= 3/16])?

I'm sure there is a simple solution, but I may be overthinking this. Any help is much appreciated!

• I would suggest the binomial distribution. Assume, the answers were chosen by chance, then the answer is correct with probability $\frac{1}{4}$. Calculate, how likely the result is under this assumption. – Peter Sep 8 '15 at 21:51

Suppose you want to take both the test and re-test into account.

On the first test a subject who is just guessing performs $r = 21$ trials with success probability $p = 1/4$. Again on the re-test the subject does the same. So the subject's total score is on the two tests is a binomial random variable $X$ with $t = 2n = 42$ trials and success probability $p = 1/4$ on each. Thus the average (or expected) value is $\mu = E(X) = tp = 42/4 = 10.5,$ variance $V(X) = tp(1-p) = 126/16 = 7.875$, and $\sigma = SD(X) = \sqrt{7.875} = 2.8062.$ Of course, we expect that subjects who are not just guessing will tend to get higher scores.

For $n = 9$ subjects you would find the average score $\bar X.$ Then $$Var(\bar X) = \sigma^2/n = 7.875/9 = 0.875$$ and $SD(\bar X) = 0.9354.$

Your null hypothesis is $H_0: \mu = 10.5$ and your alternative hypothesis is that $H_a: \mu > 10.5.$ The average score $\bar X$ is close enough to normal that you can reject the null hypothesis at the 5% level if $Z = (\bar X - 10.5)/0.9354 \ge 1.645$ or $\bar X \ge 12.$

Notes: (a) This is assuming that the 42 trials for each subject are independent, this includes the assumption that the first test and re-test are independent. (b) We also assume that the nine subjects are chosen at random for the population of interest. (c) Because the standard deviation of $\bar X$ under the null hypothesis is know, this is a Z-test. (d) Similar tests could be done for individual subject (use his/her $X$ instead of $\bar X$ with the appropriate $\sigma$). Also, you could do a similar procedure for the first test only (use $n = 21$ instead of $t = 42$). (e) Just $X$ for a given subject is nearly normal, so there is no problem assuming that $\bar X$ is normal.

• Great - that makes sense, just to make sure I've got this now. I could also test the "re-test reliability" of sorts by analyzing how many times a subject chose the same answer on the test and then the retest. Here r=21 trials and p=1/4 (The probability of correct twice (1/16) and the probability or the same wrong twice (3/16)). Find X (for one subject) and calculate the Z-score. Is that right? – user269073 Sep 9 '15 at 17:32
• Another matter entirely: Are words and cues the same between the two test sessions? Is there likely to be a memory or learning component in results on 2nd test? Null distribution assuming everything is a guess is much easier. You can test memory/learning if questions same: chance a person replicates exact result at random is 1/4. You could check if each person's results are consistent with that: BINOM(21, 1/4). – BruceET Sep 9 '15 at 18:32
• Seems to me that in comparing two sessions, it is only matching answers that matter (whether right or wrong). What relevant info is there for $comparison$ in RW or WR pairs? Maybe you have an objective in mind that I don't see. But this is an additional topic, maybe best handled in a new Question. – BruceET Sep 9 '15 at 20:03
• There is likely to be a learning component and that is what I am trying to identify by comparing the two tests. The cues and questions are the same so I have been comparing the chance of replication using BINOM. I'm not sure if that gets to your question, but here's what I've done so far - if it clears anything up.Thus far I've found the p-value for all the successes from the entire data sat (n=42*9=378), the p-value for the first and second test separately (n=21*9=189) and the p-value for the retest (n=189).... – user269073 Sep 10 '15 at 18:09
• I feel that analyzing test 1 and 2 separately makes sense, since they are not truly independent. I also looked at the p-value for the amount correct per subject as well to see variation in user, but I'm not sure if this p-value has any real meaning to it, or if just the value for the entire data set is worth presenting. – user269073 Sep 10 '15 at 18:10


text:
# Limit regarding $$\sin x$$, can you make a right choice?

Calculus Level 4

$\large \lim_{x \to 0} \left(\frac{x}{\sin^3 x} - \frac{1}{x^2}\right)$

What can you say about the limit above?

×


text:
[[wm18:rankings]]

 Here we compare four popular rankings for the teams of #WorldCup 2018. All rankings are collected right before start of the tournament: Goalimpact (GI) Transfermarkt.de (TMW) FIFA World-Ranking (FIFA) Football Elo Rating (ELO) Soccer Power Index (SPI) The first two rankings are based on an individual player-strength averaged over the whole team, the last two are calculated on a team base by comparison of games against each other over the period of one year. The graphic on the right shows all four rankings in a linear scale, such that for each ranking Y = GI, TMW, FIFA, ELO and SPI, the lowest rank is located at 0 and the highest at 1. Naturally all ratings are more or less correlated. The cross correlation are shown in the following table. The highest correlation is given between ELO and SPI, the lowest between Goalimpact and FIFA. Altogether Goalimpact has the lowest correlation with the other ones.

#### Z-score comparison

Another way to compare completely different scales of ratings is given by Z-score-normalization. This is a normalization in terms of expectation value $E(Y)$ and standard deviation $\sigma(Y)$, defined as: $$Z(Y) := \frac{Y-E(Y)}{\sigma(Y)}.$$ So everything is expressed in units of $\sigma$ and centered around zero. The widest spread is given by Goalimpact, which means it mostly distinguishes between the teams. Furthermore, TMW is the most unequal and narrowest distribution. The reason is the non-linearity of TMW. It is a kind of exponential behaviour and indeed, taking the logarithm smoothes the distribution.

Altogether, one would expect that Goalimpact is the most meaningful soccer-ranking, followed by SPI. But due to the more widespread ELO rating, we use for the comparison against other rankings ELO instead of SPI.

 Let us compare correlations between rankings in more detail and start with the highest correlation between FIFA and ELO. This is shown in the graphic on the right side. The horizontal and vertical gray lines represent the corresponding mean values. The high correlation is immediately visible, but with some larger deviations for Saudi-Arabia, Tunisia with overestimated FIFA values and slightly underestimated FIFA values for Russia, Spain and Brazil. Overall the correlation is high and it should be noted that FIFA has revised the old ranking in favor of a new ELO based ranking system. Next let us compare the more interesting rankings and compare Goalimpact (GI) with market value (TMW) and ELO, shown below. There are some remarkable deviations. On the one hand, the two lowest valued teams of Panama and Saudi-Arabia are under- and overestimated by GI. The reason might be related to too few comparison games in case of Saudi-Arabia. On the other hand, at least England, France and Brazil are overrated by TMWs, due to players with crazy TMW-values above 120 Mio €. The correlation of GI and ELO is a bit smaller, with two really large deviations. Again Saudi-Arabia is highly overestimated by GI, for the same reason as before. In contrast, Peru is either much underestimated by GI or overestimated by ELO. If we replace those players by the mean of team, all point shift down, as indicated by the corresponding smaller flags.

We only compare the population and global domestic product with collected from Statistisches Bundesamt. The most suitable ranking to asses the player-strength of a country is of course the Goalimpact ranking, which is by construction an individual player-strength rating system.

#### Population

Let us start the comparison with the population and use the male population aged between 16-35 years, the typical age of players. There is no direct correlation or pattern visible. For example Brazil and Belgium have similar GIs, but a huge difference in population and Spain and Peru have similar population, but a large difference in GI. The only peculiarity is the observation, that nearly half of the countries are located in the vicinity of the upper left rectangle.

#### Global domestic product

The graphics below show the GI versus GDP and GDP per capita for direct comparison. The most interesting observation is, that after normalization of GDP per capita not only a stretch of all points is observed, but also some countries interchange their position, e.g. Belgium and Brazil as well as Denmark and England. And Switzerland jumps from left to right and take the position of Japan, which itself condense to more or less a single point wit South Korea.

#### Comparison to other sports

In many country's soccer is the most popular sport and dominates all other sports. Eventually, let us just for fun compare the world ranking of soccer - measured in ELO - to the number of medals in Olympic games of the last summer and winter games. This is shown in the graphic on the right, which we will not comment. As we said before, it's just for fun!

• Zuletzt geändert: 2018/07/05 17:16


text:
Event Table Function

et(x, ..., envir = parent.frame())

# S3 method for RxODE
et(x, ..., envir = parent.frame())

# S3 method for rxSolve
et(x, ..., envir = parent.frame())

# S3 method for rxParams
et(x, ..., envir = parent.frame())

# S3 method for default
et(
x,
...,
time,
amt,
evid,
cmt,
ii,
ss,
rate,
dur,
until,
id,
amountUnits,
timeUnits,
envir = parent.frame(),
by = NULL,
length.out = NULL
)

## Arguments

x This is the first argument supplied to the event table. This is named to allow et to be used in a pipe-line with arbitrary objects. Times or event tables. They can also be one of the named arguments below. the environment in which expr is to be evaluated. May also be NULL, a list, a data frame, a pairlist or an integer as specified to sys.call. Time is the time of the dose or the sampling times. This can also be unspecified and is determined by the object type (list or numeric/integer). Amount of the dose. If specified, this assumes a dosing record, instead of a sampling record. Event ID; This can be: 0 An observation. This can also be specified as evid=obs 1 A dose observation. This can also be specified as evid=dose 2 A non-dose event. This can also be specified as evid=other. 3 A reset event. A reset event resets all the compartment values to zero and turns off all infusions. This can also be specified as evid=reset. 4 Dose and reset event. This can also be specified as evid=doseReset or evid=resetDose Compartment name or number. If a number, this is an integer starting at 1. Negative compartments turn off a compartment. If the compartment is a name, the compartment name is changed to the correct state/compartment number before running the simulation. For a compartment named "-cmt" the compartment is turned off. Can also specify cmt as dosing.to, dose.to, doseTo, dosingTo, and state. When specifying a dose, this is the inter-dose interval for ss, addl and until options (described below). The number of additional doses at a inter-dose interval after one dose. Steady state flag; It can be one of: 0 This dose is not a steady state dose 1 This dose is a steady state dose with the between/inter dose interval of ii 2 This is a steady state dose that uses the super-position principle to allow more complex steady states, like 10 mg in the morning and 20 mg at night, or dosing at 8 am 12 pm and 8 pm instead of every 12 hours. Since it uses the super positioning principle, it only makes sense when you know the kinetics are linear. All other values of SS are currently invalid. When positive, this is the rate of infusion. Otherwise: 0 No infusion is on this record. -1 Rate of this record is modeled by rate(cmt) = in the RxODE model. You may also specify type or rate by rate=model -2 Duration of this record is modeled by dur(cmt) = in the RxODE model. You may also specify this type of rate by dur=model or rate=dur. When a modeled bioavailability is applied to positive rates (rate > 0), the duration of infusion is changed. This is because the data specify the rate and amount, the only think ghat modeled bioavailability can affect is duration. If instead you want the modeled bioavailability to increase the rate of infusion instead of the duration of infusion, specify the dur instead or model the duration with rate=2. Duration of infusion. When amt and dur are specified the rate is calculated from the two data items. When dur is specified instead of rate, the bioavailability changes will increase rate instead of duration. This is the time until the dosing should end. It can be an easier way to figure out how many additional doses are needed over your sampling period. A integer vector of IDs to add or remove from the event table. If the event table is identical for each ID, then you may expand it to include all the IDs in this vector. All the negative IDs in this vector will be removed. The units for the dosing records (amt) The units for the time records (time) This is a boolean indicating if a sampling time should be added at the same time as a dosing time. By default this is FALSE. When there are no observations in the event table, this is the amount to increment for the observations between from and to. The number of observations to create if there isn't any observations in the event table. By default this is 200.

## Value

A new event table

## References

Wang W, Hallow K, James D (2015). "A Tutorial on RxODE: Simulating Differential Equation Pharmacometric Models in R." CPT: Pharmacometrics \& Systems Pharmacology, 5(1), 3-10. ISSN 2163-8306, <URL: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4728294/>.

eventTable, add.sampling, add.dosing, et, etRep, etRbind, RxODE

## Examples

## Model from RxODE tutorial
mod1 <-RxODE({
KA=2.94E-01;
CL=1.86E+01;
V2=4.02E+01;
Q=1.05E+01;
V3=2.97E+02;
Kin=1;
Kout=1;
EC50=200;
C2 = centr/V2;
C3 = peri/V3;
d/dt(depot) =-KA*depot;
d/dt(centr) = KA*depot - CL*C2 - Q*C2 + Q*C3;
d/dt(peri)  =                    Q*C2 - Q*C3;
d/dt(eff)  = Kin - Kout*(1-C2/(EC50+C2))*eff;
});

## These are making the more complex regimens of the RxODE tutorial

## bid for 5 days
bid <- et(timeUnits="hr") %>%
et(amt=10000,ii=12,until=set_units(5, "days"))

## qd for 5 days
qd <- et(timeUnits="hr") %>%
et(amt=20000,ii=24,until=set_units(5, "days"))

## bid for 5 days followed by qd for 5 days

et <- seq(bid,qd) %>% et(seq(0,11*24,length.out=100));

bidQd <- rxSolve(mod1, et)

plot(bidQd, C2)

## Now Infusion for 5 days followed by oral for 5 days

##  note you can dose to a named compartment instead of using the compartment number
infusion <- et(timeUnits = "hr") %>%
et(amt=10000, rate=5000, ii=24, until=set_units(5, "days"), cmt="centr")

qd <- et(timeUnits = "hr") %>% et(amt=10000, ii=24, until=set_units(5, "days"), cmt="depot")

et <- seq(infusion,qd)

infusionQd <- rxSolve(mod1, et)

plot(infusionQd, C2)
## 2wk-on, 1wk-off

qd <- et(timeUnits = "hr") %>% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot")

et <- seq(qd, set_units(1,"weeks"), qd) %>%

wkOnOff <- rxSolve(mod1, et)

plot(wkOnOff, C2)
## You can also repeat the cycle easily with the rep function

qd <-et(timeUnits = "hr") %>% et(amt=10000, ii=24, until=set_units(2, "weeks"), cmt="depot")

et <- etRep(qd, times=4, wait=set_units(1,"weeks")) %>%