Tag Info

Hot answers tagged

13

Please see the Utility function section for a concise summary. An arbitrary density plot for the example: den = DensityPlot[Sin[x] Sin[y], {x, -180, 180}, {y, -90, 90}] : Extract the graphics primitives from the density plot: prim = First @ Cases[den, Graphics[a_, ___] :> a, {0, -1}, 1]; Plot them directly with GeoGraphics while setting the ...


7

I've spotted three issues with your approach and posted code: Spectral clustering uses the eigenvectors associated with the $k$ smallest eigenvalues of the Laplacian, but your code is selecting those associated with the $k$ largest eigenvalues. You need to Transpose your Kvecs prior to passing them to ClusteringComponents. As currently written, you're ...


7

IntegerString[Hash["363", "MD5"], 16] // StringLength (* 30 *) IntegerString[Hash["a", "MD5"], 16] // StringLength (* 31 *) Here's a whopper found Googlin': IntegerString[Hash["jk8ssl", "MD5"], 16,32] IntegerString[Hash["jk8ssl", "MD5"], 16] // StringLength (* 0000000018e6137ac2caab16074784a6 *) (* 24 *)


6

I would prefer to use the "GeoImage" styling, because you can use other projections when using it. Let's say you have data for the whole world in a matrix: data = Table[ Sin[x Degree] Sin[y Degree], {y, -90, 90}, {x, -180, 180}] Then you use ListDensityPlot: den1 = ListDensityPlot[data, AspectRatio -> 1/2, Frame -> None, PlotRangePadding ...


5

data = {{193.303, 601.595, 0.001079}, {193.383, 612.928, 0.000071}, {199.129, 476.9, 0.000828}, {199.21, 488.223, 0.000761}} Method 1 {{#1, #2}, #3} & @@@ data {{{193.303, 601.595}, 0.001079}, {{193.383, 612.928}, 0.000071}, {{199.129, 476.9}, 0.000828}, {{199.21, 488.223}, 0.000761}} Method 2 {Take[#, 2], Last[#]} & /@ data Method ...


4

Sjoerd's approach using SARIMAProcess and TimeSeriesModelFit, in particular the last portion with in which you test SARIMA models of differing orders and observe which models are particularly favoured by the AIC, is certainly a valid approach. However, since you asked about periodograms and other spectral methods in your question, I thought I'd give an ...


4

First, paste your two columns of data copied from Google docs in Mathematica: data = ImportString["Day\tTraffic 1/12/2014\t3 2/12/2014\t15 . . . 5/5/2015\t109 6/5/2015\t282", "TSV"] // Rest; Then convert the few 14s and 15s mingled between the 2014s and 2015s to full years, and convert to a TimeSeries: dataTS = MapAt[ ...


4

Import the data and chose the columns that contain relevant information: In: data = Import["file.csv"]〚All, {1, 3, 7}〛 Out: {{"Female", "A", 1}, {"x", "A", 2}, {"Male", "A", 3}, {"y", "B", 4}, {"Female", "B", 5}, {"Male", "B", 6}, {"Female","C",7}, {"Male", "C", Null}} Select those entries that start with "Female" or "Male" and wich also have a ...


4

DD[a_, b_, c_, μ_, ν_, σ_, τ_] = MixtureDistribution[{a, b, c, a, b, c}, {NormalDistribution[-μ, τ], NormalDistribution[-ν, σ], NormalDistribution[-μ - ν, σ + τ], NormalDistribution[μ, τ], NormalDistribution[ν, σ], NormalDistribution[μ + ν, σ + τ]}]; tests = {AndersonDarlingTest, CramerVonMisesTest, ...


3

imp = Import["file.csv"] (* fake data *) scores = imp[[Join @@ Range[{5, 6}, Length@imp, 12], {3, 7}]]; MFscores = GatherBy[scores, First] {{{"Cayuga ISD", 494}, {"Cayuga ISD", 489}}, {{"Elkhart ISD", 513}, {"Elkhart ISD", 455}}, {{"Westwood ISD", 519}, {"Westwood ISD", 451}}, {{"LaPoynor ISD", ""}, {"LaPoynor ISD", 451}}} You ...


3

There is a problem with your initial velocity: Hmax = Vo^2*Sin[phi Degree]^2/(2*9.8) (*13.9274*) With that initial Velocity, you can only reach 13.9 meters (far from the 25+ from your data), and that's without drag. So you can't fit anything really. Maybe the velocity is not well measured. What you could do is fit Cdrag and Vo. Using part of Mariusz's ...


3

Have a look at the documentation for CSV. The first issue you have is that your file extension is .txt so Mma imports it as text file instead of a CSV file. Your second issue is that "Table" is not a supported element for either CSV or TXT so I think it is just being ignored. Even though your file does not have the .csv file type you can still tell Mma ...


2

Let's try to simplify this even further and use a handful of extra keystrokes, they are cheap, to try to make this more understandable for a new user. Suppose you wanted to write a function that would be given a list of three elements {a, b, c} and you wanted it to return {{a, b}, c}. You might see the similarity between this and what you want to do with ...


2

I rewrote quite a few things... manually specifying the mixture, and setting very low iteration and precision goals because it hangs for what seems like an eternity. Importantly I also specified assumptions on the distribution: sas[\[Mu]_, \[Sigma]_, skew_, kurt_, z_] := ((1 + ((z - \[Mu])/\[Sigma])^2)^(-(1/2)) kurt Cosh[ kurt ArcSinh[(z - ...


2

Pick[#[[All, {1, 3}]], #[[All, 2]], 1] & @@@ grid (* {{{0, 2}, {0, 3}}, {{1, 2}, {1, 3}}} *) or (Select[#, #[[2]] == 1 &] & @@@ grid)[[All, All , {1, 3}]] (* {{{0, 2}, {0, 3}}, {{1, 2}, {1, 3}}} *) or Cases[grid, m : {{_, 1, _} ..} :> m[[All, {1, 3}]], {2}] (* {{{0, 2}, {0, 3}}, {{1, 2}, {1, 3}}} *) Update: You can also turn the ...


1

OK, I'm able to give an incomplete answer now.I can't fit but.. Values for all constants are correct? You must have made ​​a mistake somewhere. Cdrag = 0.13952; g = 9.80665; M = 0.04593; R = 0.04267/2; Vo = 48.54; \[Phi] = 19.9; \[Rho] = 1.2041; A = \[Pi] R^2; k = 1/2 \[Rho] A Cdrag; {xsol, ysol} = NDSolveValue[{x''[t] == -(k/M)*(x'[t])^2, y''[t] == ...


1

Here's an answer to the question in the comments below OP: grid={{{{0, 1, 2}, {0, 1, 3}}, {{0, 2, 2}, {0, 2, 3}}}, {{{1, 1, 2}, {1, 1, 3}}, {{1, 2, 2}, {1, 2, 3}}}} A 2x2x2 list of 3-component vectors. If I understood correctly, pick out, for example, all such vectors, that have 0 as their first component. I am inclined to take a pattern-matching ...


1

You can still use the list of data, that you plotted. You just need to Select those. (x, y) pairs you are interested in. For example: Select[plotData, MemberQ[xValues, #[[1]] ]& ] To obtain the plot data, you can use Part on the ListPlot. plotData=ListPlot[data][[1]]


1

Perhaps this example could be helpful llp = ListLinePlot[ Quantity[{0, 3, 6, 8, 10, 11, 11, 16, 20, 22}, "Centimeters"], AxesLabel -> Automatic]; pts = Cases[llp, Line[x__] :> x, -1] lp = ListPlot[pts, Joined -> True]; Grid[{{"Plot", "Replot"}, {llp, lp}}] Extracted points: {{{1., 0.}, {2., 3.}, {3., 6.}, {4., 8.}, {5., 10.}, {6., 11.}, ...



Only top voted, non community-wiki answers of a minimum length are eligible