It is with great pleasure that I can announce that Ryacas version 1.0.0 is now released to CRAN (https://cran.r-project.org/package=Ryacas). I wish to thank all co-authors: Rob Goedman, Gabor Grothendieck, Søren Højsgaard, Grzegorz Mazur, Ayal Pinkus.
It means that you can install the package by (possible after binaries have been built):
install.packages("Ryacas") Followed by:
library(Ryacas) (The source code is available at https://github.com/mikldk/ryacas/.)
Now you have the yacas computer algebra system fully available!

Box plots are often used. They are not always the best visualisation (e.g. is bi-modality not visible), but I will not discuss that in this post.
Here, I will use it as an example of Importance sampling that is a technique to estimate tail probabilities without requiring many, many simulations.
Assume that we have a standard normal distribution. What is the probability of getting a box plot extreme outlier (here we use that it must be greater than 2.

In a recent blog post I tried to get yacas to solve a system of polynomial equations. Unfortunately it could not do that, so I solved it numerically instead. Now it is possible – together with many other systems of polynomial equations thanks to fixing a small error in yacas. It has now been fixed, also in Ryacas (development version), so hurry up and update Ryacas to the latest version 0.

Finding prediction intervals (for future observations) is something different than finding confidence intervals (for unknown population parameters).
Here, I demonstrate one approach to doing so.
First we load the library and simulate some data:
library(mgcv) set.seed(1) dat <- gamSim(eg = 1, n = 400, dist = "normal", scale = 2) ## Gu & Wahba 4 term additive model The simulated in dat contains the “truth” in the f variables:

Let \(\rho_{XY}\) be the correlation between the stochastic variables \(X\) and \(Y\) and similarly for \(\rho_{XZ}\) and \(\rho_{YZ}\). If we know two of these, can we say anything about the third?
In a recent blog post I dealt with the problem mathematically and I used the concept of a partial correlation coefficient. Here I will take a simulation approach.
First z is simulated. Then x and y is simulated based on z in a regression context with a slope between \(-1\) and \(1\).

It is important to test software. One approach is unit-testing, and for R packages this can e.g. be done using testthat.
It is also important to document software. For R packages roxygen2 is really helpful: It enables you to write documentation in the code file in the R/ folder where the function is implemented. And then roxygen2 takes care of handling the Rd files in the man/ folder.
I have made a new R package that combines these approaches: roxytest.

Update Aug 10, 2019: I wrote a new blog post about the same as below but using a simulation approach.
Update Aug 27, 2019: Minor change in how equations are solved (from version 0.9.0.9122).
Let \(\rho_{XY}\) be the correlation between the stochastic variables \(X\) and \(Y\) and similarly for \(\rho_{XZ}\) and \(\rho_{YZ}\). If we know two of these, can we say anything about the third?
Yes, sometimes, but not always.

Update Aug 27, 2019: I wrote a new blog post showing that Ryacas can now solve the system of equations directly without using optim().
As you may know, I am maintaining the Ryacas package (with online documentation) for doing symbolic mathematics (and other stuff) in R using the yacas software (with online documentation).
Søren Højsgaard and I have been preparing a new major release of Ryacas (see blog post on it).

I am learning how to play piano. In that process, I needed charts with piano chords. I know it is good practise to construct the chords manually, figure out the inversions and so on, but I found that some aspects of learning were improved with a chord chart. I searched the (entire!) internet, and struggled to find good, customisable charts.
Thus I had to make something myself: pichor, an R package for making and working with piano chords in R.

© 2019 · Powered by the Academic theme for Hugo.