Community RSS Feed
http://community.wolfram.com
RSS Feed for Wolfram Community showing questions from all groups sorted by newest repliesHow can I use RLink to run the quantile regression function from R?
http://community.wolfram.com/groups/-/m/t/1343508
I am running a Monte Carlo simulation to compare errors from least squares method and quantile regression.
I have generated the data as per below *(y = x Beta + error)*, for three different beta's. (\\[Tau] is my quantile level)
The data is ready for *LinearModelFit*.
But how can I apply the *rq* function in *R* from the *quantreg* library to my data?
I appreciate your help. This community is awesome.
Thanks in advance,
Thad
Set n, m and \[Tau]
n = 1000;
m = n;
\[Tau] = 0.9;
columns = 100;
Generate data
SeedRandom[1976];
xdata = Table[RandomVariate[NormalDistribution[], n], columns];
\[Epsilon]data = Table[RandomVariate[NormalDistribution[], n], columns];
\[Beta]data = {1/3, 1, 3};
num\[Beta] = Length[\[Beta]data];
ydata = Table[xdata \[Beta]data[[k]] + \[Epsilon]data, {k, num\[Beta]}];
data = Table[
Transpose[{ydata[[q, k]], xdata[[k]]}], {q, num\[Beta]}, {k, columns}];
Run Least Squares
lsFunc = Table[LinearModelFit[#, x, x] & /@ data[[q]], {q, num\[Beta]}];
Moreover, I need the ability to extract the parameters from the quantile regression results, like I can do with *LinearModelFit["BestFitParameters"]* and *["FitResiduals"]*.Thadeu Freitas Filho2018-05-22T10:49:59ZA Geographic coordinates projection problem
http://community.wolfram.com/groups/-/m/t/1343159
How to replace a world map with a picture and project it to a specific geographic area?
I can already use shapefiles to draw satellite photos of specific administrative regions.
However, replacing the original global satellite image with a picture cannot be done.
Request friendly expert guidance ~~~
data = Import["COUNTY201804300214.shp", "Data"];
picture= Import["https://upload.wikimedia.org/wikipedia/commons/thumb/4/41/Simple_\world_map.svg/2000px-Simple_world_map.svg.png", "PNG"];
data[[All, 1]]
geometry = ("Geometry" /. data);
GeoGraphics[{GeoStyling["Satellite"], geometry[[12]]}, GeoBackground -> None]
GeoGraphics[{GeoStyling[{"Image", picture}], geometry[[12]]}, GeoBackground -> None]Tsai Ming-Chou2018-05-22T09:19:35ZNeural Nets for time series prediction: Where to start?
http://community.wolfram.com/groups/-/m/t/1343037
Dear Members
I have used mathematica to learn some things such as regression for time series. There are plenty of models with unctions of very high leves of abstraction such as "TimeSeriesForecast". Also, many detailed examples are given.
I like to try to learn newural nets for time series forecasting but it has not been easy at all. I have not found examples in the subject an not related models are available in the neural net repository-
Could any one help me to find a good place to start on the subject?
Best regards
JesusJ Jesus Rico-Melgoza2018-05-22T01:14:25Zsolving a system of eq
http://community.wolfram.com/groups/-/m/t/1342968
Please I need some help, I have this system of 6 equations :
- a x Squart[x^2 + y^2 + z^2] + b (-z n + y r) = 0 ,
- -c + a y Squart[x^2 + y^2 + z^2] + b (z m - x r) = 0 ,
- a z Squart[x^2 + y^2 + z^2] + b (-y m + x n) = 0
- m ' [ t ] = d Squart[x^2 + y^2 + z^2] m
- n ' [ t ] = d Squart[x^2 + y^2 + z^2] n
- r ' [ t ] = d Squart[x^2 + y^2 + z^2] r
>the variables are { x , y , z , m , n , r }
How to solve this system of equations using Mathematica ??Abdelhalim AANIBA2018-05-21T23:27:32ZAutomatically sliding a conv net onto a larger image
http://community.wolfram.com/groups/-/m/t/1343104
**How to control the step size of the following conv net as it slides onto a larger image?**
See also: https://mathematica.stackexchange.com/questions/144060/sliding-fullyconvolutional-net-over-larger-images/148033
As a toy example, I'd like to slide a digit classifier trained on 28x28 images to classify each neighborhood of a larger image.
This is lenet with linear layers replaced by 1x1 convolutional layers.
trainingData = ResourceData["MNIST", "TrainingData"];
testData = ResourceData["MNIST", "TestData"];
lenetModel =
NetModel["LeNet Trained on MNIST Data",
"UninitializedEvaluationNet"];
newlenet = NetExtract[lenetModel, All];
newlenet[[7]] = ConvolutionLayer[500, {4, 4}];
newlenet[[8]] = ElementwiseLayer[Ramp];
newlenet[[9]] = ConvolutionLayer[10, 1];
newlenet[[10]] = SoftmaxLayer[1];
newlenet[[11]] = PartLayer[{All, 1, 1}];
newlenet =
NetChain[newlenet,
"Input" ->
NetEncoder[{"Image", {28, 28}, ColorSpace -> "Grayscale"}]]
Now train it:
newtd = First@# -> UnitVector[10, Last@# + 1] & /@ trainingData;
newvd = First@# -> UnitVector[10, Last@# + 1] & /@ testData;
ng = NetGraph[
<|"inference" -> newlenet,
"loss" -> CrossEntropyLossLayer["Probabilities", "Input" -> 10]
|>,
{
"inference" -> NetPort["loss", "Input"],
NetPort["Target"] -> NetPort["loss", "Target"]
}
]
tnew = NetTrain[ng, newtd, ValidationSet -> newvd,
TargetDevice -> "GPU"]
Now remove dimensions information (see stackexchange for the code definition of `removeInputInformation`):
removeInputInformation[layer_ConvolutionLayer] :=
With[{k = NetExtract[layer, "OutputChannels"],
kernelSize = NetExtract[layer, "KernelSize"],
weights = NetExtract[layer, "Weights"],
biases = NetExtract[layer, "Biases"],
padding = NetExtract[layer, "PaddingSize"],
stride = NetExtract[layer, "Stride"],
dilation = NetExtract[layer, "Dilation"]},
ConvolutionLayer[k, kernelSize, "Weights" -> weights,
"Biases" -> biases, "PaddingSize" -> padding, "Stride" -> stride,
"Dilation" -> dilation]]
removeInputInformation[layer_PoolingLayer] :=
With[{f = NetExtract[layer, "Function"],
kernelSize = NetExtract[layer, "KernelSize"],
padding = NetExtract[layer, "PaddingSize"],
stride = NetExtract[layer, "Stride"]},
PoolingLayer[kernelSize, stride, "PaddingSize" -> padding,
"Function" -> f]]
removeInputInformation[layer_ElementwiseLayer] :=
With[{f = NetExtract[layer, "Function"]}, ElementwiseLayer[f]]
removeInputInformation[x_] := x
tmp = NetExtract[NetExtract[tnew, "inference"], All];
n3 = removeInputInformation /@ tmp[[1 ;; -3]];
AppendTo[n3, SoftmaxLayer[1]];
n3 = NetChain@n3;
And the network `n3` slides onto any larger input. However, note that it seems to slide with steps of 4. How could I make it take steps of 1 instead?
In[358]:= n3[RandomReal[1, {1, 28*10, 28}]] // Dimensions
Out[358]= {10, 64, 1}
In[359]:= BlockMap[Length, Range[28*10], 28, 4] // Length
Out[359]= 64Matthias Odisio2018-05-21T22:20:23ZWhat's the hardest integral Mathematica running Rubi can find?
http://community.wolfram.com/groups/-/m/t/1343015
***Rubi*** (***Ru***le-***b***ased ***i***ntegrator) is an open source program written in ***Mathematica***'s powerful pattern-matching language. The recently released version 4.15 of ***Rubi*** at http://www.apmaths.uwo.ca/~arich/ requires ***Mathematica*** 7 or better to run. Among other improvements, ***Rubi*** 4.15 enhances the functionality of its integrate command as follows:
- Int[*expn*, *var*] returns the antiderivative (indefinite integral) of *expn* with respect to *var*.
- Int[*expn*, *var*, Step] displays the first step used to integrate *expn* with respect to *var*, and returns the intermediate result.
- Int[*expn*, *var*, Steps] displays all the steps used to integrate *expn* with respect to *var*, and returns the antiderivative.
- Int[*expn*, *var*, Stats], before returning the antiderivative of *expn* with respect to *var*, displays a list of statistics of the form {*a*, *b*, *c*, *d*, *e*} where
*a*) is the number of steps used to integrate *expn*,
*b*) is the number of distinct rules used to integrate *expn*,
*c*) is the leaf count size of *expn*,
*d*) is the leaf count size of the antiderivative of *expn*, and
*e*) is the rule-to-size ratio of the integration (i.e. the quotient of elements *b* and *c*).
The last element of the list of statistics displayed by ***Rubi***'s Int[*expn*, *var*, Stats] command is the number of distinct rules required to integrate *expn* divided by the size of *expn*. This rule-to-size ratio provides a normalized measure of the amount of mathematical knowledge ***Rubi*** uses to integrate expressions. In other words, this ratio can be used as a metric showing the difficulty of solving indefinite integration problems. For example, the hardest problem in ***Rubi***'s 70,000+ test suite is integrating (a+b ArcTanh[c/x^2])^2 which has a rule-to-size ratio of 2.5.
On ***Rubi***'s website are the terms of a challenge, for which there is a substantial prize, for the user who finds the hardest problem ***Rubi*** can integrate.Albert Rich2018-05-21T22:17:32ZHow to control, and get No. of a step of, replacing a set name by the set?
http://community.wolfram.com/groups/-/m/t/1342594
Given the following sets with names
s1={x1,x2}
x1={y1,y2}
y1 ={z1,z2}
When s1 is entered, the names would be replaced finally by all the sets. That is
Input s1
output::{{{z1,z2},y2},x2}
Question1: could we control a replacement step in any step? For example, we get
{{y1,y2},x2} so that y1 is not replaced?
Question2:: could we get the number of the replacement step, for example,to know, at step 2, we get {{y1,y2},x2}?Math Logic2018-05-21T20:20:58ZFinancialData
http://community.wolfram.com/groups/-/m/t/1342726
Using mathematica online FinancialData function often returns $Aborted.Kianoosh Kassiri2018-05-21T13:20:07Z