Community Profile # the cyclist

### Alden Scientific

Last seen: Today Active since 2011

Head of Modeling and Statistics at Alden Scientific. Obsessive runner. Professional Interests: Predictive modeling, statistics. (I don't respond to email via author page, but will usually look at a question if you send me a link to it.)

Programming Languages:
Python, R, MATLAB, SQL
Spoken Languages:
English

#### Statistics

All
• • • • • • • • • • • • #### Content Feed

View by

Performing Chi Square Test
The crosstab function calculates the table from raw data. It does not expect the table itself as input. After an admittedly bri...

6 hours ago | 0

Is there a Matlab function to convert a plot into a matrix or image?
I assume you mean that you want to do it programatically, as opposed to interactively. I'm a creature of habit, and I generally...

1 day ago | 0

| accepted

How to calculate the minimum distance between two points?
I am not absolutely certain that this code is equivalent to what you wrote, because I cannot test it on my local machine. (I do ...

3 days ago | 0

K-means clustering output matrix C (represent centroid locations)
You have 8 centroids, each of which is a point in a 10-dimensional space. Each row gives the 10 coordinates needed to locate tha...

3 days ago | 0

| accepted

How to calculate the minimum distance between two points?
I doubt that this is the main issue slowing down the code, but you should preallocate the memory for your output array. Growing ...

3 days ago | 0

Adding multiple variable contents in a single variable
If your data are already stored in dynamically named variables, then I think your only recourse is to use eval to do this task: ...

6 days ago | 1

| accepted

simple regression analysis issue
The method you used does not include an intercept, so your fit is forced to go through the origin. Try this instead (which is al...

9 days ago | 0

| accepted

Reshape matrix with averages of 4 elements in each row
Here is one way: n = 4; A = [ 0 2 2 4 0 6 4 6 1 1 2 8 0 0 4 0 9 9 2 8 0 0 0 8]; tmp = movmean(A,[0 n-1],2); B ...

13 days ago | 0

Why scatterplot shows one point in different color and rest all the points are different?
If I have interpreted your code correctly, you have plotted the x-y data, just in different groups. Your figure actually has fou...

13 days ago | 0

Problems clustering with kmeans
I think you might have success if you try the DBSCAN algorithm instead.

24 days ago | 0

| accepted

Question

Write file(s) with all properties of a MATLAB model
Suppose I have built a machine learning model in MATLAB. It has a list of properties (and underlying property data) that encapsu...

25 days ago | 1 answer | 0

### 1

i have one dimensional array and i want to move every non zero element oh that array to exchange position with every zero in each iteration.
I think this does what you want: % Input data a = [1 2 3 4 0 0 0]; % Find the indices of the non-zeros and the zeros idxNo...

26 days ago | 0

Finding values with the same index in two arrays
RowCol1 = [17.487504; 17.487591; 17.487596; 17.487605; 17.487617]; RowCol2 = [16.113; 16.116; 16.244; 17.487591; 17.487596; 17...

1 month ago | 0

| accepted

Selecting Specific Elements in a Matrix Using Group
Height = [62; 65; 63; 70; 58; 70; 73]; Gender = [1; 1; 1; 2; 1; 2; 2]; % where 1 is female and 2 is male data_table = [Height(...

1 month ago | 1

| accepted

how can I classify the loads based on Bagging decision trees and compare it with actual data?
I have not gone through your whole code, but I loaded your MAT file and then ran C = confusionchart(Actualdata.Loads,Preddata.L...

1 month ago | 0

| accepted

I want to get the difference between the present number and the previous number for 1000 set of data from the plot.
a = [2 3 5 7 11]; a - a' % All possible differences between pairs of elements of a

1 month ago | 1

How can I create a 16 round for loop in this problem?
Use a cell array to store the values: for k = 1:16 Key{k} = randi([0,1],[1,4]); In{k} = randi([0,1],[1,4]); Cip...

1 month ago | 0

Problem with index in position 1 exceeding array bounds in PSO algorithm
x_min and x_max are 1x2 vectors, but in the loop you try to access a second row of those matrices, which do not exist. I'm not ...

1 month ago | 0

A=[1,2; 6,4; 2,7]; [~,sortingIndex] = sort(sum(A,2)); output = A(sortingIndex,:)

1 month ago | 0

Mean and Standard deviation table
You can use the groupsummary command.

1 month ago | 0

Intersect() with with repetition
I frankly have not quite figured out the logic of what you want as output, but I'm pretty sure that you can construct what you w...

1 month ago | 0

two for loops in parallel
If I understand you correctly, you don't need two for loops, and this will do what you want M=5; x=0; A=[1 4 7 10 13 16 19]; ...

1 month ago | 0

| accepted

24 Hours for run my for loop
Without seeing your code, it is impossible to know specifically what are possible approaches to speed it up, but two possibiliti...

1 month ago | 0

| accepted

How can i interpolate 1-D data, whit y especified values?
Unless I'm missing something, it sounds like you just want to interpolate x from y, instead of y from x: x = [1 2 3]; y = [1 4...

1 month ago | 0

| accepted

Hello everyone, I want to restrict the domain of a vector to return it to a smaller data set. For example, X between 2 and 7
X = [ 1 2 3 4 5 6 7 8 9 10 ]; idxToKeep = (X>=2) & (X<=7); Xkeep = X(idxToKeep) You can also do it all in one...

2 months ago | 0

chose the marker with plot3d
It looks like you used a hyphen instead of an underscore. x = 1:5; y = rand(1,5); z = rand(1,5); figure plot3(x,y,z,'blac...

2 months ago | 0

| accepted

How to improve regression models for a dataset with too many variables?
@NC_, as I expect you realize, your question is not really a MATLAB question, but is a generic machine learning question. You ar...

2 months ago | 0

| accepted

i trying to 3d plot, but mesh nor plot3 worked
This is what I get from your equation: xv = -5 : 0.01 : 5; yv = -5 : 0.01 : 5; [x,y] = meshgrid(xv,yv); f = 10*x.^2.*y -...

2 months ago | 1

| accepted

How can I find negative factorial ? (-0.5)!
Use the gamma function: x = -0.5; gamma(x+1) % gamma(x+1) is equal to factorial(x)

2 months ago | 1

| accepted