How to extend nonlinear curve beyond supplied data in google sheets - google-sheets

I have a plotted spectral curve in google sheets. All points are real coordinates. As you can see, data is not provided for the slope below 614nm. I would like to extend the slope beyond the supplied data, so that it reaches 0. In a mathematically relevant way to follow the trajectory it was taking from when the slope started. Someone mentioned to me I would have to potentially use a linear regression? I'm not sure what that is. How would I go about extending this slope relevant to it's defined trajectory down to 0 in google sheets?
Here's the data
x-axis:
614
616
618
620
622
624
626
628
630
632
634
636
638
640
642
644
646
648
650
652
654
656
658
660
662
664
666
668
670
672
674
676
678
680
682
684
686
688
690
692
694
696
698
700
702
704
706
708
710
712
714
716
718
720
722
724
726
728
730
y-axis:
0.7101
0.7863
0.8623
0.9345
1.0029
1.069
1.1317
1.1898
1.2424
1.289
1.3303
1.3667
1.3985
1.4261
1.4499
1.47
1.4867
1.5005
1.5118
1.5206
1.5273
1.532
1.5348
1.5359
1.5355
1.5336
1.5305
1.5263
1.5212
1.5151
1.5079
1.4994
1.4892
1.4771
1.4631
1.448
1.4332
1.4197
1.4088
1.4015
1.3965
1.3926
1.388
1.3813
1.3714
1.359
1.345
1.3305
1.3163
1.303
1.2904
1.2781
1.2656
1.2526
1.2387
1.2242
1.2091
1.1937
1.1782
Thanks

I understand that you want The curve should be increased beyond the given data in a mathematically sound fashion until it approaches 0, In what follows, I'm going to show how it's done with the last 2 data points which make the filled data linear it might help, like this: take a look at this Sheet.
We need to
1 - Paste this SEQUENCE function formula in C3 to get the order of input
=SEQUENCE(COUNTA(B3:B),1,1,1)
2 - SORT the the input by pasting this formula in E3.
=SORT(A3:C61,3,0)
3 - In F62 after the last line of the sorted data paste this TREND function that Fits an ideal linear trend using the least squares approach to incomplete data about a linear trend and/or makes additional value predictions..
=TREND(F60:F61,E60:E61,E62:E101)
TREND takes
'known_data_y' set to F60:F61
'[known_data_x]' set to E61,E62 those are the 2 data point
[known_data_x] set to E62:E101, we get it by pasting E62:E101 after the last line of the sorted data in "x-axis:" in output table cell E62
4 - To see the newly genrated data in the red curve we need a new column that start from K62 till the very bottom of the data "y-axis:" in output table cell K62, by pasting this ArrayFormula in K62.
=ArrayFormula(E62:G101)
5 - Add a Serie in tne chart in chart editor > setup > Series > Add Serie.

Related

If number in range was >= 100 and subsequently <100

Anyone got any ideas on how to do this?
I'm trying to build a spreadsheet that helps me monitor the performance of my blog articles. So if the article historically had >=100 visits at any point but subsequently gets <100 at any point I want to know about it.
The formula I've been playing with is:
=IF(((FILTER(C2:G2,C2:G2<>E2))>=100 AND (FILTER(C2:G2,C2:G2<>E2))<100, "Article Failing", ""))
I'm using Filter btw because I need to exclude column E, which is the delta between this month's & last month's numbers.
I know the formula isn't logically right but struggling to think of a way to do it.
Edit:
Here's a link to the spreadsheet with desired output https://docs.google.com/spreadsheets/d/1TeaQ6oUbJDeKxUi8tvvCWXtw0oK9d5IVO60j1UbQCK8/edit?usp=sharing
Here's a table showing the sample data and desired output:
Total users (last 30 days)
Total users (prev 30 days)
Delta - Total users
Total users last 30-60 days
Total users prev 60-90 days
Delta - Total users
Above 100
Article Failing
651
90
-417
772
249
523
Tweak Article
Failing
610
570
40
550
432
118
Tweak Article
OK
436
409
27
328
210
118
Tweak Article
OK
422
288
134
53
288
-235
Tweak Article
OK
95
476
-90
417
477
-60
Below100
Failing
337
179
158
129
182
-53
Tweak Article
OK
305
395
-90
318
343
-25
Tweak Article
OK
304
348
-44
299
253
46
Tweak Article
OK
302
277
25
283
317
-34
Tweak Article
OK
286
252
34
268
281
-13
Tweak Article
OK
213
193
20
221
168
53
Tweak Article
OK
157
138
19
132
166
-34
Tweak Article
OK
150
157
-7
110
68
42
Tweak Article
OK
I've made cells B2 & A6 be failing articles i.e. they were >=100 but have since gone below 100. The end column 'Article Failing' is where I'm trying to create the formula.
Hope that makes things a bit clearer.
This formula will match the desired results you show in the sample spreadsheet:
=if(
(max(A$2:A2) >= 100) * (A2 < 100)
+
(max(B$2:B2) >= 100) * (B2 < 100)
+
(row(B2) = row(B$2)) * (B2 < 100),
"Failing",
"OK"
)

GIMP palette file (.gpl) format / syntax?

I'm looking for the exact specifications of this file format. Anyone got a link? Or want to comment?
I have spent the better part of the day searching, yet I keep getting directed back to the GIMP online user-manual. It says "look at a .gpl file and you will see it is easy" to build manually with a text editor. I don't actually have GIMP, but I see examples online. Yep, easy. • EXCEPT:
• What meaning do the color names ultimately have? Are they purely semantic, or does a program rely on them? If the latter, then what if there are two (2) or more colors with the same name?
• What does the "Columns" line do?
I've seen examples that have no "Columns" line.
I've seen examples that have values of 0, 4, and 16; yet this does not in any way that I can see correspond to the color data. I see 3 columns of decimal-sRGB values, and an optional 4th column with the color-name; seems I remember the example with "Columns 4" had no color names, only the 3 RGB columns.
• Do columns of RGB values need to "line up"? Or will the following example from my output algorithm work? (from the Crayola palette):
159 129 112 Beaver
253 124 110 Bittersweet
0 0 0 Black
172 229 238 Blizzard Blue
31 117 254 Blue
162 162 208 Blue Bell
102 153 204 Blue Gray
13 152 186 Blue Green
• Does this format accept sRGBA colors? And if so, how is the "A" value defined (0-1, 0%-100%, 0-127, 0-255, etc.?) (seems I remember when creating .png files with PHP, the "A" value was 7-bit)?
• How exactly do you add comments / metadata?
Today I see an example that says lines that begin with # are comments, or anything after a # on a line is a comment. Yesterday I thought (maybe I'm confused) I saw an example that said that comment lines begin with ;
• Is any other data-format supported?
Originally I thought the text-line just before the color-data that I see in every example indicated the format: "#" signifying decimal-sRGB; until today when I see that is just a blank-line comment.
• What line ending character(s) can / must I use?
\n
\r
• What character-encodings can I use? ASCII only? ¿UTF-8 ☺ with extended ♪♫ charset (¡hopefully!)?
• Anything I'm missing? Any other options available?
Here is an example from http://gimpchat.com/viewtopic.php?f=8&t=3375#
GIMP Palette
Name: bugslife_final.png-10
Columns: 16
#
191 180 180 Index 0
163 158 157 Index 1
145 136 132 Index 2
130 125 112 Index 3
… … …
56 50 49 Index 29
41 38 38 Index 30
23 23 23 Index 31
242 245 213 Index 32
227 232 181 Index 33
210 217 147 Index 34
195 204 118 Index 35
… … …
0 0 0 Index 251
0 0 0 Index 252
0 0 0 Index 253
0 0 0 Index 254
0 0 0 Index 255
Aloha!
Looking at the source code:
Columns is just an indication for display in the palette editor
Comments must start with a #. In non-empty lines that don't, the first three tokens are parsed as numbers
There is no alpha support

Calculate statistical difference from pivot table

I've built this table:
s_male Values
0 1
hs_name1 AVERAGE of sat_composite STDEV of sat_composite COUNT of s_lasid AVERAGE of sat_composite STDEV of sat_composite COUNT of s_lasid
Hope High School 986 600 639 979 630 579
James High School 837 568 473 830 612 428
Juniper High School 789 525 538 722 577 466
Kennedy High School 531 468 314 523 484 239
King High School 683 540 275 619 569 258
Lincoln High School 842 538 354 933 534 279
Meadowbrook High School 484 517 292 484 507 274
North Falls High School 1056 531 590 1046 547 564
Orange High School 905 597 555 828 619 526
Polk High School 680 569 567 691 568 501
South Falls High School 898 602 488 904 584 461
Upper Hills High School 457 491 349 431 490 248
Washington High School 795 609 482 818 635 401
Grand Total 801 585 5916 796 603 5224
Alos pictured here:
I now want to calculate if the average SAT_composite score for women (s_male=0) is statistically different than for men (s_male=1).
I've been trying to figure this out and I am a little lost. Any help would be greatly appreciated.
What you're looking for is just a regular t-test. In google sheets the syntax is:
=TTEST(B2:B8,C2:C8,2,2)
That will give you the p value associated with the test
Arguments:
Range for male scores
Range for female scores
How many tails? 1 or 2
Type of t-test. This choice is important and depends on whether certain assumptions have been violated (primarily independence and homoscedasticity)
I would agree with Toms suggestion in the comments about going back to the raw data as you'll be able to better model your data (in your example you've already collapsed across schools by calculating means, which loses information)

GridSearchCV freezing with linear svm

I have problem with GridSearchCV freezing (CPU is active but program in not advancing) with linear svm (but with rbf svm it works fine).
Depending on the random_state that I use for splitting my data, I have this freezing in different splits points of cv for different PCA components?
The features of one sample looks like the following(it is about 39 features)
[1 117 137 2 80 16 2 39 228 88 5 6 0 10 13 6 22 23 1 227 246 7 1.656934307 0 5 0.434195726 0.010123735 0.55568054 5 275 119.48398 0.9359527 0.80484825 3.1272728 98 334 526 0.13454546 0.10181818]
Another sample's features:
[23149 4 31839 9 219 117 23 5 31897 12389 108 2 0 33 23 0 0 18 0 0 0 23149 0 0 74 0.996405221 0.003549844 4.49347E-05 74 5144 6.4480677 0.286384 0.9947901 3.833787 20 5135 14586 0.0060264384 0.011664075]
If I delete the last 10 feature I don't have this problem ( The 10 new features that I added before my code worked fine). I did not check other combinations of the 10 last new features to check if a specific feature is causing this problem.
Also I use StandardScaler to scale the features but still facing this issue. I have less of this problem if I use MinMaxScaler scaler (but read soewhere it is not good for svm).
I also put n_jobs to different numbers and it only could advance by little but freezes again.
What do you suggest?
I followed part of this code to write my code:
TypeError grid seach

Need to Arrange Some Numbers Accordingly in the View

I have a tree structure suppose. I know some conditions. I would like to give an example:
469 & 470 results 468
472 & 473 results 471
476 & 477 results 475
479 & 480 results 478
This is the round 1 suppose. In the next few rounds:
Round 2:
468 & 471 results 467
475 & 478 results 474
Round 3:
467 & 474 results 466
I need to arrange them as shown in image. Also I have one more thing that to arrange them I have made some ids in css so that they go in the appropriate position. So starting from the right most it should get 15 and then left to it 14, 13. I cannot post images so I am making a structure here itself:
469
468
470
467
472
471
473
466
476
475
477
474
479
478
480
Now the numbers each will get is:
1
9
2
13
3
10
4
15
5
11
6
14
7
12
8
Now my question is I get this things from database that these two numbers result into third. I need to write a piece of code that makes this arrangement automatic. I am getting an array of hashes for each number. Means a hash for 469, other for 470 and so on. In rails term what we call is ActiveRecord::Relation. Can anyone help me please.
More update:
I know always that 469 & 470 will results 468 and so on. Also suppose I am on 466 then it will have the detail that it has came from 467 & 474. In short it has the forward and backward both numbers. I want to run a loop on them and arrange them in the above order so that the left side schedules and right side schedules match. This can be assumed as a world cup match of any sport in which the two matches result in next match and so on. And finally I want to make a tree in my view.
I have solved the issue. What I have done is made a custom hash. For this I have ran a loop like this:
First took the last one i.e., in the above example it is 466. So I inserted it in hash:
{5 => {466}}
Then I know that 466 has come from 467 & 474. So I inserted these two in the same has as this:
{5 => {466}, 4=> {467, 474}}
Then for the next one I ran a loop on the hash[4] and first took the two schedules from 467 and inserted in the hash and then the two from 474 in the hash. This is how:
{5 => {466}, 4 => {467, 474}, 3 => {468, 471, 475, 478}}
and so on. And then in the view I looped on the hash according to the key and arranged them in the view. Suppose the hash is s. Then:
(4).downto(1).each do |i|
s[i].each do |x|
#code to display here
end
end
Hope this helps anyone else too if they need to do the same thing.

Resources