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
1 vote
0 answers
72 views

P value calculation for Anderson Darling normality

For p-value calculation I use (in c++) following equations I found on the internet ...
user avatar
  • 11
3 votes
0 answers
67 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 ...
user avatar
  • 1,063
1 vote
0 answers
1k 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 ...
user avatar
5 votes
1 answer
509 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,...
user avatar
  • 539
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 ...
user avatar
1 vote
1 answer
111 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 ...
user avatar
  • 111
1 vote
0 answers
273 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 ...
user avatar
  • 11
1 vote
2 answers
366 views

Normal Neural Network for Image 100×100?

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 ...
user avatar
0 votes
0 answers
682 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
2 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 ...
user avatar
2 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 ...
user avatar
  • 455
3 votes
4 answers
9k 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 ...
user avatar
0 votes
0 answers
749 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 ...
user avatar
  • 1
1 vote
1 answer
403 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 ...
user avatar
1 vote
0 answers
209 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, ...
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: ...
user avatar
  • 143
2 votes
0 answers
815 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 ...
user avatar
  • 31
1 vote
3 answers
3k 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 ...
user avatar
3 votes
1 answer
775 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 ...
user avatar
  • 3,348
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 ...
user avatar
  • 133
6 votes
1 answer
6k 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 ...
user avatar
  • 6,820
2 votes
1 answer
433 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 ...
user avatar
1 vote
1 answer
521 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 ...
user avatar
  • 119
1 vote
1 answer
982 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 ...
user avatar
1 vote
1 answer
565 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 ...
user avatar
  • 1,022
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-...
user avatar
  • 265
0 votes
1 answer
430 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 ...
user avatar
  • 265
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++. ...
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 ...
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 ...
user avatar
  • 655
26 votes
1 answer
13k 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,...
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 ...
user avatar
32 votes
2 answers
83k 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 ...
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 ...
user avatar
  • 437
2 votes
0 answers
559 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 ...
user avatar
  • 131
3 votes
1 answer
4k 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 ...
user avatar
4 votes
1 answer
828 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?
user avatar
  • 728
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....
user avatar
  • 214
0 votes
1 answer
1k 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 ...
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 ...
user avatar
  • 141
0 votes
1 answer
170 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 ...
user avatar
23 votes
4 answers
12k 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 ...
user avatar
  • 4,700
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 . ...
user avatar
  • 21.3k