Questions tagged [c++]

C++ is a compiled general-purpose programming language. Use this tag for any *on-topic* question that (a) involves C++ either as a critical part of the question or expected answer, & (b) is not *just* about how to use C++.

Filter by
Sorted by
Tagged with
2 votes
1 answer
44 views

What is a numerically stable way to generate an exponential distribution that properly yields very large, low-probability values in Excel and C++?

I have sets of sampled data with the following statistics: Because the mean is so close to the min, and because of our understanding of the process that generated the samples, we are treating the ...
All The Rage's user avatar
-1 votes
1 answer
28 views

Generating Distributions From Random Number Generators

Background I am working on developing a R package that focuses on implementation of pseudo-Random Number Generators (pRNGs) from scratch. To date I have successfully programmed a Linear Congruential ...
Bensstats's user avatar
  • 173
0 votes
0 answers
132 views

Visualizing multisource Breadth-First Search (BFS) on large dataset

I have a very large dataset (2.4 million vertices and 123 million edges) and I'd like to visualize running multisource Breadth-First Search (BFS) on it. In particular, each starting node is given a ...
Yaseen's user avatar
  • 1
1 vote
1 answer
29 views

How does finding the error work in the back propogation of a CNN when 4D tensors are used?

I am currently creating a CNN from scratch in C++ only using vectors, and Matrix classes I have created. Mainly doing this as an exercise so that I can make sure I fully understand the process. I am ...
Sam Moldenha's user avatar
1 vote
0 answers
469 views

P value calculation for Anderson Darling normality

For p-value calculation I use (in c++) following equations I found on the internet ...
vlad's user avatar
  • 111
3 votes
0 answers
77 views

Why is my QR decomposition updating code numerically off?

I apologize if this is the wrong place for this question; there are a number of potential points of failure each of which suggest either Math StackExchange or StackOverflow or here, but since the ...
cgmil's user avatar
  • 1,343
1 vote
0 answers
2k views

How to use Yolo Darknet in C++ applications? [closed]

I am unfortunately very inexperienced with C++ and have only used darknet in Python so far. For the work I have to set up a C++ project with Visual Studio, in which Yolov3 recognizes objects in the ...
user273484's user avatar
5 votes
1 answer
1k views

How can we numerically compute the autocorrelation of a sample from a Markov chain generated by the Metropolis-Hastings algorithm?

Let $(X_n)_{n\in\mathbb N_0}$ denote a $\mathbb R^d$-valued Markov chain generated by the Metropolis-Hastings algorithm. Suppose I've run the algorithm on a computer and obtained a sample $x_0,\ldots,...
0xbadf00d's user avatar
  • 283
0 votes
0 answers
25 views

Area interaction model sufficient statistics calculation algorithm

I'm currently trying to write a simulation algorithm in Rcpp for a point process model which requires calculating the sufficient statistics for an Area interaction point process model. It entails a ...
NamelessGods's user avatar
1 vote
1 answer
166 views

Clustering large 3D dataset into many clusters

I have a 3D point cloud with several million points and I need to partition it into roughly 50k clusters. As the clusters have to be spherical, usually a drawback of k-means, k-means seems pretty ...
A1m's user avatar
  • 111
1 vote
0 answers
301 views

Why SVM with RBF kernel always classify to one group?

I've downloaded Dog vs Cat from kaggle dataset and utilize OpenCv 3.2 Machine Learning library and c++ language, And I choose 60-40(percent for train/test) from training set(kaggle test set do not ...
frdf's user avatar
  • 11
1 vote
2 answers
424 views

Normal Neural Network for Image 100×100? [duplicate]

So, I have created a neural network using back propagation and sigmoid function. It seems to work for XOR and images with size of 28×28. However, When I input it 100×100 image the mean-square-error is ...
Sad.coder's user avatar
0 votes
0 answers
687 views

How to fit a gaussian curve to data for a goodness-of-fit C++? [duplicate]

I've given a dataset of N samples like: (x,y) (-100,1), (-90, 30), (-50,60), (-10,90), (0,100), (10, 90), (30, 20),(100,4) Now I would like to determine how well the data fits a perfect gaussian (...
user avatar
3 votes
1 answer
1k views

Standard library for Funk SVD or other gradient descent SVD/eigenvalue

I want to get the first few eigenvectors of real symmetric matrices with missing values. Since it has missing values, I won't be able to use the common linear programming techniques, but stochastic ...
highBandWidth's user avatar
3 votes
1 answer
1k views

Influence of Normalization and PCA on Distance Metrics

After standardizing my dataset, I perform a principal component analysis. Then I do a nearest neighbour search. I observed then after performing the PCA, even though I kept (for testing purposes) all ...
Chris's user avatar
  • 515
3 votes
4 answers
11k views

Determine the number of clusters for K-means automatically

Since a couple of days I research for a method to determine the number of clusters for K-means automatically, I found elbow method but I can not till now understand its principle. Is there any ...
lotfishtaine's user avatar
0 votes
0 answers
796 views

Fastest way of determining Threshold of Weak classifier (adaboost)

I am trying to implement a faster way of determining the threshold of my weak classifier. Currently I have a function that takes in a positive vector and a negative vector of values. Along with the ...
pdm's user avatar
  • 1
1 vote
1 answer
410 views

About implementing convolutional neural network

I want to implement a convolutional neural network using the tiny-cnn implmentation for c++. I have downloaded it and tried the MNIST example in there, but I'm having trouble implementing it for my ...
Or Cohen's user avatar
1 vote
0 answers
216 views

Having trouble understanding/implementing backpropagation algorithm

I have a simple feedforward neural network with 2 input neurons (and 1 bias neuron), 4 hidden neurons (and 1 bias neuron), and one output neuron. The feedforward mechanism seems to be working fine, ...
Mehdi Saffar's user avatar
3 votes
1 answer
2k views

Implementing Convolutional Neural Network - Problems

Recently I have started to implement my own Convolutional Neural Network. I have few questions. I will talk with reference to an example, so that we all remain on the same page. Suppose, input: ...
Adorn's user avatar
  • 143
2 votes
0 answers
1k views

Two dimensional Kolmogorov-Smirnov test

For a one dimensional Kolmogorov-Smirnov test there is a theoretical result, one can compare his or her test results directly by theoretical one, which is infinite sum (notice this formula is for big ...
Narek's user avatar
  • 31
1 vote
3 answers
4k views

Random Forest Underfitting

I am running a random forest for different sets of data, with an attempt to make it dynamic enough to optimize for all sets of data (they are are similar data sets). There are around 150 predictor ...
HBaldwin's user avatar
4 votes
1 answer
917 views

Calculate logarithm of Beta function for large alpha, beta in C++?

I want to calculate the logarithm of $\mathrm{B}_x(\alpha,\beta)$ for very large values of $\alpha,\beta$ (on the order of the thousands), where $\mathrm{B}_x(\alpha,\beta)$ is the incomplete Beta ...
a06e's user avatar
  • 4,420
3 votes
1 answer
1k views

KFold Cross Validation Package/Library in C++?

I need to do some cross validation work in C++. Is there any existing package/library that you'd recommend? I performed a search on Google but prefer to get advice from field experts here. Thank you ...
Dinosaur's user avatar
  • 133
6 votes
1 answer
7k views

How to implement GLM computationally in C++ (or other languages)? [closed]

I want to implement the GLM model in C++ for a commercial package (ie. this is not for fun), including but not limited to normal, binomial distribution etc. I'm not so sure how the implementation ...
SmallChess's user avatar
  • 7,211
2 votes
1 answer
461 views

Recommendation: Fast algorithm for logistic random effects?

What is the fastest algorithm for fitting a simple logistic 'random effects' type model, with only one level of categorical predictors? Another way of putting it might be a logistic regression with ...
counfounded's user avatar
2 votes
1 answer
546 views

Neural Network Predicting Live Market Data (fun project for BTC prediction)

Made it just for fun - not for profit, wrote a neural network application that is predicting output from live data from exchange markets dealing with Bitcoin. Now just to clarify, i am not asking if ...
PeeS's user avatar
  • 129
1 vote
2 answers
1k views

How to use gsl_linalg_cholesky_ decomp to composite the lower triangular matrix?

As we know, Cholesky decomposition of $A = L*L^T$. I tried to write a simple function to decompose the lower triangular matrix $L$. I know there is a C++ function of ...
user40596's user avatar
2 votes
1 answer
585 views

Automatically fitting a mixture distribution with two univariate scaled noncentral student's t components

So far my own trials to fit such a mixture distribution to simulated or real data in R were unsuccessful (even if the data was simulated from a two-component t mixture!!!). I'm about to try the same ...
Joz's user avatar
  • 1,082
1 vote
0 answers
1k views

Anderson-Darling vs Kolmogorov-Smirnov (Many points in sample)

Previous question In my previous question (Kolmogorov-Smirnov test - reliability) I misused two-sample KS test for normality testing of one-sample data. I was given an advice that I should use one-...
Michal's user avatar
  • 285
0 votes
1 answer
521 views

Expectation maximization and Gaussian mixtures - bad results

I am supposed to find parameters of individual gaussians in a 1D mixture with a known number of components. I use my own implementation of EM algorithm; however, I am not able to find the right ...
Michal's user avatar
  • 285
4 votes
0 answers
2k views

How to calculate pvalue for the Spearman correlation test

I'm trying to code up the spearman correlation coefficient test of R in C++. ...
koskos's user avatar
  • 41
7 votes
4 answers
8k views

Open source classification algorithms, preferably in C++ [closed]

I am in search of open source classification algorithms. I am working on a computer vision project that uses classification for scene recognition. I wish to bench test a range of machine learning ...
hally9k's user avatar
  • 173
4 votes
3 answers
2k views

Efficient generation of chi random variables

I need to generate random variables generated from a chi distribution (not chi-squared!). There doesn't seem to be standard mechanism in C++ in (for example) Boost::Random and hence I am looking for ...
Damien's user avatar
  • 695
27 votes
1 answer
14k views

Converting (normalizing) very small likelihood values to probability

I am writing an algorithm where, given a model, I compute likelihoods for a list of datasets and then need to normalize (to probability) each one of the likelihood. So something like [0.00043, 0.00004,...
Ikram Ullah's user avatar
3 votes
0 answers
1k views

How to calculate p-value for Cross-Correlation for two time series with delay?

I have two stationery time series that I want to see are they correlated or not. I decided to work with cross correlation, there is a good answer in Correlation between two time series but I dont know ...
user28552's user avatar
32 votes
2 answers
86k views

libsvm data format [closed]

I'm using the libsvm (http://www.csie.ntu.edu.tw/~cjlin/libsvm/) tool for support vector classification. However, I'm confused about the format of the input data. From the README: The format of ...
Siddhant Saraf's user avatar
4 votes
1 answer
2k views

Why do R function `eigen()' and Armadillo's `eig_sym()` give different results

I am trying to compute eigenvalues in C++ using the Armadillo function eig_sym via RcppArmadillo. The results are not entirely ...
Alex's user avatar
  • 457
2 votes
0 answers
563 views

Activation value at output neuron equals 1, and the network doesn't learn anything [duplicate]

I'm implementing a typical neural network with 1 hidden layer. The network does well with the logic XOR and other simple problems, but fails miserably when encountering a (16-input, 20~30 hidden, 3 ...
Max's user avatar
  • 131
3 votes
1 answer
5k views

Hidden Markov model library

I am looking for a free hidden markov model libraries in C/C++. I can google and get a list, but a it is impossible to tell which free ones are industry standard and well established. Can anyone ...
John Robertson's user avatar
4 votes
1 answer
840 views

Latent Dirichlet allocation Implementation

I'm looking for some LDA implementation. I know about this one, MALLET but it is coded in Java and I need some more performant. Can someone give me some reference?
Aslan986's user avatar
  • 756
3 votes
2 answers
1k views

On ARIMA and its implementation

I am interested in ARMA/ARIMA models. First off, is there any material online about how to identify such models? It is done via acf and pacf, but I find the material I found online somewhat misleading....
zzzbbx's user avatar
  • 126
0 votes
1 answer
2k views

Difference between simultaneous fitting and separate fitting

I get from a specific experiment 3 outputs. Each is the information of some physical quantity in the direction x,y or z. The way we extract the information from those signals is by fitting. In the ...
Samer Afach's user avatar
4 votes
1 answer
3k views

C++ library to play with statistics (detecting outliers in time series)

I am looking for a C++ library for statistics to play with outliers detection in time series (amongst other). What I need: Robust estimators, correlations, hypothesis tests, etc; No dependencies ...
Korchkidu's user avatar
  • 141
0 votes
1 answer
184 views

About the GMRFlib [closed]

I am trying to access the GMRFlib as mentioned in the link http://www.math.ntnu.no/~hrue/GMRFsim/doc/html/. However, I think it is not available anymore. I couldn't see the tarball mentioned. Does ...
rajan sthapit's user avatar
23 votes
4 answers
13k views

C++ libraries for statistical computing

I've got a particular MCMC algorithm which I would like to port to C/C++. Much of the expensive computation is in C already via Cython, but I want to have the whole sampler written in a compiled ...
JMS's user avatar
  • 4,870
10 votes
1 answer
11k views

Translate R to C++ (eventually with Rcpp) [closed]

I would like to learn to use Rcpp. I went through the docs on the package's CRAN website, but i feel working on a practical example (second practical, considering convolve3) would be more helpfull . ...
user603's user avatar
  • 22.6k