Categories
Mastering Development

Error in xy.coords(x, y, xlabel, ylabel, log) while knitting the file

I have everything working when I run the chunks but an error occurs when I decide to knit my .rmd file ########### needed for testing purpose ################# library(tree) set.seed(77191) library(ISLR) library(randomForest) attach(Carseats) n=nrow(Carseats) indices=sample(1:n,n/2,replace=F) cstrain=Carseats[indices,] cstest=Carseats[-indices,] tree.cs <- tree(Sales ~. , data = cstrain) summary(tree.cs) plot(tree.cs) text(tree.cs) y_hat <-predict(tree.cs, newdata = cstest) test.mse =mean((y_hat – […]

Categories
Artificial Intelligence (AI) Mastering Development

Understanding Basic notions of Neural Networks Terms

i have read a lot of information about several notions, like batch_size, epochs,iterations, but because of explanation was without numerical examples and i am not native speaker, i have some kind of problem of understanding still about those terms, so i decided to work with data and step by step show what i have done […]

Categories
Ask Mathematics

Solve optimal control problem whose associated system is nonlinear

Solve the optimal control problem of the LQR kind $$ \min_u \int_0^{+\infty} x_1^2+x_2^2+\gamma(u_1^2+u_2^2) \, dt \quad\text{such that}\quad \begin{cases}\dot x_1=\alpha(x_2-x_1)+u_1,& x_1(0)=1,\\\dot x_2=\beta(x_1-x_2)+u_2,& x_2(0)=-1\end{cases} $$ where $\alpha>\beta>0$ and $\gamma>0$. I notice that all $x_i$ and $u_i$ in the integrand are squared and that there are no subtractions, hence the integrand has a minimum value in $0$ reached […]

Categories
Ask Mathematics

What happens if you strip everything but the “between” relation in metric spaces

Given a metric space $(X,d)$ and three points $x,y,z$ in $X$, say that $y$ is between $x$ and $z$ if $d(x,z) = d(x,y) + d(y,z)$, and write $[x,z]$ for the set of points between $x$ and $z$. Obviously, we have $x,z\in[x,z]$; $[x,z]=[z,x]$; $y \in [x,z]$ implies $[x,y] \subseteq [x,z]$; $w,y \in [x,z]$ implies: $w\in [x,y]$ […]

Categories
Ask Mathematics

A slightly weird topology/physics question

Note: Being no expert in any area of topology, I might make some major errors in describing what I’m envisioning here. Imagine three-dimensional Cartesian space with any point $P$ in it represented as $(x,y,z)$. Now let there be a differentiable function $f(x,y)$ such that $f(x,y) = z$. By the definition of a function, only one […]

Categories
Mastering Development

Identify missing elements from another dataset per group

I have two datasets both containing a common field but would like to retrieve all of the missing elements of one dataset compared to the other one. My df1 looks like this: Account.ID Product.ID 1 A 1 B 1 C 1 D 2 A 2 E 2 F 3 B 3 D And my other […]

Categories
Game Creation Mastering Development

Drawing outlines around 2D objects OpenGL

I am trying to draw an outline around any arbitrary object using OpenGL and shaders with a different color than the original object, while also retaining compatibility with alpha values <1. I am currently trying to get this working with just a rectangle. I tried using points to determine x, y, width, and height, but […]

Categories
Ask Mathematics

How do I find the portion of a cell/voxel lying within a defined surface?

We have a 3-dimensional grid of voxels (or cells), with individual voxels being of volume $dx\,dy\,dz$ where $dx=dy=dz=1$. A cone-like surface is defined by some function, $z = f(x, y)$, which in this case is specifically: $$z=\left(\frac{x^2+y^2}{w_0^2r_0^{-2\epsilon}}\right)^{\frac{1}{2\epsilon}}$$ Over the entire grid, how does one compute the fraction of each voxel’s volume lying within the volume […]

Categories
Ask Mathematics

Is a upright tuple a valid notation?

Usually a tuple is written like $(x, y, z)$, e.g. like $$\DeclareMathOperator{\argmax}{argmax} a*, b*, c* = \argmax_{a,b,c}( \dotso\text{long line}\dotso ). $$ For my publication I don’t have space for a long tuple like that in the line. So I would like to write: $$ \begin{pmatrix} a* \\ b* \\ c* \end{pmatrix} = \argmax_{a,b,c}( \dotso\text{long line}\dotso […]

Categories
Ask Mathematics

What is the subterms of $M\equiv (\lambda x\cdot yx)(\lambda z \cdot x(yx))$?

Using this Definition (Subterms): The subterms of a term M are defined by induction on $|M|$ as follows: an atom is a subterm of itself; if $M\equiv \lambda x \cdot P$, its subterms are $M$ and all subterms of $P$; if $M \equiv P_1 P_2$, its subterms are all the subterms of $P_1$, all those […]